ai 5.0.0-canary.9 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,1311 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - e1cbf8a: chore(@ai-sdk/rsc): extract to separate package
8
+ - a847c3e: chore: rename reasoning to reasoningText etc
9
+ - 13fef90: chore (ai): remove automatic conversion of UI messages to model messages
10
+ - d964901: - remove setting temperature to `0` by default
11
+ - remove `null` option from `DefaultSettingsMiddleware`
12
+ - remove setting defaults for `temperature` and `stopSequences` in `ai` to enable middleware changes
13
+ - 0a710d8: feat (ui): typed tool parts in ui messages
14
+ - 9ad0484: feat (ai): automatic tool execution error handling
15
+ - 63f9e9b: chore (provider,ai): tools have input/output instead of args,result
16
+ - ab7ccef: chore (ai): change source ui message parts to source-url
17
+ - d5f588f: AI SDK 5
18
+ - ec78cdc: chore (ai): remove "data" UIMessage role
19
+ - 6a83f7d: refactoring (ai): restructure message metadata transfer
20
+ - db345da: chore (ai): remove exports of internal ui functions
21
+ - 496bbc1: chore (ui): inline/remove ChatRequest type
22
+ - 72d7d72: chore (ai): stable activeTools
23
+ - 40acf9b: feat (ui): introduce ChatStore and ChatTransport
24
+ - 98f25e5: chore (ui): remove managed chat inputs
25
+ - 2d03e19: chore (ai): remove StreamCallbacks.onCompletion
26
+ - da70d79: chore (ai): remove getUIText helper
27
+ - c60f895: chore (ai): remove useChat keepLastMessageOnError
28
+ - 0560977: chore (ai): improve consistency of generate text result, stream text result, and step result
29
+ - 9477ebb: chore (ui): remove useAssistant hook (**breaking change**)
30
+ - 1f55c21: chore (ai): send reasoning to the client by default
31
+ - e7dc6c7: chore (ai): remove onResponse callback
32
+ - 8b86e99: chore (ai): replace `Message` with `UIMessage`
33
+ - 04d5063: chore (ai): rename default provider global to AI_SDK_DEFAULT_PROVIDER
34
+ - 319b989: chore (ai): remove content from ui messages
35
+ - 14c9410: chore: refactor file towards source pattern (spec)
36
+ - a34eb39: chore (ai): remove `data` and `allowEmptySubmit` from `ChatRequestOptions`
37
+ - f04fb4a: chore (ai): replace useChat attachments with file ui parts
38
+ - f7e8bf4: chore (ai): flatten ui message stream parts
39
+ - 257224b: chore (ai): separate TextStreamChatTransport
40
+ - fd1924b: chore (ai): remove redundant `mimeType` property
41
+ - 2524fc7: chore (ai): remove ui message toolInvocations property
42
+ - 6fba4c7: chore (ai): remove deprecated experimental_providerMetadata
43
+ - b4b4bb2: chore (ui): rename experimental_resume to resumeStream
44
+ - 441d042: chore (ui): data stream protocol v2 with SSEs
45
+ - ef256ed: chore (ai): refactor and use chatstore in svelte
46
+ - 516be5b: ### Move Image Model Settings into generate options
47
+
48
+ Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
49
+
50
+ Before
51
+
52
+ ```js
53
+ await generateImage({
54
+ model: luma.image('photon-flash-1', {
55
+ maxImagesPerCall: 5,
56
+ pollIntervalMillis: 500,
57
+ }),
58
+ prompt,
59
+ n: 10,
60
+ });
61
+ ```
62
+
63
+ After
64
+
65
+ ```js
66
+ await generateImage({
67
+ model: luma.image('photon-flash-1'),
68
+ prompt,
69
+ n: 10,
70
+ maxImagesPerCall: 5,
71
+ providerOptions: {
72
+ luma: { pollIntervalMillis: 5 },
73
+ },
74
+ });
75
+ ```
76
+
77
+ Pull Request: https://github.com/vercel/ai/pull/6180
78
+
79
+ - a662dea: chore (ai): remove sendExtraMessageFields
80
+ - d884051: feat (ai): simplify default provider setup
81
+ - e8324c5: feat (ai): add args callbacks to tools
82
+ - fafc3f2: chore (ai): change file to parts to use urls instead of data
83
+ - 1ed0287: chore (ai): stable sendStart/sendFinish options
84
+ - c7710a9: chore (ai): rename DataStreamToSSETransformStream to JsonToSseTransformStream
85
+ - bfbfc4c: feat (ai): streamText/generateText: totalUsage contains usage for all steps. usage is for a single step.
86
+ - 9ae327d: chore (ui): replace chat store concept with chat instances
87
+ - 9315076: chore (ai): rename continueUntil to stopWhen. Rename maxSteps stop condition to stepCountIs.
88
+ - 247ee0c: chore (ai): remove steps from tool invocation ui parts
89
+ - 109c0ac: chore (ai): rename id to chatId (in post request, resume request, and useChat)
90
+ - 954aa73: feat (ui): extended regenerate support
91
+ - 33eb499: feat (ai): inject message id in createUIMessageStream
92
+ - 901df02: feat (ui): use UI_MESSAGE generic
93
+ - 4892798: chore (ai): always stream tool calls
94
+ - c25cbce: feat (ai): use console.error as default error handler for streamText and streamObject
95
+ - b33ed7a: chore (ai): rename DataStream* to UIMessage*
96
+ - ed675de: feat (ai): add ui data parts
97
+ - 7bb58d4: chore (ai): restructure prepareRequest
98
+ - ea7a7c9: feat (ui): UI message metadata
99
+ - 0463011: fix (ai): update source url stream part
100
+ - dcc549b: remove StreamTextResult.mergeIntoDataStream method
101
+ rename DataStreamOptions.getErrorMessage to onError
102
+ add pipeTextStreamToResponse function
103
+ add createTextStreamResponse function
104
+ change createDataStreamResponse function to accept a DataStream and not a DataStreamWriter
105
+ change pipeDataStreamToResponse function to accept a DataStream and not a DataStreamWriter
106
+ change pipeDataStreamToResponse function to have a single parameter
107
+ - 35fc02c: chore (ui): rename RequestOptions to CompletionRequestOptions
108
+ - 64f6d64: feat (ai): replace maxSteps with continueUntil (generateText)
109
+ - 175b868: chore (ai): rename reasoning UI parts 'reasoning' property to 'text'
110
+ - 60e2c56: feat (ai): restructure chat transports
111
+ - 765f1cd: chore (ai): remove deprecated useChat isLoading helper
112
+ - cb2b53a: chore (ai): refactor header preparation
113
+ - e244a78: chore (ai): remove StreamData and mergeStreams
114
+ - d306260: feat (ai): replace maxSteps with continueUntil (streamText)
115
+ - 4bfe9ec: chore (ai): remove ui message reasoning property
116
+ - 1766ede: chore: rename maxTokens to maxOutputTokens
117
+ - 2877a74: chore (ai): remove ui message data property
118
+ - 1409e13: chore (ai): remove experimental continueSteps
119
+ - b32e192: chore (ai): rename reasoning to reasoningText, rename reasoningDetails to reasoning (streamText, generateText)
120
+ - 92cb0a2: chore (ai): rename CoreMessage to ModelMessage
121
+ - 2b637d6: chore (ai): rename UIMessageStreamPart to UIMessageChunk
122
+
123
+ ### Minor Changes
124
+
125
+ - b7eae2d: feat (core): Add finishReason field to NoObjectGeneratedError
126
+ - bcea599: feat (ai): add content to generateText result
127
+ - 48d675a: feat (ai): add content to streamText result
128
+ - c9ad635: feat (ai): add filename to file ui parts
129
+
130
+ ### Patch Changes
131
+
132
+ - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils
133
+ - de2d2ab: feat(ai): add provider and provider registry middleware functionality
134
+ - c22ad54: feat(smooth-stream): chunking callbacks
135
+ - d88455d: feat (ai): expose http chat transport type
136
+ - e7fcc86: feat (ai): introduce dynamic tools
137
+ - da1e6f0: feat (ui): add generics to ui message stream parts
138
+ - 48378b9: fix (ai): send null as tool output when tools return undefined
139
+ - 5d1e3ba: chore (ai): remove provider re-exports
140
+ - 93d53a1: chore (ai): remove cli
141
+ - e90d45d: chore (rsc): move HANGING_STREAM_WARNING_TIME constant into @ai-sdk/rsc package
142
+ - b32c141: feat (ai): add array support to stopWhen
143
+ - bc3109f: chore (ai): push stream-callbacks into langchain/llamaindex adapters
144
+ - 0d9583c: fix (ai): use user-provided media type when available
145
+ - 38ae5cc: feat (ai): export InferUIMessageChunk type
146
+ - 10b21eb: feat(cli): add ai command line interface
147
+ - 9e40cbe: Allow destructuring output and errorText on `ToolUIPart` type
148
+ - 6909543: feat (ai): support system parameter in Agent constructor
149
+ - 86cfc72: feat (ai): add ignoreIncompleteToolCalls option to convertToModelMessages
150
+ - 377bbcf: fix (ui): tool input can be undefined during input-streaming
151
+ - d8aeaef: feat(providers/fal): add transcribe
152
+ - ae77a99: chore (ai): rename text and reasoning chunks in streamText fullstream
153
+ - 4fef487: feat: support for zod v4 for schema validation
154
+
155
+ All these methods now accept both a zod v4 and zod v3 schemas for validation:
156
+
157
+ - `generateObject()`
158
+ - `streamObject()`
159
+ - `generateText()`
160
+ - `experimental_useObject()` from `@ai-sdk/react`
161
+ - `streamUI()` from `@ai-sdk/rsc`
162
+
163
+ - b1e3abd: feat (ai): expose ui message stream headers
164
+ - 4f3e637: fix (ui): avoid caching globalThis.fetch in case it is patched by other libraries
165
+ - 14cb3be: chore(providers/llamaindex): extract to separate package
166
+ - 1f6ce57: feat (ai): infer tool call types in the `onToolCall` callback
167
+ - 16ccfb2: feat (ai): add readUIMessageStream helper
168
+ - 225f087: fix (ai/mcp): prevent mutation of customEnv
169
+ - ce1d1f3: feat (ai): export mock image, speech, and transcription models
170
+ - fc0380b: feat (ui): resolvable header, body, credentials in http chat transport
171
+ - 6622441: feat (ai): add static/dynamic toolCalls/toolResults helpers
172
+ - 4048ce3: fix (ai): add tests and examples for openai responses
173
+ - 6c42e56: feat (ai): validate ui stream data chunks
174
+ - bedb239: chore (ai): make ui stream parts value optional when it's not required
175
+ - 9b4d074: feat(streamObject): add enum support
176
+ - c8fce91: feat (ai): add experimental Agent abstraction
177
+ - 655cf3c: feat (ui): add onFinish to createUIMessageStream
178
+ - 3e10408: fix(utils/detect-mimetype): add support for detecting id3 tags
179
+ - d5ae088: feat (ui): add sendAutomaticallyWhen to Chat
180
+ - ced8eee: feat(ai): re-export zodSchema from main package
181
+ - c040e2f: fix (ui): inject generated response message id
182
+ - d3960e3: selectTelemetryAttributes more robustness
183
+ - faea29f: fix (provider/openai): multi-step reasoning with text
184
+ - 66af894: fix (ai): respect content order in toResponseMessages
185
+ - 332167b: chore (ai): move maxSteps into UseChatOptions
186
+ - 6b1c55c: feat (ai): introduce GLOBAL_DEFAULT_PROVIDER
187
+ - 5a975a4: feat (ui): update Chat tool result submission
188
+ - 507ac1d: fix (ui/react): update messages immediately with the submitted user message
189
+ - a166433: feat: add transcription with experimental_transcribe
190
+ - 26735b5: chore(embedding-model): add v2 interface
191
+ - c93a8bc: chore(ai): export AsyncIterableStream type from async-iterable-stream module
192
+ - 0d2c085: feat (ai): support string model ids through gateway
193
+ - 2b9bbcd: feat (ai): improve prompt validation error message
194
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
195
+ - 75c3396: fix (ai): handle errors in 2nd streamText doStream call
196
+ - cb9c9e4: remove deprecated `experimental_wrapLanguageModel`
197
+ - 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
198
+ - 9b0da33: fix (ai): do not send id with start unless specified
199
+ - 28ad69e: fix(react-native): support experimental_attachments without FileList global
200
+ - 0b78e17: chore(ai/generateObject): simplify function signature
201
+ - 20398f2: feat: ai sdk cli documentation + adjusted default model
202
+ - 66962ed: fix(packages): export node10 compatible types
203
+ - b71fe8d: fix(ai): remove jsondiffpatch dependency
204
+ - 7827a49: fix (ai/core): refactor `toResponseMessages` to filter out empty string/content
205
+ - bd8a36c: feat(embedding-model-v2/embedMany): add response body field
206
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
207
+ - b346545: feat (ai): add data ui part schemas
208
+ - 05d2819: feat: allow zod 4.x as peer dependency
209
+ - f2b041e: Fix custom `fetch` in HttpChatTransport
210
+ - 2a62513: Fix error thrown when emptying messages in onError or onFinish
211
+ - 143c55b: feat (ai): export Chat callback types
212
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
213
+ - 904fa5e: feat (ai/core): add terminateOnError option to readUIMessageStream
214
+ - 0a87932: core (ai): change transcription model mimeType to mediaType
215
+ - 1675396: fix: avoid job executor deadlock when adding tool result
216
+ - 51f497d: feat (ai): step input message modification in prepareStep
217
+ - cee64b2: fix(otel): change back toolCall attributes of input/output back to args/result for compatibility
218
+ - f04ffe4: feat (ui): add onData callback to Chat
219
+ - bc24722: feat (ai): Add finishReason as a promise on StreamObjectResult to match StreamTextResult
220
+ - b6f9f3c: remove deprecated `CoreTool*` types
221
+ - 8aa9e20: feat: add speech with experimental_generateSpeech
222
+ - 4617fab: chore(embedding-models): remove remaining settings
223
+ - 8255639: ### Fix use with Google APIs + zod v4's `.literal()` schema
224
+
225
+ Before [zod@3.25.49](https://github.com/colinhacks/zod/releases/tag/v3.25.49), requests to Google's APIs failed due to a missing `type` in the provided schema. The problem has been resolved for the `ai` SDK by bumping our `zod` peer dependencies to `^3.25.49`.
226
+
227
+ pull request: https://github.com/vercel/ai/pull/6609
228
+
229
+ - f81c720: chore(ai): bundle dependencies in CLI binary
230
+ - cf9af6e: feat (ai): allow sync prepareStep
231
+ - ee38081: Add support for audio/webm to detect-media-type
232
+ - 2e4f9e4: feat (ai): improved error messages when using gateway
233
+ - 3e3b9df: fix (ai/mcp): better support for zero-argument MCP tools
234
+ - cda32ba: fix (ai): send `start` part in correct position in stream (streamText)
235
+ - 48a7606: feat (ai): support changing the system prompt in prepareSteps
236
+ - cb68df0: feat: add transcription and speech model support to provider registry
237
+ - db64cbe: fix (provider/openai): multi-step reasoning with tool calls
238
+ - 97c35c0: feat (ui): transient data parts
239
+ - 26695a3: feat (ui): add state for text and reasoning ui message parts
240
+ - 90ac328: fix (ui): tool part metadata support in ui messages
241
+ - 60132dd: fixed date formatting for updated mcp protocol version
242
+ - 4a1e0c8: fix(ai-cli): fix bundling and improve authentication error handling
243
+ - c6b64a7: feat (ai): allow async prepareRequest on HttpChatTransport
244
+ - fccf75c: update mcp protocol version
245
+ - 9121250: Expose provider metadata as an attribute on exported OTEL spans
246
+ - ea27cc6: chore (ai): use JSONValue definition from provider
247
+ - 90ca2b9: feat(ai): Record tool call errors on tool call spans recorded in `generateText` and `streamText`.
248
+ - 50f0362: fix (ai): fix experimental sendStart/sendFinish options in streamText
249
+ - 825e8d7: release alpha.5
250
+ - 7d97ab6: release alpha.4
251
+ - 0ff02bb: chore(provider-utils): move over jsonSchema
252
+ - 4f3776c: feat (ai): add InferUITools helper
253
+ - 9338f3e: fix (ai): throw error for v1 models
254
+ - 92c8e66: fix(ai/core): properly handle custom separator in provider registry
255
+ - 53569b8: feat (ai): add experimental repairText function to streamObject
256
+ - 82aa95d: fix (ai): merge data ui stream parts correctly
257
+ - e7d2ce3: feat: provider-executed tools
258
+ - add5ac1: feat (ai): make streamText toUIMessageStream async iterable
259
+ - 37a916d: feat (ai): add prepareSteps to streamText
260
+ - 30ac566: fix (ui): text message metadata support in ui messages
261
+ - 8026705: fix (core): send buffered text in smooth stream when stream parts change
262
+ - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (#5977)
263
+
264
+ The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
265
+
266
+ ```js
267
+ const prompt = 'Santa Claus driving a Cadillac';
268
+
269
+ const { providerMetadata } = await experimental_generateImage({
270
+ model: openai.image('dall-e-3'),
271
+ prompt,
272
+ });
273
+
274
+ const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;
275
+
276
+ console.log({
277
+ prompt,
278
+ revisedPrompt,
279
+ });
280
+ ```
281
+
282
+ - ec5933d: chore (ai/mcp): add `assertCapability` method to experimental MCP client
283
+ - 09f41ac: fix (ui): add message metadata in Chat.sendMessage
284
+ - ff1c81a: feat (ai): add streamText onAbort callback
285
+ - af1d5a5: fix(ai): Unexpected reasoning-start event in extract reasoning middleware
286
+ - cb3b9c9: fix (ai): catch errors in ui message stream
287
+ - 86293e5: fix (ai): use correct generateMessageId in streamText toUIMessageStream
288
+ - d1a034f: feature: using Zod 4 for internal stuff
289
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
290
+ - d92b9a8: fix(ai): add support for MCP protocol version 2025-06-18
291
+ - 102b066: fix (ai): fix invalid fetch call
292
+ - 142576e: feat (ui): support message replacement in chat via messageId param on sendMessage
293
+ - 84343eb: fix (ui): call sendAutomaticallyWhen with updated messages
294
+ - a76a62b: feat (ai): add experimental prepareStep callback to generateText
295
+ - 89ba235: fix (ui): support tool names with dash
296
+ - 8e31d46: feat (ai): export SourceDocumentUIPart
297
+ - bd398e4: fix (core): improve error handling in streamText's consumeStream method
298
+ - 88a8ee5: fix (ai): support abort during retry waits
299
+ - 205077b: fix: improve Zod compatibility
300
+ - d91b50d: chore(ui-utils): merge into ai package
301
+ - e4c8647: feat (ui): allow asynchronous onFinish in createUIMessageStream
302
+ - c808e4d: fix (ui): do not send changing assistant message ids when onFinish is provided
303
+ - e862b5b: feat (ai): allow sync tool.execute
304
+ - 395c85e: feat (ai): add consumeSseStream option to UI message stream responses
305
+ - 5bdff05: Removed deprecated `options.throwErrorForEmptyVectors` from `cosineSimilarity()`. Since `throwErrorForEmptyVectors` was the only option the entire `options` argument was removed.
306
+
307
+ ```diff
308
+ - cosineSimilarity(vector1, vector2, options)
309
+ +cosineSimilarity(vector1, vector2)
310
+ ```
311
+
312
+ - 13b4f46: feat (ai): export experimental MCPClient and MCPClientConfig interfaces
313
+ - a4f3007: chore: remove ai/react
314
+ - 8e64e9c: feat (ai): allow using provider default temperature by specifying null
315
+ - b983b51: feat (ai): support model message array in prompt
316
+ - 56c232b: fix (ai): remove outdated sendStart jsdoc
317
+ - 7324c21: fix (ai/telemetry): Avoid JSON.stringify on Uint8Arrays for telemetry
318
+ - f10304b: feat(tool-calling): don't require the user to have to pass parameters
319
+ - dd5fd43: feat (ai): support dynamic tools in Chat onToolCall
320
+ - a753b3a: feat (provider/anthropic): cache control for tools
321
+ - 383cbfa: feat (ai): add isAborted to onFinish callback for ui message streams
322
+ - 27deb4d: feat (provider/gateway): Add providerMetadata to embeddings response
323
+ - 5f2b3d4: chore (ai): stable prepareStep
324
+ - 4c8f834: feat: automatically respect rate limit headers in retry logic
325
+
326
+ Added automatic support for respecting rate limit headers (`retry-after-ms` and `retry-after`) in the SDK's retry logic. When these headers are present and contain reasonable values (0-60 seconds), the retry mechanism will use the server-specified delay instead of exponential backoff. This matches the behavior of Anthropic and OpenAI client SDKs and improves rate limit handling without requiring any API changes.
327
+
328
+ - f2c7f19: feat (ui): add Chat.clearError()
329
+ - 7bd025b: fix (ai): fix sync tool execute with streamText
330
+ - Updated dependencies [a571d6e]
331
+ - Updated dependencies [742b7be]
332
+ - Updated dependencies [9e16bfd]
333
+ - Updated dependencies [e7fcc86]
334
+ - Updated dependencies [0477a13]
335
+ - Updated dependencies [7cddb72]
336
+ - Updated dependencies [ccce59b]
337
+ - Updated dependencies [e2b9e4b]
338
+ - Updated dependencies [95857aa]
339
+ - Updated dependencies [45c1ea2]
340
+ - Updated dependencies [6f6bb89]
341
+ - Updated dependencies [26b6dd0]
342
+ - Updated dependencies [060370c]
343
+ - Updated dependencies [dc714f3]
344
+ - Updated dependencies [b5da06a]
345
+ - Updated dependencies [d1a1aa1]
346
+ - Updated dependencies [63f9e9b]
347
+ - Updated dependencies [5d142ab]
348
+ - Updated dependencies [d5f588f]
349
+ - Updated dependencies [30ab1de]
350
+ - Updated dependencies [e025824]
351
+ - Updated dependencies [0571b98]
352
+ - Updated dependencies [b6b43c7]
353
+ - Updated dependencies [4fef487]
354
+ - Updated dependencies [48d257a]
355
+ - Updated dependencies [0c0c0b3]
356
+ - Updated dependencies [0d2c085]
357
+ - Updated dependencies [40acf9b]
358
+ - Updated dependencies [9222aeb]
359
+ - Updated dependencies [e2aceaf]
360
+ - Updated dependencies [411e483]
361
+ - Updated dependencies [97fedf9]
362
+ - Updated dependencies [8ba77a7]
363
+ - Updated dependencies [c91586a]
364
+ - Updated dependencies [7b3ae3f]
365
+ - Updated dependencies [a166433]
366
+ - Updated dependencies [3cbcbb7]
367
+ - Updated dependencies [26735b5]
368
+ - Updated dependencies [443d8ec]
369
+ - Updated dependencies [a8c8bd5]
370
+ - Updated dependencies [abf9a79]
371
+ - Updated dependencies [14c9410]
372
+ - Updated dependencies [e86be6f]
373
+ - Updated dependencies [9bf7291]
374
+ - Updated dependencies [2e13791]
375
+ - Updated dependencies [9f95b35]
376
+ - Updated dependencies [66962ed]
377
+ - Updated dependencies [fedb55e]
378
+ - Updated dependencies [0d06df6]
379
+ - Updated dependencies [472524a]
380
+ - Updated dependencies [dd3ff01]
381
+ - Updated dependencies [6c2c708]
382
+ - Updated dependencies [d9c98f4]
383
+ - Updated dependencies [05d2819]
384
+ - Updated dependencies [9301f86]
385
+ - Updated dependencies [0a87932]
386
+ - Updated dependencies [c4a2fec]
387
+ - Updated dependencies [957b739]
388
+ - Updated dependencies [721775e]
389
+ - Updated dependencies [70ebead]
390
+ - Updated dependencies [79457bd]
391
+ - Updated dependencies [a3f768e]
392
+ - Updated dependencies [f3639fa]
393
+ - Updated dependencies [7435eb5]
394
+ - Updated dependencies [8aa9e20]
395
+ - Updated dependencies [4617fab]
396
+ - Updated dependencies [ac34802]
397
+ - Updated dependencies [0054544]
398
+ - Updated dependencies [cb68df0]
399
+ - Updated dependencies [ad80501]
400
+ - Updated dependencies [8bd3624]
401
+ - Updated dependencies [68ecf2f]
402
+ - Updated dependencies [9e9c809]
403
+ - Updated dependencies [32831c6]
404
+ - Updated dependencies [6dc848c]
405
+ - Updated dependencies [6b98118]
406
+ - Updated dependencies [d0f9495]
407
+ - Updated dependencies [c145d62]
408
+ - Updated dependencies [63d791d]
409
+ - Updated dependencies [87b828f]
410
+ - Updated dependencies [3f2f00c]
411
+ - Updated dependencies [bfdca8d]
412
+ - Updated dependencies [0ff02bb]
413
+ - Updated dependencies [7979f7f]
414
+ - Updated dependencies [f77bc38]
415
+ - Updated dependencies [989ac75]
416
+ - Updated dependencies [39a4fab]
417
+ - Updated dependencies [44f4aba]
418
+ - Updated dependencies [7742ba3]
419
+ - Updated dependencies [9bd5ab5]
420
+ - Updated dependencies [57edfcb]
421
+ - Updated dependencies [faf8446]
422
+ - Updated dependencies [c190907]
423
+ - Updated dependencies [7ea4132]
424
+ - Updated dependencies [d1a034f]
425
+ - Updated dependencies [d454e4b]
426
+ - Updated dependencies [5c56081]
427
+ - Updated dependencies [fd65bc6]
428
+ - Updated dependencies [cf1e00e]
429
+ - Updated dependencies [023ba40]
430
+ - Updated dependencies [cc21603]
431
+ - Updated dependencies [ea7a7c9]
432
+ - Updated dependencies [26535e0]
433
+ - Updated dependencies [e030615]
434
+ - Updated dependencies [5e57fae]
435
+ - Updated dependencies [393138b]
436
+ - Updated dependencies [c57e248]
437
+ - Updated dependencies [88a8ee5]
438
+ - Updated dependencies [41fa418]
439
+ - Updated dependencies [205077b]
440
+ - Updated dependencies [71f938d]
441
+ - Updated dependencies [e001ea1]
442
+ - Updated dependencies [3795467]
443
+ - Updated dependencies [28a5ed5]
444
+ - Updated dependencies [7182d14]
445
+ - Updated dependencies [c1e6647]
446
+ - Updated dependencies [1766ede]
447
+ - Updated dependencies [811dff3]
448
+ - Updated dependencies [f10304b]
449
+ - Updated dependencies [dd5fd43]
450
+ - Updated dependencies [33f4a6a]
451
+ - Updated dependencies [383cbfa]
452
+ - Updated dependencies [27deb4d]
453
+ - Updated dependencies [c4df419]
454
+ - @ai-sdk/provider-utils@3.0.0
455
+ - @ai-sdk/provider@2.0.0
456
+ - @ai-sdk/gateway@1.0.0
457
+
458
+ ## 5.0.0-beta.34
459
+
460
+ ### Patch Changes
461
+
462
+ - 53569b8: feat (ai): add experimental repairText function to streamObject
463
+ - 88a8ee5: fix (ai): support abort during retry waits
464
+ - f2c7f19: feat (ui): add Chat.clearError()
465
+ - Updated dependencies [721775e]
466
+ - Updated dependencies [88a8ee5]
467
+ - @ai-sdk/gateway@1.0.0-beta.19
468
+ - @ai-sdk/provider-utils@3.0.0-beta.10
469
+
470
+ ## 5.0.0-beta.33
471
+
472
+ ### Patch Changes
473
+
474
+ - 48378b9: fix (ai): send null as tool output when tools return undefined
475
+ - 93d53a1: chore (ai): remove cli
476
+ - 27deb4d: feat (provider/gateway): Add providerMetadata to embeddings response
477
+ - Updated dependencies [27deb4d]
478
+ - @ai-sdk/gateway@1.0.0-beta.18
479
+ - @ai-sdk/provider@2.0.0-beta.2
480
+ - @ai-sdk/provider-utils@3.0.0-beta.9
481
+
482
+ ## 5.0.0-beta.32
483
+
484
+ ### Patch Changes
485
+
486
+ - bc24722: feat (ai): Add finishReason as a promise on StreamObjectResult to match StreamTextResult
487
+ - 13b4f46: feat (ai): export experimental MCPClient and MCPClientConfig interfaces
488
+ - 56c232b: fix (ai): remove outdated sendStart jsdoc
489
+
490
+ ## 5.0.0-beta.31
491
+
492
+ ### Patch Changes
493
+
494
+ - 6622441: feat (ai): add static/dynamic toolCalls/toolResults helpers
495
+ - ced8eee: feat(ai): re-export zodSchema from main package
496
+ - cee64b2: fix(otel): change back toolCall attributes of input/output back to args/result for compatibility
497
+ - ee38081: Add support for audio/webm to detect-media-type
498
+ - dd5fd43: feat (ai): support dynamic tools in Chat onToolCall
499
+ - Updated dependencies [dd5fd43]
500
+ - @ai-sdk/provider-utils@3.0.0-beta.8
501
+ - @ai-sdk/gateway@1.0.0-beta.17
502
+
503
+ ## 5.0.0-beta.30
504
+
505
+ ### Patch Changes
506
+
507
+ - Updated dependencies [fedb55e]
508
+ - @ai-sdk/gateway@1.0.0-beta.16
509
+
510
+ ## 5.0.0-beta.29
511
+
512
+ ### Patch Changes
513
+
514
+ - e7fcc86: feat (ai): introduce dynamic tools
515
+ - d92b9a8: fix(ai): add support for MCP protocol version 2025-06-18
516
+ - Updated dependencies [e7fcc86]
517
+ - @ai-sdk/provider-utils@3.0.0-beta.7
518
+ - @ai-sdk/gateway@1.0.0-beta.15
519
+
520
+ ## 5.0.0-beta.28
521
+
522
+ ### Patch Changes
523
+
524
+ - 84343eb: fix (ui): call sendAutomaticallyWhen with updated messages
525
+ - a753b3a: feat (provider/anthropic): cache control for tools
526
+ - Updated dependencies [ac34802]
527
+ - @ai-sdk/provider-utils@3.0.0-beta.6
528
+ - @ai-sdk/gateway@1.0.0-beta.14
529
+
530
+ ## 5.0.0-beta.27
531
+
532
+ ### Patch Changes
533
+
534
+ - d5ae088: feat (ui): add sendAutomaticallyWhen to Chat
535
+ - Updated dependencies [0477a13]
536
+ - Updated dependencies [cf1e00e]
537
+ - Updated dependencies [cc21603]
538
+ - @ai-sdk/gateway@1.0.0-beta.13
539
+
540
+ ## 5.0.0-beta.26
541
+
542
+ ### Patch Changes
543
+
544
+ - ae77a99: chore (ai): rename text and reasoning chunks in streamText fullstream
545
+ - 1f6ce57: feat (ai): infer tool call types in the `onToolCall` callback
546
+ - 5a975a4: feat (ui): update Chat tool result submission
547
+ - 2a62513: Fix error thrown when emptying messages in onError or onFinish
548
+ - 904fa5e: feat (ai/core): add terminateOnError option to readUIMessageStream
549
+ - f81c720: chore(ai): bundle dependencies in CLI binary
550
+ - Updated dependencies [70ebead]
551
+ - @ai-sdk/gateway@1.0.0-beta.12
552
+
553
+ ## 5.0.0-beta.25
554
+
555
+ ### Patch Changes
556
+
557
+ - Updated dependencies [8bd3624]
558
+ - Updated dependencies [e001ea1]
559
+ - @ai-sdk/gateway@1.0.0-beta.11
560
+
561
+ ## 5.0.0-beta.24
562
+
563
+ ### Patch Changes
564
+
565
+ - add5ac1: feat (ai): make streamText toUIMessageStream async iterable
566
+ - ff1c81a: feat (ai): add streamText onAbort callback
567
+ - e4c8647: feat (ui): allow asynchronous onFinish in createUIMessageStream
568
+ - 383cbfa: feat (ai): add isAborted to onFinish callback for ui message streams
569
+ - Updated dependencies [57edfcb]
570
+ - Updated dependencies [383cbfa]
571
+ - @ai-sdk/provider-utils@3.0.0-beta.5
572
+ - @ai-sdk/gateway@1.0.0-beta.10
573
+
574
+ ## 5.0.0-beta.23
575
+
576
+ ### Patch Changes
577
+
578
+ - 89ba235: fix (ui): support tool names with dash
579
+
580
+ ## 5.0.0-beta.22
581
+
582
+ ### Patch Changes
583
+
584
+ - de2d2ab: feat(ai): add provider and provider registry middleware functionality
585
+ - 6c42e56: feat (ai): validate ui stream data chunks
586
+ - c93a8bc: chore(ai): export AsyncIterableStream type from async-iterable-stream module
587
+ - 20398f2: feat: ai sdk cli documentation + adjusted default model
588
+ - 86293e5: fix (ai): use correct generateMessageId in streamText toUIMessageStream
589
+ - 205077b: fix: improve Zod compatibility
590
+ - Updated dependencies [205077b]
591
+ - @ai-sdk/provider-utils@3.0.0-beta.4
592
+ - @ai-sdk/gateway@1.0.0-beta.9
593
+
594
+ ## 5.0.0-beta.21
595
+
596
+ ### Patch Changes
597
+
598
+ - 38ae5cc: feat (ai): export InferUIMessageChunk type
599
+ - faea29f: fix (provider/openai): multi-step reasoning with text
600
+ - 90ac328: fix (ui): tool part metadata support in ui messages
601
+ - 4a1e0c8: fix(ai-cli): fix bundling and improve authentication error handling
602
+ - 30ac566: fix (ui): text message metadata support in ui messages
603
+
604
+ ## 5.0.0-beta.20
605
+
606
+ ### Patch Changes
607
+
608
+ - 4c8f834: feat: automatically respect rate limit headers in retry logic
609
+
610
+ Added automatic support for respecting rate limit headers (`retry-after-ms` and `retry-after`) in the SDK's retry logic. When these headers are present and contain reasonable values (0-60 seconds), the retry mechanism will use the server-specified delay instead of exponential backoff. This matches the behavior of Anthropic and OpenAI client SDKs and improves rate limit handling without requiring any API changes.
611
+
612
+ ## 5.0.0-beta.19
613
+
614
+ ### Patch Changes
615
+
616
+ - 10b21eb: feat(cli): add ai command line interface
617
+ - 75c3396: fix (ai): handle errors in 2nd streamText doStream call
618
+ - 05d2819: feat: allow zod 4.x as peer dependency
619
+ - db64cbe: fix (provider/openai): multi-step reasoning with tool calls
620
+ - Updated dependencies [05d2819]
621
+ - @ai-sdk/provider-utils@3.0.0-beta.3
622
+ - @ai-sdk/gateway@1.0.0-beta.8
623
+
624
+ ## 5.0.0-beta.18
625
+
626
+ ### Patch Changes
627
+
628
+ - d3960e3: selectTelemetryAttributes more robustness
629
+ - 9338f3e: fix (ai): throw error for v1 models
630
+
631
+ ## 5.0.0-beta.17
632
+
633
+ ### Patch Changes
634
+
635
+ - Updated dependencies [c190907]
636
+ - @ai-sdk/gateway@1.0.0-beta.7
637
+
638
+ ## 5.0.0-beta.16
639
+
640
+ ### Patch Changes
641
+
642
+ - Updated dependencies [9e16bfd]
643
+ - @ai-sdk/gateway@1.0.0-beta.6
644
+
645
+ ## 5.0.0-beta.15
646
+
647
+ ### Patch Changes
648
+
649
+ - 8e31d46: feat (ai): export SourceDocumentUIPart
650
+
651
+ ## 5.0.0-beta.14
652
+
653
+ ### Patch Changes
654
+
655
+ - Updated dependencies [30ab1de]
656
+ - @ai-sdk/gateway@1.0.0-beta.5
657
+
658
+ ## 5.0.0-beta.13
659
+
660
+ ### Patch Changes
661
+
662
+ - 377bbcf: fix (ui): tool input can be undefined during input-streaming
663
+ - ce1d1f3: feat (ai): export mock image, speech, and transcription models
664
+ - c040e2f: fix (ui): inject generated response message id
665
+ - c808e4d: fix (ui): do not send changing assistant message ids when onFinish is provided
666
+
667
+ ## 5.0.0-beta.12
668
+
669
+ ### Patch Changes
670
+
671
+ - fc0380b: feat (ui): resolvable header, body, credentials in http chat transport
672
+ - 51f497d: feat (ai): step input message modification in prepareStep
673
+ - 4f3776c: feat (ai): add InferUITools helper
674
+
675
+ ## 5.0.0-beta.11
676
+
677
+ ### Patch Changes
678
+
679
+ - 9e40cbe: Allow destructuring output and errorText on `ToolUIPart` type
680
+
681
+ ## 5.0.0-beta.10
682
+
683
+ ### Major Changes
684
+
685
+ - 2b637d6: chore (ai): rename UIMessageStreamPart to UIMessageChunk
686
+
687
+ ### Patch Changes
688
+
689
+ - 16ccfb2: feat (ai): add readUIMessageStream helper
690
+ - 90ca2b9: feat(ai): Record tool call errors on tool call spans recorded in `generateText` and `streamText`.
691
+ - af1d5a5: fix(ai): Unexpected reasoning-start event in extract reasoning middleware
692
+
693
+ ## 5.0.0-beta.9
694
+
695
+ ### Patch Changes
696
+
697
+ - 86cfc72: feat (ai): add ignoreIncompleteToolCalls option to convertToModelMessages
698
+
699
+ ## 5.0.0-beta.8
700
+
701
+ ### Patch Changes
702
+
703
+ - 6909543: feat (ai): support system parameter in Agent constructor
704
+ - c8fce91: feat (ai): add experimental Agent abstraction
705
+ - 9121250: Expose provider metadata as an attribute on exported OTEL spans
706
+ - Updated dependencies [97fedf9]
707
+ - @ai-sdk/gateway@1.0.0-beta.4
708
+
709
+ ## 5.0.0-beta.7
710
+
711
+ ### Patch Changes
712
+
713
+ - 60132dd: fixed date formatting for updated mcp protocol version
714
+
715
+ ## 5.0.0-beta.6
716
+
717
+ ### Patch Changes
718
+
719
+ - 143c55b: feat (ai): export Chat callback types
720
+ - f04ffe4: feat (ui): add onData callback to Chat
721
+ - 97c35c0: feat (ui): transient data parts
722
+ - fccf75c: update mcp protocol version
723
+
724
+ ## 5.0.0-beta.5
725
+
726
+ ### Patch Changes
727
+
728
+ - 4f3e637: fix (ui): avoid caching globalThis.fetch in case it is patched by other libraries
729
+
730
+ ## 5.0.0-beta.4
731
+
732
+ ### Patch Changes
733
+
734
+ - 09f41ac: fix (ui): add message metadata in Chat.sendMessage
735
+
736
+ ## 5.0.0-beta.3
737
+
738
+ ### Patch Changes
739
+
740
+ - Updated dependencies [f3639fa]
741
+ - Updated dependencies [d454e4b]
742
+ - @ai-sdk/gateway@1.0.0-beta.3
743
+
744
+ ## 5.0.0-beta.2
745
+
746
+ ### Patch Changes
747
+
748
+ - 0d9583c: fix (ai): use user-provided media type when available
749
+ - c6b64a7: feat (ai): allow async prepareRequest on HttpChatTransport
750
+ - cb3b9c9: fix (ai): catch errors in ui message stream
751
+ - d1a034f: feature: using Zod 4 for internal stuff
752
+ - Updated dependencies [0571b98]
753
+ - Updated dependencies [c91586a]
754
+ - Updated dependencies [39a4fab]
755
+ - Updated dependencies [d1a034f]
756
+ - @ai-sdk/provider-utils@3.0.0-beta.2
757
+ - @ai-sdk/gateway@1.0.0-beta.2
758
+
759
+ ## 5.0.0-beta.1
760
+
761
+ ### Major Changes
762
+
763
+ - 9ad0484: feat (ai): automatic tool execution error handling
764
+
765
+ ### Patch Changes
766
+
767
+ - d88455d: feat (ai): expose http chat transport type
768
+ - 4048ce3: fix (ai): add tests and examples for openai responses
769
+ - f2b041e: Fix custom `fetch` in HttpChatTransport
770
+ - cb68df0: feat: add transcription and speech model support to provider registry
771
+ - 26695a3: feat (ui): add state for text and reasoning ui message parts
772
+ - e7d2ce3: feat: provider-executed tools
773
+ - 102b066: fix (ai): fix invalid fetch call
774
+ - e862b5b: feat (ai): allow sync tool.execute
775
+ - 7bd025b: fix (ai): fix sync tool execute with streamText
776
+ - Updated dependencies [742b7be]
777
+ - Updated dependencies [7cddb72]
778
+ - Updated dependencies [ccce59b]
779
+ - Updated dependencies [e2b9e4b]
780
+ - Updated dependencies [45c1ea2]
781
+ - Updated dependencies [e025824]
782
+ - Updated dependencies [0d06df6]
783
+ - Updated dependencies [472524a]
784
+ - Updated dependencies [dd3ff01]
785
+ - Updated dependencies [7435eb5]
786
+ - Updated dependencies [cb68df0]
787
+ - Updated dependencies [bfdca8d]
788
+ - Updated dependencies [f77bc38]
789
+ - Updated dependencies [44f4aba]
790
+ - Updated dependencies [023ba40]
791
+ - Updated dependencies [5e57fae]
792
+ - Updated dependencies [71f938d]
793
+ - Updated dependencies [28a5ed5]
794
+ - @ai-sdk/provider@2.0.0-beta.1
795
+ - @ai-sdk/provider-utils@3.0.0-beta.1
796
+ - @ai-sdk/gateway@1.0.0-beta.1
797
+
798
+ ## 5.0.0-alpha.15
799
+
800
+ ### Major Changes
801
+
802
+ - 04d5063: chore (ai): rename default provider global to AI_SDK_DEFAULT_PROVIDER
803
+ - b4b4bb2: chore (ui): rename experimental_resume to resumeStream
804
+ - d884051: feat (ai): simplify default provider setup
805
+ - 954aa73: feat (ui): extended regenerate support
806
+ - 60e2c56: feat (ai): restructure chat transports
807
+
808
+ ### Patch Changes
809
+
810
+ - b1e3abd: feat (ai): expose ui message stream headers
811
+ - 142576e: feat (ui): support message replacement in chat via messageId param on sendMessage
812
+ - 395c85e: feat (ai): add consumeSseStream option to UI message stream responses
813
+ - Updated dependencies [48d257a]
814
+ - Updated dependencies [8ba77a7]
815
+ - Updated dependencies [c145d62]
816
+ - @ai-sdk/provider@2.0.0-alpha.15
817
+ - @ai-sdk/provider-utils@3.0.0-alpha.15
818
+ - @ai-sdk/gateway@1.0.0-alpha.15
819
+
820
+ ## 5.0.0-alpha.14
821
+
822
+ ### Major Changes
823
+
824
+ - 63f9e9b: chore (provider,ai): tools have input/output instead of args,result
825
+
826
+ ### Patch Changes
827
+
828
+ - Updated dependencies [b5da06a]
829
+ - Updated dependencies [63f9e9b]
830
+ - Updated dependencies [2e13791]
831
+ - @ai-sdk/provider@2.0.0-alpha.14
832
+ - @ai-sdk/gateway@1.0.0-alpha.14
833
+ - @ai-sdk/provider-utils@3.0.0-alpha.14
834
+
835
+ ## 5.0.0-alpha.13
836
+
837
+ ### Major Changes
838
+
839
+ - 0a710d8: feat (ui): typed tool parts in ui messages
840
+ - 6a83f7d: refactoring (ai): restructure message metadata transfer
841
+ - 1f55c21: chore (ai): send reasoning to the client by default
842
+ - 33eb499: feat (ai): inject message id in createUIMessageStream
843
+ - 901df02: feat (ui): use UI_MESSAGE generic
844
+
845
+ ### Patch Changes
846
+
847
+ - Updated dependencies [68ecf2f]
848
+ - @ai-sdk/provider@2.0.0-alpha.13
849
+ - @ai-sdk/gateway@1.0.0-alpha.13
850
+ - @ai-sdk/provider-utils@3.0.0-alpha.13
851
+
852
+ ## 5.0.0-alpha.12
853
+
854
+ ### Major Changes
855
+
856
+ - 4892798: chore (ai): always stream tool calls
857
+
858
+ ### Patch Changes
859
+
860
+ - da1e6f0: feat (ui): add generics to ui message stream parts
861
+ - Updated dependencies [e2aceaf]
862
+ - @ai-sdk/gateway@1.0.0-alpha.12
863
+ - @ai-sdk/provider@2.0.0-alpha.12
864
+ - @ai-sdk/provider-utils@3.0.0-alpha.12
865
+
866
+ ## 5.0.0-alpha.11
867
+
868
+ ### Major Changes
869
+
870
+ - e8324c5: feat (ai): add args callbacks to tools
871
+
872
+ ### Patch Changes
873
+
874
+ - Updated dependencies [c1e6647]
875
+ - @ai-sdk/provider@2.0.0-alpha.11
876
+ - @ai-sdk/gateway@1.0.0-alpha.11
877
+ - @ai-sdk/provider-utils@3.0.0-alpha.11
878
+
879
+ ## 5.0.0-alpha.10
880
+
881
+ ### Major Changes
882
+
883
+ - 98f25e5: chore (ui): remove managed chat inputs
884
+ - 7bb58d4: chore (ai): restructure prepareRequest
885
+
886
+ ### Patch Changes
887
+
888
+ - Updated dependencies [c4df419]
889
+ - @ai-sdk/provider@2.0.0-alpha.10
890
+ - @ai-sdk/gateway@1.0.0-alpha.10
891
+ - @ai-sdk/provider-utils@3.0.0-alpha.10
892
+
893
+ ## 5.0.0-alpha.9
894
+
895
+ ### Major Changes
896
+
897
+ - 9ae327d: chore (ui): replace chat store concept with chat instances
898
+
899
+ ### Patch Changes
900
+
901
+ - 8255639: ### Fix use with Google APIs + zod v4's `.literal()` schema
902
+
903
+ Before [zod@3.25.49](https://github.com/colinhacks/zod/releases/tag/v3.25.49), requests to Google's APIs failed due to a missing `type` in the provided schema. The problem has been resolved for the `ai` SDK by bumping our `zod` peer dependencies to `^3.25.49`.
904
+
905
+ pull request: https://github.com/vercel/ai/pull/6609
906
+
907
+ - Updated dependencies [26b6dd0]
908
+ - Updated dependencies [811dff3]
909
+ - @ai-sdk/gateway@1.0.0-alpha.9
910
+ - @ai-sdk/provider@2.0.0-alpha.9
911
+ - @ai-sdk/provider-utils@3.0.0-alpha.9
912
+
913
+ ## 5.0.0-alpha.8
914
+
915
+ ### Major Changes
916
+
917
+ - c25cbce: feat (ai): use console.error as default error handler for streamText and streamObject
918
+
919
+ ### Patch Changes
920
+
921
+ - 4fef487: feat: support for zod v4 for schema validation
922
+
923
+ All these methods now accept both a zod v4 and zod v3 schemas for validation:
924
+
925
+ - `generateObject()`
926
+ - `streamObject()`
927
+ - `generateText()`
928
+ - `experimental_useObject()` from `@ai-sdk/react`
929
+ - `streamUI()` from `@ai-sdk/rsc`
930
+
931
+ - 6b1c55c: feat (ai): introduce GLOBAL_DEFAULT_PROVIDER
932
+ - 2e4f9e4: feat (ai): improved error messages when using gateway
933
+ - Updated dependencies [4fef487]
934
+ - Updated dependencies [9222aeb]
935
+ - Updated dependencies [3cbcbb7]
936
+ - Updated dependencies [989ac75]
937
+ - Updated dependencies [7742ba3]
938
+ - @ai-sdk/provider-utils@3.0.0-alpha.8
939
+ - @ai-sdk/provider@2.0.0-alpha.8
940
+ - @ai-sdk/gateway@1.0.0-alpha.8
941
+
942
+ ## 5.0.0-alpha.7
943
+
944
+ ### Major Changes
945
+
946
+ - db345da: chore (ai): remove exports of internal ui functions
947
+ - 247ee0c: chore (ai): remove steps from tool invocation ui parts
948
+
949
+ ### Patch Changes
950
+
951
+ - 9b0da33: fix (ai): do not send id with start unless specified
952
+ - Updated dependencies [5c56081]
953
+ - @ai-sdk/provider@2.0.0-alpha.7
954
+ - @ai-sdk/gateway@1.0.0-alpha.7
955
+ - @ai-sdk/provider-utils@3.0.0-alpha.7
956
+
957
+ ## 5.0.0-alpha.6
958
+
959
+ ### Patch Changes
960
+
961
+ - 0d2c085: feat (ai): support string model ids through gateway
962
+ - 48a7606: feat (ai): support changing the system prompt in prepareSteps
963
+ - Updated dependencies [0d2c085]
964
+ - Updated dependencies [6c2c708]
965
+ - @ai-sdk/provider@2.0.0-alpha.6
966
+ - @ai-sdk/gateway@1.0.0-alpha.6
967
+ - @ai-sdk/provider-utils@3.0.0-alpha.6
968
+
969
+ ## 5.0.0-alpha.5
970
+
971
+ ### Major Changes
972
+
973
+ - ef256ed: chore (ai): refactor and use chatstore in svelte
974
+ - 1ed0287: chore (ai): stable sendStart/sendFinish options
975
+
976
+ ### Patch Changes
977
+
978
+ - 655cf3c: feat (ui): add onFinish to createUIMessageStream
979
+ - 1675396: fix: avoid job executor deadlock when adding tool result
980
+ - cf9af6e: feat (ai): allow sync prepareStep
981
+ - 825e8d7: release alpha.5
982
+ - 7324c21: fix (ai/telemetry): Avoid JSON.stringify on Uint8Arrays for telemetry
983
+
984
+ ## 5.0.0-alpha.4
985
+
986
+ ### Major Changes
987
+
988
+ - 72d7d72: chore (ai): stable activeTools
989
+ - 9315076: chore (ai): rename continueUntil to stopWhen. Rename maxSteps stop condition to stepCountIs.
990
+
991
+ ### Patch Changes
992
+
993
+ - b32c141: feat (ai): add array support to stopWhen
994
+ - 7d97ab6: release alpha.4
995
+ - 37a916d: feat (ai): add prepareSteps to streamText
996
+ - 5f2b3d4: chore (ai): stable prepareStep
997
+ - Updated dependencies [dc714f3]
998
+ - @ai-sdk/provider@2.0.0-alpha.4
999
+ - @ai-sdk/provider-utils@3.0.0-alpha.4
1000
+
1001
+ ## 5.0.0-alpha.3
1002
+
1003
+ ### Major Changes
1004
+
1005
+ - ab7ccef: chore (ai): change source ui message parts to source-url
1006
+ - 257224b: chore (ai): separate TextStreamChatTransport
1007
+ - 0463011: fix (ai): update source url stream part
1008
+ - d306260: feat (ai): replace maxSteps with continueUntil (streamText)
1009
+
1010
+ ### Patch Changes
1011
+
1012
+ - Updated dependencies [6b98118]
1013
+ - @ai-sdk/provider@2.0.0-alpha.3
1014
+ - @ai-sdk/provider-utils@3.0.0-alpha.3
1015
+
1016
+ ## 5.0.0-alpha.2
1017
+
1018
+ ### Patch Changes
1019
+
1020
+ - 82aa95d: fix (ai): merge data ui stream parts correctly
1021
+ - Updated dependencies [26535e0]
1022
+ - @ai-sdk/provider@2.0.0-alpha.2
1023
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
1024
+
1025
+ ## 5.0.0-alpha.1
1026
+
1027
+ ### Major Changes
1028
+
1029
+ - 109c0ac: chore (ai): rename id to chatId (in post request, resume request, and useChat)
1030
+
1031
+ ### Patch Changes
1032
+
1033
+ - b346545: feat (ai): add data ui part schemas
1034
+ - Updated dependencies [3f2f00c]
1035
+ - @ai-sdk/provider@2.0.0-alpha.1
1036
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
1037
+
1038
+ ## 5.0.0-canary.24
1039
+
1040
+ ### Major Changes
1041
+
1042
+ - f7e8bf4: chore (ai): flatten ui message stream parts
1043
+ - ed675de: feat (ai): add ui data parts
1044
+ - 64f6d64: feat (ai): replace maxSteps with continueUntil (generateText)
1045
+
1046
+ ### Patch Changes
1047
+
1048
+ - bedb239: chore (ai): make ui stream parts value optional when it's not required
1049
+ - 507ac1d: fix (ui/react): update messages immediately with the submitted user message
1050
+ - 2b9bbcd: feat (ai): improve prompt validation error message
1051
+ - cda32ba: fix (ai): send `start` part in correct position in stream (streamText)
1052
+ - 50f0362: fix (ai): fix experimental sendStart/sendFinish options in streamText
1053
+ - Updated dependencies [faf8446]
1054
+ - @ai-sdk/provider-utils@3.0.0-canary.19
1055
+
1056
+ ## 5.0.0-canary.23
1057
+
1058
+ ### Major Changes
1059
+
1060
+ - 40acf9b: feat (ui): introduce ChatStore and ChatTransport
1061
+
1062
+ ### Patch Changes
1063
+
1064
+ - Updated dependencies [40acf9b]
1065
+ - @ai-sdk/provider-utils@3.0.0-canary.18
1066
+
1067
+ ## 5.0.0-canary.22
1068
+
1069
+ ### Major Changes
1070
+
1071
+ - e7dc6c7: chore (ai): remove onResponse callback
1072
+ - a34eb39: chore (ai): remove `data` and `allowEmptySubmit` from `ChatRequestOptions`
1073
+ - b33ed7a: chore (ai): rename DataStream* to UIMessage*
1074
+ - 765f1cd: chore (ai): remove deprecated useChat isLoading helper
1075
+
1076
+ ## 5.0.0-canary.21
1077
+
1078
+ ### Major Changes
1079
+
1080
+ - d964901: - remove setting temperature to `0` by default
1081
+ - remove `null` option from `DefaultSettingsMiddleware`
1082
+ - remove setting defaults for `temperature` and `stopSequences` in `ai` to enable middleware changes
1083
+ - 0560977: chore (ai): improve consistency of generate text result, stream text result, and step result
1084
+ - 516be5b: ### Move Image Model Settings into generate options
1085
+
1086
+ Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
1087
+
1088
+ Before
1089
+
1090
+ ```js
1091
+ await generateImage({
1092
+ model: luma.image('photon-flash-1', {
1093
+ maxImagesPerCall: 5,
1094
+ pollIntervalMillis: 500,
1095
+ }),
1096
+ prompt,
1097
+ n: 10,
1098
+ });
1099
+ ```
1100
+
1101
+ After
1102
+
1103
+ ```js
1104
+ await generateImage({
1105
+ model: luma.image('photon-flash-1'),
1106
+ prompt,
1107
+ n: 10,
1108
+ maxImagesPerCall: 5,
1109
+ providerOptions: {
1110
+ luma: { pollIntervalMillis: 5 },
1111
+ },
1112
+ });
1113
+ ```
1114
+
1115
+ Pull Request: https://github.com/vercel/ai/pull/6180
1116
+
1117
+ - bfbfc4c: feat (ai): streamText/generateText: totalUsage contains usage for all steps. usage is for a single step.
1118
+ - ea7a7c9: feat (ui): UI message metadata
1119
+ - 1409e13: chore (ai): remove experimental continueSteps
1120
+
1121
+ ### Patch Changes
1122
+
1123
+ - 66af894: fix (ai): respect content order in toResponseMessages
1124
+ - Updated dependencies [ea7a7c9]
1125
+ - @ai-sdk/provider-utils@3.0.0-canary.17
1126
+
1127
+ ## 5.0.0-canary.20
1128
+
1129
+ ### Major Changes
1130
+
1131
+ - 13fef90: chore (ai): remove automatic conversion of UI messages to model messages
1132
+ - 496bbc1: chore (ui): inline/remove ChatRequest type
1133
+ - da70d79: chore (ai): remove getUIText helper
1134
+ - c7710a9: chore (ai): rename DataStreamToSSETransformStream to JsonToSseTransformStream
1135
+ - 35fc02c: chore (ui): rename RequestOptions to CompletionRequestOptions
1136
+ - b983b51: feat (ai): support model message array in prompt
1137
+
1138
+ ### Minor Changes
1139
+
1140
+ - bcea599: feat (ai): add content to generateText result
1141
+ - 48d675a: feat (ai): add content to streamText result
1142
+
1143
+ ### Patch Changes
1144
+
1145
+ - e90d45d: chore (rsc): move HANGING_STREAM_WARNING_TIME constant into @ai-sdk/rsc package
1146
+ - bc3109f: chore (ai): push stream-callbacks into langchain/llamaindex adapters
1147
+ - Updated dependencies [87b828f]
1148
+ - @ai-sdk/provider-utils@3.0.0-canary.16
1149
+
1150
+ ## 5.0.0-canary.19
1151
+
1152
+ ### Major Changes
1153
+
1154
+ - 2d03e19: chore (ai): remove StreamCallbacks.onCompletion
1155
+ - 319b989: chore (ai): remove content from ui messages
1156
+ - 441d042: chore (ui): data stream protocol v2 with SSEs
1157
+ - dcc549b: remove StreamTextResult.mergeIntoDataStream method
1158
+ rename DataStreamOptions.getErrorMessage to onError
1159
+ add pipeTextStreamToResponse function
1160
+ add createTextStreamResponse function
1161
+ change createDataStreamResponse function to accept a DataStream and not a DataStreamWriter
1162
+ change pipeDataStreamToResponse function to accept a DataStream and not a DataStreamWriter
1163
+ change pipeDataStreamToResponse function to have a single parameter
1164
+ - cb2b53a: chore (ai): refactor header preparation
1165
+ - e244a78: chore (ai): remove StreamData and mergeStreams
1166
+
1167
+ ## 5.0.0-canary.18
1168
+
1169
+ ### Major Changes
1170
+
1171
+ - c60f895: chore (ai): remove useChat keepLastMessageOnError
1172
+ - a662dea: chore (ai): remove sendExtraMessageFields
1173
+
1174
+ ### Patch Changes
1175
+
1176
+ - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils
1177
+ - 332167b: chore (ai): move maxSteps into UseChatOptions
1178
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
1179
+ - Updated dependencies [a571d6e]
1180
+ - Updated dependencies [a8c8bd5]
1181
+ - Updated dependencies [7979f7f]
1182
+ - Updated dependencies [41fa418]
1183
+ - @ai-sdk/provider-utils@3.0.0-canary.15
1184
+ - @ai-sdk/provider@2.0.0-canary.14
1185
+
1186
+ ## 5.0.0-canary.17
1187
+
1188
+ ### Major Changes
1189
+
1190
+ - f04fb4a: chore (ai): replace useChat attachments with file ui parts
1191
+ - fd1924b: chore (ai): remove redundant `mimeType` property
1192
+ - fafc3f2: chore (ai): change file to parts to use urls instead of data
1193
+ - 92cb0a2: chore (ai): rename CoreMessage to ModelMessage
1194
+
1195
+ ### Minor Changes
1196
+
1197
+ - c9ad635: feat (ai): add filename to file ui parts
1198
+
1199
+ ### Patch Changes
1200
+
1201
+ - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (#5977)
1202
+
1203
+ The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
1204
+
1205
+ ```js
1206
+ const prompt = 'Santa Claus driving a Cadillac';
1207
+
1208
+ const { providerMetadata } = await experimental_generateImage({
1209
+ model: openai.image('dall-e-3'),
1210
+ prompt,
1211
+ });
1212
+
1213
+ const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;
1214
+
1215
+ console.log({
1216
+ prompt,
1217
+ revisedPrompt,
1218
+ });
1219
+ ```
1220
+
1221
+ - Updated dependencies [957b739]
1222
+ - Updated dependencies [9bd5ab5]
1223
+ - @ai-sdk/provider-utils@3.0.0-canary.14
1224
+ - @ai-sdk/provider@2.0.0-canary.13
1225
+
1226
+ ## 5.0.0-canary.16
1227
+
1228
+ ### Major Changes
1229
+
1230
+ - ec78cdc: chore (ai): remove "data" UIMessage role
1231
+ - 8b86e99: chore (ai): replace `Message` with `UIMessage`
1232
+ - 2524fc7: chore (ai): remove ui message toolInvocations property
1233
+ - 175b868: chore (ai): rename reasoning UI parts 'reasoning' property to 'text'
1234
+
1235
+ ### Patch Changes
1236
+
1237
+ - 9b4d074: feat(streamObject): add enum support
1238
+ - 28ad69e: fix(react-native): support experimental_attachments without FileList global
1239
+ - ec5933d: chore (ai/mcp): add `assertCapability` method to experimental MCP client
1240
+
1241
+ ## 5.0.0-canary.15
1242
+
1243
+ ### Major Changes
1244
+
1245
+ - 4bfe9ec: chore (ai): remove ui message reasoning property
1246
+ - 2877a74: chore (ai): remove ui message data property
1247
+
1248
+ ### Patch Changes
1249
+
1250
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
1251
+ - ea27cc6: chore (ai): use JSONValue definition from provider
1252
+ - 0ff02bb: chore(provider-utils): move over jsonSchema
1253
+ - Updated dependencies [7b3ae3f]
1254
+ - Updated dependencies [0ff02bb]
1255
+ - @ai-sdk/provider@2.0.0-canary.12
1256
+ - @ai-sdk/provider-utils@3.0.0-canary.13
1257
+
1258
+ ## 5.0.0-canary.14
1259
+
1260
+ ### Patch Changes
1261
+
1262
+ - 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
1263
+ - 4617fab: chore(embedding-models): remove remaining settings
1264
+ - a76a62b: feat (ai): add experimental prepareStep callback to generateText
1265
+ - Updated dependencies [9bf7291]
1266
+ - Updated dependencies [4617fab]
1267
+ - Updated dependencies [e030615]
1268
+ - @ai-sdk/provider@2.0.0-canary.11
1269
+ - @ai-sdk/provider-utils@3.0.0-canary.12
1270
+
1271
+ ## 5.0.0-canary.13
1272
+
1273
+ ### Patch Changes
1274
+
1275
+ - 14cb3be: chore(providers/llamaindex): extract to separate package
1276
+ - 66962ed: fix(packages): export node10 compatible types
1277
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
1278
+ - Updated dependencies [66962ed]
1279
+ - Updated dependencies [9301f86]
1280
+ - Updated dependencies [a3f768e]
1281
+ - @ai-sdk/provider-utils@3.0.0-canary.11
1282
+ - @ai-sdk/provider@2.0.0-canary.10
1283
+
1284
+ ## 5.0.0-canary.12
1285
+
1286
+ ### Patch Changes
1287
+
1288
+ - Updated dependencies [e86be6f]
1289
+ - @ai-sdk/provider@2.0.0-canary.9
1290
+ - @ai-sdk/provider-utils@3.0.0-canary.10
1291
+
1292
+ ## 5.0.0-canary.11
1293
+
1294
+ ### Patch Changes
1295
+
1296
+ - 8e64e9c: feat (ai): allow using provider default temperature by specifying null
1297
+ - Updated dependencies [95857aa]
1298
+ - Updated dependencies [7ea4132]
1299
+ - @ai-sdk/provider@2.0.0-canary.8
1300
+ - @ai-sdk/provider-utils@3.0.0-canary.9
1301
+
1302
+ ## 5.0.0-canary.10
1303
+
1304
+ ### Patch Changes
1305
+
1306
+ - d8aeaef: feat(providers/fal): add transcribe
1307
+ - 3e10408: fix(utils/detect-mimetype): add support for detecting id3 tags
1308
+
3
1309
  ## 5.0.0-canary.9
4
1310
 
5
1311
  ### Major Changes