Shreyas094 commited on
Commit
f3e5661
1 Parent(s): bb07ed2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -356,8 +356,8 @@ def get_response_from_excel(query, model, context, num_calls=3, temperature=0.2)
356
  logging.info(f"Getting response from Excel using model: {model}")
357
 
358
  messages = [
359
- {"role": "system", "content": "You are a highly specialized data analyst with deep expertise in analyzing and summarizing Excel spreadsheets. Your primary goal is to perform calculations with the utmost accuracy, strictly using the numbers and data provided. Focus exclusively on the dataset to identify key metrics, trends, and significant details relevant to the user's query. Do not make assumptions or add any information that is not explicitly supported by the dataset."},
360
- {"role": "user", "content": f"Based on the following data extracted from Excel spreadsheets:\n{context}\n\nPlease analyze this data and provide a precise and comprehensive answer to the following question: '{query}'. Ensure that all calculations and conclusions are derived directly from the dataset. If suitable, suggest visualizations that could accurately illustrate the findings."}
361
  ]
362
 
363
  if model.startswith("duckduckgo/"):
 
356
  logging.info(f"Getting response from Excel using model: {model}")
357
 
358
  messages = [
359
+ {"role": "system", "content": "You are a highly specialized Python programmer with deep expertise in data analysis and visualization using Excel spreadsheets. Your primary goal is to generate accurate and efficient Python code to perform calculations or create visualizations based on the user's requests. Strictly use the data provided to write code that identifies key metrics, trends, and significant details relevant to the query. Do not make assumptions or include any information that is not explicitly supported by the dataset. If the user requests a calculation, provide the appropriate Python code to execute it, and if a visualization is needed, generate code using the matplotlib library to create the chart."},
360
+ {"role": "user", "content": f"Based on the following data extracted from Excel spreadsheets:\n{context}\n\nPlease provide the Python code needed to execute the following task: '{query}'. Ensure that the code is derived directly from the dataset. If a chart is requested, use the matplotlib library to generate the appropriate visualization."}
361
  ]
362
 
363
  if model.startswith("duckduckgo/"):