ai 5.0.0-canary.2 → 5.0.0-canary.21

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +356 -0
  2. package/README.md +4 -4
  3. package/dist/index.d.mts +3023 -2408
  4. package/dist/index.d.ts +3023 -2408
  5. package/dist/index.js +4039 -3790
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +4017 -3774
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/internal/index.d.mts +467 -0
  10. package/dist/internal/index.d.ts +467 -0
  11. package/dist/internal/index.js +957 -0
  12. package/dist/internal/index.js.map +1 -0
  13. package/dist/internal/index.mjs +930 -0
  14. package/dist/internal/index.mjs.map +1 -0
  15. package/{mcp-stdio/dist → dist/mcp-stdio}/index.js +5 -8
  16. package/dist/mcp-stdio/index.js.map +1 -0
  17. package/{mcp-stdio/dist → dist/mcp-stdio}/index.mjs +5 -20
  18. package/dist/mcp-stdio/index.mjs.map +1 -0
  19. package/{test/dist → dist/test}/index.d.mts +23 -24
  20. package/{test/dist → dist/test}/index.d.ts +23 -24
  21. package/{test/dist → dist/test}/index.js +39 -16
  22. package/dist/test/index.js.map +1 -0
  23. package/{test/dist → dist/test}/index.mjs +38 -15
  24. package/dist/test/index.mjs.map +1 -0
  25. package/internal.d.ts +1 -0
  26. package/mcp-stdio.d.ts +1 -0
  27. package/package.json +32 -49
  28. package/test.d.ts +1 -0
  29. package/mcp-stdio/create-child-process.test.ts +0 -92
  30. package/mcp-stdio/create-child-process.ts +0 -21
  31. package/mcp-stdio/dist/index.js.map +0 -1
  32. package/mcp-stdio/dist/index.mjs.map +0 -1
  33. package/mcp-stdio/get-environment.ts +0 -43
  34. package/mcp-stdio/index.ts +0 -4
  35. package/mcp-stdio/mcp-stdio-transport.test.ts +0 -262
  36. package/mcp-stdio/mcp-stdio-transport.ts +0 -157
  37. package/rsc/dist/index.d.ts +0 -813
  38. package/rsc/dist/index.mjs +0 -18
  39. package/rsc/dist/rsc-client.d.mts +0 -1
  40. package/rsc/dist/rsc-client.mjs +0 -18
  41. package/rsc/dist/rsc-client.mjs.map +0 -1
  42. package/rsc/dist/rsc-server.d.mts +0 -748
  43. package/rsc/dist/rsc-server.mjs +0 -2142
  44. package/rsc/dist/rsc-server.mjs.map +0 -1
  45. package/rsc/dist/rsc-shared.d.mts +0 -101
  46. package/rsc/dist/rsc-shared.mjs +0 -308
  47. package/rsc/dist/rsc-shared.mjs.map +0 -1
  48. package/test/dist/index.js.map +0 -1
  49. package/test/dist/index.mjs.map +0 -1
  50. package/{mcp-stdio/dist → dist/mcp-stdio}/index.d.mts +8 -8
  51. package/{mcp-stdio/dist → dist/mcp-stdio}/index.d.ts +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,361 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.0-canary.21
