mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(anthropic): avoid GeneralTypeIssues by single-assigning the rewrite block
This commit is contained in:
parent
d03238136c
commit
31569619c9
1 changed files with 3 additions and 3 deletions
|
|
@ -163,10 +163,10 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig):
|
|||
continue
|
||||
# Only copy the block when the text changed.
|
||||
if stripped_text == text:
|
||||
next_block = content_block
|
||||
filtered_list.append(content_block)
|
||||
else:
|
||||
next_block = {**content_block, "text": stripped_text} # mutable-ok: API message payload
|
||||
filtered_list.append(next_block)
|
||||
rewritten: Final = {**content_block, "text": stripped_text} # mutable-ok: API message payload
|
||||
filtered_list.append(rewritten)
|
||||
else:
|
||||
# Keep non-dict items as-is
|
||||
filtered_list.append(content_block)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue