sammy786 commited on
Commit
1ccbc08
Β·
verified Β·
1 Parent(s): 27d8d6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -21
app.py CHANGED
@@ -1534,35 +1534,58 @@ Built with ❀️ for the MCP community
1534
  )
1535
 
1536
  with gr.Tab("πŸ“– API Docs"):
1537
- gr.Markdown(
1538
- """
1539
- πŸ“‘ API EndpointsOrchestrator APIBase URL: https://mcp-1st-birthday-rewardpilot-orchestrator.hf.spacePOST /recommendGet comprehensive card recommendation.Request:
1540
- jsonCopy code[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}{
 
 
 
 
 
 
 
 
1541
  "user_id": "u_alice",
1542
  "merchant": "Whole Foods",
1543
  "mcc": "5411",
1544
  "amount_usd": 125.50,
1545
  "transaction_date": "2025-01-15"
1546
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1547
 
1548
- Other Services[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}ServiceBase URLSmart Wallethttps://mcp-1st-birthday-rewardpilot-smart-wallet.hf.spaceRewards-RAGhttps://mcp-1st-birthday-rewardpilot-rewards-rag.hf.spaceSpend-Forecasthttps://mcp-1st-birthday-rewardpilot-spend-forecast.hf.space
1549
-
1550
- πŸ“š Interactive DocsVisit /docs on any service for interactive Swagger UI documentation.Examples:
1551
- https://mcp-1st-birthday-rewardpilot-orchestrator.hf.space/docs
1552
- https://mcp-1st-birthday-rewardpilot-smart-wallet.hf.space/docs
1553
 
1554
- πŸ”§ cURL ExamplesbashCopy code[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}# Get recommendation
1555
- curl -X POST https://mcp-1st-birthday-rewardpilot-orchestrator.hf.space/recommend \
1556
- -H "Content-Type: application/json" \
1557
- -d '{
1558
- "user_id": "u_alice",
1559
- "merchant": "Whole Foods",
1560
- "mcc": "5411",
1561
- "amount_usd": 125.50
1562
- }'
1563
-
1564
- """
1565
- )
1566
 
1567
 
1568
  # ===================== Launch App =====================
 
1534
  )
1535
 
1536
  with gr.Tab("πŸ“– API Docs"):
1537
+ api_docs_html = """
1538
+ <div style="font-family: system-ui; padding: 20px;">
1539
+ <h2>πŸ“‘ API Endpoints</h2>
1540
+
1541
+ <h3>Orchestrator API</h3>
1542
+ <p><strong>Base URL:</strong> <code>https://mcp-1st-birthday-rewardpilot-orchestrator.hf.space</code></p>
1543
+
1544
+ <h4>POST /recommend</h4>
1545
+ <p>Get comprehensive card recommendation.</p>
1546
+
1547
+ <pre style="background: #f5f5f5; padding: 15px; border-radius: 5px; overflow-x: auto;">
1548
+ {
1549
  "user_id": "u_alice",
1550
  "merchant": "Whole Foods",
1551
  "mcc": "5411",
1552
  "amount_usd": 125.50,
1553
  "transaction_date": "2025-01-15"
1554
  }
1555
+ </pre>
1556
+
1557
+ <hr>
1558
+
1559
+ <h3>Other Services</h3>
1560
+ <ul>
1561
+ <li><strong>Smart Wallet:</strong> https://mcp-1st-birthday-rewardpilot-smart-wallet.hf.space</li>
1562
+ <li><strong>Rewards-RAG:</strong> https://mcp-1st-birthday-rewardpilot-rewards-rag.hf.space</li>
1563
+ <li><strong>Spend-Forecast:</strong> https://mcp-1st-birthday-rewardpilot-spend-forecast.hf.space</li>
1564
+ </ul>
1565
+
1566
+ <hr>
1567
+
1568
+ <h3>πŸ“š Interactive Docs</h3>
1569
+ <p>Visit <code>/docs</code> on any service for Swagger UI:</p>
1570
+ <ul>
1571
+ <li><a href="https://mcp-1st-birthday-rewardpilot-orchestrator.hf.space/docs" target="_blank">Orchestrator Docs</a></li>
1572
+ <li><a href="https://mcp-1st-birthday-rewardpilot-smart-wallet.hf.space/docs" target="_blank">Smart Wallet Docs</a></li>
1573
+ </ul>
1574
+
1575
+ <hr>
1576
+
1577
+ <h3>πŸ”§ cURL Example</h3>
1578
+ <pre style="background: #f5f5f5; padding: 15px; border-radius: 5px; overflow-x: auto;">
1579
+ curl -X POST https://mcp-1st-birthday-rewardpilot-orchestrator.hf.space/recommend \\
1580
+ -H "Content-Type: application/json" \\
1581
+ -d '{"user_id": "u_alice", "merchant": "Whole Foods", "mcc": "5411", "amount_usd": 125.50}'
1582
+ </pre>
1583
+ </div>
1584
+ """
1585
 
1586
+ # In your Gradio interface:
1587
+ gr.HTML(api_docs_html)
 
 
 
1588
 
 
 
 
 
 
 
 
 
 
 
 
 
1589
 
1590
 
1591
  # ===================== Launch App =====================