Team Ai
Apppublic

operations-granite/HuggingFace-Granite-AI-Practice-Agent-Dev

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
test_email_intel_response.py55 linesDownload Raw Back to root
1import json2 3# Simulate what the backend should return4test_response = {5    "success": True,6    "data": {7        "user_name": "Test User",8        "user_role": "VP Commercial Growth",9        "emails_sent": 50,10        "emails_received": 75,11        "response_rate": 85.5,12        "avg_response_time_hours": 2.3,13        "active_days": 15,14        "daily_volumes": [15            {"date": "2026-04-21", "sent": 5, "received": 8},16            {"date": "2026-04-22", "sent": 7, "received": 10}17        ],18        "top_recipients": [19            {"email": "client@example.com", "name": "Client Name", "count": 15}20        ],21        "insights": [22            {"type": "strength", "category": "Strength", "meta": "Performance", "title": "Test", "description": "Test"}23        ],24        "raw_insights": {25            "deal_email_matches": [],26            "performance_insights": {},27            "strategic_alignment": {},28            "opportunities_and_risks": {}29        },30        "advanced": {31            "relationship_health": {32                "overall_health_score": 8.5,33                "health_category": "Strong",34                "key_strengths": "Test strengths",35                "areas_for_improvement": "Test improvements"36            },37            "sentiment_analysis": {38                "avg_positive": 0.6,39                "avg_neutral": 0.3,40                "avg_negative": 0.1,41                "insights": "Test sentiment"42            },43            "topic_clustering": {44                "topics": [45                    {"topic": "Client Proposals", "count": 10, "percentage": 40.0},46                    {"topic": "Project Updates", "count": 8, "percentage": 32.0}47                ]48            }49        }50    }51}52 53print(json.dumps(test_response, indent=2))54print("\n✅ Backend should return 'advanced' field with 8 insight types")55