From 6d6baa79fab76c9fb8754ad3db86a3b9e007fe46 Mon Sep 17 00:00:00 2001 From: Connor Rhodes Date: Wed, 29 Apr 2026 02:00:20 +0000 Subject: [PATCH] remove date from OCR, use today's date instead --- log-work-expense/SKILL.md | 10 +++++----- log-work-expense/scripts/ocr_receipt.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/log-work-expense/SKILL.md b/log-work-expense/SKILL.md index cd72397..17f0653 100644 --- a/log-work-expense/SKILL.md +++ b/log-work-expense/SKILL.md @@ -16,13 +16,13 @@ Log receipt images and expense details into the `wip.work_expenses` collection i ## Steps -1. **Extract receipt info** — If the user sent an image, run the OCR script to read the date, vendor, and amount: +1. **Extract receipt info** — If the user sent an image, run the OCR script to read the merchant and amount: ```bash uv run --with requests python3 scripts/ocr_receipt.py /path/to/image.jpg ``` -The script is located at `~/notes/skills/log-work-expense/scripts/ocr_receipt.py`. It returns JSON with `date`, `vendor`, and `amount` fields. If the output doesn't contain a confident date, **ask the user** — never guess. If they only provided text, use that. +The script is located at `~/notes/skills/log-work-expense/scripts/ocr_receipt.py`. It returns JSON with `merchant` and `amount` fields. 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. @@ -39,12 +39,12 @@ The script is located at `~/notes/skills/log-work-expense/scripts/ocr_receipt.py ``` - **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 you cannot confidently read the date from the receipt, ask the user — do not guess. -- **merchant**: Extracted from the OCR result or the receipt image. +- **date**: Always use today's date (the date you receive the message), formatted as YYYY-MM-DD. +- **merchant**: Extracted from the OCR result. - **description**: What the user told you about the expense (e.g. "travel meal during LTISD onsite"). If they didn't provide context, ask. - **status**: Always set to `"todo"` when inserting. -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, merchant, and file link if applicable). ## Notes diff --git a/log-work-expense/scripts/ocr_receipt.py b/log-work-expense/scripts/ocr_receipt.py index 2fdcd51..5dc8efa 100644 --- a/log-work-expense/scripts/ocr_receipt.py +++ b/log-work-expense/scripts/ocr_receipt.py @@ -24,8 +24,8 @@ resp = requests.post( { "type": "text", "text": ( - "Extract from this receipt: date, vendor/restaurant name, and total amount. " - "Return ONLY a JSON object with keys: date (YYYY-MM-DD format), vendor, amount. " + "Extract from this receipt: merchant/restaurant name and total amount. " + "Return ONLY a JSON object with keys: merchant, amount. " "No other text." ), },