fix(examples): migrate OpenAI examples to Responses API#1122
Merged
Conversation
gpt-5.4 no longer supports reasoning_effort with function tools on /v1/chat/completions. Migrate openai_tool.mjs to the Responses API which supports both. Remove reasoning_effort from Vercel AI SDK and LangChain examples since those libraries use chat completions internally.
Add ai.*, anthropic.*, openai.* build artifacts to .gitignore alongside the existing wrapper.* and langchain.* entries.
AI SDK 5 (ai@^5) requires providers implementing spec v2. @ai-sdk/openai v1 only implements v1, causing UnsupportedModelVersionError on vercel_ai_tool.mjs.
@ai-sdk/openai v2 drops Zod type info when converting to function parameters, sending type: "None" to OpenAI which rejects it. Switch to jsonSchema() which preserves the type: "object" wrapper correctly. Also remove unused zod import.
Upgrade ai@5 -> ai@6 and @ai-sdk/openai@2 -> @ai-sdk/openai@3. AI SDK v6 renamed tool parameter from `parameters` to `inputSchema` and uses the Responses API by default. Use jsonSchema() for explicit schema declaration that serializes correctly.
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.
Summary
openai.responses.create()), which supportsreasoning: { effort: "none" }with function tools on gpt-5.4reasoning_effortparameter since these libraries use Chat Completions internally where this combination is no longer supportedWhy
All JS CI jobs have been failing with:
OpenAI changed their API — gpt-5.4 no longer supports combining
reasoning_effortwith function tools on the/v1/chat/completionsendpoint. The Responses API (/v1/responses) supports both.This was not a Doppler config, network, or billing issue — the API keys are working fine (400 not 401/403).
Test plan
.mjsfiles passnode --check(syntax valid)bash_basics.mjs,langchain_integration.mjs) run successfullycargo fmt --checkandcargo clippypass