Update app.py
Browse files
app.py
CHANGED
|
@@ -564,24 +564,24 @@ def get_recommendation_with_agent(user_id, merchant, category, amount):
|
|
| 564 |
|
| 565 |
reasoning_bullets = format_reasoning(reasoning)
|
| 566 |
|
| 567 |
-
#
|
| 568 |
output = f"""## π― Recommended: **{card_name}**
|
| 569 |
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
|
| 586 |
# Alternatives
|
| 587 |
if alternatives:
|
|
@@ -629,6 +629,10 @@ def get_recommendation_with_agent(user_id, merchant, category, amount):
|
|
| 629 |
</details>
|
| 630 |
"""
|
| 631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 632 |
chart = create_agent_recommendation_chart_enhanced(result)
|
| 633 |
yield output, chart
|
| 634 |
|
|
|
|
| 564 |
|
| 565 |
reasoning_bullets = format_reasoning(reasoning)
|
| 566 |
|
| 567 |
+
# Format the output - CRITICAL: No indentation on f-string!
|
| 568 |
output = f"""## π― Recommended: **{card_name}**
|
| 569 |
|
| 570 |
+
| Metric | Value |
|
| 571 |
+
|--------|-------|
|
| 572 |
+
| π° **Rewards Earned** | ${rewards_earned:.2f} ({rewards_rate}) |
|
| 573 |
+
| π **Confidence** | {confidence*100:.0f}% |
|
| 574 |
+
| π **Annual Potential** | ${net_benefit:.2f}/year |
|
| 575 |
+
| β **Optimization Score** | {optimization_score}/100 |
|
| 576 |
+
|
| 577 |
+
---
|
| 578 |
+
|
| 579 |
+
### π§ Why This Card?
|
| 580 |
+
|
| 581 |
+
{reasoning_bullets}
|
| 582 |
+
|
| 583 |
+
---
|
| 584 |
+
"""
|
| 585 |
|
| 586 |
# Alternatives
|
| 587 |
if alternatives:
|
|
|
|
| 629 |
</details>
|
| 630 |
"""
|
| 631 |
|
| 632 |
+
chart = create_agent_recommendation_chart_enhanced(result)
|
| 633 |
+
yield output, chart
|
| 634 |
+
|
| 635 |
+
|
| 636 |
chart = create_agent_recommendation_chart_enhanced(result)
|
| 637 |
yield output, chart
|
| 638 |
|