classify_deal_intent
Classify deal intent by evaluating merchant, category, and value to return top insurance products with confidence scores, using rule-based classification and AI fallback.
Instructions
Classify deal intent and return top insurance products.
Takes a deal object and returns the top 2 insurance products with confidence scores. Uses rule-based classification first, falls back to Claude API if category is unknown.
Args: merchant: Merchant name e.g. "IndiGo", "Samsung", "Zomato" category: One of travel, electronics, food, health, fashion subcategory: Specific subcategory like flight, hotel, gadget, phone deal_value: Deal amount in INR user_history: Optional dict with risk_tier, total_purchases, categories_bought
Returns: ClassificationResult with top_products, cart_context, show_offer, fallback_used
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | ||
| merchant | Yes | ||
| deal_value | Yes | ||
| subcategory | Yes | ||
| user_history | No |