This app allows users to convert text to SQL queries and generates database schema from text using the OpenAI GPT3-turbo. It also features a user-friendly interface built with Streamlit.
- Clone the repository
git clone https://github.com/Rafayqayyum/text-to-sql
- Install the requirements
pip install -r requirements.txt
- Sign up for an OpenAI API key here
- Add your OpenAI API key to the environment variable by exporting it in your terminal:
export OPENAI_API_KEY='YOUR_API_KEY'
- Run the app ```streamlit run .py`Generate_SQL.py``
- Select the database type you want to query
- Provide the schema of the database
- Provide the text you want to convert to SQL.
- Click the button to convert the text to SQL.
- Or choose the open the schema generator page to generate a schema