Skip to content

AbstractChatModel #58

@recursix

Description

@recursix

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions