From 36abb5dd41125b57ae56902a93da084ce0e43c76 Mon Sep 17 00:00:00 2001 From: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:26:08 -0500 Subject: [PATCH] cohere[patch]: Fix positional argument (#19678) cohere: Fix positional argument Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> --- libs/partners/cohere/langchain_cohere/chat_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/partners/cohere/langchain_cohere/chat_models.py b/libs/partners/cohere/langchain_cohere/chat_models.py index ea830e81f9..8babfc3e16 100644 --- a/libs/partners/cohere/langchain_cohere/chat_models.py +++ b/libs/partners/cohere/langchain_cohere/chat_models.py @@ -303,7 +303,7 @@ class ChatCohere(BaseChatModel, BaseCohere): def get_num_tokens(self, text: str) -> int: """Calculate number of tokens.""" - return len(self.client.tokenize(text).tokens) + return len(self.client.tokenize(text=text).tokens) def _format_cohere_tool_calls(