diff --git a/litellm/llms/bedrock/chat/converse_transformation.py b/litellm/llms/bedrock/chat/converse_transformation.py index a37c7a72452..410a92abb4a 100644 --- a/litellm/llms/bedrock/chat/converse_transformation.py +++ b/litellm/llms/bedrock/chat/converse_transformation.py @@ -2250,6 +2250,8 @@ class AmazonConverseConfig(BaseConfig): ) if filtered_tools: chat_completion_message["tool_calls"] = filtered_tools + if chat_completion_message.get("content") == "": + chat_completion_message["content"] = None ## CALCULATING USAGE - bedrock returns usage in the headers usage = self._transform_usage( diff --git a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py index 797f58b4a67..e355b171765 100644 --- a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py +++ b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py @@ -781,6 +781,7 @@ def test_transform_response_with_computer_use_tool(): encoding=None, ) # Check that the tool call is present in the returned message + assert result.choices[0].message.content is None assert result.choices[0].message.tool_calls is not None assert len(result.choices[0].message.tool_calls) == 1 tool_call = result.choices[0].message.tool_calls[0]