Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(documentation): invoice line items extraction example #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/async_extract_key_value_pdf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@
" \"date\": \"date of the invoice\",\n",
" }\n",
"\n",
"# If you want to extract line items from an invoice you can follow this structure\n",
"extract_instruction = {\n",
" \"line_items\": {\n",
" \"description\": \"Item description\",\n",
" \"quantity\": \"Item quantity as integer\",\n",
" \"unit_prices\": \"Item unit price as a decimal number\",\n",
" \"net_amounts\": \"Item net amount before tax as a decimal number\",\n",
" \"tax_rate\": \"Item tax rate percentage as a decimal number\",\n",
" \"tax_amount\": \"Item tax amount charged as a decimal number\",\n",
" \"total_amount\": \"Item total amount including tax as a decimal number\",\n",
" }\n",
" }\n",
"\n",
"# extract returns a tuple containing the markdown as a string and total time\n",
"file_id = ap.async_extract_key_value(example_local_file, extract_instruction)\n",
"\n",
Expand Down