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"