Examples

Read a photographed receipt

Open in playground →
  • Image input
  • Typed numbers
  • depends_on

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 number 194000, not a string, and not 194.
  • 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.
The image sent with this call
Receipt from CORD v2, CC BY 4.0.

Laying out…

Time 0.87 s · Cost $0.000063

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