Skip to content

Commit 74cf51e

Browse files
committed
feat: Introduce .env configuration file and remove legacy .env_example; enhance intelligent routing service for better error handling and CSV analysis
1 parent e28fb10 commit 74cf51e

File tree

6 files changed

+159
-204
lines changed

6 files changed

+159
-204
lines changed

.env_examp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
GROQ_API_KEY=your_groq_api_key_here
2+
GROQ_MODEL_NAME=model/name
3+
4+
APP_NAME=Querypls
5+
APP_VERSION=1.0.0
6+
MAX_TOKENS=1000
7+
TEMPERATURE=0.7
8+
MAX_CHAT_HISTORIES=5
9+
LOG_LEVEL=INFO

.env_example

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,31 @@
77
[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](LICENSE)
88
<img src='https://img.shields.io/github/stars/samadpls/querypls?color=red&label=stars&logoColor=black&style=social'>
99

10-
# 💬 Querypls - Prompt to SQL
10+
# 💬 Querypls - Intelligent SQL and CSV Analysis
1111

12-
Querypls is a web application that provides an interactive chat interface, simplifying SQL query generation. Users can effortlessly enter SQL queries and receive corresponding results. The application harnesses the capabilities of the language models from Hugging Face to generate SQL queries based on user input.
12+
Querypls is a modern web application that provides an interactive chat interface for SQL query generation and CSV data analysis. Built with Pydantic AI and powered by OpenAI's GPT-OSS-120B model through Groq, it offers intelligent routing between different analysis modes to handle various data-related queries.
13+
14+
🌐 **Try it live**: [querypls.streamlit.app](https://querypls.streamlit.app/)
1315

1416
## Key Features
1517

16-
💬 Interactive chat interface for easy communication.
17-
🔍 Enter SQL queries and receive query results as responses.
18-
🤖 Utilizes language models from Hugging Face for advanced query generation ([Querypls-prompt2sql](https://huggingface.co/samadpls/querypls-prompt2sql)).
19-
💻 User-friendly interface for seamless interaction.
18+
💬 **Interactive Chat Interface** - Natural language conversations for data analysis
19+
🔍 **SQL Query Generation** - Convert natural language to optimized SQL queries
20+
📊 **CSV Data Analysis** - Upload and analyze CSV files with intelligent insights
21+
🤖 **Intelligent Routing** - Automatically determines the best agent for your query
22+
**Fast Inference** - Powered by Groq's optimized infrastructure
23+
🔒 **Type-Safe Development** - Built with Pydantic AI for robust validation
24+
📈 **Visual Analytics** - Generate charts and visualizations from your data
2025

2126
![QueryplsDemo](https://github.com/samadpls/Querypls/assets/94792103/daa6e37d-a256-4fd8-9607-6e18cf41df3f)
2227

2328

2429

2530
# Acknowledgments
2631

27-
`Querypls` received a shoutout from [🦜 🔗 Langchain](https://www.langchain.com/) on their Twitter, reaching over **60,000 impressions**. Additionally, it was featured under the **Community Favorite Projects** section on `🦜 🔗 Langchain's blog`, leading to a significant increase in stars for this repository and a growing user base. The project was also highlighted in a [YouTube video](https://www.youtube.com/watch?v=htHVb-fK9xU), and it also caught the attention of Backdrop, expressing their interest and liking in an email, inviting the project to be a part of their hackathon.
32+
`Querypls` received a shoutout from [🦜 🔗 Langchain](https://www.langchain.com/) on their Twitter in 2023, reaching over **60,000 impressions**. Additionally, it was featured under the **Community Favorite Projects** section on `🦜 🔗 Langchain's blog`, leading to a significant increase in stars for this repository and a growing user base. The project was also highlighted in a [YouTube video](https://www.youtube.com/watch?v=htHVb-fK9xU), and it also caught the attention of Backdrop, expressing their interest and liking in an email, inviting the project to be a part of their hackathon.
33+
34+
However, due to constant breakdowns and instability issues with the LangChain framework, we made the strategic decision to migrate to **Pydantic AI** - a more stable and reliable framework. This transition has brought improved performance, better type safety, and enhanced maintainability to the project.
2835

2936
| [🔗 Langhchain Twitter Post](https://twitter.com/LangChainAI/status/1729959981523378297?t=Zdpw9ZQYvE3QS-3Bf-xaGw&s=19) | [🔗 Langhcain Blog Post](https://blog.langchain.dev/week-of-11-27-langchain-release-notes/) |
3037
|----------|----------|
@@ -38,7 +45,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
3845

3946

4047
> [!Note]
41-
> Querypls, while powered by a 7B model of Satablility AI LLM Model, is currently limited in providing optimal responses for simple queries.
48+
> Querypls is now powered by OpenAI's GPT-OSS-120B model through Groq, providing fast and reliable AI-powered SQL generation and CSV analysis capabilities.
4249
4350
---
4451

@@ -59,11 +66,11 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
5966
pip install -r requirements.txt
6067
```
6168

62-
4. Create a `.env` file based on `.env_example` and set the necessary variables.
69+
4. Create a `.env` file based on `.env_examp` and set the necessary variables.
6370

6471
5. Run the application:
6572
```bash
66-
streamlit run src/app.py
73+
streamlit run src/frontend/app.py
6774
```
6875

6976
6. Open the provided link in your browser to use Querypls.

src/config/settings.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,15 @@ class Settings(BaseModel):
1717
debug_mode: bool = Field(default=False, env="DEBUG_MODE")
1818

1919
# Legacy fields for backward compatibility
20-
app_name: Optional[str] = Field(None, env="APP_NAME")
21-
streamlit_port: Optional[str] = Field(None, env="STREAMLIT_PORT")
22-
streamlit_host: Optional[str] = Field(None, env="STREAMLIT_HOST")
23-
max_tokens: Optional[str] = Field(None, env="MAX_TOKENS")
24-
temperature: Optional[str] = Field(None, env="TEMPERATURE")
25-
log_level: Optional[str] = Field(None, env="LOG_LEVEL")
20+
max_tokens: Optional[str] = Field(1000, env="MAX_TOKENS")
21+
temperature: Optional[str] = Field(0.7, env="TEMPERATURE")
22+
log_level: Optional[str] = Field("INFO", env="LOG_LEVEL")
2623

2724
json_schema_extra: ClassVar[str] = "ignore"
2825

2926
model_config = ConfigDict(
3027
env_file = ".env",
3128
env_file_encoding = "utf-8",
32-
# Add any necessary configuration here
3329
)
3430

3531

0 commit comments

Comments
 (0)