"""
OCR Labeling API — Barrel Re-export

Split into:
- ocr_labeling_models.py         — Pydantic models and constants
- ocr_labeling_helpers.py        — OCR wrappers, image storage, hashing
- ocr_labeling_routes.py         — Session/queue/labeling route handlers
- ocr_labeling_upload_routes.py  — Upload, run-OCR, export route handlers

All public names are re-exported here for backward compatibility.
"""

# Models
from .models import (  # noqa: F401
    LOCAL_STORAGE_PATH,
    SessionCreate,
    SessionResponse,
    ItemResponse,
    ConfirmRequest,
    CorrectRequest,
    SkipRequest,
    ExportRequest,
    StatsResponse,
)

# Helpers
from .helpers import (  # noqa: F401
    VISION_OCR_AVAILABLE,
    PADDLEOCR_AVAILABLE,
    TROCR_AVAILABLE,
    DONUT_AVAILABLE,
    MINIO_AVAILABLE,
    TRAINING_EXPORT_AVAILABLE,
    compute_image_hash,
    run_ocr_on_image,
    run_vision_ocr_wrapper,
    run_paddleocr_wrapper,
    run_trocr_wrapper,
    run_donut_wrapper,
    save_image_locally,
    get_image_url,
)

# Conditional re-exports from helpers' optional imports
try:
    from minio_storage import upload_ocr_image, get_ocr_image, MINIO_BUCKET  # noqa: F401
except ImportError:
    pass

try:
    from training.export_service import (  # noqa: F401
        TrainingExportService,
        TrainingSample,
        get_training_export_service,
    )
except ImportError:
    pass

try:
    from hybrid_vocab_extractor import run_paddle_ocr  # noqa: F401
except ImportError:
    pass

try:
    from services.trocr_service import run_trocr_ocr  # noqa: F401
except ImportError:
    pass

try:
    from services.donut_ocr_service import run_donut_ocr  # noqa: F401
except ImportError:
    pass

try:
    from vision_ocr_service import get_vision_ocr_service, VisionOCRService  # noqa: F401
except ImportError:
    pass

# Routes (router is the main export for app.include_router)
from .routes import router  # noqa: F401
from .upload_routes import router as upload_router  # noqa: F401
