From aab5a3cf91b61e54538090fa9e64c3e5dbb4c11a Mon Sep 17 00:00:00 2001 From: Ruiming Zhao Date: Fri, 14 Aug 2026 17:09:34 -0700 Subject: [PATCH] fix(anthropic): drop redundant cast when appending document block --- litellm/litellm_core_utils/prompt_templates/factory.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index 2ce157ae3b6..32510caa5fb 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -2438,9 +2438,7 @@ def anthropic_messages_pt( anthropic_content_element=_document_content_element, original_content_element=m, ) - user_content.append( - cast(AnthropicMessagesDocumentParam, _document_content_element) - ) # cast-ok: same union narrowing as above + user_content.append(_document_content_element) continue # Bedrock invoke models have format: invoke/... # Vertex AI Anthropic also doesn't support URL sources for images