| title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned |
|---|---|---|---|---|---|---|---|
TEXT-2-SQL Chatbot |
🧠 |
indigo |
blue |
docker |
4.0.0 |
app.py |
false |
This application is a Text-to-SQL Chatbot designed to answer natural language questions about pharmaceutical sales and prescription data. It leverages a Large Language Model (LLM) to translate user queries into SQL, executes them against a local SQLite database (pharma_data.db), and presents the results in an interactive interface.
Key features:
- Natural Language Querying: Ask questions like "Which territory has the highest prescription volume?" without knowing SQL.
- Transparent Logic: View the generated SQL, the raw result, and a natural language explanation of the answer.
- Interactive UI: Built with Gradio for a user-friendly experience.
This project uses uv for fast Python package management.
- Python 3.11 or higher
- uv installed
-
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh -
Clone the repository Navigate to the project directory.
-
Sync dependencies: This command will create a virtual environment and install all dependencies defined in
pyproject.toml.uv sync
-
Set up environment variables:
export OPENAI_API_KEY="your_openai_api_key_here"
To run the Gradio application:
uv run app.pyThe application will launch in your browser (typically at http://127.0.0.1:7860).