\fix(lint): narrow reasoning to dict before copy to satisfy basedpyright budget"

This commit is contained in:
onatozmenn 2026-09-25 15:06:19 +03:00
parent a855df7b33
commit dce9f6f276
No known key found for this signature in database

View file

@ -256,12 +256,13 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
if unsupported_effort:
if should_drop_effort:
updated_reasoning: Final = dict(reasoning) # mutable-ok: local copy
updated_reasoning.pop("effort", None)
if updated_reasoning:
params["reasoning"] = updated_reasoning
else:
params.pop("reasoning", None)
if isinstance(reasoning, dict):
updated_reasoning: Final = reasoning.copy() # mutable-ok: local copy
updated_reasoning.pop("effort", None)
if updated_reasoning:
params["reasoning"] = updated_reasoning
else:
params.pop("reasoning", None)
else:
raise litellm.UnsupportedParamsError(
message=f"reasoning.effort={effort} is not supported for this model.",