This commit is contained in:
okxint 2026-09-23 14:35:34 +00:00 • committed by GitHub
commit 4059c8ecc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -311,6 +311,20 @@ class OpenAIGPT5Config(OpenAIGPTConfig):
message=(f"reasoning_effort={effective_effort} is not supported for this model."),
status_code=400,
)
elif effective_effort == "none":
# none is opt-out: unknown models pass through; only block when
# the model map explicitly sets supports_none_reasoning_effort=false.
# gpt-5 and gpt-5-mini are both marked supports_none_reasoning_effort=false
# and OpenAI returns 400 for none on those models.
if self._is_reasoning_effort_level_explicitly_disabled(model, effective_effort):
if litellm.drop_params or drop_params:
non_default_params.pop("reasoning_effort", None)
optional_params.pop("reasoning_effort", None)
else:
raise litellm.utils.UnsupportedParamsError(
message=(f"reasoning_effort={effective_effort} is not supported for this model."),
status_code=400,
)
################################################################
# max_tokens is not supported for gpt-5 models on OpenAI API