"""LegacyHUB adapter for the shared Docling recognition engine.""" from __future__ import annotations from pathlib import Path from teamhub_document_recognition_engine import ( ExtractedBlock, ExtractedFigure, ExtractedPage, ExtractedTable, ExtractionResult, ) from teamhub_document_recognition_engine import extract as _engine_extract from app.config import settings # Re-exported engine models: chunker, table/figure processors and tests import # them from this adapter instead of depending on the engine package directly. __all__ = [ "ExtractedBlock", "ExtractedFigure", "ExtractedPage", "ExtractedTable", "ExtractionResult", "extract", ] def extract(pdf_path: Path) -> ExtractionResult: return _engine_extract(pdf_path, docling_ocr_enabled=settings.docling_ocr_enabled)