You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: normalize provider specific model options type names and ensure they are exported (#12443)
## Background
Provider-specific model options types had inconsistent naming
(`*ProviderOptions`, `*CallOptions`, `*ChatOptions`, etc.) and many were
not exported from their packages, making it impossible for consumers to
use `satisfies` for type-safe `providerOptions`. This needs to be
normalized before the v7 beta release, especially in preparation for
renaming `providerOptions` to `options`.
## Summary
Normalizes all provider-specific model options type names across 31
packages to follow a consistent `*ModelOptions` convention and ensures
they are all exported:
- Renamed types to follow
`{Provider}{ModelType}{OptionalModelSuffix}Options` pattern, e.g.:
- `AnthropicProviderOptions` → `AnthropicLanguageModelOptions`
- `OpenAIResponsesProviderOptions` →
`OpenAILanguageModelResponsesOptions`
- Renamed Zod schemas to match
- e.g. `anthropicProviderOptions` → `anthropicLanguageModelOptions`
- Exported 13 types from 8 packages that were previously internal-only,
e.g.
- `GroqTranscriptionModelOptions`
- `OpenAITranscriptionModelOptions`
- `FalSpeechModelOptions`
- Added deprecated aliases for all previously exported names across 23
packages to maintain backward compatibility
- Fixed `@ai-sdk/groq`: Already had a transcription model options type,
but in the wrong file and under the wrong name and not exported
- Updated ~190 example files to use `satisfies *Options` on
`providerOptions` inner objects
- Updates examples across documentation to use the new type names and
include the types on examples where they were missing but relevant
- Added the new naming convention and export requirements to
`contributing/providers.md`
All changes are fully backward compatible — no breaking changes.
## Manual Verification
- `pnpm type-check:full` passes with no errors
- `pnpm build` succeeds for all packages
- `pnpm prettier-check` passes
## Checklist
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
## Future Work
Consider adding options types for providers that don't have them yet,
and add `satisfies` to those examples accordingly. For example:
- #8241
- #12435
- #12437
- #12438
- #12439
## Related Issues
Fixes#12269
Copy file name to clipboardExpand all lines: content/cookbook/00-guides/17-gemini.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ console.log(text);
46
46
Gemini 3 models can use enhanced reasoning through thinking mode, which improves their ability to solve complex problems. You can control the thinking level using the `thinkingLevel` provider option:
Copy file name to clipboardExpand all lines: content/cookbook/00-guides/18-claude-4.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ console.log(text);
48
48
Claude 4 enhances the extended thinking capabilities first introduced in Claude 3.7 Sonnet—the ability to solve complex problems with careful, step-by-step reasoning. Additionally, both Opus 4 and Sonnet 4 can now use tools during extended thinking, allowing Claude to alternate between reasoning and tool use to improve responses. You can enable extended thinking using the `thinking` provider option and specifying a thinking budget in tokens. For interleaved thinking (where Claude can think in between tool calls) you'll need to enable a beta feature using the `anthropic-beta` header:
Claude 3.7 Sonnet introduces a new extended thinking—the ability to solve complex problems with careful, step-by-step reasoning. You can enable it using the `thinking` provider option and specifying a thinking budget in tokens:
0 commit comments