Examples

Classify a ticket, refund only for billing, and reply

Open in playground →
  • depends_on
  • when
  • Enum
  • Typed numbers

Task

Classify a support ticket and say whether it is urgent, give a refund amount only for billing, and write a one-sentence reply that takes both answers into account.

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