Sort an email, then ask what that kind needs
Open in playground →Task
Tell what kind of email this is, then ask only what that kind needs: the amount due for an invoice, the date for a meeting request, the role for a job application.
Challenges
kindis an enum of three. Each follow-up has awhenon one of them, so exactly one runs:amount_due(a number) for an invoice,meeting_date(a string) for a meeting request,role(an enum) for a job application.- This email is an invoice, so
amount_duecomes back as the number1240, andmeeting_dateandroleare skipped: no requests are sent for them, andskippedlists them. - The tests run in code on the typed
kind. The fields awhennames are dependencies, so none of the follow-ups listsdepends_on.
Laying out…
Generation(
result={
'kind': 'invoice',
'amount_due': 1240,
},
thinking={},
usage=Usage(input_tokens=195, thinking_tokens=0),
skipped=[
'meeting_date',
'role',
],
)