From 2425aaa540d44655b1ad058d7dd4b9db347819d2 Mon Sep 17 00:00:00 2001 From: Dev 2049 Date: Tue, 25 Apr 2023 11:40:31 -0700 Subject: [PATCH] idea --- langchain/schema.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/langchain/schema.py b/langchain/schema.py index 821dc70ad60..7497ce94501 100644 --- a/langchain/schema.py +++ b/langchain/schema.py @@ -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."""