Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -65,6 +65,8 @@ Notes about the data (follow these):
|
|
| 65 |
- Resolution SLA breach means Resolution_Hours > sla_targets.Resolution_SLA.
|
| 66 |
- Complaint rate = complaints divided by all requests: 100.0 * (SELECT COUNT(*) FROM complaints) / (SELECT COUNT(*) FROM requests). For a group (entity, service, channel) use 100.0 * COUNT(c.complaint_id) / COUNT(DISTINCT r.request_id) from requests r LEFT JOIN complaints c ON c.request_id = r.request_id, grouped by that column.
|
| 67 |
- For any rate or share, count the matching rows with COUNT(*) FILTER (WHERE condition) and divide by the total rows in the group. Never put the condition in the WHERE clause when those same rows are also the denominator.
|
|
|
|
|
|
|
| 68 |
"""
|
| 69 |
|
| 70 |
NOTES_SENTIMENT = """- feedback.Sentiment is exactly 'Positive', 'Neutral' or 'Negative' (AI-generated from Feedback_Text ONLY); Sentiment_Confidence is 0-1. Complaints are never sentiment-scored; do not compute sentiment for complaints.
|
|
|
|
| 65 |
- Resolution SLA breach means Resolution_Hours > sla_targets.Resolution_SLA.
|
| 66 |
- Complaint rate = complaints divided by all requests: 100.0 * (SELECT COUNT(*) FROM complaints) / (SELECT COUNT(*) FROM requests). For a group (entity, service, channel) use 100.0 * COUNT(c.complaint_id) / COUNT(DISTINCT r.request_id) from requests r LEFT JOIN complaints c ON c.request_id = r.request_id, grouped by that column.
|
| 67 |
- For any rate or share, count the matching rows with COUNT(*) FILTER (WHERE condition) and divide by the total rows in the group. Never put the condition in the WHERE clause when those same rows are also the denominator.
|
| 68 |
+
- When answering from comments, begin with 'In a sample of comments' and do not say 'many' or 'most', because the agent only sees a sample.
|
| 69 |
+
- Low satisfaction means overall_satisfaction <= 2 (1 or 2 on the 1-5 scale; 3 is neutral). Low-satisfaction rate = 100.0 * COUNT(*) FILTER (WHERE overall_satisfaction <= 2) / COUNT(overall_satisfaction). Still rank 'happiest' or 'least happy' questions by AVG(overall_satisfaction).
|
| 70 |
"""
|
| 71 |
|
| 72 |
NOTES_SENTIMENT = """- feedback.Sentiment is exactly 'Positive', 'Neutral' or 'Negative' (AI-generated from Feedback_Text ONLY); Sentiment_Confidence is 0-1. Complaints are never sentiment-scored; do not compute sentiment for complaints.
|