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(responses-bridge): type-safe reasoning_content assignment in merge pass

HarryZhoude95372dfbd7
diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py
index e3e62ab3c55..d7b6b8c7b8f 100644
--- a/litellm/responses/litellm_completion_transformation/transformation.py
+++ b/litellm/responses/litellm_completion_transformation/transformation.py
@@ -630,7 +630,7 @@ class LiteLLMCompletionResponsesConfig:
if existing:
combined = combined + "\n" + existing
if isinstance(msg, dict):
- msg["reasoning_content"] = combined
+ cast(dict[str, Any], msg)["reasoning_content"] = combined # cast-ok: mutable reasoning carrier
else:
setattr(msg, "reasoning_content", combined) # noqa: B010
pending_reasoning = [] # mutable-ok: reset accumulator