Update app.py
Browse files
app.py
CHANGED
|
@@ -391,14 +391,12 @@ def generate_response(user_prompt):
|
|
| 391 |
|
| 392 |
# System prompt for code generation (strict, no explanations)
|
| 393 |
system_msg = """You are a pandas expert for SAP data.
|
| 394 |
-
Output ONLY valid Python code. No explanations, no markdown, no ```python blocks.
|
| 395 |
-
Use the DataFrames that already exist: df_saleorders, df_customers, df_products, df_saleorderitems.
|
| 396 |
-
Always end with a print() that shows the result as a clean markdown table using .to_markdown(index=False).
|
| 397 |
-
If no records match, just print: "No records found."""
|
| 398 |
|
| 399 |
-
user_msg = f"""User question: {user_prompt}
|
| 400 |
-
|
| 401 |
-
Write the pandas code to answer this question."""
|
| 402 |
|
| 403 |
messages = [
|
| 404 |
{"role": "system", "content": system_msg},
|
|
|
|
| 391 |
|
| 392 |
# System prompt for code generation (strict, no explanations)
|
| 393 |
system_msg = """You are a pandas expert for SAP data.
|
| 394 |
+
Output ONLY valid Python code. No explanations, no markdown, no ```python blocks.
|
| 395 |
+
Use the DataFrames that already exist: df_saleorders, df_customers, df_products, df_saleorderitems.
|
| 396 |
+
Always end with a print() that shows the result as a clean markdown table using .to_markdown(index=False).
|
| 397 |
+
If no records match, just print: "No records found."""
|
| 398 |
|
| 399 |
+
user_msg = f"""User question: {user_prompt} Write the pandas code to answer this question."""
|
|
|
|
|
|
|
| 400 |
|
| 401 |
messages = [
|
| 402 |
{"role": "system", "content": system_msg},
|