19 lines
664 B
Python
19 lines
664 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 vision providers. Each provider implements extract_from_image."""
|
||
|
|
|
||
|
|
@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
|