You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Please extract all available details from the receipt image, including merchant/store name, transaction date (YYYY-MM-DD), total amount, and a fully itemized list (name, quantity, unit price, subtotal for each item).", # noqa
217
+
"--query",
218
+
"-q",
219
+
help="Query for OCR and comprehensive structured extraction from the receipt image",
220
+
),
221
+
file_path: str=typer.Option(
222
+
"./docs/images/streamlit.png",
223
+
"--file",
224
+
"-f",
225
+
help="Path to the receipt image file for analysis",
226
+
),
227
+
model: str=typer.Option(
228
+
"gemma3:4b-it-q4_K_M",
229
+
"--model",
230
+
"-m",
231
+
help="Model to use for OCR and structured information extraction",
232
+
),
233
+
verbose: bool=typer.Option(
234
+
False,
235
+
"--verbose",
236
+
"-v",
237
+
help="Enable verbose output",
238
+
),
239
+
):
240
+
set_verbose_logging(verbose)
241
+
frompydanticimportBaseModel, Field
242
+
243
+
classItem(BaseModel):
244
+
item_name: str=Field(..., description="Exact name of the purchased item")
245
+
quantity: int=Field(..., description="Number of units purchased")
246
+
unit_price: float=Field(..., description="Unit price per item")
247
+
total_price: float=Field(..., description="Subtotal for this item")
248
+
249
+
classReceiptInfo(BaseModel):
250
+
merchant_name: str=Field(..., description="Full name of the merchant/store")
251
+
transaction_date: str=Field(..., description="Transaction date in ISO format YYYY-MM-DD")
252
+
total_amount: float=Field(..., description="Total amount paid, including tax")
253
+
items: list[Item] =Field(
254
+
...,
255
+
description="Detailed list of all purchased items with name, quantity, unit price, and subtotal",
0 commit comments