Skip to content

feat(provider/openai-compatible): add textVerbosity provider option - #9400

Merged
gr2m merged 4 commits into
vercel:mainfrom
rahulbhadja:fix/openai-compatible-textverbosity-support
Oct 10, 2025
Merged

feat(provider/openai-compatible): add textVerbosity provider option#9400
gr2m merged 4 commits into
vercel:mainfrom
rahulbhadja:fix/openai-compatible-textverbosity-support

Conversation

@rahulbhadja

Copy link
Copy Markdown
Collaborator

Background

The @ai-sdk/openai-compatible package was missing support for the textVerbosity provider option. This caused API errors when users tried to use textVerbosity with OpenAI-compatible providers.

Summary

  • Added textVerbosity option to openaiCompatibleProviderOptions schema
  • Transform textVerbosity to verbosity in API request body
  • Added unit tests to verify transformation and ensure no duplication in the request body
  • Updated snapshot tests
  • Added example file demonstrating textVerbosity usage

Manual Verification

  • Created example file demonstrating textVerbosity usage: examples/ai-core/src/generate-text/openai-compatible-chat-provider-options.ts
  • Built the package successfully with pnpm build
  • All unit tests pass, including new textVerbosity tests
  • Verified through unit tests that:
    • textVerbosity is correctly transformed to verbosity in the API request body
    • No duplicate textVerbosity field appears in requests
    • Custom options still work alongside textVerbosity

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)
  • I have reviewed this pull request (self-review)

Future Work

N/A

Related Issues

Fixes #8832

@rahulbhadja

Copy link
Copy Markdown
Collaborator Author

Hi @gr2m , please let me know if any changes are needed. Thanks!

@gr2m

gr2m commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

Hi @gr2m , please let me know if any changes are needed. Thanks!

thanks Rahul! PR looks great! I just committed a small change to make the example you added runnable without any changes needed.

@gr2m
gr2m enabled auto-merge (squash) October 10, 2025 22:53
@gr2m gr2m changed the title Fix/OpenAI compatible textverbosity support feat(provider/openai-compatible): add textVerbosity provider option Oct 10, 2025
@gr2m
gr2m disabled auto-merge October 10, 2025 22:56
@gr2m
gr2m enabled auto-merge (squash) October 10, 2025 22:57
@gr2m
gr2m merged commit b689220 into vercel:main Oct 10, 2025
11 of 12 checks passed
@gr2m gr2m added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Oct 10, 2025
@ghost ghost removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Oct 10, 2025
@ghost

ghost commented Oct 10, 2025

Copy link
Copy Markdown

✅ Backport PR created: #9404

ghost pushed a commit that referenced this pull request Oct 10, 2025
…der option (#9404)

This is an automated backport of #9400 to the release-v5.0 branch.

Co-authored-by: Rahul <41661703+rahulbhadja@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
@gr2m gr2m added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/openai-compatible Issues related to the @ai-sdk/openai-compatible provider labels Oct 27, 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-compatible Issues related to the @ai-sdk/openai-compatible provider task-merge-tracking-done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support textVerbosity option for openai-compatible

3 participants