sammy786 commited on
Commit
1a411e8
Β·
verified Β·
1 Parent(s): ba28577

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -16
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
- # NO INDENTATION IN 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,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