Examples

Route a support ticket

Open in playground →
  • Enum
  • Probabilities

Task

Send a customer's email to the right team, rate how urgent it is, say whether they want money back, and sum up the problem in a sentence.

Challenges

  • Routing needs more than a label. To send unsure tickets to a person, you need to know how sure the model is, so every option comes back with a probability.
  • The queue must be one of your four names exactly, never Billing team or a category you did not list.
  • The refund is implied, not asked for in so many words: the customer wants "the second charge back".

Laying out…

Time 0.32 s · Cost $0.0000097

Generation(
    result={
        'queue': {
            'value': 'billing',
            'probabilities': {
                'billing': 1,
                'technical': 0,
                'account': 0,
                'sales': 0,
            },
            'confidence': 1,
        },
        'urgency': {
            'value': 'high',
            'probabilities': {
                'low': 0.028,
                'medium': 0.052,
                'high': 0.92,
            },
            'confidence': 0.88,
        },
        'wants_refund': {
            'value': True,
            'probabilities': {
                'true': 0.998,
                'false': 0.002,
            },
            'confidence': 0.997,
        },
        'summary': 'Customer was double-charged $49 for a Pro plan upgrade and cannot locate the refund option in the billing page.',
    },
    thinking={},
    usage=Usage(input_tokens=195, thinking_tokens=0),
)