An LLM-powered application which takes user queries related to a database -> converts the query into a SQL query -> executes the query on the db -> returns the result in text and table format✨
- Uses OpenAI's API to process user queries and convert it into SQL query.
- The application is able to extract the relevant information from the database based on the query.
- The list of tables in the database is available on the top in the Streamlit interface. You can use this list to query relevant information.
- Clone this repository:
git clone https://github.com/Aaryan015/Natural-language-to-SQL.git
- Install the necessary libraries:
pip install streamlit openai pandas python-dotenv
- Create a
.env
file and place the API key in it. - Place a sample database file (.db) in the same directory.
- Run the application:
python -m streamlit run app.py
- Input your query.