from __future__ import annotations from abc import ABC, abstractmethod from pydantic import BaseModel class ChatModel(ABC): @abstractmethod def structured(self, messages: list[dict], schema: type[BaseModel]) -> BaseModel: """Call the model and return a validated Pydantic instance.""" @abstractmethod def complete(self, messages: list[dict]) -> str: """Call the model and return raw text content."""