This is an example projects to check how lang chain can be used to interact with different kinds of databases like SQL to explain the database.
General Resources:
- Clone the repo with
git clone
- Create a .env file on root folder
- Add a variable OPENAI_API_KEY=your_open_api_key
- Run
npm i
- Run the solution with
npx ts-node sql-chain-example.ts
Currently its using davinci-003. Due to the reduced max token size, I would always incorporate the tables that you want to include for your prompts.
You can to that by tweaking the code here:
includesTables: ['Products', 'Orders', 'Order Details'],
I am working on a solution to make it easier.
- Add reading git repos to search for particular solutions or libraries.
- Add OpenAPI Chain to query against OpenAPI definitions.