Skip to content

Commit

Permalink
clarify output structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cpfiffer committed Nov 7, 2024
1 parent 679aa54 commit 847e472
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/cookbook/receipt-digitization.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,20 @@ image = load_and_resize_image("receipt.png")

## Define the output structure

We'll define a Pydantic model to describe the data we want to extract from the image. After processing the image, the LLM will output data in this format -- in this case, we'll have a list of items, a store name, address, and so on.
We'll define a Pydantic model to describe the data we want to extract from the image.

In our case, we want to extract the following information:

- The store name
- The store address
- The store number
- A list of items, including the name, quantity, price per unit, and total price
- The tax
- The total
- The date
- The payment method

Most fields are optional, as not all receipts contain all information.

```python
class Item(BaseModel):
Expand Down

0 comments on commit 847e472

Please sign in to comment.