Compare commits

...
Sign in to create a new pull request.

1 commit
main ... kvant

Author SHA1 Message Date
a48cb0e63a
fix for 6958 2024-12-01 22:00:01 +01:00

View file

@ -1635,7 +1635,7 @@ def token_counter(
for tool_call in message["tool_calls"]: for tool_call in message["tool_calls"]:
if "function" in tool_call: if "function" in tool_call:
function_arguments = tool_call["function"]["arguments"] function_arguments = tool_call["function"]["arguments"]
text += function_arguments text += str(function_arguments) # See https://github.com/BerriAI/litellm/issues/6958
else: else:
raise ValueError("text and messages cannot both be None") raise ValueError("text and messages cannot both be None")
elif isinstance(text, List): elif isinstance(text, List):