From 645ac875aa6d44010675c0295d0b03719f3baeec Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 5 Aug 2025 13:43:50 -0700 Subject: [PATCH] fix _validate_format for BedrockImageProcessor --- litellm/litellm_core_utils/prompt_templates/factory.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index b4ace1545d2..5d17a46cf22 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -2479,7 +2479,9 @@ class BedrockImageProcessor: ) if is_document: - potential_extensions = mimetypes.guess_all_extensions(mime_type) + potential_extensions = mimetypes.guess_all_extensions( + mime_type, strict=False + ) valid_extensions = [ ext[1:] for ext in potential_extensions @@ -2950,7 +2952,10 @@ def process_empty_text_blocks( ] modified_message = message.copy() - modified_message["content"] = modified_content_block + modified_message["content"] = cast( + Union[List[ChatCompletionTextObject], List[ChatCompletionThinkingBlock]], + modified_content_block, + ) return modified_message