Examples

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.

  • depends_on
  • when
  • Enum
  • Typed numbers

Challenges

  • refund has a when on category, so it runs only for a billing ticket. reply lists category and urgent in depends_on, so it runs after them and reads their answers.
  • category and urgent need nothing from each other, so they run together. The ticket is read and billed once for all four fields.

Laying out…

Time 1.56 s · Cost $0.0000074

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),
)