Update app.py
Browse files
app.py
CHANGED
|
@@ -129,18 +129,18 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 129 |
|
| 130 |
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=["numpy", "pandas", "matplotlib.pyplot", "seaborn", "sklearn", "json"])
|
| 131 |
analysis_result = agent.run("""
|
| 132 |
-
You are a
|
| 133 |
-
Load the data
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
5.
|
| 138 |
-
|
| 139 |
The dictionary should have the following structure:
|
| 140 |
{
|
| 141 |
'observations': {
|
| 142 |
-
'observation_1_key': '
|
| 143 |
-
'observation_2_key': '
|
| 144 |
...
|
| 145 |
},
|
| 146 |
'insights': {
|
|
@@ -149,6 +149,9 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 149 |
...
|
| 150 |
}
|
| 151 |
}
|
|
|
|
|
|
|
|
|
|
| 152 |
""", additional_args={"additional_notes": additional_notes, "source_file": csv_file})
|
| 153 |
|
| 154 |
execution_time = time.time() - start_time
|
|
|
|
| 129 |
|
| 130 |
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=["numpy", "pandas", "matplotlib.pyplot", "seaborn", "sklearn", "json"])
|
| 131 |
analysis_result = agent.run("""
|
| 132 |
+
You are a data analysis agent. Just return insight information and visualization and follow following instruction strictly.
|
| 133 |
+
1. Load the data from provide source_file.Do not create your own.
|
| 134 |
+
2. Detect numeric and categorical columns.
|
| 135 |
+
3. Generate at least 5 visualizations and 5 insights.
|
| 136 |
+
4. Generate publication-quality visualizations and Save all plots to `./figures/` as PNGs using matplotlib or seaborn.
|
| 137 |
+
5. Do not use 'open()' or write to files. Just return variables and plots.
|
| 138 |
+
6. Return insights in this exact Python dictionary structure:
|
| 139 |
The dictionary should have the following structure:
|
| 140 |
{
|
| 141 |
'observations': {
|
| 142 |
+
'observation_1_key': 'Brief, clear observation.',
|
| 143 |
+
'observation_2_key': 'Another brief point.',
|
| 144 |
...
|
| 145 |
},
|
| 146 |
'insights': {
|
|
|
|
| 149 |
...
|
| 150 |
}
|
| 151 |
}
|
| 152 |
+
DO NOT use open(), DO NOT print. Only return this dictionary object as your final output in a code block.
|
| 153 |
+
|
| 154 |
+
Be concise. Do not include text explanations outside the code block.
|
| 155 |
""", additional_args={"additional_notes": additional_notes, "source_file": csv_file})
|
| 156 |
|
| 157 |
execution_time = time.time() - start_time
|