From d77fd30f2fa4b74cb01dd435bcf236db80c3df62 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 14 Nov 2024 12:57:53 -0800 Subject: [PATCH] fix _process_response --- litellm/llms/anthropic/chat/handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/chat/handler.py b/litellm/llms/anthropic/chat/handler.py index d9f1ef4d4..63798ef10 100644 --- a/litellm/llms/anthropic/chat/handler.py +++ b/litellm/llms/anthropic/chat/handler.py @@ -276,11 +276,12 @@ class AnthropicChatCompletion(BaseLLM): "arguments" ) if json_mode_content_str is not None: - _message = self._convert_tool_response_to_message( + _converted_message = self._convert_tool_response_to_message( tool_calls=tool_calls, ) - if _message is not None: + if _converted_message is not None: completion_response["stop_reason"] = "stop" + _message = _converted_message model_response.choices[0].message = _message # type: ignore model_response._hidden_params["original_response"] = completion_response[ "content"