pavanmutha commited on
Commit
9fa587f
·
verified ·
1 Parent(s): 712d83a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
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 helpful data analysis agent. Just return insight information and visualization.
133
- Load the data that is passed.do not create your own.
134
- Automatically detect numeric columns and names.
135
- 2. 5 data visualizations
136
- 3. at least 5 insights from data
137
- 5. Generate publication-quality visualizations and save to './figures/'.
138
- Do not use 'open()' or write to files. Just return variables and plots.
139
  The dictionary should have the following structure:
140
  {
141
  'observations': {
142
- 'observation_1_key': 'observation_1_value',
143
- 'observation_2_key': 'observation_2_value',
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