第一次提交

This commit is contained in:
2026-08-01 16:50:55 +08:00
commit c8f9e39039
68 changed files with 6016 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
"""OCR 引擎抽象接口。"""
from dataclasses import dataclass
from typing import Protocol
@dataclass
class OcrResult:
markdown: str
confidence: float # 0-1,未知时给 1.0
engine: str # "pix2text" / "vlm"
class OcrEngine(Protocol):
async def recognize(self, image_bytes: bytes, mime: str) -> OcrResult: ...