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