mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 08:12:39 +00:00
fix: support multimodal content in Bedrock message formatting
- Add format_text_content override for Bedrock's {"text": ...} format
- Handle pre-formatted list content in _format_messages_for_converse
- Update Bedrock tests to use Claude 3 Haiku for on-demand availability
- Add VCR cassettes for Bedrock multimodal tests
This commit is contained in:
@@ -153,7 +153,7 @@ class TestBedrockMultimodalIntegration:
|
||||
@pytest.mark.vcr()
|
||||
def test_describe_image(self, test_image_bytes: bytes) -> None:
|
||||
"""Test Bedrock Claude can describe an image."""
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0")
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-haiku-20240307-v1:0")
|
||||
files = {"image": ImageFile(source=test_image_bytes)}
|
||||
|
||||
messages = _build_multimodal_message(
|
||||
@@ -171,7 +171,7 @@ class TestBedrockMultimodalIntegration:
|
||||
@pytest.mark.vcr()
|
||||
def test_analyze_pdf(self) -> None:
|
||||
"""Test Bedrock Claude can analyze a PDF."""
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0")
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-haiku-20240307-v1:0")
|
||||
files = {"document": PDFFile(source=MINIMAL_PDF)}
|
||||
|
||||
messages = _build_multimodal_message(
|
||||
|
||||
Reference in New Issue
Block a user