This repository contains the code for a text-to-data retrieval app that uses the Gemini AI model to retrieve data from a database based on a natural language query. The app allows users to input a natural language description of the data they are looking for, and the model generates the corresponding SQL query to retrieve that data from the database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them
- Python 3.9
- pip (Python package manager)
- virtualenv (Python virtual environment manager)
- A SQL database (e.g. PostgreSQL, MySQL)
A step by step series of examples that tell you how to get a development environment running
- Clone the repository to your local machine
git clone https://github.com/christinestraub/Text-To-Data-GeminiAI-App.git
- Create a virtual environment and activate it
virtualenv venv
source venv/bin/activate
- Install the required packages
pip install -r requirements.txt
- Set up the database connection
- Create a new database and user for the app
- Update the
config.py
file with the database connection details
- Run the app
python app.py
The app will prompt you to enter a natural language description of the data you are looking for. For example, you might enter "Show me the names and salaries of all employees in the sales department." The model will then generate the corresponding SQL query and retrieve the data from the database.
- Python - Programming language
- Streamlit - Web framework
- Gemini AI Model - AI model for generating SQL queries
- MySQL - Database toolkit and Object-Relational Mapping (ORM) system for Python
This project is licensed under the MIT License - see the LICENSE.md file for details.