Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: include redacted_thinking in list-content thinking block detection

Chesars3fe482967688
diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py
index 84e4aeb1a2f..1bcf53e3778 100644
--- a/litellm/litellm_core_utils/prompt_templates/factory.py
+++ b/litellm/litellm_core_utils/prompt_templates/factory.py
@@ -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