diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py index ae970e1ff06..594e03ee078 100644 --- a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py +++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py @@ -750,10 +750,12 @@ def test_translate_anthropic_messages_to_openai_tool_result_with_base64_image(): break assert tool_message is not None, "Tool message not found in result" - # Tool messages in OpenAI format have string content (data URL), not list - assert isinstance(tool_message["content"], str) - assert tool_message["content"].startswith("data:image/jpeg;base64,") - assert "/9j/4AAQSkZJRgABAQAAAQABAAD" in tool_message["content"] + # Tool messages with single image should have structured image_url content + assert isinstance(tool_message["content"], list) + assert len(tool_message["content"]) == 1 + assert tool_message["content"][0]["type"] == "image_url" + assert tool_message["content"][0]["image_url"]["url"].startswith("data:image/jpeg;base64,") + assert "/9j/4AAQSkZJRgABAQAAAQABAAD" in tool_message["content"][0]["image_url"]["url"] def test_translate_anthropic_messages_to_openai_tool_result_with_url_image(): @@ -806,10 +808,12 @@ def test_translate_anthropic_messages_to_openai_tool_result_with_url_image(): break assert tool_message is not None, "Tool message not found in result" - # Tool messages in OpenAI format have string content (URL), not list - assert isinstance(tool_message["content"], str) + # Tool messages with single image should have structured image_url content + assert isinstance(tool_message["content"], list) + assert len(tool_message["content"]) == 1 + assert tool_message["content"][0]["type"] == "image_url" assert ( - tool_message["content"] + tool_message["content"][0]["image_url"]["url"] == "https://i0.wp.com/picjumbo.com/wp-content/uploads/amazing-stone-path-in-forest-free-image.jpg" )