A playground for leveraging GPT to answer user prompts using various databases.
vi .env
Paste your API_KEY into the .env file, then close and save with :wq. Your .env file should look like this when finished:
API_KEY=<your API key here>
pip install -r requirements.text
python3 setup.py
code examples.ipynb
- Class takes a table_schema and a list of questions, and generates a list of SQL queries for each question (if GPT isn't confident that the data exists in the database, it returns 'out of scope')
- The query is fed into SQLite3, and the result is returned to the user
TODOs:
- Return a formatted sentence back to the user, not a pd.DataFrame
- Turn on pyre
- Concurrently handle requests
- Class detects obvious mistakes in the query and fixes them automatically
- If the query still throws an error, class is able to go back-and-forth with ChatGPT to create a working solution
- Class can effectively navigate questions involving multiple tables and complex schemas, joining where necessary
- In the event that the class isn't sure exactly what to return, it returns a list of potential answers to each question, sorted by likelihood
- Class can handle various SQL and NoSQL database connections at the same time
- Ability to handle user uploaded files and databases
- Answer open-ended questions like "What products do my customers enjoy most?"
- Connections to GCP and AWS