forked from vercel/ai
-
Notifications
You must be signed in to change notification settings - Fork 0
[DONOTMERGE] verifying/implementing citations for cohere #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
dubwub
wants to merge
496
commits into
main
Choose a base branch
from
dd/cohere-citations
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.
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
…ercel#5977) ## Background Compare vercel#5698 ## Summary Additional provider-specific options to the image model provider interface. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider. Unlike other models, ImageModel request return an array of images, and provider can return image-specific metadata for each. So far, this pull request passing through the revised prompt used for each image. In order to make that possible, I introduced a new type `ImageModelV2ProviderMetadata` which is the same as `SharedV2ProviderMetadata` plus it guarantees the presence of the `.images` key ```js export type ImageModelV2ProviderMetadata = Record< string, { images: JSONArray; } & JSONValue >; ``` That also makes it possible to deeply merge providerMetadata from multiple responses effectively. ## Verification I updated the `examples/ai-core/src/generate-image/openai.ts` example to verify that the code is working.
…ercel#6049) ## Background In vercel#5896 we removed logprobs to simplify models. ## Summary Re-introduce logprobs as provider-specific functionality for openai.
## Background This pull request adds the ability for clients to resume an ongoing chat generation stream after a network disconnect. ## Summary This pull request adds support for the `useChat` hook to resume an ongoing chat generation stream by exposing `experimental_resume()` that can be called by any client, typically during the initial mount of the hook. The `experimental_resume` function makes a `GET` request to the api endpoint you've initialized the hook with (or `/api/chat` by default) and streams the contents of the stream if it is active or fails silently if it has ended. In order for `experimental_resume` to work as intended, it requires the usage of the [`resumable-stream`](https://www.npmjs.com/package/resumable-stream) package for stream creation and a redis instance for the package to manage the pub/sub mechanism. ## Verification An example has been added at `examples/next-openai/app/use-chat-resume` to test the feature. Follow the following steps to test it end-to-end: 1. Run the development server 2. Navigate to `http://localhost:3000/use-chat-resume` 3. Send a message that will have a longer generation duration, example "Write an essay about Michael Jordan" 4. Once the generation starts, click the chat id above to open the conversation in a new tab 5. Verify the stream gets resumed ## 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 - [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root)
## Background With the switch to UI message parts, attachments can be replaced with FileUIParts to enable using the same code for assistant and user file parts. ## Summary Replace attachments with file ui parts.
## Background This pull request fixes a docs formatting issue due to a missing comma in useChat reference docs. ## Summary Fixed formatting in useChat reference docs by adding a comma. ## Tasks - [x] Documentation has been added / updated (for bug fixes / features) - [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) ## Related Issues vercel#6053
…mable HTTP transport usage (vercel#5972) (vercel#6093) ## Background The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config). ## Summary Updates documentation to illustrate usage of the new Streamable HTTP Transport with `experimental_createMCPClient` for tool conversion. As of now, `experimental_createMCPClient` is only used in the AI SDK as a way to fetch and call MCP server tools; for this reason, we are **not** adding support for Session Management or Resumable Streams - which are new features supported by the new HTTP transport. Examples have been updated to illustrate basic usage, and a new Next.js example has been added to illustrate setting up a **stateless** MCP **server** to be used with `useChat` and `streamText`. ## Future Work Given the deprecation of the SSE transport, we should likely deprecate on our end as well. We should consider fully deprecating native support for transports (e.g. our custom `stdio` transport), and enforcing users to always pass in a custom transport to limit need for maintenance on our end. Fixes vercel#5984 --------- Co-authored-by: Grace Yun <[email protected]>
## Background Recently [Weave](https://github.com/wandb/weave) by Weights and Biases added OTEL support and some specialized parsing for Vercel's span attributes. This PR provides docs for configuring exports to Weave and adds it to the list of observability providers. ## Summary Added setup and configuration docs for exporting OTEL traces from the AI SDK to Weave projects Co-authored-by: Zach Birenbaum <[email protected]>
…ercel#6095) This resolves an issue a user ran into: vercel#6041 Aligned openai provider with openai-compatible
Co-authored-by: Mrinank Bhowmick <[email protected]>
…ercel#6103) ## Background The Dify provider allows developers to easily integrate Dify's application workflow with their applications using the Vercel AI SDK. ## Summary This PR adds the Dify provider documentation to the AI SDK, enabling users to understand how to implement and use the Dify integration. ## Tasks - [x] Documentation has been added for the Dify provider - [x] Installation instructions are included - [x] Usage examples for both cloud and self-hosted instances are provided ## Related Issues [Support Dify Provider](vercel#4084) Co-authored-by: Oscar Jiang <[email protected]>
## Background Attachments were moved to file ui parts in a previous pull request. File UI parts do not have filenames (file content parts do). ## Summary Add filenames to file ui parts. ## Verification Tested with `examples/next-openai` attachment uploads.
## Background The name `CoreMessage` was an artifact of needed to introduce a separate message type. Over time it became clear that we have threee distinct message types: - messages used on the client that are displayed to the user (`UIMessage`) - messages that are sent to our user-facing APIs (currently `CoreMessage`) - messages that are sent to the providers (`LanguageModelV2Message`) They all have distinct DX considerations and are different by design. The name `CoreMessage` is not clear here. ## Summary Rename `CoreMessage` to `ModelMessage` to make the distinction `UIMessage <> ModelMessage` clear (most users are not exposed to internal provider messages). ## Future Work `CoreMessages` and related types and functions are deprecated and will be removed in AI SDK 6
…odyJson (vercel#6106) ## Background There are different `requestBody*` methods in `TestServerCall` that indicate their type in the suffix. The JSON one was the initial method and is inconsistent. ## Summary Rename `TestServerCall.requestBody` to `requestBodyJson`.
# Releases ## [email protected] ### Major Changes - f04fb4a: chore (ai): replace useChat attachments with file ui parts - fd1924b: chore (ai): remove redundant `mimeType` property - fafc3f2: chore (ai): change file to parts to use urls instead of data - 92cb0a2: chore (ai): rename CoreMessage to ModelMessage ### Minor Changes - c9ad635: feat (ai): add filename to file ui parts ### Patch Changes - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (vercel#5977) The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models. ```js const prompt = 'Santa Claus driving a Cadillac'; const { providerMetadata } = await experimental_generateImage({ model: openai.image('dall-e-3'), prompt, }); const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt; console.log({ prompt, revisedPrompt, }); ``` - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 957b739: chore (provider-utils): rename TestServerCall.requestBody to requestBodyJson ### Patch Changes - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [136819b] - Updated dependencies [9bd5ab5] - Updated dependencies [284353f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 136819b: chore(providers/openai): re-introduce logprobs as providerMetadata - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (vercel#5977) The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models. ```js const prompt = 'Santa Claus driving a Cadillac'; const { providerMetadata } = await experimental_generateImage({ model: openai.image('dall-e-3'), prompt, }); const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt; console.log({ prompt, revisedPrompt, }); ``` - 284353f: fix(providers/openai): zod parse error with function - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (vercel#5977) The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models. ```js const prompt = 'Santa Claus driving a Cadillac'; const { providerMetadata } = await experimental_generateImage({ model: openai.image('dall-e-3'), prompt, }); const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt; console.log({ prompt, revisedPrompt, }); ``` ## @ai-sdk/[email protected] ### Patch Changes - c34ccd7: feat (ui/react): support resuming an ongoing stream - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [f04fb4a] - Updated dependencies [fd1924b] - Updated dependencies [957b739] - Updated dependencies [fafc3f2] - Updated dependencies [c9ad635] - Updated dependencies [9bd5ab5] - Updated dependencies [92cb0a2] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [957b739] - Updated dependencies [9bd5ab5] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background `maxSteps` is available in all `useChat` implementations. ## Summary Add `maxSteps` to `UseChatOptions`.
…vercel#6091) Followup to vercel#6049, we were missing streaming logprobs it was commented for the completion model but accidentally missed this one
## Background `keepLastMessageOnError` is deprecated and should be removed in AI SDK 5. ## Summary Remove `keepLastMessageOnError` and simplify adjacent code.
## Background `UIMessage` has replaced `Message`. ## Summary Remove outdated `UIMessage` type casts.
## Background IDGenerator needed to be updated to remove the `size` param and to standardize the name. ## Summary - rename `IDGenerator` to `IdGenerator` - return `IdGeneration` instead of custom function from `createIdGenerator` - rewrite id generation algorithm
…#6108) ## Background We didn't actually read the supportsParallelCalls field at all, and we did everything serially in embedding model ## Summary This makes the embedding model actually respect supportsParallel calls Co-authored-by: Lars Grammel <[email protected]>
…el#6121) ## Background After a lot of cross-referencing, the only cleanup we need is to unify this interface into provider-utils ## Summary Move ToolResultContent to provider-utils
## Background The message id and createdAt fields are required for any solution that implements a realistic chatbot. If more control over the request is needed, filtering can be done using `prepareRequestBody`. ## Summary Remove `sendExtraMessageFields` (default to true).
…viderOptions (vercel#6122) ## Background We were using nullish in some places (due to AI autocompletion) ## Summary Now it's unified to use `.optional()` everywhere ## Verification Checked JSDoc to make sure we're not breaking anything
…kImageModelV2` (vercel#6132) ## Background Follow up to https://github.com/vercel/ai/pull/6083/files#r2069803342 ## Summary `packages/ai/core/generate-image/generate-image.test.ts` uses `MockImageModelV2` which sets `provdier` to `"mock-provider"`. But the tests use `openai` as the provider key. This pull request updates the tests to use `mock-provider` as the provider key to match the used model.
… token in usage information (vercel#6140) ## Background Over the past year, additional token usage information such as cached input tokens and reasoning tokens were added by many providers. In addition, the meaning of total tokens is now provider-dependent, with some providers including reasoning tokens in the total token count. ## Summary Standardize sending reasoning tokens, cached prompt tokens, and total tokens from the providers.
# Releases ## [email protected] ### Major Changes - c60f895: chore (ai): remove useChat keepLastMessageOnError - a662dea: chore (ai): remove sendExtraMessageFields ### Patch Changes - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils - 332167b: chore (ai): move maxSteps into UseChatOptions - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 7979f7f: feat (provider): support reasoning tokens, cached input tokens, total token in usage information ### Patch Changes - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency ## @ai-sdk/[email protected] ### Major Changes - 41fa418: chore (provider-utils): return IdGenerator interface ### Patch Changes - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [928fadf] - Updated dependencies [41fa418] - Updated dependencies [6f231db] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 928fadf: fix(providers/openai): logprobs for stream alongside completion model - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [41fa418] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [c60f895] - Updated dependencies [332167b] - Updated dependencies [a8c8bd5] - Updated dependencies [a662dea] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [a571d6e] - Updated dependencies [a8c8bd5] - Updated dependencies [7979f7f] - Updated dependencies [41fa418] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# Releases ## [email protected] ### Major Changes - 0a710d8: feat (ui): typed tool parts in ui messages - 6a83f7d: refactoring (ai): restructure message metadata transfer - 1f55c21: chore (ai): send reasoning to the client by default - 33eb499: feat (ai): inject message id in createUIMessageStream - 901df02: feat (ui): use UI_MESSAGE generic ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 0a710d8: feat (ui): typed tool parts in ui messages - 901df02: feat (ui): use UI_MESSAGE generic ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 0a710d8: feat (ui): typed tool parts in ui messages - 901df02: feat (ui): use UI_MESSAGE generic ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 0a710d8: feat (ui): typed tool parts in ui messages - 901df02: feat (ui): use UI_MESSAGE generic ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 8dfcb11: feat(anthropic/citation): text support for citations - ee5a9c0: feat: streamText onChunk raw chunk support - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [8dfcb11] - Updated dependencies [68ecf2f] - Updated dependencies [ee5a9c0] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 478acd8: feat(mistral): added magistral reasoning models - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 68ecf2f: release alpha.13 ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [0a710d8] - Updated dependencies [6a83f7d] - Updated dependencies [1f55c21] - Updated dependencies [68ecf2f] - Updated dependencies [33eb499] - Updated dependencies [901df02] - [email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - d7cb6b4: chore (valibot): update to valibot 1.1 - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [68ecf2f] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## background The `LanguageModelV2ProviderDefinedClientTool` type was renamed from `LanguageModelV2ProviderDefinedTool` so we can add a defined server tool later on ## summary - updated all export for `LanguageModelV2ProviderDefinedClientTool` type ## verification - updated imports resolved - type is properly exported from `@ai-sdk/provider`
## summary - add server-side web search support via `providerOptions.anthropic.webSearch` - implement `LanguageModelV2ProviderDefinedServerTool` for unified tool handling ## verification - all tests pass including server-side tool-specific tests - web search executes on Anthropic servers with automatic source integration - examples demonstrate real-time search with proper response structure ## future work * extend pattern for additional Anthropic server-side tools as they become available --------- Co-authored-by: Josh [email protected]
## Background Adding Smithery to the docs as an additional toolkit. ## Verification Only the documentation was changed. No tests required. Co-authored-by: Henry Mao <[email protected]>
… location (vercel#6759) ## background API validation errors when using Anthropic web search with partial location data. The API was rejecting requests with empty strings for optional fields, preventing flexible location-based search configurations. ## summary - make all userLocation fields optional (city, region, country, timezone) - add conditional field inclusion in tool preparation - add validation warning for empty userLocation objects ## verification - all tests pass including new optional field combinations - real API calls work with any single field (city-only, country-only, timezone-only) - empty userLocation generates proper unsupported-tool warning - no userLocation at all works correctly --------- Co-authored-by: Josh [email protected]
…ercel#6760) ## Background `args`, `parameters`, and `result` for tools are not intuitive and do not align with `inputSchema` and `outputSchema` from MCP tools ## Summary Switch to `input` and `output` for tools.
<!-- 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 When using the React Compiler (currently in RC), deeply nested mutations to message parts (and likely metadata) fail to trigger re-renders even though we are re-creating the entire array messages array upon every chunk (in `replaceMessage`) ## Summary In `replaceMessage`, we use `structuredClone` to guarantee the message being updated reflected deeply nested changes in the React state manager Alternatives considered: - Apply snapshot when executing mutate job (in `AbstractChat`); this approach was vetoed because the snapshotting should be collocated to the React implementation - Add custom cloning approach to avoid deep cloning the entire message; if users report a huge impact on performance, we can potentially pivot to this approach. For now, this is the simplest solution! ## Verification Tested in demo Next.js project with React Compiler enabled ## 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 as needed. 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) - [ ] 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) ## Future Work See custom clone/snapshot method snippet above ## Related Issues Addresses vercel#6466
# Releases ## [email protected] ### Major Changes - 63f9e9b: chore (provider,ai): tools have input/output instead of args,result ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Major Changes - 63f9e9b: chore (provider,ai): tools have input/output instead of args,result ### Patch Changes - b5da06a: update to LanguageModelV2ProviderDefinedClientTool to add server side tool later on - 2e13791: feat(anthropic): add server-side web search support ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 2e13791: feat(anthropic): add server-side web search support - 6392f60: fix(anthropic): resolve web search API validation errors with partial location + provider output - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - Updated dependencies [6392f60] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [63f9e9b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [63f9e9b] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 995baa0: fix (react): structuredClone message in replaceMessage - Updated dependencies [63f9e9b] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [63f9e9b] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @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 - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [63f9e9b] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b5da06a] - Updated dependencies [63f9e9b] - Updated dependencies [2e13791] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background The UI message stream headers need to sometimes be used in custom responses, e.g. for resume stream endpoints. ## Summary Rename and expose `UI_MESSAGE_STREAM_HEADERS`.
Existing code continues to work. ### Example Before ```ts import { convertUint8ArrayToBase64 } from '@ai-sdk/provider-utils'; // Had to manually convert binary data to base64 const fileData = new Uint8Array([0, 1, 2, 3]); const filePart = { type: 'file', mediaType: 'application/pdf', data: convertUint8ArrayToBase64(fileData), // Required conversion }; ``` After ```ts // Can use binary data directly const fileData = new Uint8Array([0, 1, 2, 3]); const filePart = { type: 'file', mediaType: 'application/pdf', data: fileData, // Direct Uint8Array support }; ```
…6767) ## Background The `SubscriptionRegistrars` was not necessary and added accidental complexity. ## Summary Remove `SubscriptionRegistrars` interface.
## Background Resuming streams on load currently requires `useEffect` and `experimental_resume`. The DX can be simplified by offering a `resume` flag on `useChat` that does the same. ## Summary Add `resume` flag to `useChat` (React).
…vercel#6771) ## Background Resumable streams need to consume a branch of the JSON SSE output without being affect by stream abortion. ## Summary Add `consumeSseStream` that invokes callback with a teed branch of the SSE stream.
## Background Chat resumption on reload needs a separate endpoint to connect to. ## Summary * restructure chat transports * move default route for stream reconnection to `/chat/[id]/stream` * rename `prepareRequest` to `prepareSubmitMessagesRequest`` ## Verification * test `next` example
## Background Changing the default provider was not type safe and required an import. ## Summary Rename and type the global variable to simplify the default provider setup. ```ts globalThis.VERCEL_AI_GLOBAL_DEFAULT_PROVIDER = openai; ```
## Background Reload was slightly misleading as a name. Regenerating any assistant message should be supported. ## Summary * rename `reload` to `regenerate` on chat * support optional `messageId` param and regenerate on user msgs * rename transport `submitMessages` and related to `sendMessages` ## Verification Tested with `next` example.
…vercel#6779) ## Background The default provider global name was unnecessarily complex. ## Summary Rename global variable for the default provider to `AI_SDK_DEFAULT_PROVIDER`.
…eGatewayProvider (vercel#6778) ## Background The Gateway provider deviates from most other AI SDK provider with its custom provider creation method having the `Provider` suffix. ## Summary This change adds a shorthand alias for the function as just `createGateway`. This lines up more clearly with custom provider methods in other modules, e.g. `google` has `createGoogleGenerativeAi` and `xai` has `createXai`.
## Background Resume is no longer experimental. ## Summary Rename `experimental_resume` to `resumeStream`.
… sendMessage (vercel#6775) ## Background Editing and submitting user messages is a common task in advanced chat UIs that should be easy to do with the AI SDK. ## Summary Add `messageId` option to `sendMessage`. If set, it replaces an existing message. ## Verification Integrated message replace into `next` example and tested it manually.
## Background The eventsource-parser library has performance optimizations that will speed up stream processing. It was removed before because of performance issues, but has since then improved. ## Summary Replace event source stream processing with `eventsource-parser` library.
# Releases ## [email protected] ### Major Changes - 04d5063: chore (ai): rename default provider global to AI_SDK_DEFAULT_PROVIDER - b4b4bb2: chore (ui): rename experimental_resume to resumeStream - d884051: feat (ai): simplify default provider setup - 954aa73: feat (ui): extended regenerate support - 60e2c56: feat (ai): restructure chat transports ### Patch Changes - b1e3abd: feat (ai): expose ui message stream headers - 142576e: feat (ui): support message replacement in chat via messageId param on sendMessage - 395c85e: feat (ai): add consumeSseStream option to UI message stream responses - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - Updated dependencies [c145d62] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - c145d62: feat (providers/gateway): add createGateway shorthand alias for createGatewayProvider - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b1e3abd] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b1e3abd] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - 48d257a: release alpha.15 ## @ai-sdk/[email protected] ### Patch Changes - 8ba77a7: chore (provider-utils): use eventsource-parser library - Updated dependencies [48d257a] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - ae0dc0a: feat (ui/react): add resume flag to useChat - Updated dependencies [b1e3abd] - Updated dependencies [8ba77a7] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b1e3abd] - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b1e3abd] - Updated dependencies [8ba77a7] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [b1e3abd] - Updated dependencies [8ba77a7] - Updated dependencies [04d5063] - Updated dependencies [b4b4bb2] - Updated dependencies [d884051] - Updated dependencies [954aa73] - Updated dependencies [142576e] - Updated dependencies [395c85e] - Updated dependencies [60e2c56] - [email protected] - @ai-sdk/[email protected] ## @ai-sdk/[email protected] ### Patch Changes - Updated dependencies [48d257a] - Updated dependencies [8ba77a7] - @ai-sdk/[email protected] - @ai-sdk/[email protected] - @ai-sdk/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[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.
@ai-cohere/2.0.0-alpha.15
release versionpnpm build
, add COHERE_API_KEY (see ferndocs env vars) to .env.local inexamples/next-cohere
,pnpm install
, then go tohttp://localhost:3000/api/cohere-generate-text