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

const model = new ChatOpenAI({});
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 full)

Constructors

Properties

Methods

Constructors

Properties

dialect: string = "sqlite"
tools: ToolInterface<ZodObjectAny>[]

Methods

  • Returns StructuredToolInterface<ZodObjectAny>[]