Decide when a support agent may answer alone
Your task
Your support team wants an agent that answers common tickets straight from the product docs before a person sees them. It may only send a reply it can ground in the docs, and some topics always go to a person.
Write route_support_ticket(ticket_text, retrieval_confidence, has_citation): the rule your agent follows for each ticket.
ticket_text(str): the customer's message.retrieval_confidence(float, 0 to 1): how well the retrieved doc passages match the question.has_citation(bool): the draft reply cites a doc passage.
It returns one of the values in the rules below. Apply them in order. The first one that matches decides:
- The ticket, lowercased, contains
refund,securityorlegalanywhere, even inside a longer word:"escalate_sensitive". - No citation:
"escalate_no_citation". retrieval_confidencebelow 0.8:"escalate_low_confidence".- Otherwise:
"auto_reply".
Examples
route_support_ticket(ticket_text: str, retrieval_confidence: float, has_citation: bool) -> strExample 1
Input
route_support_ticket("How do I export a CSV report?", 0.93, True)Output
"auto_reply"Example 2
Input
route_support_ticket("I need a refund for last month", 0.95, True)Output
"escalate_sensitive"Example 3
Input
route_support_ticket("Where is the settings page?", 0.42, True)Output
"escalate_low_confidence"