From a48cb0e63a96c6e92f3e1768cd435aff1af9db42 Mon Sep 17 00:00:00 2001 From: Angel Nunez Mencias Date: Sun, 1 Dec 2024 22:00:01 +0100 Subject: [PATCH] fix for 6958 --- litellm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index b925fbf5b..4eea26035 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1635,7 +1635,7 @@ def token_counter( for tool_call in message["tool_calls"]: if "function" in tool_call: function_arguments = tool_call["function"]["arguments"] - text += function_arguments + text += str(function_arguments) # See https://github.com/BerriAI/litellm/issues/6958 else: raise ValueError("text and messages cannot both be None") elif isinstance(text, List):