Something like this:
class AbstractChatModel(ABC):
@abstractmethod
def __call__(self, messages: list[dict]) -> dict:
pass
def invoke(self, messages: list[dict]) -> dict:
return self(messages)
def get_stats(self):
return {}
- make other ChatModle extend this.
- Don't implement get_stats if returning nothing
- do we still need both call and invoke?
- If no, remove one of the two everywhere.
- If yes, are they exactly the same? if so, just clone it in the base class.
Something like this: