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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -18
app.py CHANGED
@@ -610,24 +610,31 @@ def get_recommendation_with_agent(user_id, merchant, category, amount):
610
 
611
  # Calculation details (collapsible)
612
  output += f"""
613
- <details>
614
- <summary>πŸ“Š <b>Annual Impact Calculation</b> (Click to expand)</summary>
615
-
616
- **Assumptions:**
617
- - Transaction: ${amount_float:.2f} at {merchant} ({category})
618
- - Frequency: {frequency_label} β†’ ${annual_spend:.2f}/year
619
-
620
- **Rewards Breakdown:**
621
-
622
- {calc_table}
623
-
624
- **vs. Baseline (1% card):** ${baseline_rewards:.2f}/year
625
- **Net Benefit:** ${net_benefit:+.2f}/year {"πŸŽ‰" if net_benefit > 0 else "⚠️"}
626
-
627
- **Card Details:** {reward_rate_value}% on {category} | Cap: {"$" + str(monthly_cap or annual_cap) if (monthly_cap or annual_cap) else "None"} | Fee: ${annual_fee}
628
-
629
- </details>
630
- """
 
 
 
 
 
 
 
631
 
632
  chart = create_agent_recommendation_chart_enhanced(result)
633
  yield output, chart
 
610
 
611
  # Calculation details (collapsible)
612
  output += f"""
613
+ <details>
614
+ <summary>πŸ“Š <b>Annual Impact Calculation</b> (Click to expand)</summary>
615
+
616
+ <br>
617
+
618
+ **Assumptions:**
619
+
620
+ - Transaction: ${amount_float:.2f} at {merchant} ({category})
621
+ - Frequency: {frequency_label} β†’ ${annual_spend:.2f}/year
622
+
623
+ **Rewards Breakdown:**
624
+
625
+ {calc_table}
626
+
627
+ **vs. Baseline (1% card):** ${baseline_rewards:.2f}/year
628
+
629
+ **Net Benefit:** ${net_benefit:+.2f}/year {"πŸŽ‰" if net_benefit > 0 else "⚠️"}
630
+
631
+ **Card Details:** {reward_rate_value}% on {category} | Cap: {"$" + str(monthly_cap or annual_cap) if (monthly_cap or annual_cap) else "None"} | Fee: ${annual_fee}
632
+
633
+ <br>
634
+
635
+ </details>
636
+ """
637
+ ```
638
 
639
  chart = create_agent_recommendation_chart_enhanced(result)
640
  yield output, chart