22 lines
681 B
Python
22 lines
681 B
Python
"""Base LLM provider - abstract interface for vision extraction."""
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from app.schemas.transaction import TransactionExtractItem
|
|
|
|
|
|
class BaseLLMProvider(ABC):
|
|
"""Abstract base for LLM providers. Supports optional model override."""
|
|
|
|
def __init__(self, model_override: str | None = None):
|
|
self._model_override = model_override
|
|
|
|
@abstractmethod
|
|
async def extract_from_image(self, image_bytes: bytes) -> list[TransactionExtractItem]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def chat(self, system: str, user: str) -> str:
|
|
"""Plain text chat (for inference/reasoning tasks like report generation)."""
|
|
pass
|