langchain.js
    Preparing search index...

    Class that represents a toolkit for working with SQL databases. It initializes SQL tools based on the provided SQL database.

    const model = new ChatOpenAI({ model: "gpt-4o-mini" });
    const toolkit = new SqlToolkit(sqlDb, model);
    const executor = createSqlAgent(model, toolkit);
    const result = await executor.invoke({ input: 'List the total sales per country. Which country's customers spent the most?' });
    console.log(`Got output ${result.output}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Constructors

    • Parameters

      Returns SqlToolkit

    Properties

    dialect: string = "sqlite"
    tools: ToolInterface[]