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}`); Copy
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}`);
Optional
Class that represents a toolkit for working with SQL databases. It initializes SQL tools based on the provided SQL database.
Example