Dimitris
Codex
feat(extraction): GBNF grammar + local MiniCPM-V (llama.cpp) backend + factory
e0169bf Download src/extraction/base.py from build-small-hackathon/blood-test-explainer: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/blood-test-explainer/resolve/refs%2Fpr%2F1/src/extraction/base.py
- Command line
-
hf download hf://spaces/build-small-hackathon/blood-test-explainer@refs/pr/1/src/extraction/base.py
-
curl -L -o base.py https://huggingface.co/spaces/build-small-hackathon/blood-test-explainer/resolve/refs%2Fpr%2F1/src/extraction/base.py
534 Bytes
| """The extractor interface shared by every backend.""" | |
| from __future__ import annotations | |
| from typing import Protocol, runtime_checkable | |
| # Reuse the existing result dataclass so there is exactly one definition in the codebase. | |
| from src.openbmb_client import ExtractionResult | |
| __all__ = ["Extractor", "ExtractionResult"] | |
| class Extractor(Protocol): | |
| """Anything that turns an uploaded document into structured lab values.""" | |
| def extract(self, file_path: str, max_pages: int = 3) -> ExtractionResult: ... | |