Skip to content

feat (providers/openai): add support for reasoning summaries#5906

Merged
lgrammel merged 11 commits intomainfrom
shaper/pr/openai-responses-reasoning-summaries
Apr 23, 2025
Merged

feat (providers/openai): add support for reasoning summaries#5906
lgrammel merged 11 commits intomainfrom
shaper/pr/openai-responses-reasoning-summaries

Conversation

@shaper
Copy link
Copy Markdown
Collaborator

@shaper shaper commented Apr 23, 2025

Background

OpenAI reasoning models now expose "reasoning summary" text per https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries

Developers would like to be able to surface this content to users.

Summary

Add support for parsing and processing reasoning summary content into the 'reasoning' field for generate and stream output. Fixes #5813.

Tasks

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If required, a patch changeset for relevant packages has been added
  • You've run pnpm prettier-fix to fix any formatting issues

Future Work

Consider adding a separate field for "reasoning summary" separate from "reasoning", or a way to tag this reasoning content as a "summary" variant. For the time being, as this is the only reasoning content made available by the OpenAI API, it seems like a sufficient fit for the existing reasoning fields.

@shaper shaper changed the title Shaper/pr/openai responses reasoning summaries feat (providers/openai): add support for reasoning summaries Apr 23, 2025
@shaper shaper requested a review from lgrammel April 23, 2025 06:15
@shaper shaper marked this pull request as ready for review April 23, 2025 06:15
@lgrammel
Copy link
Copy Markdown
Collaborator

There are potential issues with multi-turn chats and OpenAI requiring correct ids (e.g. for multi-turn computer use). We could release a snapshot for users to try out.

There is also ongoing work on reasoning in the v5 branch that'll conflict here.

@lgrammel lgrammel merged commit ca7bce3 into main Apr 23, 2025
7 checks passed
@lgrammel lgrammel deleted the shaper/pr/openai-responses-reasoning-summaries branch April 23, 2025 06:41
lgrammel added a commit that referenced this pull request Apr 23, 2025
samdenty pushed a commit that referenced this pull request Apr 24, 2025
…ining2

* origin/v5: (25 commits)
  chore(providers/langchain): extract to separate package (#5928)
  Version Packages (canary) (#5898)
  fix (docs): fix typo (#5914) (#5919)
  docs: update chat-with-pdf page to include updated provider information (#5895) (#5917)
  docs: Added documentation for function call parsing middleware (#5900)
  refactoring: extract SharedV2Headers (#5912)
  feat (providers/openai): add support for reasoning summaries (#5906) (#5909)
  fix (docs): fix OpenRouter code examples (#5876) (#5893)
  fix(providers/xai): return actual usage when streaming instead of NaN (#5873) (#5891)
  fix (docs): fix valibotSchema import (#5865) (#5889)
  fix (providers/fal): improve model compatibility (#5855) (#5892)
  chore: extract spec types (#5901)
  chore: remove logprobs (#5896)
  Version Packages (canary) (#5872)
  chore (ci): unify jobs & remove unnecessary example builds (#5894)
  feat (ai): allow using provider default temperature by specifying null (#5890)
  fix(ai/mcp-stdio): make `createChildProcess` synchronous to prevent spawn race condition (#5852) (#5888)
  feat (providers/google): add thinking config to provider options (#5842) (#5887)
  fix (examples): avoid mixed message types in `use-chat-streamdata-multistep` (#5824) (#5886)
  chore: restructure language model supported urls (#5882)
  ...
@gr2m gr2m added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/openai Issues related to the @ai-sdk/openai provider labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/openai Issues related to the @ai-sdk/openai provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for OpenAI Reasoning summaries

3 participants