fix: allow reasoning.effort "none" for third-party models (#45) - #114
Draft
shoemoney wants to merge 1 commit into
Draft
fix: allow reasoning.effort "none" for third-party models (#45)#114shoemoney wants to merge 1 commit into
shoemoney wants to merge 1 commit into
Conversation
Adds "none" to the Reasoning effort Literal in both the typed ResponseCreateParams and the generated ReasoningConfigInput/Output models. Third-party models proxied via the Responses API (e.g. openai/gpt-5-mini) support reasoning_effort none, but the SDK rejected it client-side with a Literal validation error. Fixes perplexityai#45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45
Summary
Adds
"none"to thereasoning.effortLiteral so the Responses API can be used with third-party models (e.g.openai/gpt-5-mini) that supportreasoning_effort: "none".Root cause
Reasoning.effortinsrc/perplexity/types/response_create_params.pyandReasoningConfigInput/ReasoningConfigOutputinsrc/perplexity/generated/api.pyonly allowedminimal | low | medium | high | xhigh. The server already acceptsnonefor proxied third-party models, but the SDK rejected it client-side:The API error surfaced as
400 - effort must be one of: low medium highwhen the value did slip through.Fix
src/perplexity/types/response_create_params.py:Literal["minimal","low","medium","high","xhigh"]→Literal["minimal","low","medium","high","xhigh","none"]src/perplexity/generated/api.py:ReasoningConfigInputandReasoningConfigOutputsame change (2 sites)Minimal, no behavior change for existing values.
nonealigns with OpenAI'sreasoning_effort: "none"for the same underlying models.Verification
ReasoningConfigInput(effort="none")raisedValidationErrorbefore, succeeds after. Same forReasoningConfigOutput. Existing values (minimal/low/medium/high/xhigh/None) still pass, invalid values still rejected.PYTHONPATH=src python -m pytest tests/test_models.py tests/test_required_args.py tests/test_response.py tests/test_transform.py— 146 passed.