Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
fix(bedrock): allow image input_files for OpenAI GPT-6 Sol/Luna/Astra (#7733)
Lucas Kim6dd895fd7203
diff --git a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py b/lib/crewai/src/crewai/llms/providers/bedrock/completion.pyindex 3cfa3fd47..50845ed6c 100644--- a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py+++ b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py@@ -2153,7 +2153,8 @@ class BedrockCompletion(BaseLLM):def supports_multimodal(self) -> bool:"""Check if the model supports multimodal inputs.- Claude 3+ and Nova Lite/Pro/Premier on Bedrock support vision.+ Claude 3+, Nova Lite/Pro/Premier and OpenAI GPT-6 (Sol, Luna, Astra)+ on Bedrock support vision.Returns:True if the model supports images.@@ -2164,6 +2165,9 @@ class BedrockCompletion(BaseLLM):"anthropic.claude-sonnet-4","anthropic.claude-opus-4","anthropic.claude-haiku-4",+ "openai.gpt-6",+ "us.openai.gpt-6",+ "global.openai.gpt-6","amazon.nova-lite","amazon.nova-pro","amazon.nova-premier",diff --git a/lib/crewai/tests/llms/test_multimodal.py b/lib/crewai/tests/llms/test_multimodal.pyindex 18f37f50d..0827f3b4b 100644--- a/lib/crewai/tests/llms/test_multimodal.py+++ b/lib/crewai/tests/llms/test_multimodal.py@@ -293,6 +293,30 @@ class TestBedrockMultimodal:llm = LLM(model="bedrock/anthropic.claude-v2")assert llm.supports_multimodal() is False+ @pytest.mark.parametrize(+ "model",+ [+ "bedrock/openai.gpt-6-sol",+ "bedrock/openai.gpt-6-luna",+ "bedrock/openai.gpt-6-astra",+ "bedrock/us.openai.gpt-6-sol",+ "bedrock/us.openai.gpt-6-luna",+ "bedrock/us.openai.gpt-6-astra",+ "bedrock/global.openai.gpt-6-sol",+ "bedrock/global.openai.gpt-6-luna",+ "bedrock/global.openai.gpt-6-astra",+ ],+ )+ def test_supports_multimodal_openai_gpt_6(self, model: str) -> None:+ """Test Bedrock OpenAI GPT-6 Sol/Luna/Astra support multimodal."""+ llm = LLM(model=model)+ assert llm.supports_multimodal() is True++ def test_does_not_support_gpt_oss(self) -> None:+ """Test Bedrock gpt-oss (no image input) does not support multimodal."""+ llm = LLM(model="bedrock/openai.gpt-oss-120b-1:0")+ assert llm.supports_multimodal() is False+def test_format_multimodal_content_image(self) -> None:"""Test Bedrock uses Converse API image format."""llm = LLM(model="bedrock/anthropic.claude-3-sonnet")