mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix: include redacted_thinking in list-content thinking block detection
The _list_has_thinking guard only checked for type == "thinking" but Anthropic can also return redacted_thinking blocks (safety-filtered). These are also accumulated in thinking_blocks, so the same duplication bug would occur with redacted thinking content.
This commit is contained in:
parent
0680a97409
commit
3fe4829676
1 changed files with 1 additions and 1 deletions
|
|
@ -2626,7 +2626,7 @@ def anthropic_messages_pt( # noqa: PLR0915
|
|||
_list_has_thinking = False
|
||||
if _content_is_list:
|
||||
for _item in assistant_content_block["content"]:
|
||||
if isinstance(_item, dict) and _item.get("type") == "thinking":
|
||||
if isinstance(_item, dict) and _item.get("type") in ("thinking", "redacted_thinking"):
|
||||
_list_has_thinking = True
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue