• Create a SQL query chain that can create SQL queries for the given database. Returns a Runnable.

    Parameters

    Returns Promise<any>

    A runnable sequence representing the chain.

    Example

    const datasource = new DataSource({
    type: "sqlite",
    database: "../../../../Chinook.db",
    });
    const db = await SqlDatabase.fromDataSourceParams({
    appDataSource: datasource,
    });
    const llm = new ChatOpenAI({ temperature: 0 });
    const chain = await createSqlQueryChain({
    llm,
    db,
    dialect: "sqlite",
    });

Generated using TypeDoc