Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -370,10 +370,15 @@ def get_response_from_gemini(query, model, selected_docs, file_type, num_calls=1
|
|
370 |
|
371 |
if file_type == "excel":
|
372 |
# Excel functionality remains the same
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
full_prompt = f"{system_instruction}\n\nContext:\n{selected_docs}\n\nUser query: {query}"
|
379 |
|
|
|
370 |
|
371 |
if file_type == "excel":
|
372 |
# Excel functionality remains the same
|
373 |
+
|
374 |
+
system_instruction = """You are a highly specialized Python programmer with deep expertise in data analysis and visualization using Excel spreadsheets.
|
375 |
+
Your primary goal is to generate accurate and efficient Python code to perform calculations or create visualizations based on the user's requests.
|
376 |
+
Strictly use the data provided to write code that identifies key metrics, trends, and significant details relevant to the query.
|
377 |
+
Do not make assumptions or include any information that is not explicitly supported by the dataset.
|
378 |
+
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.
|
379 |
+
Based on the following data extracted from Excel spreadsheets:\n{context}\n\nPlease provide the Python code needed to execute the following task: '{query}'.
|
380 |
+
Ensure that the code is derived directly from the dataset.
|
381 |
+
If a chart is requested, use the matplotlib library to generate the appropriate visualization."""
|
382 |
|
383 |
full_prompt = f"{system_instruction}\n\nContext:\n{selected_docs}\n\nUser query: {query}"
|
384 |
|