Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saritaphd/end-to-end-text-to-sql-llm-app-along-with-quering-sql-database
https://github.com/saritaphd/end-to-end-text-to-sql-llm-app-along-with-quering-sql-database
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/saritaphd/end-to-end-text-to-sql-llm-app-along-with-quering-sql-database
- Owner: SaritaPhD
- License: mit
- Created: 2024-07-25T09:07:47.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T09:23:33.000Z (4 months ago)
- Last Synced: 2024-07-25T10:52:18.395Z (4 months ago)
- Language: Python
- Size: 327 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gemini App To Retrieve SQL Data
## Overview
This application allows users to input questions in natural language, and it generates and executes corresponding SQL queries on a pre-defined database. The app uses Google Gemini's Generative AI to convert questions to SQL commands.## Features
- Input a question in natural language.
- Generate an SQL query using Google Gemini's Generative AI.
- Execute the SQL query on a local SQLite database.
- Display the results of the SQL query on the Streamlit app.## Requirements
- Python 3.10 or higher
- Streamlit
- dotenv
- sqlite3
- google-generativeai## Installation
- Clone the repository: git clone [email protected]:SaritaPhD/End-to-End-Text-to-SQL-LLM-App-Along-With-Quering-SQL-Database.git
- cd End-to-End-Text-to-SQL-LLM-App-Along-With-Quering-SQL-Database
- Create and activate a virtual environment: python3 -m venv venv
- source venv/bin/activate
- Install the required packages: pip install -r requirements.txt
- Create a .env file in the project root directory and add your Google API key: GOOGLE_API_KEY=your_google_api_key## Usage
Ensure you have a SQLite database named database.db in the project directory with a table STUDENT containing columns NAME, CLASS, and SECTION.
- You can get this databse by running the following command: python3 sqlite.py- Once database is created then run the below given command:
- Run the Streamlit app: streamlit run app.py
- Open your web browser and navigate to the URL provided by Streamlit (usually http://localhost:8501).
- Input your question in the text input field and click the "Ask the question" button.
## License
This project is licensed under the MIT License.## Acknowledgements
Streamlit
Google Generative AI
dotenv
SQLite![Alt text](image.png)