Classify a ticket, refund only for billing, and reply
Open in playground →A support ticket's workflow in one call: classify it, detect urgency, extract the refund only when it is a billing ticket, and generate a reply given the category and urgency.
Challenges
refundhas awhenoncategory, so it runs only for a billing ticket.replylistscategoryandurgentindepends_on, so it runs after them and reads their answers.categoryandurgentneed nothing from each other, so they run together. The ticket is read and billed once for all four fields.
Laying out…
Generation(
result={
'category': 'billing',
'urgent': True,
'refund': 49,
'reply': 'I am sorry to hear about the duplicate charge on your company card, and I have flagged this as urgent for our billing team to process your refund immediately.',
},
thinking={},
usage=Usage(input_tokens=149, thinking_tokens=0),
)