4
+
5
+ ### Major Changes
6
+
7
+ - d964901: - remove setting temperature to `0` by default
8
+ - remove `null` option from `DefaultSettingsMiddleware`
9
+ - remove setting defaults for `temperature` and `stopSequences` in `ai` to enable middleware changes
10
+ - 0560977: chore (ai): improve consistency of generate text result, stream text result, and step result
11
+ - 516be5b: ### Move Image Model Settings into generate options
12
+
13
+ Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
14
+
15
+ Before
16
+
17
+ ```js
18
+ await generateImage({
19
+ model: luma.image('photon-flash-1', {
20
+ maxImagesPerCall: 5,
21
+ pollIntervalMillis: 500,
22
+ }),
23
+ prompt,
24
+ n: 10,
25
+ });
26
+ ```
27
+
28
+ After
29
+
30
+ ```js
31
+ await generateImage({
32
+ model: luma.image('photon-flash-1'),
33
+ prompt,
34
+ n: 10,
35
+ maxImagesPerCall: 5,
36
+ providerOptions: {
37
+ luma: { pollIntervalMillis: 5 },
38
+ },
39
+ });
40
+ ```
41
+
42
+ Pull Request: https://github.com/vercel/ai/pull/6180
43
+
44
+ - bfbfc4c: feat (ai): streamText/generateText: totalUsage contains usage for all steps. usage is for a single step.
45
+ - ea7a7c9: feat (ui): UI message metadata
46
+ - 1409e13: chore (ai): remove experimental continueSteps
47
+
48
+ ### Patch Changes
49
+
50
+ - 66af894: fix (ai): respect content order in toResponseMessages
51
+ - Updated dependencies [ea7a7c9]
52
+ - @ai-sdk/provider-utils@3.0.0-canary.17
53
+
54
+ ## 5.0.0-canary.20
55
+
56
+ ### Major Changes
57
+
58
+ - 13fef90: chore (ai): remove automatic conversion of UI messages to model messages
59
+ - 496bbc1: chore (ui): inline/remove ChatRequest type
60
+ - da70d79: chore (ai): remove getUIText helper
61
+ - c7710a9: chore (ai): rename DataStreamToSSETransformStream to JsonToSseTransformStream
62
+ - 35fc02c: chore (ui): rename RequestOptions to CompletionRequestOptions
63
+ - b983b51: feat (ai): support model message array in prompt
64
+
65
+ ### Minor Changes
66
+
67
+ - bcea599: feat (ai): add content to generateText result
68
+ - 48d675a: feat (ai): add content to streamText result
69
+
70
+ ### Patch Changes
71
+
72
+ - e90d45d: chore (rsc): move HANGING_STREAM_WARNING_TIME constant into @ai-sdk/rsc package
73
+ - bc3109f: chore (ai): push stream-callbacks into langchain/llamaindex adapters
74
+ - Updated dependencies [87b828f]
75
+ - @ai-sdk/provider-utils@3.0.0-canary.16
76
+
77
+ ## 5.0.0-canary.19
78
+
79
+ ### Major Changes
80
+
81
+ - 2d03e19: chore (ai): remove StreamCallbacks.onCompletion
82
+ - 319b989: chore (ai): remove content from ui messages
83
+ - 441d042: chore (ui): data stream protocol v2 with SSEs
84
+ - dcc549b: remove StreamTextResult.mergeIntoDataStream method
85
+ rename DataStreamOptions.getErrorMessage to onError
86
+ add pipeTextStreamToResponse function
87
+ add createTextStreamResponse function
88
+ change createDataStreamResponse function to accept a DataStream and not a DataStreamWriter
89
+ change pipeDataStreamToResponse function to accept a DataStream and not a DataStreamWriter
90
+ change pipeDataStreamToResponse function to have a single parameter
91
+ - cb2b53a: chore (ai): refactor header preparation
92
+ - e244a78: chore (ai): remove StreamData and mergeStreams
93
+
94
+ ## 5.0.0-canary.18
95
+
96
+ ### Major Changes
97
+
98
+ - c60f895: chore (ai): remove useChat keepLastMessageOnError
99
+ - a662dea: chore (ai): remove sendExtraMessageFields
100
+
101
+ ### Patch Changes
102
+
103
+ - a571d6e: chore(provider-utils): move ToolResultContent to provider-utils
104
+ - 332167b: chore (ai): move maxSteps into UseChatOptions
105
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
106
+ - Updated dependencies [a571d6e]
107
+ - Updated dependencies [a8c8bd5]
108
+ - Updated dependencies [7979f7f]
109
+ - Updated dependencies [41fa418]
110
+ - @ai-sdk/provider-utils@3.0.0-canary.15
111
+ - @ai-sdk/provider@2.0.0-canary.14
112
+
113
+ ## 5.0.0-canary.17
114
+
115
+ ### Major Changes
116
+
117
+ - f04fb4a: chore (ai): replace useChat attachments with file ui parts
118
+ - fd1924b: chore (ai): remove redundant `mimeType` property
119
+ - fafc3f2: chore (ai): change file to parts to use urls instead of data
120
+ - 92cb0a2: chore (ai): rename CoreMessage to ModelMessage
121
+
122
+ ### Minor Changes
123
+
124
+ - c9ad635: feat (ai): add filename to file ui parts
125
+
126
+ ### Patch Changes
127
+
128
+ - 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2 interface (#5977)
129
+
130
+ The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
131
+
132
+ ```js
133
+ const prompt = 'Santa Claus driving a Cadillac';
134
+
135
+ const { providerMetadata } = await experimental_generateImage({
136
+ model: openai.image('dall-e-3'),
137
+ prompt,
138
+ });
139
+
140
+ const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;
141
+
142
+ console.log({
143
+ prompt,
144
+ revisedPrompt,
145
+ });
146
+ ```
147
+
148
+ - Updated dependencies [957b739]
149
+ - Updated dependencies [9bd5ab5]
150
+ - @ai-sdk/provider-utils@3.0.0-canary.14
151
+ - @ai-sdk/provider@2.0.0-canary.13
152
+
153
+ ## 5.0.0-canary.16
154
+
155
+ ### Major Changes
156
+
157
+ - ec78cdc: chore (ai): remove "data" UIMessage role
158
+ - 8b86e99: chore (ai): replace `Message` with `UIMessage`
159
+ - 2524fc7: chore (ai): remove ui message toolInvocations property
160
+ - 175b868: chore (ai): rename reasoning UI parts 'reasoning' property to 'text'
161
+
162
+ ### Patch Changes
163
+
164
+ - 9b4d074: feat(streamObject): add enum support
165
+ - 28ad69e: fix(react-native): support experimental_attachments without FileList global
166
+ - ec5933d: chore (ai/mcp): add `assertCapability` method to experimental MCP client
167
+
168
+ ## 5.0.0-canary.15
169
+
170
+ ### Major Changes
171
+
172
+ - 4bfe9ec: chore (ai): remove ui message reasoning property
173
+ - 2877a74: chore (ai): remove ui message data property
174
+
175
+ ### Patch Changes
176
+
177
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
178
+ - ea27cc6: chore (ai): use JSONValue definition from provider
179
+ - 0ff02bb: chore(provider-utils): move over jsonSchema
180
+ - Updated dependencies [7b3ae3f]
181
+ - Updated dependencies [0ff02bb]
182
+ - @ai-sdk/provider@2.0.0-canary.12
183
+ - @ai-sdk/provider-utils@3.0.0-canary.13
184
+
185
+ ## 5.0.0-canary.14
186
+
187
+ ### Patch Changes
188
+
189
+ - 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
190
+ - 4617fab: chore(embedding-models): remove remaining settings
191
+ - a76a62b: feat (ai): add experimental prepareStep callback to generateText
192
+ - Updated dependencies [9bf7291]
193
+ - Updated dependencies [4617fab]
194
+ - Updated dependencies [e030615]
195
+ - @ai-sdk/provider@2.0.0-canary.11
196
+ - @ai-sdk/provider-utils@3.0.0-canary.12
197
+
198
+ ## 5.0.0-canary.13
199
+
200
+ ### Patch Changes
201
+
202
+ - 14cb3be: chore(providers/llamaindex): extract to separate package
203
+ - 66962ed: fix(packages): export node10 compatible types
204
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
205
+ - Updated dependencies [66962ed]
206
+ - Updated dependencies [9301f86]
207
+ - Updated dependencies [a3f768e]
208
+ - @ai-sdk/provider-utils@3.0.0-canary.11
209
+ - @ai-sdk/provider@2.0.0-canary.10
210
+
211
+ ## 5.0.0-canary.12
212
+
213
+ ### Patch Changes
214
+
215
+ - Updated dependencies [e86be6f]
216
+ - @ai-sdk/provider@2.0.0-canary.9
217
+ - @ai-sdk/provider-utils@3.0.0-canary.10
218
+
219
+ ## 5.0.0-canary.11
220
+
221
+ ### Patch Changes
222
+
223
+ - 8e64e9c: feat (ai): allow using provider default temperature by specifying null
224
+ - Updated dependencies [95857aa]
225
+ - Updated dependencies [7ea4132]
226
+ - @ai-sdk/provider@2.0.0-canary.8
227
+ - @ai-sdk/provider-utils@3.0.0-canary.9
228
+
229
+ ## 5.0.0-canary.10
230
+
231
+ ### Patch Changes
232
+
233
+ - d8aeaef: feat(providers/fal): add transcribe
234
+ - 3e10408: fix(utils/detect-mimetype): add support for detecting id3 tags
235
+
236
+ ## 5.0.0-canary.9
237
+
238
+ ### Major Changes
239
+
240
+ - a847c3e: chore: rename reasoning to reasoningText etc
241
+ - b32e192: chore (ai): rename reasoning to reasoningText, rename reasoningDetails to reasoning (streamText, generateText)
242
+
243
+ ### Patch Changes
244
+
245
+ - cb9c9e4: remove deprecated `experimental_wrapLanguageModel`
246
+ - 8aa9e20: feat: add speech with experimental_generateSpeech
247
+ - Updated dependencies [5d142ab]
248
+ - Updated dependencies [b6b43c7]
249
+ - Updated dependencies [8aa9e20]
250
+ - Updated dependencies [3795467]
251
+ - @ai-sdk/provider-utils@3.0.0-canary.8
252
+ - @ai-sdk/provider@2.0.0-canary.7
253
+
254
+ ## 5.0.0-canary.8
255
+
256
+ ### Major Changes
257
+
258
+ - 14c9410: chore: refactor file towards source pattern (spec)
259
+
260
+ ### Patch Changes
261
+
262
+ - 5d1e3ba: chore (ai): remove provider re-exports
263
+ - 26735b5: chore(embedding-model): add v2 interface
264
+ - 7827a49: fix (ai/core): refactor `toResponseMessages` to filter out empty string/content
265
+ - bd8a36c: feat(embedding-model-v2/embedMany): add response body field
266
+ - b6f9f3c: remove deprecated `CoreTool*` types
267
+ - 92c8e66: fix(ai/core): properly handle custom separator in provider registry
268
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
269
+ - 5bdff05: Removed deprecated `options.throwErrorForEmptyVectors` from `cosineSimilarity()`. Since `throwErrorForEmptyVectors` was the only option the entire `options` argument was removed.
270
+
271
+ ```diff
272
+ - cosineSimilarity(vector1, vector2, options)
273
+ +cosineSimilarity(vector1, vector2)
274
+ ```
275
+
276
+ - Updated dependencies [26735b5]
277
+ - Updated dependencies [443d8ec]
278
+ - Updated dependencies [14c9410]
279
+ - Updated dependencies [d9c98f4]
280
+ - Updated dependencies [c4a2fec]
281
+ - Updated dependencies [0054544]
282
+ - Updated dependencies [9e9c809]
283
+ - Updated dependencies [32831c6]
284
+ - Updated dependencies [d0f9495]
285
+ - Updated dependencies [fd65bc6]
286
+ - Updated dependencies [393138b]
287
+ - Updated dependencies [7182d14]
288
+ - @ai-sdk/provider@2.0.0-canary.6
289
+ - @ai-sdk/provider-utils@3.0.0-canary.7
290
+
291
+ ## 5.0.0-canary.7
292
+
293
+ ### Major Changes
294
+
295
+ - 6fba4c7: chore (ai): remove deprecated experimental_providerMetadata
296
+ - 1766ede: chore: rename maxTokens to maxOutputTokens
297
+
298
+ ### Patch Changes
299
+
300
+ - 0b78e17: chore(ai/generateObject): simplify function signature
301
+ - 3e3b9df: fix (ai/mcp): better support for zero-argument MCP tools
302
+ - f10304b: feat(tool-calling): don't require the user to have to pass parameters
303
+ - Updated dependencies [411e483]
304
+ - Updated dependencies [79457bd]
305
+ - Updated dependencies [ad80501]
306
+ - Updated dependencies [1766ede]
307
+ - Updated dependencies [f10304b]
308
+ - @ai-sdk/provider@2.0.0-canary.5
309
+ - @ai-sdk/provider-utils@3.0.0-canary.6
310
+
311
+ ## 5.0.0-canary.6
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [6f6bb89]
316
+ - @ai-sdk/provider@2.0.0-canary.4
317
+ - @ai-sdk/provider-utils@3.0.0-canary.5
318
+
319
+ ## 5.0.0-canary.5
320
+
321
+ ### Patch Changes
322
+
323
+ - b71fe8d: fix(ai): remove jsondiffpatch dependency
324
+ - d91b50d: chore(ui-utils): merge into ai package
325
+ - Updated dependencies [d1a1aa1]
326
+ - @ai-sdk/provider@2.0.0-canary.3
327
+ - @ai-sdk/provider-utils@3.0.0-canary.4
328
+
329
+ ## 5.0.0-canary.4
330
+
331
+ ### Major Changes
332
+
333
+ - e1cbf8a: chore(@ai-sdk/rsc): extract to separate package
334
+
335
+ ### Patch Changes
336
+
337
+ - 225f087: fix (ai/mcp): prevent mutation of customEnv
338
+ - a166433: feat: add transcription with experimental_transcribe
339
+ - 0a87932: core (ai): change transcription model mimeType to mediaType
340
+ - Updated dependencies [a166433]
341
+ - Updated dependencies [abf9a79]
342
+ - Updated dependencies [9f95b35]
343
+ - Updated dependencies [0a87932]
344
+ - Updated dependencies [6dc848c]
345
+ - @ai-sdk/provider-utils@3.0.0-canary.3
346
+ - @ai-sdk/provider@2.0.0-canary.2
347
+ - @ai-sdk/ui-utils@2.0.0-canary.3
348
+
349
+ ## 5.0.0-canary.3
350
+
351
+ ### Patch Changes
352
+
353
+ - Updated dependencies [c57e248]
354
+ - Updated dependencies [33f4a6a]
355
+ - @ai-sdk/provider@2.0.0-canary.1
356
+ - @ai-sdk/provider-utils@3.0.0-canary.2
357
+ - @ai-sdk/ui-utils@2.0.0-canary.2
358
+
3
359
  ## 5.0.0-canary.2
4
360
 
5
361
  ### Patch Changes
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # AI SDK
4
4
 
5
- The [AI SDK](https://sdk.vercel.ai/docs) is a TypeScript toolkit designed to help you build AI-powered applications using popular frameworks like Next.js, React, Svelte, Vue and runtimes like Node.js.
5
+ The [AI SDK](https://ai-sdk.dev/docs) is a TypeScript toolkit designed to help you build AI-powered applications using popular frameworks like Next.js, React, Svelte, Vue and runtimes like Node.js.
6
6
 
7
- To learn more about how to use the AI SDK, check out our [API Reference](https://sdk.vercel.ai/docs/reference) and [Documentation](https://sdk.vercel.ai/docs).
7
+ To learn more about how to use the AI SDK, check out our [API Reference](https://ai-sdk.dev/docs/reference) and [Documentation](https://ai-sdk.dev/docs).
8
8
 
9
9
  ## Installation
10
10
 
@@ -18,7 +18,7 @@ npm install ai
18
18
 
19
19
  ### AI SDK Core
20
20
 
21
- The [AI SDK Core](https://sdk.vercel.ai/docs/ai-sdk-core/overview) module provides a unified API to interact with model providers like [OpenAI](https://sdk.vercel.ai/providers/ai-sdk-providers/openai), [Anthropic](https://sdk.vercel.ai/providers/ai-sdk-providers/anthropic), [Google](https://sdk.vercel.ai/providers/ai-sdk-providers/google-generative-ai), and more.
21
+ The [AI SDK Core](https://ai-sdk.dev/docs/ai-sdk-core/overview) module provides a unified API to interact with model providers like [OpenAI](https://ai-sdk.dev/providers/ai-sdk-providers/openai), [Anthropic](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic), [Google](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai), and more.
22
22
 
23
23
  You will then install the model provider of your choice.
24
24
 
@@ -43,7 +43,7 @@ console.log(text);
43
43
 
44
44
  ### AI SDK UI
45
45
 
46
- The [AI SDK UI](https://sdk.vercel.ai/docs/ai-sdk-ui/overview) module provides a set of hooks that help you build chatbots and generative user interfaces. These hooks are framework agnostic, so they can be used in Next.js, React, Svelte, and Vue.
46
+ The [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) module provides a set of hooks that help you build chatbots and generative user interfaces. These hooks are framework agnostic, so they can be used in Next.js, React, Svelte, and Vue.
47
47
 
48
48
  You need to install the package for your framework:
49
49