fix: never guess receipt dates, ask user when OCR fails

This commit is contained in:
Connor Rhodes 2026-04-29 01:47:58 +00:00
parent 4f982a522b
commit 5729338167

View file

@ -16,7 +16,7 @@ Log receipt images and expense details into the `wip.work_expenses` collection i
## Steps ## Steps
1. **Extract receipt info** — If the user sent an image, use the image tool to read the date, vendor, and amount from the receipt. If they only provided text, use that. 1. **Extract receipt info** — If the user sent an image, use the image tool to read the date, vendor, and amount. If the image tool fails, read the image with the `read` tool and try to extract the info visually. If you cannot confidently read the date, **ask the user** — never guess. If they only provided text, use that.
2. **Upload the receipt image to S2** — If the user provided an image, upload it to S2 and get the public URL. If they only provided a file or no image, skip this step. 2. **Upload the receipt image to S2** — If the user provided an image, upload it to S2 and get the public URL. If they only provided a file or no image, skip this step.
@ -31,7 +31,7 @@ Log receipt images and expense details into the `wip.work_expenses` collection i
``` ```
- **file**: The S2 URL of the uploaded receipt image. Omit if no image was provided. - **file**: The S2 URL of the uploaded receipt image. Omit if no image was provided.
- **date**: The date from the receipt, formatted as YYYY-MM-DD. If no date is on the receipt, ask the user. - **date**: The date from the receipt, formatted as YYYY-MM-DD. If you cannot confidently read the date from the receipt, ask the user — do not guess.
- **note**: Any context the user gave about the expense (what it was for, project, etc.). If they didn't provide context, ask what the expense was for. - **note**: Any context the user gave about the expense (what it was for, project, etc.). If they didn't provide context, ask what the expense was for.
4. **Confirm** — Reply with a brief confirmation showing what was logged (date, note, and file link if applicable). 4. **Confirm** — Reply with a brief confirmation showing what was logged (date, note, and file link if applicable).