Examples

Refund only when sure

Open in playground →
  • Probabilities
  • when
  • Typed numbers

Task

Classify a ticket, and give the refund amount only when it is a billing ticket and the model is at least 80% sure of that.

Challenges

  • refund runs only if category is billing with a confidence of at least 0.8: "when": {"category": {"in": ["billing"], "confidence": {"gte": 0.8}}}.
  • This ticket is plainly billing, so the refund is asked. A vaguer one, "Since I changed my email I can't log in, and my last invoice looks wrong too.", came back account at confidence 0.34, and refund was skipped.

Laying out…

Time 0.28 s · Cost $0.0000044

Generation(
    result={
        'category': {
            'value': 'billing',
            'probabilities': {
                'billing': 1,
                'technical': 0,
                'account': 0,
            },
            'confidence': 1,
        },
        'refund': 49,
    },
    thinking={},
    usage=Usage(input_tokens=87, thinking_tokens=0),
)