What the example shows
The two answer keys differ in three useful ways. The first invoice has a blank due date, a printed zero for tax and a credit. The second prints a due date and tax separately. The included checker catches a guessed date and an amount that ignores the credit.
| Printed field | Practice invoice A | Holdout invoice B |
|---|---|---|
| Due date | Blank → null | 2026-12-18 |
| Subtotal | USD 120.00 | USD 80.00 |
| Tax | USD 0.00 | USD 4.00 |
| Credit applied | USD 20.00 | USD 0.00 |
| Amount due | USD 100.00 | USD 84.00 |
Try it yourself
Read one page before prompting
Open invoice-a.pdf in the kit. Locate the issue date, the empty due-date line and the credit below the subtotal. Transcribe the amount owed by hand. Keep invoice-b.pdf aside until your extraction instructions are settled.
Use the document as the boundary
Give Gemini invoice-a.pdf and prompt.txt. The prompt asks for one JSON object with dates, USD amounts and a review flag. It assigns null to an unprinted value. Save the response as candidate.json and remove any surrounding Markdown fences.
Compare the fields, then change the document
Run the checker below from the extracted kit. It reports every missing, extra or mismatched field. Repeat with invoice-b.pdf using the same prompt and replace a with b in the command. Test your checking setup first with example-wrong.json.
python3 check.py a candidate.json
The next test
The answer keys and checker were verified on the sample files. A recorded Gemini run can now show which fields the model gets right on the first attempt and which ones still need a person.
