This project is a proof-of-concept (POC) application that allows users to interact with a SQLite database using natural language queries. The application utilizes Google's Gemini API for natural language processing (NLP) to convert English questions into SQL queries, which are then executed on a SQLite database containing information about Classic Models, a fictional company with offices worldwide.
- Natural Language Processing: Users can input English questions related to the database, and the application will generate corresponding SQL queries.
- Database Integration: The application interacts with a SQLite database named
ClassicModels.db
, which contains information about Classic Models, its employees, and customers. - Streamlit UI: The user interface is built using Streamlit, providing a simple and intuitive experience for users to input questions and view database details.
main.py
: The main Python script containing the Streamlit application code.ClassicModels.db
: SQLite database file containing the company's information.Gemini.py
: Module for interfacing with Google's Gemini API for NLP.requirements.txt
: List of Python dependencies required to run the project.
-
Clone the repository:
git clone https://github.com/your-username/chatwith-database-poc.git
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Obtain a Google API key for Gemini API and set it as
GOOGLE_API_KEY
in your environment variables.
- Obtain a Google API key for Gemini API and set it as
-
Run the application:
streamlit run main.py
- Upon running the application, you will be presented with a user interface.
- Enter your English query in the input field provided.
- Click on the "Ask the question" button to generate the corresponding SQL query.
- The generated SQL query will be displayed, and the database details corresponding to the query will be shown below.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.