Commit
Β·
578017a
1
Parent(s):
f639c56
update readme
Browse files
README.md
CHANGED
|
@@ -1,104 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
- **Interactive Chat Interface**: User-friendly Gradio-based web interface
|
| 14 |
-
- **Data Visualization**: Generate visualizations from query results
|
| 15 |
-
- **Environment Configuration**: Easy setup with environment variables
|
| 16 |
-
|
| 17 |
-
## π Quick Start
|
| 18 |
-
|
| 19 |
-
### Prerequisites
|
| 20 |
-
|
| 21 |
-
- Python 3.8 or higher
|
| 22 |
-
- MySQL database (or compatible database)
|
| 23 |
-
- Google API key for Gemini
|
| 24 |
-
|
| 25 |
-
### Installation
|
| 26 |
-
|
| 27 |
-
1. Clone the repository:
|
| 28 |
-
```bash
|
| 29 |
-
git clone https://github.com/yourusername/chatbot-agent-sql-gemini.git
|
| 30 |
-
cd chatbot-agent-sql-gemini
|
| 31 |
-
```
|
| 32 |
-
|
| 33 |
-
2. Install dependencies:
|
| 34 |
-
```bash
|
| 35 |
-
pip install -r requirements.txt
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
3. Create a `.env` file in the project root with your configuration:
|
| 39 |
-
```env
|
| 40 |
-
DB_USER=your_db_username
|
| 41 |
-
DB_PASSWORD=your_db_password
|
| 42 |
-
DB_HOST=your_db_host
|
| 43 |
-
DB_NAME=your_database_name
|
| 44 |
-
GOOGLE_API_KEY=your_google_api_key
|
| 45 |
-
```
|
| 46 |
-
|
| 47 |
-
### Running the Application
|
| 48 |
-
|
| 49 |
-
1. Start the application:
|
| 50 |
-
```bash
|
| 51 |
-
python app.py
|
| 52 |
-
```
|
| 53 |
-
|
| 54 |
-
2. Open your web browser and navigate to `http://localhost:7860`
|
| 55 |
-
|
| 56 |
-
## π οΈ Configuration
|
| 57 |
-
|
| 58 |
-
The application can be configured using the following environment variables:
|
| 59 |
-
|
| 60 |
-
| Variable | Description | Required |
|
| 61 |
-
|----------|-------------|----------|
|
| 62 |
-
| `DB_USER` | Database username | β
|
|
| 63 |
-
| `DB_PASSWORD` | Database password | β
|
|
| 64 |
-
| `DB_HOST` | Database host | β
|
|
| 65 |
-
| `DB_NAME` | Database name | β
|
|
| 66 |
-
| `GOOGLE_API_KEY` | Google API key for Gemini | β
|
|
| 67 |
-
|
| 68 |
-
## π¦ Dependencies
|
| 69 |
-
|
| 70 |
-
- gradio >= 3.0.0
|
| 71 |
-
- langchain >= 0.1.0
|
| 72 |
-
- langchain-community >= 0.0.10
|
| 73 |
-
- langchain-google-genai >= 0.1.0
|
| 74 |
-
- langgraph >= 0.0.0
|
| 75 |
-
- matplotlib >= 3.7.0
|
| 76 |
-
- pandas >= 2.0.0
|
| 77 |
-
- sqlalchemy >= 2.0.0
|
| 78 |
-
- python-dotenv >= 1.0.0
|
| 79 |
-
|
| 80 |
-
## π€ How It Works
|
| 81 |
-
|
| 82 |
-
1. The application connects to your SQL database using the provided credentials
|
| 83 |
-
2. Users input natural language questions through the Gradio interface
|
| 84 |
-
3. The Gemini model converts these questions into SQL queries
|
| 85 |
-
4. Queries are executed against the database
|
| 86 |
-
5. Results are formatted and displayed to the user
|
| 87 |
-
6. For appropriate data, visualizations are automatically generated
|
| 88 |
-
|
| 89 |
-
## π Example Queries
|
| 90 |
-
|
| 91 |
-
- "Show me the top 10 customers by total purchases"
|
| 92 |
-
- "What were our total sales last month?"
|
| 93 |
-
- "List all products with stock below minimum levels"
|
| 94 |
-
- "Generate a bar chart of monthly sales for the past year"
|
| 95 |
-
|
| 96 |
-
## π License
|
| 97 |
-
|
| 98 |
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
| 99 |
-
|
| 100 |
-
## π Acknowledgments
|
| 101 |
-
|
| 102 |
-
- [Gradio](https://gradio.app/) for the web interface
|
| 103 |
-
- [Google Gemini](https://ai.google.dev/) for the language model
|
| 104 |
-
- [LangChain](https://www.langchain.com/) for the agent framework
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: ChatbotAgentGraphSQLgemini Etheroji
|
| 3 |
+
emoji: π€
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "3.50.2"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|