From 92ad75a12cd11b4da9b507e4cae6e68a0a22521e Mon Sep 17 00:00:00 2001 From: hx <1367557521@qq.com> Date: Fri, 18 Sep 2026 15:32:00 +0800 Subject: [PATCH] fix: avoid rebinding Final candidate in thinking type mapping --- litellm/litellm_core_utils/thinking_param_translation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/thinking_param_translation.py b/litellm/litellm_core_utils/thinking_param_translation.py index 9cc490d8fd6..f9916ed9a86 100644 --- a/litellm/litellm_core_utils/thinking_param_translation.py +++ b/litellm/litellm_core_utils/thinking_param_translation.py @@ -52,9 +52,9 @@ def _thinking_enabled(thinking: object) -> bool: def _thinking_type_value(thinking: object, allowed: Sequence[str]) -> str | None: if isinstance(thinking, str): - candidate: Final = thinking + candidate = thinking elif isinstance(thinking, Mapping): - raw: Final = thinking.get("type") + raw = thinking.get("type") candidate = raw if isinstance(raw, str) else None elif isinstance(thinking, bool): candidate = "enabled" if thinking else "disabled"