Fix: Only pass reasoning_effort to models that support it#264
Fix: Only pass reasoning_effort to models that support it#264hahnicity wants to merge 2 commits into
Conversation
The `reasoning_effort` and `verbosity` parameters are only supported by reasoning models (o-series, GPT-5 family). Passing them to non-reasoning models like gpt-4o-mini causes a 400 BadRequestError: "Unrecognized request argument supplied: reasoning_effort" Per OpenAI's documentation, gpt-4o-mini is not a reasoning model and does not support reasoning_effort. The parameter is documented as being for reasoning models only (o1, o3, o4-mini, gpt-5, etc.). Ref: https://developers.openai.com/docs/guides/reasoning Ref: https://developers.openai.com/docs/models/gpt-4o-mini This change conditionally includes reasoning_effort and verbosity only when the model name indicates a reasoning model.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Pylint does not narrow `self._valid_locations` after a None guard on the instance attribute. Assigning to a local variable after the check lets pylint infer the correct non-None type.
|
Added a fix for a pre-existing pylint failure in The CI
These errors occur because pylint does not narrow the type of |
|
This looks good to me, we should be able to merge it once you've signed the Google CLA. |
Summary
reasoning_effortandverbosityare only supported by OpenAI reasoning models (o-series, GPT-5 family). Passing them to non-reasoning models likegpt-4o-minicauses a400 BadRequestError:"Unrecognized request argument supplied: reasoning_effort"References
Per OpenAI's reasoning guide,
reasoning_effortcontrols how many reasoning tokens a model generates, and supported values are "model-dependent." The gpt-4o-mini model page confirms it is not a reasoning model and does not support this parameter.Test plan
gpt-4o-minino longer returns400 BadRequestErrorwhen used with Concordiao1,o3,o4,gpt-5) will still passreasoning_effortandverbosityas before