UNPKG

ai

Version:

AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript

1,994 lines (1,286 loc) 161 kB
# ai ## 6.0.3 ### Patch Changes - 29264a3: feat: add MCP tool approval - Updated dependencies [29264a3] - @ai-sdk/provider-utils@4.0.1 - @ai-sdk/gateway@3.0.2 ## 6.0.2 ### Patch Changes - 129ff26: fix(ai): skip tool input validation in `safeValidateUIMessages` when `output-error` state has undefined input Fixes #11392 - Updated dependencies [c0c8a0e] - @ai-sdk/gateway@3.0.1 ## 6.0.1 ### Patch Changes - Updated dependencies [387980f] - @ai-sdk/gateway@3.0.0 ## 6.0.0 ### Major Changes - dee8b05: ai SDK 6 beta ### Minor Changes - 78928cb: release: start 5.1 beta ### Patch Changes - 0c3b58b: fix(provider): add specificationVersion to ProviderV3 - 58920e0: fix(ai): do not drop custom headers in HttpChatTransport - a7da2b6: feat(agent): change output generics - 0adc679: feat(provider): shared spec v3 - 50b70d6: feat(anthropic): add programmatic tool calling - 2d28066: chore(agent): limit agent call parameters - fca786b: feat(agent): configurable call options - 046aa3b: feat(provider): speech model v3 spec - e1f6e8e: feat(ai): add Output.json() - 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3 Before ```ts model.textEmbeddingModel('my-model-id'); ``` After ```ts model.embeddingModel('my-model-id'); ``` - b67d224: Fixes an issue where `providerMetadata` and `providerExecuted` were lost when tool input validation failed - ab6f01a: Improve ai gateway error message when api key is not present - 9388ff1: feat(ui): add isDataUIPart helper - dce03c4: feat: tool input examples - 2625a04: feat(openai); update spec for mcp approval - 37c58a0: This release introduces `wrapEmbeddingModel`, a new helper that brings embedding model customization capabilities similar to `wrapLanguageModel`. - 4e2b04d: fix(gateway): throw error with user-friendly message in non-production environments if `AI_GATEWAY_API_KEY` is not configured - ab1087b: feat(ai): `chat.addToolResult()` is now `chat.addToolOutput()` - bb10a89: fix(ai): mcp errors to be jsonrpc 2.0 compliant - 457f1c6: feat(ai): onFinish callback for generateText - 95f65c2: chore: use import \* from zod/v4 - 754df61: fix(ai): correct type field in arrayOutputStrategy from 'enum' to 'array' - 58920e0: refactor: consolidate header normalization across packages, remove duplicates, preserve custom headers - 954c356: feat(openai): allow custom names for provider-defined tools - 7fdd89d: feat(agent): export AgentCallParameters and AgentStreamParameters types - eca63f3: feat(ai): add OAuth for MCP clients + refactor to new package This change replaces ```ts import { experimental_createMCPClient } from 'ai'; import { Experimental_StdioMCPTransport } from 'ai/mcp-stdio'; ``` with ```ts import { experimental_createMCPClient } from '@ai-sdk/mcp'; import { Experimental_StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio'; ``` - 90e5bdd: chore(ai): restructure agent files - 42cf7ed: fix(agent): use tool.toModelOutput when available - 544d4e8: chore(specification): rename v3 provider defined tool to provider tool - 4812235: fix(ai): add missing export for `LoadSettingError` - 7f2c9b6: fix(ui): do not submit automatically when server return with error - 614599a: chore(ai): deprecate generateObject and streamObject - 0c4822d: feat: `EmbeddingModelV3` - e062079: chore(agent): move Agent.respond into createAgentStreamResponse function - 2b49dae: feat(agent): support UIMessageStreamOptions in createAgentStreamResponse - ee651d7: `https://v6.ai-sdk.dev` -> `https://ai-sdk.dev` - 5a4e732: Export `parseJsonEventStream` and `uiMessageChunkSchema` from "ai" package - f733285: fix(ai): only parse experimental_output in generateText when finishReason is stop - 9b83947: feat(ai): add convertDataPart option to convertToModelMessages Add optional convertDataPart callback for converting custom data parts (URLs, code files, etc.) to text or file parts that models can process. Fully type-safe using existing UIMessage generics. - 7eca093: fix(ai): update `uiMessageChunkSchema` to satisfy the `UIMessageChunk` type - 077aea3: feat(ai): stable structured output on generateText, streamText, and ToolLoopAgent - 9f20c87: chore: updated README - 521c537: feat(ai): Tool.needsApproval can be a function - 7169511: feat(agent): support context in onFinish callback - e8109d3: feat: tool execution approval - 03849b0: move DelayedPromise into provider utils - ed329cb: feat: `Provider-V3` - 22ef5c6: feat(ai): Output.text() is default output mode - 9ba4324: feat(ai): support SystemModelMessage[] in system and instructions properties - 3bd2689: feat: extended token usage - 293a6b7: Added a title to the tools - 7c3c216: fixed docs and exported NoSpeechGeneratedError - c62ecf0: feat(ai): add support for v2 specs in transcription and speech models - d1bdadb: Added experimental_rerank support - 703459a: feat: tool execution approval for dynamic tools - 3071620: fix header loss when statusText is undefined in writeHead - 7e4649f: fix(core): Fix image download behavior when the initial model is swapped out during prepareStep - 48454ab: fix(ai): handle backpressure in `writeToServerResponse` - e06b663: feat(agent): support experimental stream transforms - 83e5744: feat: support async Tool.toModelOutput - 8c98371: Extend addToolResult to support error results - b1405bf: feat(ai): send context into streamText / generateText onFinish callbacks - a5e152d: fix(ai): back version support for V2 providers - aa0515c: feat(ai): move Agent to stable - f6f0c5a: chore: remove zod from ui packages - 3ed5519: chore: rename ToolCallOptions to ToolExecutionOptions - eb8d1cb: fix not catching of empty arrays in validateUIMessage - e7d9b00: feat(agent): add optional name property to agent - d5b25ee: feat(ai): add Output.array() - d7bae86: feat(ai): add Output.choice() - 8dac895: feat: `LanguageModelV3` - a755db5: feat(ai): improve warnings with provider and model id - 1c2a4c1: fix(ai): remove outdated jsdoc param descriptions - 686103c: chore(ai): export ContentPart type - 0d6c0d8: chore(ai): remove deprecated CodeMessage type and related types and functions - 9b8d17e: fix(agent): move provider options to main agent config - 79a8e7f: feat(agent): support abortSignal in createAgentUIStream - d59ce25: fix(ai): do not mutate middleware array argument when wrapping - 475189e: chore(specification): rename EmbeddingModelCallOptions - 3d83f38: chore(ai): improve addToolInputExamplesMiddleware - 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings - b681d7d: feat: expose usage tokens for 'generateImage' function - c99da05: feat(ai): add onFinish to Agent - db913bd: fix(google): add thought signature to gemini 3 pro image parts - 9061dc0: feat: image editing - 8445d70: feat: export GatewayModelId and use to type LanguageModel - 32223c8: feat: add toolCallId arg to toModelOutput - 8370068: fix(provider/google): preserve thoughtSignature through tool execution - 5e313e3: fix(agent): do not allow static tools when tools is empty - db62f7d: Added schema name and description for generateText and output - a7f6f81: Add safeValidateUIMessages utility to validate UI messages without throwing, returning a success/failure result object like Zod’s safeParse - 79ba99f: feat(agent): add message metadata support when inferring UI messages - c98373a: chore(agent): rename createAgentStreamResponse to createAgentUIStreamResponse - 846e80e: fix(ai): bind functions for v2 -> v3 adapter - bbdcb81: Add experimental_context parameter to prepareStep callback - 67a407c: chore(ai): add warning when using v2 models with AISDK v6 - 9524761: chore(ai): rename relevanceScore to score - ca13d26: feat(ai): add output to StreamTextResult - 4616b86: chore: update zod peer depenedency version - a322efa: Added finishReason on useChat onFinish callbck - 2d166e4: feat(provider/gateway): add support for image models - 384142c: feat(agent): add abortSignal parameter to generate and stream - 36b175c: chore(ai): change output generics - 2b1bf9d: feat(ai): add pruneMessages helper function - 81d4308: feat: provider-executed dynamic tools - e0d1ea9: fix(ai): align logic of text-end with reasoning-end - 2406576: chore(agent): rename messages property on agent ui stream functions to uiMessages - b1aeea7: feat(ai): set default stopWhen on Agent to stepCountIs(20) - dce4e7b: chore(agent): rename system to instructions - 4ece5f9: feat(agent): add experimental_download to ToolLoopAgent - a417a34: feat(agent): introduce version property - 637eaa4: feat(ai): print model warnings in embed and embedMany - 177b475: fix(ai): download files when intermediate file cannot be downloaded - 21e20c0: feat(provider): transcription model v3 spec - afe7093: feat: add middleware for tool input examples - 61f7b0f: chore(agent): rename BasicAgent to ToolLoopAgent - af9dab3: fix(ai): remove unused mode setting from generateObject and streamObject - 522f6b8: feat: `ImageModelV3` - 97b1d77: fix(ui): Don't resend messages for providerExecuted tools in lastAssistantMessageIsCompleteWithToolCalls and lastAssistantMessageIsCompleteWithApprovalResponses - 69768c2: chore(ai): remove UI message reference from model message validation - 27e8c3a: chore(ai): rename Agent to BasicAgent, introduce Agent interface - 81e29ab: feat(ai): allow modifying experimental context in prepareStep - 7da02d2: fix(ai): prune messages properly when toolCalls set to 'before-last-message' - 763d04a: feat: Standard JSON Schema support - 95b77e2: feat(agent): extract createAgentUIStream, add pipeAgentUIStreamToResponse - 3794514: feat: flexible tool output content support - cbf52cd: feat: expose raw finish reason - 14ca35d: feat: add support for v2 specs - 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies - dcdac8c: chore(ai): rename tool helpers - 960ec8f: chore: change argument of toModelOutput to parameter object - b59d924: feat(ai): support SystemModelMessage in system and instructions properties - 1bd7d32: feat: tool-specific strict mode - 95f65c2: chore: load zod schemas lazily - Updated dependencies - @ai-sdk/provider@3.0.0 - @ai-sdk/gateway@2.0.0 - @ai-sdk/provider-utils@4.0.0 ## 6.0.0-beta.169 ### Patch Changes - ee651d7: `https://v6.ai-sdk.dev` -> `https://ai-sdk.dev` ## 6.0.0-beta.168 ### Patch Changes - Updated dependencies [7294355] - @ai-sdk/gateway@2.0.0-beta.93 ## 6.0.0-beta.167 ### Patch Changes - 475189e: chore(specification): rename EmbeddingModelCallOptions - Updated dependencies [475189e] - @ai-sdk/provider@3.0.0-beta.32 - @ai-sdk/gateway@2.0.0-beta.92 - @ai-sdk/provider-utils@4.0.0-beta.59 ## 6.0.0-beta.166 ### Patch Changes - 9f20c87: chore: updated README ## 6.0.0-beta.165 ### Patch Changes - 2625a04: feat(openai); update spec for mcp approval - Updated dependencies [2625a04] - @ai-sdk/provider@3.0.0-beta.31 - @ai-sdk/gateway@2.0.0-beta.91 - @ai-sdk/provider-utils@4.0.0-beta.58 ## 6.0.0-beta.164 ### Patch Changes - cbf52cd: feat: expose raw finish reason - Updated dependencies [cbf52cd] - @ai-sdk/provider@3.0.0-beta.30 - @ai-sdk/gateway@2.0.0-beta.90 - @ai-sdk/provider-utils@4.0.0-beta.57 ## 6.0.0-beta.163 ### Patch Changes - Updated dependencies [9549c9e] - @ai-sdk/provider@3.0.0-beta.29 - @ai-sdk/gateway@2.0.0-beta.89 - @ai-sdk/provider-utils@4.0.0-beta.56 ## 6.0.0-beta.162 ### Patch Changes - 50b70d6: feat(anthropic): add programmatic tool calling - Updated dependencies [50b70d6] - @ai-sdk/provider-utils@4.0.0-beta.55 - @ai-sdk/gateway@2.0.0-beta.88 ## 6.0.0-beta.161 ### Patch Changes - Updated dependencies [ee71658] - @ai-sdk/gateway@2.0.0-beta.87 ## 6.0.0-beta.160 ### Patch Changes - 9061dc0: feat: image editing - Updated dependencies [9061dc0] - @ai-sdk/provider-utils@4.0.0-beta.54 - @ai-sdk/provider@3.0.0-beta.28 - @ai-sdk/gateway@2.0.0-beta.86 ## 6.0.0-beta.159 ### Patch Changes - 3071620: fix header loss when statusText is undefined in writeHead - Updated dependencies [870297d] - @ai-sdk/gateway@2.0.0-beta.85 ## 6.0.0-beta.158 ### Patch Changes - Updated dependencies [366f50b] - @ai-sdk/provider@3.0.0-beta.27 - @ai-sdk/gateway@2.0.0-beta.84 - @ai-sdk/provider-utils@4.0.0-beta.53 ## 6.0.0-beta.157 ### Patch Changes - 763d04a: feat: Standard JSON Schema support - Updated dependencies [763d04a] - @ai-sdk/provider-utils@4.0.0-beta.52 - @ai-sdk/gateway@2.0.0-beta.83 ## 6.0.0-beta.156 ### Patch Changes - 2406576: chore(agent): rename messages property on agent ui stream functions to uiMessages ## 6.0.0-beta.155 ### Patch Changes - Updated dependencies [c1efac4] - @ai-sdk/provider-utils@4.0.0-beta.51 - @ai-sdk/gateway@2.0.0-beta.82 ## 6.0.0-beta.154 ### Patch Changes - 32223c8: feat: add toolCallId arg to toModelOutput - Updated dependencies [32223c8] - @ai-sdk/provider-utils@4.0.0-beta.50 - @ai-sdk/gateway@2.0.0-beta.81 ## 6.0.0-beta.153 ### Patch Changes - 83e5744: feat: support async Tool.toModelOutput - Updated dependencies [83e5744] - @ai-sdk/provider-utils@4.0.0-beta.49 - @ai-sdk/gateway@2.0.0-beta.80 ## 6.0.0-beta.152 ### Patch Changes - 960ec8f: chore: change argument of toModelOutput to parameter object - Updated dependencies [960ec8f] - @ai-sdk/provider-utils@4.0.0-beta.48 - @ai-sdk/gateway@2.0.0-beta.79 ## 6.0.0-beta.151 ### Patch Changes - dcdac8c: chore(ai): rename tool helpers ## 6.0.0-beta.150 ### Patch Changes - db62f7d: Added schema name and description for generateText and output ## 6.0.0-beta.149 ### Patch Changes - 4e2b04d: fix(gateway): throw error with user-friendly message in non-production environments if `AI_GATEWAY_API_KEY` is not configured ## 6.0.0-beta.148 ### Patch Changes - Updated dependencies [f18ef7f] - @ai-sdk/gateway@2.0.0-beta.78 ## 6.0.0-beta.147 ### Patch Changes - 637eaa4: feat(ai): print model warnings in embed and embedMany ## 6.0.0-beta.146 ### Patch Changes - Updated dependencies [e9e157f] - @ai-sdk/provider-utils@4.0.0-beta.47 - @ai-sdk/gateway@2.0.0-beta.77 ## 6.0.0-beta.145 ### Patch Changes - Updated dependencies [34ee8d0] - @ai-sdk/gateway@2.0.0-beta.76 ## 6.0.0-beta.144 ### Patch Changes - ab6f01a: Improve ai gateway error message when api key is not present ## 6.0.0-beta.143 ### Patch Changes - 81e29ab: feat(ai): allow modifying experimental context in prepareStep - Updated dependencies [81e29ab] - @ai-sdk/provider-utils@4.0.0-beta.46 - @ai-sdk/gateway@2.0.0-beta.75 ## 6.0.0-beta.142 ### Patch Changes - 7169511: feat(agent): support context in onFinish callback - bbdcb81: Add experimental_context parameter to prepareStep callback ## 6.0.0-beta.141 ### Patch Changes - b1405bf: feat(ai): send context into streamText / generateText onFinish callbacks ## 6.0.0-beta.140 ### Patch Changes - 7fdd89d: feat(agent): export AgentCallParameters and AgentStreamParameters types ## 6.0.0-beta.139 ### Patch Changes - 3bd2689: feat: extended token usage - Updated dependencies [3bd2689] - @ai-sdk/provider@3.0.0-beta.26 - @ai-sdk/gateway@2.0.0-beta.74 - @ai-sdk/provider-utils@4.0.0-beta.45 ## 6.0.0-beta.138 ### Patch Changes - Updated dependencies [53f3368] - @ai-sdk/provider@3.0.0-beta.25 - @ai-sdk/gateway@2.0.0-beta.73 - @ai-sdk/provider-utils@4.0.0-beta.44 ## 6.0.0-beta.137 ### Patch Changes - 9ba4324: feat(ai): support SystemModelMessage[] in system and instructions properties ## 6.0.0-beta.136 ### Patch Changes - 3d83f38: chore(ai): improve addToolInputExamplesMiddleware ## 6.0.0-beta.135 ### Patch Changes - afe7093: feat: add middleware for tool input examples ## 6.0.0-beta.134 ### Patch Changes - 686103c: chore(ai): export ContentPart type ## 6.0.0-beta.133 ### Patch Changes - dce03c4: feat: tool input examples - Updated dependencies [dce03c4] - @ai-sdk/provider-utils@4.0.0-beta.43 - @ai-sdk/provider@3.0.0-beta.24 - @ai-sdk/gateway@2.0.0-beta.72 ## 6.0.0-beta.132 ### Patch Changes - af9dab3: fix(ai): remove unused mode setting from generateObject and streamObject ## 6.0.0-beta.131 ### Patch Changes - 3ed5519: chore: rename ToolCallOptions to ToolExecutionOptions - Updated dependencies [3ed5519] - @ai-sdk/provider-utils@4.0.0-beta.42 - @ai-sdk/gateway@2.0.0-beta.71 ## 6.0.0-beta.130 ### Patch Changes - 1bd7d32: feat: tool-specific strict mode - Updated dependencies [1bd7d32] - @ai-sdk/provider-utils@4.0.0-beta.41 - @ai-sdk/provider@3.0.0-beta.23 - @ai-sdk/gateway@2.0.0-beta.70 ## 6.0.0-beta.129 ### Patch Changes - 67a407c: chore(ai): add warning when using v2 models with AISDK v6 ## 6.0.0-beta.128 ### Patch Changes - Updated dependencies [b1624f0] - @ai-sdk/gateway@2.0.0-beta.69 ## 6.0.0-beta.127 ### Patch Changes - 614599a: chore(ai): deprecate generateObject and streamObject ## 6.0.0-beta.126 ### Patch Changes - b67d224: Fixes an issue where `providerMetadata` and `providerExecuted` were lost when tool input validation failed ## 6.0.0-beta.125 ### Patch Changes - 0d6c0d8: chore(ai): remove deprecated CodeMessage type and related types and functions ## 6.0.0-beta.124 ### Patch Changes - 544d4e8: chore(specification): rename v3 provider defined tool to provider tool - Updated dependencies [544d4e8] - @ai-sdk/provider-utils@4.0.0-beta.40 - @ai-sdk/provider@3.0.0-beta.22 - @ai-sdk/gateway@2.0.0-beta.68 ## 6.0.0-beta.123 ### Patch Changes - 954c356: feat(openai): allow custom names for provider-defined tools - Updated dependencies [954c356] - @ai-sdk/provider-utils@4.0.0-beta.39 - @ai-sdk/provider@3.0.0-beta.21 - @ai-sdk/gateway@2.0.0-beta.67 ## 6.0.0-beta.122 ### Patch Changes - 03849b0: move DelayedPromise into provider utils - Updated dependencies [03849b0] - @ai-sdk/provider-utils@4.0.0-beta.38 - @ai-sdk/gateway@2.0.0-beta.66 ## 6.0.0-beta.121 ### Patch Changes - Updated dependencies [cdd0bc2] - @ai-sdk/gateway@2.0.0-beta.65 ## 6.0.0-beta.120 ### Patch Changes - 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings - Updated dependencies [457318b] - @ai-sdk/provider@3.0.0-beta.20 - @ai-sdk/gateway@2.0.0-beta.64 - @ai-sdk/provider-utils@4.0.0-beta.37 ## 6.0.0-beta.119 ### Patch Changes - b59d924: feat(ai): support SystemModelMessage in system and instructions properties ## 6.0.0-beta.118 ### Patch Changes - 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3 Before ```ts model.textEmbeddingModel('my-model-id'); ``` After ```ts model.embeddingModel('my-model-id'); ``` - Updated dependencies [8d9e8ad] - @ai-sdk/provider@3.0.0-beta.19 - @ai-sdk/gateway@2.0.0-beta.63 - @ai-sdk/provider-utils@4.0.0-beta.36 ## 6.0.0-beta.117 ### Patch Changes - Updated dependencies [10d819b] - @ai-sdk/provider@3.0.0-beta.18 - @ai-sdk/gateway@2.0.0-beta.62 - @ai-sdk/provider-utils@4.0.0-beta.35 ## 6.0.0-beta.116 ### Patch Changes - 4ece5f9: feat(agent): add experimental_download to ToolLoopAgent ## 6.0.0-beta.115 ### Patch Changes - 7da02d2: fix(ai): prune messages properly when toolCalls set to 'before-last-message' ## 6.0.0-beta.114 ### Patch Changes - 69768c2: chore(ai): remove UI message reference from model message validation ## 6.0.0-beta.113 ### Patch Changes - 79a8e7f: feat(agent): support abortSignal in createAgentUIStream ## 6.0.0-beta.112 ### Patch Changes - e06b663: feat(agent): support experimental stream transforms ## 6.0.0-beta.111 ### Patch Changes - Updated dependencies [e8694af] - @ai-sdk/gateway@2.0.0-beta.61 ## 6.0.0-beta.110 ### Patch Changes - db913bd: fix(google): add thought signature to gemini 3 pro image parts - Updated dependencies [db913bd] - @ai-sdk/provider@3.0.0-beta.17 - @ai-sdk/gateway@2.0.0-beta.60 - @ai-sdk/provider-utils@4.0.0-beta.34 ## 6.0.0-beta.109 ### Patch Changes - 79ba99f: feat(agent): add message metadata support when inferring UI messages ## 6.0.0-beta.108 ### Patch Changes - Updated dependencies [5dd4c6a] - @ai-sdk/gateway@2.0.0-beta.59 ## 6.0.0-beta.107 ### Patch Changes - 8445d70: feat: export GatewayModelId and use to type LanguageModel ## 6.0.0-beta.106 ### Patch Changes - Updated dependencies [1425df5] - @ai-sdk/gateway@2.0.0-beta.58 ## 6.0.0-beta.105 ### Patch Changes - Updated dependencies [bca7e61] - @ai-sdk/gateway@2.0.0-beta.57 ## 6.0.0-beta.104 ### Patch Changes - 2d166e4: feat(provider/gateway): add support for image models - Updated dependencies [2d166e4] - @ai-sdk/gateway@2.0.0-beta.56 ## 6.0.0-beta.103 ### Patch Changes - Updated dependencies [cc5170d] - @ai-sdk/gateway@2.0.0-beta.55 ## 6.0.0-beta.102 ### Patch Changes - Updated dependencies [5f66123] - @ai-sdk/gateway@2.0.0-beta.54 ## 6.0.0-beta.101 ### Patch Changes - Updated dependencies [3782645] - @ai-sdk/gateway@2.0.0-beta.53 ## 6.0.0-beta.100 ### Patch Changes - 8370068: fix(provider/google): preserve thoughtSignature through tool execution ## 6.0.0-beta.99 ### Patch Changes - 384142c: feat(agent): add abortSignal parameter to generate and stream ## 6.0.0-beta.98 ### Patch Changes - b681d7d: feat: expose usage tokens for 'generateImage' function - Updated dependencies [b681d7d] - @ai-sdk/provider@3.0.0-beta.16 - @ai-sdk/gateway@2.0.0-beta.52 - @ai-sdk/provider-utils@4.0.0-beta.33 ## 6.0.0-beta.97 ### Patch Changes - Updated dependencies [32d8dbb] - @ai-sdk/provider-utils@4.0.0-beta.32 - @ai-sdk/gateway@2.0.0-beta.51 ## 6.0.0-beta.96 ### Patch Changes - a322efa: Added finishReason on useChat onFinish callbck ## 6.0.0-beta.95 ### Patch Changes - eb8d1cb: fix not catching of empty arrays in validateUIMessage ## 6.0.0-beta.94 ### Patch Changes - ab1087b: feat(ai): `chat.addToolResult()` is now `chat.addToolOutput()` ## 6.0.0-beta.93 ### Patch Changes - Updated dependencies [bb36798] - @ai-sdk/provider@3.0.0-beta.15 - @ai-sdk/gateway@2.0.0-beta.50 - @ai-sdk/provider-utils@4.0.0-beta.31 ## 6.0.0-beta.92 ### Patch Changes - 97b1d77: fix(ui): Don't resend messages for providerExecuted tools in lastAssistantMessageIsCompleteWithToolCalls and lastAssistantMessageIsCompleteWithApprovalResponses ## 6.0.0-beta.91 ### Patch Changes - Updated dependencies [4f16c37] - @ai-sdk/provider-utils@4.0.0-beta.30 - @ai-sdk/gateway@2.0.0-beta.49 ## 6.0.0-beta.90 ### Patch Changes - Updated dependencies [af3780b] - @ai-sdk/provider@3.0.0-beta.14 - @ai-sdk/gateway@2.0.0-beta.48 - @ai-sdk/provider-utils@4.0.0-beta.29 ## 6.0.0-beta.89 ### Patch Changes - d59ce25: fix(ai): do not mutate middleware array argument when wrapping ## 6.0.0-beta.88 ### Patch Changes - 22ef5c6: feat(ai): Output.text() is default output mode ## 6.0.0-beta.87 ### Patch Changes - ca13d26: feat(ai): add output to StreamTextResult ## 6.0.0-beta.86 ### Patch Changes - 36b175c: chore(ai): change output generics ## 6.0.0-beta.85 ### Patch Changes - Updated dependencies [96322b7] - @ai-sdk/gateway@2.0.0-beta.47 ## 6.0.0-beta.84 ### Patch Changes - Updated dependencies [016b111] - @ai-sdk/provider-utils@4.0.0-beta.28 - @ai-sdk/gateway@2.0.0-beta.46 ## 6.0.0-beta.83 ### Patch Changes - e1f6e8e: feat(ai): add Output.json() ## 6.0.0-beta.82 ### Patch Changes - 37c58a0: This release introduces `wrapEmbeddingModel`, a new helper that brings embedding model customization capabilities similar to `wrapLanguageModel`. - Updated dependencies [37c58a0] - @ai-sdk/provider@3.0.0-beta.13 - @ai-sdk/gateway@2.0.0-beta.45 - @ai-sdk/provider-utils@4.0.0-beta.27 ## 6.0.0-beta.81 ### Patch Changes - Updated dependencies [7d73922] - @ai-sdk/gateway@2.0.0-beta.44 ## 6.0.0-beta.80 ### Patch Changes - 9524761: chore(ai): rename relevanceScore to score ## 6.0.0-beta.79 ### Patch Changes - d1bdadb: Added experimental_rerank support - Updated dependencies [d1bdadb] - @ai-sdk/provider@3.0.0-beta.12 - @ai-sdk/gateway@2.0.0-beta.43 - @ai-sdk/provider-utils@4.0.0-beta.26 ## 6.0.0-beta.78 ### Patch Changes - Updated dependencies [4c44a5b] - @ai-sdk/provider@3.0.0-beta.11 - @ai-sdk/gateway@2.0.0-beta.42 - @ai-sdk/provider-utils@4.0.0-beta.25 ## 6.0.0-beta.77 ### Patch Changes - 0c3b58b: fix(provider): add specificationVersion to ProviderV3 - Updated dependencies [0c3b58b] - @ai-sdk/provider@3.0.0-beta.10 - @ai-sdk/gateway@2.0.0-beta.41 - @ai-sdk/provider-utils@4.0.0-beta.24 ## 6.0.0-beta.76 ### Patch Changes - a755db5: feat(ai): improve warnings with provider and model id - Updated dependencies [a755db5] - @ai-sdk/provider@3.0.0-beta.9 - @ai-sdk/gateway@2.0.0-beta.40 - @ai-sdk/provider-utils@4.0.0-beta.23 ## 6.0.0-beta.75 ### Patch Changes - 58920e0: fix(ai): do not drop custom headers in HttpChatTransport - 58920e0: refactor: consolidate header normalization across packages, remove duplicates, preserve custom headers - Updated dependencies [58920e0] - @ai-sdk/provider-utils@4.0.0-beta.22 - @ai-sdk/gateway@2.0.0-beta.39 ## 6.0.0-beta.74 ### Patch Changes - 293a6b7: Added a title to the tools - Updated dependencies [293a6b7] - @ai-sdk/provider-utils@4.0.0-beta.21 - @ai-sdk/gateway@2.0.0-beta.38 ## 6.0.0-beta.73 ### Patch Changes - 754df61: fix(ai): correct type field in arrayOutputStrategy from 'enum' to 'array' ## 6.0.0-beta.72 ### Patch Changes - eca63f3: feat(ai): add OAuth for MCP clients + refactor to new package This change replaces ```ts import { experimental_createMCPClient } from 'ai'; import { Experimental_StdioMCPTransport } from 'ai/mcp-stdio'; ``` with ```ts import { experimental_createMCPClient } from '@ai-sdk/mcp'; import { Experimental_StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio'; ``` ## 6.0.0-beta.71 ### Patch Changes - 077aea3: feat(ai): stable structured output on generateText, streamText, and ToolLoopAgent ## 6.0.0-beta.70 ### Patch Changes - d7bae86: feat(ai): add Output.choice() ## 6.0.0-beta.69 ### Patch Changes - d5b25ee: feat(ai): add Output.array() ## 6.0.0-beta.68 ### Patch Changes - 9b83947: feat(ai): add convertDataPart option to convertToModelMessages Add optional convertDataPart callback for converting custom data parts (URLs, code files, etc.) to text or file parts that models can process. Fully type-safe using existing UIMessage generics. ## 6.0.0-beta.67 ### Patch Changes - Updated dependencies [2b6a848] - @ai-sdk/gateway@2.0.0-beta.37 ## 6.0.0-beta.66 ### Patch Changes - fca786b: feat(agent): configurable call options - Updated dependencies [fca786b] - @ai-sdk/provider-utils@4.0.0-beta.20 - @ai-sdk/gateway@2.0.0-beta.36 ## 6.0.0-beta.65 ### Patch Changes - dce4e7b: chore(agent): rename system to instructions ## 6.0.0-beta.64 ### Patch Changes - 2d28066: chore(agent): limit agent call parameters ## 6.0.0-beta.63 ### Patch Changes - a7da2b6: feat(agent): change output generics ## 6.0.0-beta.62 ### Patch Changes - 95b77e2: feat(agent): extract createAgentUIStream, add pipeAgentUIStreamToResponse ## 6.0.0-beta.61 ### Patch Changes - c98373a: chore(agent): rename createAgentStreamResponse to createAgentUIStreamResponse ## 6.0.0-beta.60 ### Patch Changes - 2b49dae: feat(agent): support UIMessageStreamOptions in createAgentStreamResponse ## 6.0.0-beta.59 ### Patch Changes - e062079: chore(agent): move Agent.respond into createAgentStreamResponse function ## 6.0.0-beta.58 ### Patch Changes - a417a34: feat(agent): introduce version property ## 6.0.0-beta.57 ### Patch Changes - 61f7b0f: chore(agent): rename BasicAgent to ToolLoopAgent ## 6.0.0-beta.56 ### Patch Changes - 3794514: feat: flexible tool output content support - Updated dependencies [3794514] - @ai-sdk/provider-utils@4.0.0-beta.19 - @ai-sdk/provider@3.0.0-beta.8 - @ai-sdk/gateway@2.0.0-beta.35 ## 6.0.0-beta.55 ### Patch Changes - 42cf7ed: fix(agent): use tool.toModelOutput when available ## 6.0.0-beta.54 ### Patch Changes - 9388ff1: feat(ui): add isDataUIPart helper ## 6.0.0-beta.53 ### Patch Changes - Updated dependencies [2f8b0c8] - @ai-sdk/gateway@2.0.0-beta.34 ## 6.0.0-beta.52 ### Patch Changes - Updated dependencies [1890317] - @ai-sdk/gateway@2.0.0-beta.33 ## 6.0.0-beta.51 ### Patch Changes - 5e313e3: fix(agent): do not allow static tools when tools is empty ## 6.0.0-beta.50 ### Patch Changes - 4812235: fix(ai): add missing export for `LoadSettingError` - 81d4308: feat: provider-executed dynamic tools - Updated dependencies [81d4308] - @ai-sdk/provider@3.0.0-beta.7 - @ai-sdk/gateway@2.0.0-beta.32 - @ai-sdk/provider-utils@4.0.0-beta.18 ## 6.0.0-beta.49 ### Patch Changes - 703459a: feat: tool execution approval for dynamic tools - Updated dependencies [703459a] - @ai-sdk/provider-utils@4.0.0-beta.17 - @ai-sdk/gateway@2.0.0-beta.31 ## 6.0.0-beta.48 ### Patch Changes - 7f2c9b6: fix(ui): do not submit automatically when server return with error ## 6.0.0-beta.47 ### Patch Changes - c62ecf0: feat(ai): add support for v2 specs in transcription and speech models ## 6.0.0-beta.46 ### Patch Changes - Updated dependencies [0a2ff8a] - @ai-sdk/gateway@2.0.0-beta.30 ## 6.0.0-beta.45 ### Patch Changes - 48454ab: fix(ai): handle backpressure in `writeToServerResponse` ## 6.0.0-beta.44 ### Patch Changes - 2b1bf9d: feat(ai): add pruneMessages helper function ## 6.0.0-beta.43 ### Patch Changes - 27e8c3a: chore(ai): rename Agent to BasicAgent, introduce Agent interface ## 6.0.0-beta.42 ### Patch Changes - Updated dependencies [6306603] - @ai-sdk/provider-utils@4.0.0-beta.16 - @ai-sdk/gateway@2.0.0-beta.29 ## 6.0.0-beta.41 ### Patch Changes - Updated dependencies [f0b2157] - @ai-sdk/gateway@2.0.0-beta.28 - @ai-sdk/provider-utils@4.0.0-beta.15 ## 6.0.0-beta.40 ### Patch Changes - Updated dependencies [3b1d015] - @ai-sdk/provider-utils@4.0.0-beta.14 - @ai-sdk/gateway@2.0.0-beta.27 ## 6.0.0-beta.39 ### Patch Changes - f6f0c5a: chore: remove zod from ui packages ## 6.0.0-beta.38 ### Patch Changes - Updated dependencies [d116b4b] - @ai-sdk/provider-utils@4.0.0-beta.13 - @ai-sdk/gateway@2.0.0-beta.26 ## 6.0.0-beta.37 ### Patch Changes - Updated dependencies [7e32fea] - @ai-sdk/provider-utils@4.0.0-beta.12 - @ai-sdk/gateway@2.0.0-beta.25 ## 6.0.0-beta.36 ### Patch Changes - Updated dependencies [0e29b8b] - @ai-sdk/gateway@2.0.0-beta.24 ## 6.0.0-beta.35 ### Patch Changes - Updated dependencies [acc14d8] - @ai-sdk/gateway@2.0.0-beta.23 ## 6.0.0-beta.34 ### Patch Changes - bb10a89: fix(ai): mcp errors to be jsonrpc 2.0 compliant ## 6.0.0-beta.33 ### Patch Changes - f733285: fix(ai): only parse experimental_output in generateText when finishReason is stop ## 6.0.0-beta.32 ### Patch Changes - 7e4649f: fix(core): Fix image download behavior when the initial model is swapped out during prepareStep ## 6.0.0-beta.31 ### Patch Changes - 95f65c2: chore: use import \* from zod/v4 - 95f65c2: chore: load zod schemas lazily - Updated dependencies - @ai-sdk/provider-utils@4.0.0-beta.11 - @ai-sdk/gateway@2.0.0-beta.22 ## 6.0.0-beta.30 ### Patch Changes - Updated dependencies [7b1b1b1] - @ai-sdk/gateway@2.0.0-beta.21 ## 6.0.0-beta.29 ### Major Changes - dee8b05: ai SDK 6 beta ### Patch Changes - Updated dependencies [dee8b05] - @ai-sdk/gateway@2.0.0-beta.20 - @ai-sdk/provider@3.0.0-beta.6 - @ai-sdk/provider-utils@4.0.0-beta.10 ## 5.1.0-beta.28 ### Patch Changes - 521c537: feat(ai): Tool.needsApproval can be a function - Updated dependencies [521c537] - @ai-sdk/provider-utils@3.1.0-beta.9 - @ai-sdk/gateway@1.1.0-beta.19 ## 5.1.0-beta.27 ### Patch Changes - Updated dependencies [e06565c] - @ai-sdk/provider-utils@3.1.0-beta.8 - @ai-sdk/gateway@1.1.0-beta.18 ## 5.1.0-beta.26 ### Patch Changes - c99da05: feat(ai): add onFinish to Agent ## 5.1.0-beta.25 ### Patch Changes - 457f1c6: feat(ai): onFinish callback for generateText ## 5.1.0-beta.24 ### Patch Changes - 90e5bdd: chore(ai): restructure agent files ## 5.1.0-beta.23 ### Patch Changes - Updated dependencies [1d8ea2c] - @ai-sdk/gateway@1.1.0-beta.17 ## 5.1.0-beta.22 ### Patch Changes - 046aa3b: feat(provider): speech model v3 spec - e8109d3: feat: tool execution approval - a5e152d: fix(ai): back version support for V2 providers - 21e20c0: feat(provider): transcription model v3 spec - Updated dependencies - @ai-sdk/provider@2.1.0-beta.5 - @ai-sdk/provider-utils@3.1.0-beta.7 - @ai-sdk/gateway@1.1.0-beta.16 ## 5.1.0-beta.21 ### Patch Changes - Updated dependencies [ef62178] - @ai-sdk/gateway@1.1.0-beta.15 ## 5.1.0-beta.20 ### Patch Changes - 846e80e: fix(ai): bind functions for v2 -> v3 adapter - Updated dependencies [a90dca6] - @ai-sdk/gateway@1.1.0-beta.14 ## 5.1.0-beta.19 ### Patch Changes - aa0515c: feat(ai): move Agent to stable - e7d9b00: feat(agent): add optional name property to agent - b1aeea7: feat(ai): set default stopWhen on Agent to stepCountIs(20) ## 5.1.0-beta.18 ### Patch Changes - 0adc679: feat(provider): shared spec v3 - 9b8d17e: fix(agent): move provider options to main agent config - Updated dependencies - @ai-sdk/provider-utils@3.1.0-beta.6 - @ai-sdk/provider@2.1.0-beta.4 - @ai-sdk/gateway@1.1.0-beta.13 ## 5.1.0-beta.17 ### Patch Changes - Updated dependencies [e6bfe91] - @ai-sdk/gateway@1.1.0-beta.12 ## 5.1.0-beta.16 ### Patch Changes - 14ca35d: feat: add support for v2 specs - Updated dependencies [636e614] - @ai-sdk/gateway@1.1.0-beta.11 ## 5.1.0-beta.15 ### Patch Changes - Updated dependencies [9f6149e] - @ai-sdk/gateway@1.1.0-beta.10 ## 5.1.0-beta.14 ### Patch Changes - 7c3c216: fixed docs and exported NoSpeechGeneratedError - 8dac895: feat: `LanguageModelV3` - e0d1ea9: fix(ai): align logic of text-end with reasoning-end - 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies - Updated dependencies [8dac895] - @ai-sdk/provider-utils@3.1.0-beta.5 - @ai-sdk/provider@2.1.0-beta.3 - @ai-sdk/gateway@1.1.0-beta.9 ## 5.1.0-beta.13 ### Patch Changes - 1c2a4c1: fix(ai): remove outdated jsdoc param descriptions ## 5.1.0-beta.12 ### Patch Changes - Updated dependencies [c823faf] - @ai-sdk/gateway@1.1.0-beta.8 ## 5.1.0-beta.11 ### Patch Changes - 4616b86: chore: update zod peer depenedency version - Updated dependencies [4616b86] - @ai-sdk/provider-utils@3.1.0-beta.4 - @ai-sdk/gateway@1.1.0-beta.7 ## 5.1.0-beta.10 ### Patch Changes - 8c98371: Extend addToolResult to support error results ## 5.1.0-beta.9 ### Patch Changes - ed329cb: feat: `Provider-V3` - 177b475: fix(ai): download files when intermediate file cannot be downloaded - 522f6b8: feat: `ImageModelV3` - Updated dependencies - @ai-sdk/gateway@1.1.0-beta.6 - @ai-sdk/provider@2.1.0-beta.2 - @ai-sdk/provider-utils@3.1.0-beta.3 ## 5.1.0-beta.8 ### Patch Changes - 7eca093: fix(ai): update `uiMessageChunkSchema` to satisfy the `UIMessageChunk` type ## 5.1.0-beta.7 ### Patch Changes - 5a4e732: Export `parseJsonEventStream` and `uiMessageChunkSchema` from "ai" package ## 5.1.0-beta.6 ### Patch Changes - 0c4822d: feat: `EmbeddingModelV3` - Updated dependencies - @ai-sdk/gateway@1.1.0-beta.5 - @ai-sdk/provider@2.1.0-beta.1 - @ai-sdk/provider-utils@3.1.0-beta.2 ## 5.1.0-beta.5 ### Patch Changes - Updated dependencies - @ai-sdk/gateway@1.1.0-beta.4 ## 5.1.0-beta.4 ### Patch Changes - Updated dependencies [ea9ca31] - @ai-sdk/gateway@1.1.0-beta.3 ## 5.1.0-beta.3 ### Patch Changes - Updated dependencies - @ai-sdk/gateway@1.1.0-beta.2 ## 5.1.0-beta.2 ### Patch Changes - Updated dependencies - @ai-sdk/test-server@1.0.0-beta.0 - @ai-sdk/provider-utils@3.1.0-beta.1 - @ai-sdk/gateway@1.1.0-beta.1 ## 5.1.0-beta.1 ### Patch Changes - a7f6f81: Add safeValidateUIMessages utility to validate UI messages without throwing, returning a success/failure result object like Zod’s safeParse ## 5.1.0-beta.0 ### Minor Changes - 78928cb: release: start 5.1 beta ### Patch Changes - Updated dependencies [78928cb] - @ai-sdk/gateway@1.1.0-beta.0 - @ai-sdk/provider@2.1.0-beta.0 - @ai-sdk/provider-utils@3.1.0-beta.0 ## 5.0.45 ### Patch Changes - 76024fc: fix(ai): fix static tool call and result detection when dynamic is undefined - 93d8b60: fix(ai): do not filter zero-length text parts that have provider options - d8eb31f: fix(ai): fix webp image detection from base64 ## 5.0.44 ### Patch Changes - Updated dependencies [f49f924] - @ai-sdk/gateway@1.0.23 ## 5.0.43 ### Patch Changes - 0294b58: feat(ai): set `ai`, `@ai-sdk/provider-utils`, and runtime in `user-agent` header - Updated dependencies [0294b58] - @ai-sdk/provider-utils@3.0.9 - @ai-sdk/gateway@1.0.22 ## 5.0.42 ### Patch Changes - de5c066: fix(ai): forwarded providerExecuted flag in validateUIMessages ## 5.0.41 ### Patch Changes - cd91e4b: fix(ai): use correct type for reasoning outputs ## 5.0.40 ### Patch Changes - Updated dependencies [4ee3719] - @ai-sdk/gateway@1.0.21 ## 5.0.39 ### Patch Changes - a0a725f: feat (ai): export createGateway ## 5.0.38 ### Patch Changes - Updated dependencies [350a328] - @ai-sdk/gateway@1.0.20 ## 5.0.37 ### Patch Changes - d6785d7: feat (ai): add tool and agent helpers ## 5.0.36 ### Patch Changes - ccc2ded: feat (ai): export gateway provider ## 5.0.35 ### Patch Changes - 99c946a: export missing type ## 5.0.34 ### Patch Changes - Updated dependencies - @ai-sdk/gateway@1.0.19 ## 5.0.33 ### Patch Changes - Updated dependencies [5d59a8c] - @ai-sdk/gateway@1.0.18 ## 5.0.32 ### Patch Changes - Updated dependencies [b6005cd] - @ai-sdk/gateway@1.0.17 ## 5.0.31 ### Patch Changes - Updated dependencies [99964ed] - @ai-sdk/provider-utils@3.0.8 - @ai-sdk/gateway@1.0.16 ## 5.0.30 ### Patch Changes - 7fcc6be: feat(ai): throw InvalidArgumentError when messages is not provided ## 5.0.29 ### Patch Changes - e0e9449: feat(ui): sent isAbort, isDisconnect, isError in useChat onFinish callback ## 5.0.28 ### Patch Changes - 4b81e7d: fix(ai): remove vitest dependency from test exports - d68a4f2: feat(ai): log warnings ## 5.0.27 ### Patch Changes - ca40fac: feat(ai): support custom download functions (experimental) ## 5.0.26 ### Patch Changes - 33cf848: feat(ai): pass messages to `useChat({ onFinish })` - Updated dependencies - @ai-sdk/gateway@1.0.15 ## 5.0.25 ### Patch Changes - ca65923: fix(ai): remove use of `expect()` from production code - Updated dependencies [886e7cd] - @ai-sdk/provider-utils@3.0.7 - @ai-sdk/gateway@1.0.14 ## 5.0.24 ### Patch Changes - f8f3682: fix: call onFinish when stream is cancelled in toUIMessageStream Previously, onFinish was only called on normal stream completion. Now it's also called when the reader is cancelled (e.g., browser close, navigation), ensuring partial messages are persisted. - Updated dependencies - @ai-sdk/provider-utils@3.0.6 - @ai-sdk/gateway@1.0.13 ## 5.0.23 ### Patch Changes - 5099b3d: fix(ai): make `chat.addToolResult()` compatible with dynamic tool calls - 7a2bf8d: fix(ai): support loop breaking behavior in async iterable stream - Updated dependencies - @ai-sdk/gateway@1.0.12 ## 5.0.22 ### Patch Changes - Updated dependencies - @ai-sdk/gateway@1.0.11 ## 5.0.21 ### Patch Changes - 581abea: fix(ai): call abort callback when stream is aborted during tool execution - 3c178ec: feat(ai): improved type checking for prompt/messages input - Updated dependencies [0857788] - @ai-sdk/provider-utils@3.0.5 - @ai-sdk/gateway@1.0.10 ## 5.0.20 ### Patch Changes - 8a87693: fix(ai) Make sure warnings promise in streamObject is resolved and properly collects and passes warnings ## 5.0.19 ### Patch Changes - 8da6e9c: fix(ai): use parsed tool input if possible when validation fails ## 5.0.18 ### Patch Changes - Updated dependencies [8b96f99] - @ai-sdk/gateway@1.0.9 ## 5.0.17 ### Patch Changes - 4176ecb: feat(ai): add reasoning text to generateObject result - 20f23f9: feat(ai): export LanguageModelMiddleware type ## 5.0.16 ### Patch Changes - Updated dependencies [68751f9] - @ai-sdk/provider-utils@3.0.4 - @ai-sdk/gateway@1.0.8 ## 5.0.15 ### Patch Changes - ca4f68f: feat(ai): add validateUIMessages function - Updated dependencies [28a4006] - @ai-sdk/gateway@1.0.7 ## 5.0.14 ### Patch Changes - 7729e32: fix(ai): expand mp3 detection to support all mpeg frame headers ## 5.0.13 ### Patch Changes - a7b2e66: Added providerOptions to agent stream and generate calls - 9bed210: ### `extractReasoningMiddleware()`: delay sending `text-start` chunk to prevent rendering final text before reasoning When wrapping a text stream in `extractReasoningMiddleware()`, delay queing the `text-start` chunk until either `reasoning-start` chunk was queued or the first `text-delta` chunk is about to be queued, whichever comes first. https://github.com/vercel/ai/pull/8036 ## 5.0.12 ### Patch Changes - Updated dependencies - @ai-sdk/gateway@1.0.6 - @ai-sdk/provider-utils@3.0.3 ## 5.0.11 ### Patch Changes - 38ac190: feat(ai): preliminary tool results - e3a63cb: fix(ai): streamText promises reject when stream has errors - Updated dependencies - @ai-sdk/provider-utils@3.0.2 - @ai-sdk/gateway@1.0.5 ## 5.0.10 ### Patch Changes - 63a5dc5: fix(ai): convert user message text/file part provider metadata in convertToModelMessages ## 5.0.9 ### Patch Changes - afd5c2a: fix(ai): preserve filename for file parts in convertToModelMessages ## 5.0.8 ### Patch Changes - Updated dependencies [35f93ce] - @ai-sdk/gateway@1.0.4 ## 5.0.7 ### Patch Changes - 8e72304: fix (ai): handle invalid tool calls ## 5.0.6 ### Patch Changes - d983eee: feat(ai): allow passing model string for embeddings ## 5.0.5 ### Patch Changes - Updated dependencies [893aed6] - @ai-sdk/gateway@1.0.3 ## 5.0.4 ### Patch Changes - Updated dependencies [444df49] - @ai-sdk/gateway@1.0.2 ## 5.0.3 ### Patch Changes - 90d212f: feat (ai): add experimental tool call context - Updated dependencies - @ai-sdk/gateway@1.0.1 - @ai-sdk/provider-utils@3.0.1 ## 5.0.2 ### Patch Changes - 401d73e: fix (ai): support dynamic tool calls in lastAssistantMessageIsCompleteWithToolCalls - 69fde99: Set status to ready when reconnect stream is null ## 5.0.1 ### Patch Changes - 4d0c108: fix(ai/ui): convert provider metadata for system messages to model messages ## 5.0.0 ### Major Changes - e1cbf8a: chore(@ai-sdk/rsc): extract to separate package - a847c3e: chore: rename reasoning to reasoningText etc - 13fef90: chore (ai): remove automatic conversion of UI messages to model messages - d964901: - remove setting temperature to `0` by default - remove `null` option from `DefaultSettingsMiddleware` - remove setting defaults for `temperature` and `stopSequences` in `ai` to enable middleware changes - 0a710d8: feat (ui): typed tool parts in ui messages - 9ad0484: feat (ai): automatic tool execution error handling - 63f9e9b: chore (provider,ai): tools have input/output instead of args,result - ab7ccef: chore (ai): change source ui message parts to source-url - d5f588f: AI SDK 5 - ec78cdc: chore (ai): remove "data" UIMessage role - 6a83f7d: refactoring (ai): restructure message metadata transfer - db345da: chore (ai): remove exports of internal ui functions - 496bbc1: chore (ui): inline/remove ChatRequest type - 72d7d72: chore (ai): stable activeTools - 40acf9b: feat (ui): introduce ChatStore and ChatTransport - 98f25e5: chore (ui): remove managed chat inputs - 2d03e19: chore (ai): remove StreamCallbacks.onCompletion - da70d79: chore (ai): remove getUIText helper - c60f895: chore (ai): remove useChat keepLastMessageOnError - 0560977: chore (ai): improve consistency of generate text result, stream text result, and step result - 9477ebb: chore (ui): remove useAssistant hook (**breaking change**) - 1f55c21: chore (ai): send reasoning to the client by default - e7dc6c7: chore (ai): remove onResponse callback - 8b86e99: chore (ai): replace `Message` with `UIMessage` - 04d5063: chore (ai): rename default provider global to AI_SDK_DEFAULT_PROVIDER - 319b989: chore (ai): remove content from ui messages - 14c9410: chore: refactor file towards source pattern (spec) - a34eb39: chore (ai): remove `data` and `allowEmptySubmit` from `ChatRequestOptions` - f04fb4a: chore (ai): replace useChat attachments with file ui parts - f7e8bf4: chore (ai): flatten ui message stream parts - 257224b: chore (ai): separate TextStreamChatTransport - fd1924b: chore (ai): remove redundant `mimeType` property - 2524fc7: chore (ai): remove ui message toolInvocations property - 6fba4c7: chore (ai): remove deprecated experimental_providerMetadata - b4b4bb2: chore (ui): rename experimental_resume to resumeStream - 441d042: chore (ui): data stream protocol v2 with SSEs - ef256ed: chore (ai): refactor and use chatstore in svelte - 516be5b: ### Move Image Model Settings into generate options Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`. Before ```js await generateImage({ model: luma.image('photon-flash-1', { maxImagesPerCall: 5, pollIntervalMillis: 500, }), prompt, n: 10, }); ``` After ```js await generateImage({ model: luma.image('photon-flash-1'), prompt, n: 10, maxImagesPerCall: 5, providerOptions: { luma: { pollIntervalMillis: 5 }, }, }); ``` Pull Request: https://github.com/vercel/ai/pull/6180 - a662dea: chore (ai): remove sendExtraMessageFields - d884051: feat (ai): simplify default provider setup - e8324c5: feat (ai): add args callbacks to tools - fafc3f2: chore (ai): change file to parts to use urls instead of data - 1ed0287: chore (ai): stable sendStart/sendFinish options - c7710a9: chore (ai): rename DataStreamToSSETransformStream to JsonToSseTransformStream - bfbfc4c: feat (ai): streamText/generateText: totalUsage contains usage for all steps. usage is for a single step. - 9ae327d: chore (ui): replace chat store concept with chat instances - 9315076: chore (ai): rename continueUntil to stopWhen. Rename maxSteps stop condition to stepCountIs. - 247ee0c: chore (ai): remove steps from tool invocation ui parts - 109c0ac: chore (ai): rename id to chatId (in post request, resume request, and useChat) - 954aa73: feat (ui): extended regenerate support - 33eb499: feat (ai): inject message id in createUIMessageStream - 901df02: feat (ui): use UI_MESSAGE generic - 4892798: chore (ai): always stream tool calls - c25cbce: feat (ai): use console.error as default error handler for streamText and streamObject - b33ed7a: chore (ai): rename DataStream* to UIMessage* - ed675de: feat (ai): add ui data parts - 7bb58d4: chore (ai): restructure prepareRequest - ea7a7c9: feat (ui): UI message metadata - 0463011: fix (ai): update source url stream part - dcc549b: remove StreamTextResult.mergeIntoDataStream method rename DataStreamOptions.getErrorMessage to onError add pipeTextStreamToResponse function add createTextStreamResponse function change createDataStreamResponse function to accept a DataStream and not a DataStreamWriter change pipeDataStreamToResponse function to accept a DataStream and not a DataStreamWriter change pipeDataStreamToResponse function to have a single parameter - 35fc02c: chore (ui): rename RequestOptions to CompletionRequestOptions - 64f6d64: feat (ai): replace maxSteps with continueUntil (generateText) - 175b868: chore (ai): rename reasoning UI parts 'reasoning' property to 'text' - 60e2c56: feat (ai): restructure chat transports - 765f1cd: chore (ai): remove deprecated useChat isLoading helper - cb2b53a: chore (ai): refactor header preparation - e244a78: chore (ai): remove StreamData and mergeStreams - d306260: feat (ai): replace maxSteps with continueUntil (streamText) - 4bfe9ec: chore (ai): remove ui message reasoning property - 1766ede: chore: rename maxTokens to maxOutputTokens - 2877a74: chore (ai): remove ui message data property - 1409e13: chore (ai): remove experimental continueSteps - b32e192: chore (ai): rename reasoning to reasoningText, rename reasoningDetails to reasoning (streamText, generateText) - 92cb0a2: chore (ai): rename CoreMessage to ModelMessage - 2b637d6: chore (ai): rename UIMessageStreamPart to UIMessageChunk ### Minor Changes - b7eae2d: feat (core): Add finishReason field to NoObjectGeneratedError - bcea599: feat (ai): add content to generateText result - 48d675a: feat (ai): add content to streamText result - c9ad635: feat (ai): add filename to file ui parts ### Patch Changes - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils - de2d2ab: feat(ai): add provider and provider registry middleware functionality - c22ad54: feat(smooth-stream): chunking callbacks - d88455d: feat (ai): expose http chat transport type - e7fcc86: feat (ai): introduce dynamic tools - da1e6f0: feat (ui): add generics to ui message stream parts - 48378b9: fix (ai): send null as tool output when tools return undefined - 5d1e3ba: chore (ai): remove provider re-exports - 93d53a1: chore (ai): remove cli - e90d45d: chore (rsc): move HANGING_STREAM_WARNING_TIME constant into @ai-sdk/rsc package - b32c141: feat (ai): add array support to stopWhen - bc3109f: chore (ai): push stream-callbacks into langchain/llamaindex adapters - 0d9583c: fix (ai): use user-provided media type when available - 38ae5cc: feat (ai): export InferUIMessageChunk type - 10b21eb: feat(cli): add ai command line interface - 9e40cbe: Allow destructuring output and errorText on `ToolUIPart` type - 6909543: feat (ai): support system parameter in Agent constructor - 86cfc72: feat (ai): add ignoreIncompleteToolCalls option to convertToModelMessages - 377bbcf: fix (ui): tool input can be undefined during input-streaming - d8aeaef: feat(providers/fal): add transcribe - ae77a99: chore (ai): rename text and reasoning chunks in streamText fullstream - 4fef487: feat: support for zod v4 for schema validation All these me