Look up an order and ask an agent mid-call
Open in playground →The call reads the order number, stops for your order database, and for a lost order stops again for an agent's refund decision, then writes the reply.
Challenges
order_statusandrefund_approvedhave"source": "user": your side answers them, from a database or a person, and the call resumes with the answers.- Each stops only when its
whenpasses: an email without an order number never stops.
Laying out…
- Part 10.14 s$0.000012stopped for
order_status; your side answered"lost" - Part 20.06 s$0.00000035stopped for
refund_approved; your side answeredtrue - Part 30.58 s$0.0000003completed
Generation(
result={
'order_id': '8840',
'order_status': 'lost',
'refund_approved': True,
'refund_reply': "Hi Sam, I'm sorry to hear that your order hasn't arrived. I've checked our system and confirmed that order 8840 is marked as lost. I have approved a full refund for you, which should be processed within 3-5 business days. Thank you for your patience.",
},
thinking={},
usage=Usage(input_tokens=253, thinking_tokens=0),
skipped=[
'reply',
],
)