Commit
·
e185930
1
Parent(s):
24cd56b
Enhance OpenAI prompt to explicitly mention user's budget amount and base recommendations on it
Browse files- app/smart_recommendation.py +10 -4
app/smart_recommendation.py
CHANGED
|
@@ -1442,16 +1442,22 @@ class SmartBudgetRecommender:
|
|
| 1442 |
summary = (
|
| 1443 |
f"Category: {category}\n"
|
| 1444 |
f"⚠️ IMPORTANT: This is a NEW BUDGET with NO historical spending data.\n"
|
| 1445 |
-
f"The user has
|
| 1446 |
-
f"This is the
|
|
|
|
|
|
|
| 1447 |
f"Your recommendation should be based on:\n"
|
| 1448 |
-
f" 1. The provided budget amount: {avg_expense:,.2f}\n"
|
| 1449 |
f" 2. Category-specific knowledge (e.g., Food & Drinks inflation, Transport volatility)\n"
|
| 1450 |
f" 3. General best practices (add 10-15% buffer for new budgets to account for variability)\n"
|
| 1451 |
f" 4. Economic factors (inflation typically 2-5% annually, category-specific inflation)\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1452 |
f"DO NOT reference fake trends or historical patterns - this is a new budget!\n"
|
| 1453 |
f"Recommend a budget that accounts for typical variability and inflation for this category.\n"
|
| 1454 |
-
f"For new budgets, typically recommend 10-15% increase from the provided amount to create a safety buffer.\n"
|
| 1455 |
)
|
| 1456 |
else:
|
| 1457 |
# This is based on real historical data
|
|
|
|
| 1442 |
summary = (
|
| 1443 |
f"Category: {category}\n"
|
| 1444 |
f"⚠️ IMPORTANT: This is a NEW BUDGET with NO historical spending data.\n"
|
| 1445 |
+
f"💰 USER'S BUDGET AMOUNT: The user has SET/PLANNED a budget of {avg_expense:,.2f} for this category.\n"
|
| 1446 |
+
f"This is the budget amount the user wants to allocate - this is the ONLY data point available.\n"
|
| 1447 |
+
f"There is NO spending history to analyze - this is a fresh budget.\n\n"
|
| 1448 |
+
f"🎯 YOUR TASK: Provide a recommendation based on the user's budget amount of {avg_expense:,.2f}\n\n"
|
| 1449 |
f"Your recommendation should be based on:\n"
|
| 1450 |
+
f" 1. The user's provided budget amount: {avg_expense:,.2f} (this is what they want to set)\n"
|
| 1451 |
f" 2. Category-specific knowledge (e.g., Food & Drinks inflation, Transport volatility)\n"
|
| 1452 |
f" 3. General best practices (add 10-15% buffer for new budgets to account for variability)\n"
|
| 1453 |
f" 4. Economic factors (inflation typically 2-5% annually, category-specific inflation)\n\n"
|
| 1454 |
+
f"💡 KEY INSIGHT: The user has indicated they want to budget {avg_expense:,.2f} for this category.\n"
|
| 1455 |
+
f" - If this amount seems reasonable for the category, recommend keeping it or a small increase (5-10%)\n"
|
| 1456 |
+
f" - If this category typically requires more (e.g., Food & Drinks with inflation), recommend increase (10-20%)\n"
|
| 1457 |
+
f" - Always add a buffer for unexpected expenses and inflation\n\n"
|
| 1458 |
f"DO NOT reference fake trends or historical patterns - this is a new budget!\n"
|
| 1459 |
f"Recommend a budget that accounts for typical variability and inflation for this category.\n"
|
| 1460 |
+
f"For new budgets, typically recommend 10-15% increase from the user's provided amount to create a safety buffer.\n"
|
| 1461 |
)
|
| 1462 |
else:
|
| 1463 |
# This is based on real historical data
|