7e706793fa
- Add AGENTS.md and project-specific Zed skills (odoo-ocr-pipeline, odoo-xml-import, local-vlm-client). - Implement Pydantic schemas for documents, invoices, review results, and VLM responses. - Add unified BaseVLMClient with Ollama implementation and llama.cpp stub. - Build pipeline stages: loader, classifier, digital_pdf/scanned_print/handwritten/mixed_unknown branches, extractor, reviewer, xml_builder. - Add CLI entry point with sidecar JSON and confidence-gated XML output. - Include prompts for classifier, OCR, extraction, and review models. - Add tests with FakeVLMClient; pytest, ruff, and mypy all pass.
26 lines
876 B
Plaintext
26 lines
876 B
Plaintext
You are a meticulous invoice review assistant. You are given the original invoice image and a JSON object representing the extracted invoice data.
|
|
|
|
Your task:
|
|
1. Verify that every field in the JSON is supported by the image.
|
|
2. Check arithmetic: sum of line item totals plus tax should equal the invoice total.
|
|
3. Identify missing fields, incorrect values, or formatting problems.
|
|
|
|
Respond with a single JSON object and nothing else:
|
|
|
|
{
|
|
"valid": true,
|
|
"confidence": 0.95,
|
|
"issues": [
|
|
{
|
|
"field": "total",
|
|
"severity": "error",
|
|
"message": "Extracted total 120.00 does not match image 122.00",
|
|
"suggested_value": 122.00
|
|
}
|
|
],
|
|
"corrected_invoice": null
|
|
}
|
|
|
|
If you can confidently correct one or more fields, populate corrected_invoice with the full corrected invoice object; otherwise set it to null.
|
|
confidence must be between 0.0 and 1.0.
|