Update app.py
Browse files
app.py
CHANGED
|
@@ -167,14 +167,16 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 167 |
|
| 168 |
# Run agent on cleaned CSV
|
| 169 |
raw_output = agent.run("""
|
| 170 |
-
You are a data analysis agent. Follow these instructions EXACTLY:
|
| 171 |
1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
|
| 172 |
2. Analyze the data structure and generate up to 3 visualizations and 3 insights.
|
| 173 |
3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
|
| 174 |
4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
|
| 175 |
5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
|
| 176 |
6. Run only 5 iteration and return output quickly.
|
| 177 |
-
7.
|
|
|
|
|
|
|
| 178 |
{
|
| 179 |
'observations': {
|
| 180 |
'observation_1_key': 'observation_1_value',
|
|
|
|
| 167 |
|
| 168 |
# Run agent on cleaned CSV
|
| 169 |
raw_output = agent.run("""
|
| 170 |
+
You are a data analysis agent. Output in JSON only. Follow these instructions EXACTLY:
|
| 171 |
1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
|
| 172 |
2. Analyze the data structure and generate up to 3 visualizations and 3 insights.
|
| 173 |
3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
|
| 174 |
4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
|
| 175 |
5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
|
| 176 |
6. Run only 5 iteration and return output quickly.
|
| 177 |
+
7. DO NOT include any natural language (e.g., "Thoughts:", "Code:", explanations).
|
| 178 |
+
8. ONLY output a single, valid JSON block. No markdown or extra text.
|
| 179 |
+
9. Output ONLY the following JSON code block format, exactly:
|
| 180 |
{
|
| 181 |
'observations': {
|
| 182 |
'observation_1_key': 'observation_1_value',
|