Update app.py
Browse files
app.py
CHANGED
|
@@ -136,14 +136,16 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 136 |
|
| 137 |
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=["numpy", "pandas", "matplotlib.pyplot", "seaborn", "sklearn", "json"])
|
| 138 |
analysis_result = agent.run("""
|
| 139 |
-
You are a helpful data analysis agent.
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
2.
|
| 143 |
-
3.
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
| 147 |
{
|
| 148 |
'observations': {
|
| 149 |
'observation_1_key': 'observation_1_value',
|
|
|
|
| 136 |
|
| 137 |
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=["numpy", "pandas", "matplotlib.pyplot", "seaborn", "sklearn", "json"])
|
| 138 |
analysis_result = agent.run("""
|
| 139 |
+
You are a helpful data analysis agent. Follow these instructions EXACTLY:
|
| 140 |
+
|
| 141 |
+
1. Load the data from the given `source_file` ONLY.
|
| 142 |
+
2. Analyze the data structure and generate up to 5 visualizations and 5 insights.
|
| 143 |
+
3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
|
| 144 |
+
4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
|
| 145 |
+
5. DO NOT return any explanations, thoughts, or narration outside the final output block.
|
| 146 |
+
6. Run only 5 iteration and return output quickly.
|
| 147 |
+
|
| 148 |
+
⚠️ Output ONLY the following code block format, exactly:
|
| 149 |
{
|
| 150 |
'observations': {
|
| 151 |
'observation_1_key': 'observation_1_value',
|