Skip to content

fix(examples): migrate OpenAI examples to Responses API#1122

Merged
chaliy merged 6 commits intomainfrom
claude/investigate-ci-doppler-config-ytcKx
Apr 6, 2026
Merged

fix(examples): migrate OpenAI examples to Responses API#1122
chaliy merged 6 commits intomainfrom
claude/investigate-ci-doppler-config-ytcKx

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 6, 2026

Summary

  • openai_tool.mjs: Migrated from Chat Completions to Responses API (openai.responses.create()), which supports reasoning: { effort: "none" } with function tools on gpt-5.4
  • vercel_ai_tool.mjs, langchain_agent.mjs, langchain_integration.mjs: Removed reasoning_effort parameter since these libraries use Chat Completions internally where this combination is no longer supported

Why

All JS CI jobs have been failing with:

400 Function tools with reasoning_effort are not supported for gpt-5.4
in /v1/chat/completions. Please use /v1/responses instead.

OpenAI changed their API — gpt-5.4 no longer supports combining reasoning_effort with function tools on the /v1/chat/completions endpoint. 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

  • All 4 .mjs files pass node --check (syntax valid)
  • Self-contained examples (bash_basics.mjs, langchain_integration.mjs) run successfully
  • OpenAI Responses API confirmed working via curl with gpt-5.4 + reasoning + tools
  • Rust tests pass (2,290 passed)
  • cargo fmt --check and cargo clippy pass
  • JS CI workflow runs AI examples against live OpenAI API

chaliy added 6 commits April 6, 2026 12:56
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.
@chaliy chaliy merged commit 18f3a44 into main Apr 6, 2026
20 checks passed
@chaliy chaliy deleted the claude/investigate-ci-doppler-config-ytcKx branch April 6, 2026 13:55
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.

1 participant