update: upload fix
This commit is contained in:
@@ -6,13 +6,16 @@ from app.schemas.transaction import TransactionExtractItem
|
||||
|
||||
|
||||
class BaseLLMProvider(ABC):
|
||||
"""Abstract base for LLM vision providers. Each provider implements extract_from_image."""
|
||||
"""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]:
|
||||
"""
|
||||
Analyze a billing screenshot and return structured transaction list.
|
||||
:param image_bytes: Raw image file content (PNG/JPEG)
|
||||
:return: List of extracted transactions (may be empty or partial on failure)
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def chat(self, system: str, user: str) -> str:
|
||||
"""Plain text chat (for inference/reasoning tasks like report generation)."""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user