From d03238136cafd5e928b581a7f168d797693846be Mon Sep 17 00:00:00 2001 From: Sangsiva <101570025+Sangsiva@users.noreply.github.com> Date: Mon, 21 Sep 2026 15:54:26 +0800 Subject: [PATCH] style(anthropic): keep identity-strip rewrite ruff-format clean --- .../experimental_pass_through/messages/transformation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py index 13acc0bd437..2a31c6e7e04 100644 --- a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py +++ b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py @@ -163,9 +163,10 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): continue # Only copy the block when the text changed. if stripped_text == text: - filtered_list.append(content_block) + next_block = content_block else: - filtered_list.append({**content_block, "text": stripped_text}) # mutable-ok: API message payload + next_block = {**content_block, "text": stripped_text} # mutable-ok: API message payload + filtered_list.append(next_block) else: # Keep non-dict items as-is filtered_list.append(content_block)