Read a photographed receipt
Open in playground →Task
From a photo of a restaurant receipt, read the first item, how many items there are, the subtotal, discount and total, and whether it was paid in cash; then work out the discount as a percentage of the subtotal.
Challenges
- The only input is a photo of a crumpled receipt: there is no text to copy from.
- Amounts are printed as
194,000. Each must come back as the number194000, not a string, and not194. - The discount percentage is not printed anywhere. It has to be worked out from the subtotal and the discount, so it is asked after them with
depends_on.

Laying out…
Generation(
result={
'first_item': 'ICE BLACKCOFFEE',
'item_lines': 3,
'subtotal': 194000,
'discount': 19400,
'total': 174600,
'paid_in_cash': True,
'discount_percent': 10,
},
thinking={},
usage=Usage(input_tokens=1270, thinking_tokens=0),
)