| from __future__ import annotations | |
| from .base import OcrProvider | |
| class FakeOcrProvider(OcrProvider): | |
| async def extract(self, image_bytes: bytes, region: tuple[float, float, float, float] | None = None) -> dict: | |
| return { | |
| "markdown": "TOTAL $18.42", | |
| "lines": [ | |
| { | |
| "id": "line_1", | |
| "text": "TOTAL $18.42", | |
| "bbox": region or [0.62, 0.81, 0.94, 0.86], | |
| "confidence": 0.96, | |
| "reading_order": 1, | |
| "region_type": "text_line", | |
| } | |
| ], | |
| "tables": [], | |
| } | |