Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/Yash-dev-1744/text2sql
Browse files- .gitattributes +35 -0
- README.md +0 -103
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,103 +0,0 @@
|
|
| 1 |
-
<iframe width="560" height="315" src="https://www.youtube.com/embed/0kAYAxU7YsQ?si=6ENuemAOXeLNyh-I" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
| 2 |
-
|
| 3 |
-
# 🤖 AI Database Query Assistant
|
| 4 |
-
|
| 5 |
-
A powerful AI-powered database query assistant that allows you to interact with your MySQL database using natural language.
|
| 6 |
-
|
| 7 |
-
## 🏷️ Tags
|
| 8 |
-
- agent-demo-track
|
| 9 |
-
|
| 10 |
-
## ✨ Features
|
| 11 |
-
|
| 12 |
-
### Database Connection
|
| 13 |
-
- Secure MySQL database connection with support for:
|
| 14 |
-
- Custom host and port configuration
|
| 15 |
-
- Username and password authentication
|
| 16 |
-
- Special character support in passwords
|
| 17 |
-
- Default port (3306) handling
|
| 18 |
-
- Connection status monitoring
|
| 19 |
-
|
| 20 |
-
### AI-Powered Query Processing
|
| 21 |
-
- Natural language to SQL conversion using Google's Gemini model
|
| 22 |
-
- Intelligent query validation and error handling
|
| 23 |
-
- Automatic query correction and optimization
|
| 24 |
-
- Support for complex SQL operations including:
|
| 25 |
-
- Joins
|
| 26 |
-
- Aggregations
|
| 27 |
-
- Subqueries
|
| 28 |
-
- Complex functions
|
| 29 |
-
|
| 30 |
-
### Database Analysis
|
| 31 |
-
- Comprehensive database structure analysis
|
| 32 |
-
- Table schema visualization
|
| 33 |
-
- Column information display
|
| 34 |
-
- Primary and foreign key relationship mapping
|
| 35 |
-
- Row count statistics
|
| 36 |
-
|
| 37 |
-
### Query Features
|
| 38 |
-
- Natural language question processing
|
| 39 |
-
- SQL query generation and execution
|
| 40 |
-
- Query performance metrics:
|
| 41 |
-
- Execution time tracking
|
| 42 |
-
- Row count statistics
|
| 43 |
-
- Query complexity analysis
|
| 44 |
-
- Performance insights
|
| 45 |
-
|
| 46 |
-
### Query History
|
| 47 |
-
- Track and store query history
|
| 48 |
-
- View past queries with:
|
| 49 |
-
- Timestamp
|
| 50 |
-
- Original question
|
| 51 |
-
- Generated SQL
|
| 52 |
-
- Execution metrics
|
| 53 |
-
- Complexity level
|
| 54 |
-
- Reuse previous queries
|
| 55 |
-
- Clear history functionality
|
| 56 |
-
|
| 57 |
-
### Security Features
|
| 58 |
-
- Secure password handling
|
| 59 |
-
- SQL injection prevention
|
| 60 |
-
- Query validation
|
| 61 |
-
- API key management:
|
| 62 |
-
- Environment variable support
|
| 63 |
-
- User-provided key option
|
| 64 |
-
- Secure key storage
|
| 65 |
-
|
| 66 |
-
### User Interface
|
| 67 |
-
- Modern Gradio-based interface
|
| 68 |
-
- Tabbed navigation
|
| 69 |
-
- Real-time status updates
|
| 70 |
-
- Interactive query input
|
| 71 |
-
- Formatted result display
|
| 72 |
-
- Example questions for guidance
|
| 73 |
-
|
| 74 |
-
### Performance Monitoring
|
| 75 |
-
- Query execution time tracking
|
| 76 |
-
- Complexity analysis
|
| 77 |
-
- Performance insights
|
| 78 |
-
- Resource usage optimization
|
| 79 |
-
|
| 80 |
-
### Error Handling
|
| 81 |
-
- Comprehensive error detection
|
| 82 |
-
- User-friendly error messages
|
| 83 |
-
- Automatic query correction
|
| 84 |
-
- Detailed error reporting
|
| 85 |
-
|
| 86 |
-
## 🚀 Getting Started
|
| 87 |
-
|
| 88 |
-
1. Install the required dependencies
|
| 89 |
-
2. Set up your Google API key (for Gemini model)
|
| 90 |
-
3. Configure your MySQL database connection
|
| 91 |
-
4. Launch the application
|
| 92 |
-
5. Start querying your database using natural language!
|
| 93 |
-
|
| 94 |
-
## 🔧 Requirements
|
| 95 |
-
|
| 96 |
-
- Python 3.x
|
| 97 |
-
- MySQL database
|
| 98 |
-
- Google API key for Gemini model
|
| 99 |
-
- Required Python packages (see requirements.txt)
|
| 100 |
-
|
| 101 |
-
## 📝 License
|
| 102 |
-
|
| 103 |
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|