GitHub Actions
fix: 0 test failures; FileService; real RagService; emergency probe; chat return
4aaae80 | """OCR backend protocol and result types.""" | |
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| from typing import Protocol, runtime_checkable | |
| class OcrBlock: | |
| text: str | |
| confidence: float | |
| bbox: tuple[int, int, int, int] | None = None | |
| language: str | None = None | |
| class OcrPageResult: | |
| page: int | |
| blocks: list[OcrBlock] | |
| full_text: str | |
| confidence_avg: float | |
| ms: int | |
| class OcrResult: | |
| pages: list[OcrPageResult] | |
| detected_languages: list[str] | |
| backend: str | |
| ms: int | |
| class OcrBackend(Protocol): | |
| name: str | |
| supported_languages: list[str] | |
| async def ocr_image( | |
| self, | |
| image_bytes: bytes, | |
| languages: list[str] | None = None, | |
| ) -> OcrResult: ... | |
| async def ocr_pdf( | |
| self, | |
| pdf_bytes: bytes, | |
| pages: list[int] | None = None, | |
| languages: list[str] | None = None, | |
| ) -> OcrResult: ... | |
| def health(self) -> dict: ... | |