Leo AmiriFounder & product engineer

Experiments / Gemini

The due date is missing. Will AI guess?

A polished JSON response can quietly turn an issue date into a due date. Could you catch it before the invoice joins a payment queue?

Get the files
Answer keydue_date → null

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.

Answer key for The due date is missing. Will AI guess?
Printed fieldPractice invoice AHoldout invoice B
Due dateBlank → null2026-12-18
SubtotalUSD 120.00USD 80.00
TaxUSD 0.00USD 4.00
Credit appliedUSD 20.00USD 0.00
Amount dueUSD 100.00USD 84.00

Try it yourself

  1. 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.

  2. 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.

  3. 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.

Tool documentation