Repository navigation
fix(gen): filter unsupported OpenAI reasoning and Responses parameters - #232
Open
tanweersalah wants to merge 1 commit into
Open
tanweersalah wants to merge 1 commit into
tanweersalah wants to merge 1 commit into
Conversation
tanweersalah
marked this pull request as ready for review
November 13, 2026 15:14
tanweersalah
requested review from
OscarDDD,
alpkom,
mwien and
yamaceay
as code owners
November 13, 2026 15:14
This branch has not been deployed
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.
Context
Fixes #231.
What this PR does and why it is needed
The native OpenAI proxy currently recognizes only the original
gpt-5,gpt-5-mini, andgpt-5-nanonames as temperature-incompatible GPT models. Versioned GPT-5 reasoning models and GPT-6 reasoning models can therefore receive an unsupportedtemperatureparameter. Separately, the proxy accepts arbitrary keyword arguments and forwards LangChain's defaultn=1to the Responses SDK, whosecreateandparsemethods do not acceptn.This change:
-pro/-solvariants, without matching unrelated names such asgpt-50orgpt-60.reasoning_effort="none"for Chat Completions,reasoning={"effort": "none"}for Responses).nfor every Responsescreate/parserequest, independent of model or provider, while preserving supported Chat Completionsnbehavior.packages/gen/PYPIDESCRIPTION.md.The fix uses the selected deployment's model name, so it also works when the native client is called by deployment ID rather than model name. No consumer-side monkeypatch, dependency change, or new public API is required. This does not attempt to validate reasoning-effort values or add a model capability registry.
Regression coverage
Adds 182 parameterized checks covering:
createandparsefor both Chat Completions and Responses, asserting the actual outgoing HTTP payload, preserved token limits/reasoning configuration, and parsed structured output.invokeandainvokeusinggpt-6.1-sol, exercising automatic Responses routing and the raw-response client path.Validation
PYTHONPATH=packages/gen uv run --no-sync pytest packages/gen/tests -q --tb=short— 1,188 passed (existing deprecation warnings).uv run --no-sync pylint ai_api_client_sdk ai_core_sdk gen_ai_hub --errors-only— passed.git diff --check— passed.create/parseand LangChain tool-boundinvoke/ainvoke. Used an injected HTTPX2 mock transport because the repository's RESPX fixtures target HTTPX, whereas OpenAI 3 uses HTTPX2. These extra checks are not committed as a separate test harness.Contributor review
This is an AI-assisted draft pending the contributor's code review, confirmation of compliance with SAP's AI contribution guidelines, and required DCO sign-off. No DCO attestation has been added on the contributor's behalf.
Definition of Done