fix: avoid rebinding Final candidate in thinking type mapping

This commit is contained in:
hx 2026-09-18 15:32:00 +08:00
parent 0e1147806a
commit 92ad75a12c

View file

@ -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"