-
Notifications
You must be signed in to change notification settings - Fork 0
add tool result error output #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aron
wants to merge
122
commits into
main
Choose a base branch
from
add-tool-result-error-output
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
24eafe2 to
b1265dc
Compare
## Background `web_search_call.action.sources` was not sent to the OpenAI API. ## Summary * check if tool is `web_search` or `web_search_preview` and use correct name in tool calls and results * automatically add `web_search_call.action.sources` include when either web search tool is present * remove redundant tests ## Manual Verification - [x] run `examples/ai-core/src/generate-text/openai-web-search-tool.ts` ## Tasks - [x] add include flag automatically - [x] investigate why there are no tool calls / results in the generate case - [x] update generate test (outputs, check flag) - [x] add easy way to record raw chunks and use them in tests - [x] investigate why stream does not send sources - [x] update stream test (outputs, check flag) - [x] update examples - [x] changeset ## Related Issues Closes vercel#8528
b1265dc to
3f9f067
Compare
# Releases ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [4c2bb77] - Updated dependencies [561e8b0] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 4c2bb77: fix (provider/openai): send sources action as include - 561e8b0: fix (provider/openai): fix code interpreter tool in doGenerate Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
vercel#8547) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background Meituan released a new model - LongCat Flash Chat ## Summary Adds model to the autocomplete list for Gateway ## Manual Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (excluding automated tests). Remove the section if it's not needed (e.g. for docs). --> Autocomplete works ## Tasks <!-- This task list is intended to help you keep track of what you need to do. Feel free to add tasks and remove unnecessary tasks or this section as needed. Please check if the PR fulfills the following requirements: --> - [X] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [X] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [X] I have reviewed this pull request (self-review)
## Summary * Added experimental_useObject to the Vue package, following the same pattern as the React version. * Added unit tests similar to the corresponding React tests. * Added example page to the nuxt-openai example project * Updated the docs. ## Manual Verification Added an example page `use-object` to the `nuxt-openai` example project to run and verify streaming objects works as expected. ## Tasks - [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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes vercel#2903
# Releases ## [email protected] ### Patch Changes - Updated dependencies [4ee3719] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - 4ee3719: feat(provider/gateway): Add Meituan LongCat Flash Chat to autocomplete ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - b75beb0: Add useObject support to Vue - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
3f9f067 to
9396fdf
Compare
…ercel#8580) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background Typescript issues have been identified as likely resulting from `"moduleResolution": "node"` ## Summary Updated recommendation. ## Tasks - [ ] 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) - [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [ ] I have reviewed this pull request (self-review) ## Future Work <!-- Feel free to mention things not covered by this PR that can be done in future PRs. Remove the section if it's not needed. --> ## Related Issues <!-- List related issues here, e.g. "Fixes vercel#1234". Remove the section if it's not needed. -->
Lots of interest in generating and editing images with Gemini 2.5 Flash Image. - Added guide - Added example that shows how to pass url for image editing
Related to vercel#8580. Fixing stray imports.
…d docs (vercel#8584) Passing response modalities in provider options is no longer required with gemini flash image.
## Background The types for the reasoning output are wrong, we used reasoning input types (see vercel#8589 ) ## Summary * introduce `ReasoningOutput` type and update streamText/generateText result types. ## Manual Verification * [x] verified in example that `providerMetadata` is used on reasoning parts of generateText result ## Future Work Move to explicit `*Output` types for outputs. ## Related Issues Fixes vercel#8589
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - cd91e4b: fix(ai): use correct type for reasoning outputs ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [cd91e4b] - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…el#8576) ## Summary - Fixed broken documentation link from `/docs/reference/stream-helpers/langchain-stream` to `/docs/reference/stream-helpers/langchain-adapter` - The actual documentation file is `16-langchain-adapter.mdx`, not `langchain-stream` ## Details The link in the stream helpers index page was pointing to a non-existent path. This PR corrects it to match the actual file name and working URL path. ### Changes - Updated `content/docs/07-reference/04-stream-helpers/index.mdx` line 82 - Changed `href: '/docs/reference/stream-helpers/langchain-stream'` to `href: '/docs/reference/stream-helpers/langchain-adapter'` ### Verification - Broken link: https://ai-sdk.dev/docs/reference/stream-helpers/langchain-stream (404) - Working link: https://ai-sdk.dev/docs/reference/stream-helpers/langchain-adapter (exists)
…ercel#8600) [New version of zod solves zod issues.](https://x.com/colinhacks/status/1966261915115782654). Updated troubleshooting.
…l#8556) ## Background The [OpenAI code interpreter tool](https://platform.openai.com/docs/guides/tools-code-interpreter) does not add tool call / tool results. ## Summary * add input and output schema to code interpreter tool * send tool call and tool result for code interpreter tool * add `code_interpreter_call.outputs` include when code interpreter tool is present ## Manual Verification - [x] run `examples/ai-core/src/generate-text/openai-code-interpreter-tool.ts` - [x] run `examples/ai-core/src/stream-text/openai-code-interpreter-tool.ts` - [x] run UI example ## Tasks - [x] specify tool result type - [x] add doGenerate functionality - [x] automatically set include for code interpreter outputs - [x] test include in request body - [x] update generate tests for code interpreter tool (updated / extracted fixture) - [x] container_id support - [x] add doStream functionality - [x] update stream tests for code interpreter tool (updated / extracted fixture) - [x] add ui example - [x] review and update documentation - [x] add changeset ## Future Work * preliminary output support for provider-defined tools * code interpreter code input streaming and earlier tool call * send code interpreter outputs back to openai api ## Related Issues Follow up from vercel#7952 and vercel#8505
…8607) ## Background When validating UI messages, the provided executed flag was dropped because it was missing in the zod schema. ## Summary Add `providerExecuted` flag to zod schema definitions in `validateUIMessages`. ## Manual Verification Validated as part of vercel#8604 ## Related Issues Discovered during vercel#8604
# Releases ## [email protected] ### Patch Changes - de5c066: fix(ai): forwarded providerExecuted flag in validateUIMessages ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [4235eb3] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - 4235eb3: feat(provider/openai): code interpreter tool calls and results ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [de5c066] - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ercel#8608) ## Background The OpenAI responses API calls the inputs `input`. We should align our API terminology to avoid confusion. ## Summary * rename input conversion to `convertToOpenAIResponsesInput` * rename API types accordingly ## Related Issues Discovered during vercel#8604
…ent` header (vercel#8530) ## Background Setting a custom user agent is considered best practice and would help debug problems in case any occur. As suggested by @gr2m, `ai` is not setting a custom user agent right now. This is an alternative approach to vercel#8472. ## Summary - export new `createUserAgentFetch()` and `withUserAgentSuffix()` helper methods - add `__PACKAGE_VERSION__` to each core package and inject it at build time - pass current `ai/x.y.z` version through the headers argument in all methods exported by `ai` - updated test files, with updated snapshots - expected behavior after this change is: - `user-agent` in the `Headers` with the syntax: `ai/<version> @ai-sdk/provider/<version> @ai-sdk/provider-utils/<version> <navigator.userAgent>` ## Manual Verification Running `examples/ai-core/fetch-user-agent/user-agent.ts` simulates a mock call being made to an echo server with our new `createUserAgentFetch()` method. Output shows a user-agent header with the correct versions being set. ## Tasks - [x] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Future work - vercel#8595 ## Related Issues closes vercel#8419 closes vercel#8472 --------- Co-authored-by: Aayush Kapoor <[email protected]>
…OpenAICompatible` (vercel#8616) ## Background As added for other providers/provider-utils/`ai`, we're setting user-agent property for `openai-compatible` ## Summary - added a `version.ts` file to extract that package's version - inject that version number to the user-agent string when we build and test this package - modified the `getHeaders()` function so that we append this package's string to existing user-agent header (if any) ## Manual Verification updated test file `openai-compatible-provider.test.ts` to ensure the package version is being attached to the header ## Tasks - [x] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Related Issues Fixes vercel#8612 --------- Co-authored-by: Gregor Martynus <[email protected]>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - 0294b58: feat(ai): set `ai`, `@ai-sdk/provider-utils`, and runtime in `user-agent` header - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0294b58: feat(ai): set `ai`, `@ai-sdk/provider-utils`, and runtime in `user-agent` header ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0294b58] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 3aed04c: feat(provider/openai-compatible): set `user-agent` header for `createOpenAICompatible` ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [3aed04c] - @ai-sdk/[email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background Qwen3 Next new models have been added to the AI Gateway model library.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - Updated dependencies [f49f924] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - f49f924: feat (provider/gateway): add qwen3 next model ids ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ons` (vercel#8623) ## Background Follow up to vercel#7526 which I think aimed at implementing support for the `cache_control` input argument, but didn't fix it correctly ## Summary This was already implemented and tested, but we lacked the type for `AnthropicProviderOptions` ## Manual Verification `examples/ai-core/src/generate-text/anthropic-cache-control-beta-1h.ts` ## Tasks - [x] Tests have been added / updated (for bug fixes / features) - [ ] n/a ~~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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues vercel#7526
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [da92132] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - da92132: fix(provider/anthorpic): add cacheControl to AnthropicProviderOptions ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [da92132] - @ai-sdk/[email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background Given MCP popularity, we should make the documentation more discoverable. ## Summary Created dedicated page for MCP. Added a table for feature comparison between AI SDK Tools and MCP. ## Tasks - [ ] 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) - [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [ ] I have reviewed this pull request (self-review) ## Future Work <!-- Feel free to mention things not covered by this PR that can be done in future PRs. Remove the section if it's not needed. --> ## Related Issues <!-- List related issues here, e.g. "Fixes vercel#1234". Remove the section if it's not needed. -->
Just adds the two new grok-4-fast model ids (reasoning and non-reasoning) to the docs and `XaiChatModelId` for the sdk. --------- Co-authored-by: Gregor Martynus <[email protected]>
…al (vercel#8800) ## Background Users reported needing to force Mistral models to use tools sequentially instead of in parallel for specific use cases where tool order matters or rate limits require controlled execution. ## Summary - add `parallelToolCalls` option to Anthropic provider options ## Manual Verification - all tests pass including new disable parallel tool use test - example demonstrates sequential tool execution when option is enabled ## 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes vercel#8663 --------- Co-authored-by: Gregor Martynus <[email protected]>
# Releases ## @ai-sdk/[email protected] ### Patch Changes - 62731a8: Add option for disabling parallel tool call in mistral ## @ai-sdk/[email protected] ### Patch Changes - 1861f6f: feat(xai) add grok-4-fast model ids Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…plete (vercel#8825) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background DeepSeek released a new model ## Summary Added it to the Gateway model string autocomplete ## Manual Verification Autocomplete works ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [ ] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [X] I have reviewed this pull request (self-review)
<!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background New LongCat model was released ## Summary Adds it to Gateway autocomplete ## Manual Verification Autocomplete works ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [X] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [X] I have reviewed this pull request (self-review)
# Releases ## [email protected] ### Patch Changes - Updated dependencies [7ccb36f] - Updated dependencies [6c766ef] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - 7ccb36f: feat(provider/gateway): Add LongCat Thinking model to Gateway autocomplete - 6c766ef: feat(provider/gateway): Add DeepSeek V3.1 Terminus to Gateway autocomplete ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background vercel#8763 vercel#8764 ## Summary Replace `EmbeddingModelV2` with `EmbeddingModelV3` ## 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Related Issues Fixes vercel#8764 towards vercel#8763 --------- Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
…le to nullish for better openai compatibility (vercel#8836) ## Background As reported in [vercel#8835](vercel#8835), `incomplete_details` was defined as `.nullable()`, forcing `null` instead of allowing omission. This caused validation issues when the property was simply missing. ## Summary Changed schema: ```diff - incomplete_details: z.object({ reason: z.string() }).nullable(), + incomplete_details: z.object({ reason: z.string() }).nullish(), ```` This matches runtime behavior: `incomplete_details` may be omitted, or provided as an object. `null` remains accepted as well. ## Manual Verification * Verified build passes * Objects with omitted `incomplete_details` now validate correctly * Objects with `incomplete_details: { reason: "..." }` validate correctly * `incomplete_details: null` still accepted ## Checklist * [x] Tests have been added / updated * [x] Documentation has been added / updated * [x] A *patch* changeset for relevant packages has been added (`pnpm changeset`) * [x] Formatting issues fixed (`pnpm prettier-fix`) * [x] Self-review completed ## Related Issues Fixes [vercel#8835](vercel#8835) vllm-project/vllm#11415 --------- Co-authored-by: Gregor Martynus <[email protected]>
…omplete (vercel#8840) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background New OpenAI model ## Summary Add it to the model string autocomplete list ## Manual Verification Autocomplete works ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [ ] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [X] I have reviewed this pull request (self-review)
## Background This change is added to include the provider versions in the user-agent header that we now pass. Previously, the string only appended `ai` version and runtime env ## Summary - add a `version.ts` file - export version during build by changing `tsup.config` - export verison during tests by changing `vitest.config` - mock a dummy version for tests ## Manual Verification Verified by making changes to the test file ## Tasks - [x] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Future Work Version in user-agent added for: - [x] `gateway` - [x] `openai` - [x] `anthropic` - [x] `google` - [x] `google-vertex` - [x] `azure` - [x] `amazon-bedrock` - [x] `cohere` - [x] `mistral` - [x] `groq` - [x] `cerebras` - [x] `deepinfra` - [x] `deepseek` - [x] `fireworks` - [x] `perplexity` - [x] `replicate` - [x] `togetherai` - [x] `xai` - [x] `vercel` - [x] `openai-compatible` - [x] `elevenlabs` - [x] `assemblyai` - [x] `deepgram` - [x] `gladia` - [x] `revai` - [x] `luma` - [x] `fal` - [x] `hume` - [x] `lmnt` - [x] `langchain` - [x] `llamaindex` - [x] `valibot` ## Related Issues fix in progress for vercel#8699 --------- Co-authored-by: Gregor Martynus <[email protected]>
# Releases ## [email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - Updated dependencies [5d21222] - Updated dependencies [0c4822d] - Updated dependencies [1cad0ab] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - Updated dependencies [1cad0ab] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [4920119] - Updated dependencies [0c4822d] - Updated dependencies [1cad0ab] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 5d21222: feat(provider/gateway): Add gpt-5-codex to Gateway model string autocomplete - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - Updated dependencies [1cad0ab] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 4920119: fix the "incomplete_details" key from nullable to nullish for openai compatibility - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0c4822d] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 1cad0ab: feat: add provider version to user-agent header - Updated dependencies [0c4822d] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ckage (vercel#8849) ## Background While implementing a custom `useChat` transport, I noticed these are missing from the `ai` package exports: * The `parseJsonEventStream()` function. I could grab this from the `@ai-sdk/provider-util` package directly, but since the `ai` package is already re-exporting stuff from this package, this would be nice to have as well. * The `uiMessageChunkSchema` zod schema is necessary for usage of `parseJsonEventStream()`. ## Summary Re-exported `parseJsonEventStream` from `@ai-sdk/provider-util`, and exported `uiMessageChunkSchema`.
# Releases ## [email protected] ### Patch Changes - 5a4e732: Export `parseJsonEventStream` and `uiMessageChunkSchema` from "ai" package ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [5a4e732] - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background We are currently not exporting a type for `providerOptions.openai` ## Summary Export `OpenAILanguageModelOptions` to type `providerOptions.openai` as needed ## Manual Verification [examples/ai-core/src/generate-text/openai-provider-options.ts](https://github.com/vercel/ai/blob/gr2m/export-mistral-language-model-options/examples/ai-core/src/generate-text/openai-provider-options.ts#L9-L28) ## Tasks - [ ] ~~Tests have been added / updated (for bug fixes / features)~~ we don't currently do test of module exports, we use examples instead - [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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Related Issues - vercel#8202
…` type (vercel#8863) ## Background The `uiMessageChunkSchema` seems to be out of date with the TypeScript `UIMessageChunk` type. Consider the following code: ```ts import { type UIMessageChunk, uiMessageChunkSchema } from "ai"; const m: UIMessageChunk = uiMessageChunkSchema.parse({ type: "text-delta", delta: "Hello, world!", id: "123", }); ``` This was producing the following TypeScript error: ``` Type '{ type: "text-start"; id: string; providerMetadata?: SharedV2ProviderMetadata | undefined; } | { type: "text-delta"; id: string; delta: string; providerMetadata?: SharedV2ProviderMetadata | undefined; } | ... 22 more ... | { ...; }' is not assignable to type 'UIMessageChunk'. Type '{ type: "reasoning"; text: string; providerMetadata?: SharedV2ProviderMetadata | undefined; }' is not assignable to type 'UIMessageChunk'. Type '{ type: "reasoning"; text: string; providerMetadata?: SharedV2ProviderMetadata | undefined; }' is missing the following properties from type '{ type: "source-document"; sourceId: string; mediaType: string; title: string; filename?: string | undefined; providerMetadata?: SharedV2ProviderMetadata | undefined; }': sourceId, mediaType, titlets(2322) ``` ## Summary * remove unused types from schema * add provider metadata for file * update data type parsing to support template string ## Manual Testing - [x] test UI example with reasoning (2 steps, OpenAI) ## Tasks - [x] add type test - [x] investigate expected behavior --------- Co-authored-by: Lars Grammel <[email protected]>
## Background Incorrect test name added in vercel#8863 ## Summary Update test name. ## Related Issues Introduced in vercel#8863
# Releases ## [email protected] ### Patch Changes - 7eca093: fix(ai): update `uiMessageChunkSchema` to satisfy the `UIMessageChunk` type ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [2e86082] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type ```ts import { openai, type OpenAIChatLanguageModelOptions } from '@ai-sdk/openai'; import { generateText } from 'ai'; await generateText({ model: openai.chat('gpt-4o'), prompt: 'Invent a new holiday and describe its traditions.', providerOptions: { openai: { user: 'user-123', } satisfies OpenAIChatLanguageModelOptions, }, }); ``` ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [7eca093] - [email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ercel#8882) ## Background Files where not correctly downloaded when provided items where a mix of supported and unsupported URLs/media types ## Summary Map before filtering to retain correct index ## Manual Verification Verified by testing original bug submit from our security bug bounty program ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [ ] n/a ~~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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues closes vercel#8881 --------- Co-authored-by: Lars Grammel <[email protected]>
…utocomplete (vercel#8890) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background New Qwen models launched ## Summary Added them to the Gateway model string autocomplete ## Manual Verification Autocomplete works ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [ ] Tests have been added / updated (for bug fixes / features) - [ ] 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [X] I have reviewed this pull request (self-review)
## Background vercel#8763 vercel#8769 ## Summary Replaced `ProviderV2` with `ProviderV3` ## 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Related Issues Fixes vercel#8769 towards vercel#8763
## Background vercel#8763 ## Summary Replace `ImageModelV2` with `ImageModelV3` ## Manual Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (excluding automated tests). Remove the section if it's not needed (e.g. for docs). --> ## 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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Closes vercel#8765 Towards vercel#8763 --------- Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## [email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 177b475: fix(ai): download files when intermediate file cannot be downloaded - 522f6b8: feat: `ImageModelV3` - Updated dependencies [aaf5ebf] - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - aaf5ebf: feat(provider/gateway): Add new Qwen models to Gateway model string autocomplete - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [ed329cb] - Updated dependencies [177b475] - Updated dependencies [522f6b8] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ed329cb: feat: `Provider-V3` - 522f6b8: feat: `ImageModelV3` - Updated dependencies [ed329cb] - Updated dependencies [522f6b8] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
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.
output-errorin tool call helperBackground
Currently the
addToolResult()helper allows a user to update a pending tool call evaluated on the client. However, there is not currently a mechanism for being able to report a pending tool call as errored with a state ofoutput-error.We would like to be able to use this to report client side errors with failed tool calls as well as cancellations.
There doesn't appear to be a way to replicate the behavior of the
addToolResultimplementation using just the public API provided byuseChat.So as a workaround we currently have to use
addToolResultand add an additional typed field on our tool output withstatus: "success" | "error"and consider failed tool calls "output" then adapt the rendering in our application. This differs to how we handle server side errors with tool calls which will use theoutput-errorstate.Summary
This commit extends the
addToolResultmethod on theAbstractChatclass to optionally take anoutput-errorresult. This allows clients to report both successful and failed tool calls using the same mechanism.For backwards compatibility the existing method interface is still supported and will default to a state of
output-available.Integration style tests have been added to the existing chat.test.ts suite to exercise the new behavior in the same fashion as the current implementation.
It also updates the
lastAssistantMessageIsCompleteWithToolCallshelper function to also consider tool parts with a state ofoutput-errora completed tool call. This ensures consistent behavior for both types of result.Manual Verification
None
Tasks
pnpm changesetin the project root)pnpm prettier-fixin the project root)Future Work
None
Related Issues
None