Compare commits

...

1 Commits

Author SHA1 Message Date
Dev 2049
2425aaa540 idea 2023-04-25 11:40:31 -07:00

View File

@@ -219,6 +219,21 @@ class BaseLanguageModel(BaseModel, ABC):
"""Get the number of tokens in the message."""
return sum([self.get_num_tokens(get_buffer_string([m])) for m in messages])
@classmethod
def cheapest(cls, *args: Any, **kwargs: Any) -> BaseLanguageModel:
"""Instantiate the cheapest version of this model."""
raise NotImplementedError
@classmethod
def fastest(cls, *args: Any, **kwargs: Any) -> BaseLanguageModel:
"""Instantiate the fastest version of this model."""
raise NotImplementedError
@classmethod
def test_model(cls, *args: Any, **kwargs: Any) -> BaseLanguageModel:
"""Instantiate a version of this model for unit and integration tests."""
raise NotImplementedError
class BaseMemory(BaseModel, ABC):
"""Base interface for memory in chains."""