Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,9 +51,7 @@ You are a data visualization assistant. Based on the user's prompt and the datas
|
|
| 51 |
- x_axis: (optional)
|
| 52 |
- y_axis: (optional)
|
| 53 |
- group_by: (optional)
|
| 54 |
-
|
| 55 |
Respond in JSON only. No explanation.
|
| 56 |
-
|
| 57 |
User prompt: {query}
|
| 58 |
Available columns: {columns}
|
| 59 |
""")
|
|
@@ -186,9 +184,7 @@ You are a data analysis expert. Follow these rules:
|
|
| 186 |
2. Never use matplotlib or python_repl_ast
|
| 187 |
3. Provide final answer in the format: CHART|||<chart JSON>|||ANALYSIS|||<analysis text>
|
| 188 |
4. Handle dates carefully
|
| 189 |
-
|
| 190 |
Below is an example of how you should respond:
|
| 191 |
-
|
| 192 |
EXAMPLE
|
| 193 |
-------
|
| 194 |
User: "Can you create a pie chart of Sales by Region?"
|
|
@@ -196,10 +192,8 @@ Assistant:
|
|
| 196 |
Thought: "I should use the generate_visualization tool to build the chart"
|
| 197 |
Action: generate_visualization
|
| 198 |
Action Input: "Pie chart of Sales by Region"
|
| 199 |
-
|
| 200 |
Observation:
|
| 201 |
CHART|||{"data": [...], "layout": {...}}|||ANALYSIS|||Based on the pie chart, Region A leads in sales.
|
| 202 |
-
|
| 203 |
# Final Answer from the assistant:
|
| 204 |
CHART|||{"data": [...], "layout": {...}}|||ANALYSIS|||Based on the pie chart, Region A leads in sales...
|
| 205 |
-------
|
|
@@ -334,4 +328,4 @@ if prompt := st.chat_input("Ask about your data or document"):
|
|
| 334 |
st.warning("Please upload a file first!")
|
| 335 |
|
| 336 |
if not os.getenv("GROQ_API_KEY"):
|
| 337 |
-
st.error("Missing GROQ_API_KEY in .env file!")
|
|
|
|
| 51 |
- x_axis: (optional)
|
| 52 |
- y_axis: (optional)
|
| 53 |
- group_by: (optional)
|
|
|
|
| 54 |
Respond in JSON only. No explanation.
|
|
|
|
| 55 |
User prompt: {query}
|
| 56 |
Available columns: {columns}
|
| 57 |
""")
|
|
|
|
| 184 |
2. Never use matplotlib or python_repl_ast
|
| 185 |
3. Provide final answer in the format: CHART|||<chart JSON>|||ANALYSIS|||<analysis text>
|
| 186 |
4. Handle dates carefully
|
|
|
|
| 187 |
Below is an example of how you should respond:
|
|
|
|
| 188 |
EXAMPLE
|
| 189 |
-------
|
| 190 |
User: "Can you create a pie chart of Sales by Region?"
|
|
|
|
| 192 |
Thought: "I should use the generate_visualization tool to build the chart"
|
| 193 |
Action: generate_visualization
|
| 194 |
Action Input: "Pie chart of Sales by Region"
|
|
|
|
| 195 |
Observation:
|
| 196 |
CHART|||{"data": [...], "layout": {...}}|||ANALYSIS|||Based on the pie chart, Region A leads in sales.
|
|
|
|
| 197 |
# Final Answer from the assistant:
|
| 198 |
CHART|||{"data": [...], "layout": {...}}|||ANALYSIS|||Based on the pie chart, Region A leads in sales...
|
| 199 |
-------
|
|
|
|
| 328 |
st.warning("Please upload a file first!")
|
| 329 |
|
| 330 |
if not os.getenv("GROQ_API_KEY"):
|
| 331 |
+
st.error("Missing GROQ_API_KEY in .env file!")
|