Skip to content

The agent engineering platform.

make modelname_to_contextsize as a staticmethod (#6040)

Ja-sonYuncdd1d78bf2a3
diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py
index 172697a324..c0d999d42f 100644
--- a/langchain/llms/openai.py
+++ b/langchain/llms/openai.py
@@ -500,7 +500,8 @@ class BaseOpenAI(BaseLLM):
disallowed_special=self.disallowed_special,
)
- def modelname_to_contextsize(self, modelname: str) -> int:
+ @staticmethod
+ def modelname_to_contextsize(modelname: str) -> int:
"""Calculate the maximum number of tokens possible to generate for a model.
Args: