Skip to content

fix: allow reasoning.effort "none" for third-party models (#45) - #114

Draft
shoemoney wants to merge 1 commit into
perplexityai:mainfrom
shoemoney:shoemoney/fix-perplexity-py-45
Draft

fix: allow reasoning.effort "none" for third-party models (#45)#114
shoemoney wants to merge 1 commit into
perplexityai:mainfrom
shoemoney:shoemoney/fix-perplexity-py-45

Conversation

@shoemoney

Copy link
Copy Markdown

Fixes #45

Summary

Adds "none" to the reasoning.effort Literal so the Responses API can be used with third-party models (e.g. openai/gpt-5-mini) that support reasoning_effort: "none".

Root cause

Reasoning.effort in src/perplexity/types/response_create_params.py and ReasoningConfigInput/ReasoningConfigOutput in src/perplexity/generated/api.py only allowed minimal | low | medium | high | xhigh. The server already accepts none for proxied third-party models, but the SDK rejected it client-side:

ValidationError: Input should be 'minimal', 'low', 'medium', 'high' or 'xhigh' [type=literal_error, input_value='none']

The API error surfaced as 400 - effort must be one of: low medium high when 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: ReasoningConfigInput and ReasoningConfigOutput same change (2 sites)

Minimal, no behavior change for existing values. none aligns with OpenAI's reasoning_effort: "none" for the same underlying models.

Verification

  • Reproduced locally: ReasoningConfigInput(effort="none") raised ValidationError before, succeeds after. Same for ReasoningConfigOutput. 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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses API: reasoning.effort: "none" not supported for third-party models

1 participant