Shreyas094
commited on
Commit
•
f3e5661
1
Parent(s):
bb07ed2
Update app.py
Browse files
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
|
360 |
-
{"role": "user", "content": f"Based on the following data extracted from Excel spreadsheets:\n{context}\n\nPlease
|
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/"):
|