ai 0.0.0-8777c42a-20250115032312 → 0.0.0-9477ebb9-20250403064906

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 (39) hide show
  1. package/CHANGELOG.md +660 -2
  2. package/README.md +19 -6
  3. package/dist/index.d.mts +3036 -1314
  4. package/dist/index.d.ts +3036 -1314
  5. package/dist/index.js +2705 -985
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +2667 -962
  8. package/dist/index.mjs.map +1 -1
  9. package/mcp-stdio/create-child-process.test.ts +92 -0
  10. package/mcp-stdio/create-child-process.ts +21 -0
  11. package/mcp-stdio/dist/index.d.mts +169 -0
  12. package/mcp-stdio/dist/index.d.ts +169 -0
  13. package/mcp-stdio/dist/index.js +352 -0
  14. package/mcp-stdio/dist/index.js.map +1 -0
  15. package/mcp-stdio/dist/index.mjs +337 -0
  16. package/mcp-stdio/dist/index.mjs.map +1 -0
  17. package/mcp-stdio/get-environment.ts +43 -0
  18. package/mcp-stdio/index.ts +4 -0
  19. package/mcp-stdio/mcp-stdio-transport.test.ts +262 -0
  20. package/mcp-stdio/mcp-stdio-transport.ts +157 -0
  21. package/package.json +14 -10
  22. package/react/dist/index.d.mts +12 -4
  23. package/react/dist/index.d.ts +12 -4
  24. package/react/dist/index.js +0 -3
  25. package/react/dist/index.js.map +1 -1
  26. package/react/dist/index.mjs +0 -3
  27. package/react/dist/index.mjs.map +1 -1
  28. package/rsc/dist/index.d.ts +108 -18
  29. package/rsc/dist/rsc-server.d.mts +108 -18
  30. package/rsc/dist/rsc-server.mjs +550 -256
  31. package/rsc/dist/rsc-server.mjs.map +1 -1
  32. package/rsc/dist/rsc-shared.mjs +1 -3
  33. package/rsc/dist/rsc-shared.mjs.map +1 -1
  34. package/test/dist/index.d.mts +2 -4
  35. package/test/dist/index.d.ts +2 -4
  36. package/test/dist/index.js +4 -14
  37. package/test/dist/index.js.map +1 -1
  38. package/test/dist/index.mjs +7 -14
  39. package/test/dist/index.mjs.map +1 -1
package/CHANGELOG.md CHANGED
@@ -1,10 +1,668 @@
1
1
  # ai
2
2
 
3
- ## 0.0.0-8777c42a-20250115032312
3
+ ## 0.0.0-9477ebb9-20250403064906
4
+
5
+ ### Major Changes
6
+
7
+ - 9477ebb: chore (ui): remove useAssistant hook (**breaking change**)
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [9477ebb]
12
+ - @ai-sdk/ui-utils@0.0.0-9477ebb9-20250403064906
13
+ - @ai-sdk/react@0.0.0-9477ebb9-20250403064906
14
+
15
+ ## 4.2.10
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [a043b14]
20
+ - Updated dependencies [28be004]
21
+ - @ai-sdk/react@1.2.5
22
+ - @ai-sdk/provider-utils@2.2.3
23
+ - @ai-sdk/ui-utils@1.2.4
24
+
25
+ ## 4.2.9
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [b01120e]
30
+ - @ai-sdk/provider-utils@2.2.2
31
+ - @ai-sdk/react@1.2.4
32
+ - @ai-sdk/ui-utils@1.2.3
33
+
34
+ ## 4.2.8
35
+
36
+ ### Patch Changes
37
+
38
+ - 65243ce: fix (ui): introduce step start parts
39
+ - Updated dependencies [65243ce]
40
+ - @ai-sdk/ui-utils@1.2.2
41
+ - @ai-sdk/react@1.2.3
42
+
43
+ ## 4.2.7
44
+
45
+ ### Patch Changes
46
+
47
+ - e14c066: fix (ai/core): convert user ui messages with only parts (no content) to core messages
48
+
49
+ ## 4.2.6
50
+
51
+ ### Patch Changes
52
+
53
+ - 625591b: feat (ai/core): auto-complete for provider registry
54
+ - 6a1506f: feat (ai/core): custom separator support for provider registry
55
+ - ea3d998: chore (ai/core): move provider registry to stable
56
+
57
+ ## 4.2.5
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [d92fa29]
62
+ - @ai-sdk/react@1.2.2
63
+
64
+ ## 4.2.4
65
+
66
+ ### Patch Changes
67
+
68
+ - 3d6d96d: fix (ai/core): validate that messages are not empty
69
+
70
+ ## 4.2.3
71
+
72
+ ### Patch Changes
73
+
74
+ - 0b3bf29: fix (ai/core): custom env support for stdio MCP transport
75
+
76
+ ## 4.2.2
77
+
78
+ ### Patch Changes
79
+
80
+ - f10f0fa: fix (provider-utils): improve event source stream parsing performance
81
+ - Updated dependencies [f10f0fa]
82
+ - @ai-sdk/provider-utils@2.2.1
83
+ - @ai-sdk/react@1.2.1
84
+ - @ai-sdk/ui-utils@1.2.1
85
+
86
+ ## 4.2.1
87
+
88
+ ### Patch Changes
89
+
90
+ - b796152: feat (ai/core): add headers to MCP SSE transport
91
+ - 06361d6: feat (ai/core): expose JSON RPC types (MCP)
92
+
93
+ ## 4.2.0
94
+
95
+ ### Minor Changes
96
+
97
+ - 5bc638d: AI SDK 4.2
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [5bc638d]
102
+ - @ai-sdk/provider@1.1.0
103
+ - @ai-sdk/provider-utils@2.2.0
104
+ - @ai-sdk/react@1.2.0
105
+ - @ai-sdk/ui-utils@1.2.0
106
+
107
+ ## 4.1.66
108
+
109
+ ### Patch Changes
110
+
111
+ - 5d0fc29: chore (ai): improve cosine similarity calculation
112
+
113
+ ## 4.1.65
114
+
115
+ ### Patch Changes
116
+
117
+ - 16c444f: fix (ai): expose ai/mcp-stdio
118
+
119
+ ## 4.1.64
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [d0c4659]
124
+ - @ai-sdk/provider-utils@2.1.15
125
+ - @ai-sdk/react@1.1.25
126
+ - @ai-sdk/ui-utils@1.1.21
127
+
128
+ ## 4.1.63
129
+
130
+ ### Patch Changes
131
+
132
+ - 0bd5bc6: feat (ai): support model-generated files
133
+ - Updated dependencies [0bd5bc6]
134
+ - @ai-sdk/provider@1.0.12
135
+ - @ai-sdk/provider-utils@2.1.14
136
+ - @ai-sdk/ui-utils@1.1.20
137
+ - @ai-sdk/react@1.1.24
138
+
139
+ ## 4.1.62
140
+
141
+ ### Patch Changes
142
+
143
+ - c9ed3c4: feat: enable custom mcp transports
144
+ breaking change: remove internal stdio transport creation
145
+
146
+ ## 4.1.61
147
+
148
+ ### Patch Changes
149
+
150
+ - 2e1101a: feat (provider/openai): pdf input support
151
+ - Updated dependencies [2e1101a]
152
+ - @ai-sdk/provider@1.0.11
153
+ - @ai-sdk/provider-utils@2.1.13
154
+ - @ai-sdk/ui-utils@1.1.19
155
+ - @ai-sdk/react@1.1.23
156
+
157
+ ## 4.1.60
158
+
159
+ ### Patch Changes
160
+
161
+ - 0b8797f: feat (ai/core): expose response body for each generateText step
162
+
163
+ ## 4.1.59
164
+
165
+ ### Patch Changes
166
+
167
+ - dd18049: fix (ai/core): suppress next.js warnings for node.js specific code path
168
+
169
+ ## 4.1.58
170
+
171
+ ### Patch Changes
172
+
173
+ - e9897eb: fix (ai/core): move process access into functions and use globalThis
174
+
175
+ ## 4.1.57
176
+
177
+ ### Patch Changes
178
+
179
+ - 092fdaa: feat (ai/core): add defaultSettingsMiddleware
180
+
181
+ ## 4.1.56
182
+
183
+ ### Patch Changes
184
+
185
+ - 80be82b: feat (ai/core): add simulateStreamingMiddleware
186
+ - 8109a24: fix (ai/core): limit node imports to types where possible
187
+
188
+ ## 4.1.55
189
+
190
+ ### Patch Changes
191
+
192
+ - 1531959: feat (ai/core): add MCP client for using MCP tools
193
+ - Updated dependencies [1531959]
194
+ - @ai-sdk/provider-utils@2.1.12
195
+ - @ai-sdk/react@1.1.22
196
+ - @ai-sdk/ui-utils@1.1.18
197
+
198
+ ## 4.1.54
199
+
200
+ ### Patch Changes
201
+
202
+ - ee1c787: fix (ai/core): correct spread apply order to fix extract reasoning middleware with generateText
203
+
204
+ ## 4.1.53
205
+
206
+ ### Patch Changes
207
+
208
+ - e1d3d42: feat (ai): expose raw response body in generateText and generateObject
209
+ - Updated dependencies [e1d3d42]
210
+ - @ai-sdk/provider@1.0.10
211
+ - @ai-sdk/provider-utils@2.1.11
212
+ - @ai-sdk/ui-utils@1.1.17
213
+ - @ai-sdk/react@1.1.21
214
+
215
+ ## 4.1.52
216
+
217
+ ### Patch Changes
218
+
219
+ - 5329a69: fix (ai/core): fix duplicated reasoning in streamText onFinish and messages
220
+
221
+ ## 4.1.51
222
+
223
+ ### Patch Changes
224
+
225
+ - 0cb2647: feat (ai/core): add streamText sendStart & sendFinish data stream options
226
+
227
+ ## 4.1.50
228
+
229
+ ### Patch Changes
230
+
231
+ - ae98f0d: fix (ai/core): forward providerOptions for text, image, and file parts
232
+
233
+ ## 4.1.49
234
+
235
+ ### Patch Changes
236
+
237
+ - dc027d3: fix (ai/core): add reasoning support to appendResponseMessages
238
+
239
+ ## 4.1.48
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [6255fbc]
244
+ - @ai-sdk/react@1.1.20
245
+
246
+ ## 4.1.47
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies [da5c734]
251
+ - @ai-sdk/react@1.1.19
252
+
253
+ ## 4.1.46
254
+
255
+ ### Patch Changes
256
+
257
+ - ddf9740: feat (ai): add anthropic reasoning
258
+ - Updated dependencies [ddf9740]
259
+ - @ai-sdk/provider@1.0.9
260
+ - @ai-sdk/ui-utils@1.1.16
261
+ - @ai-sdk/provider-utils@2.1.10
262
+ - @ai-sdk/react@1.1.18
263
+
264
+ ## 4.1.45
265
+
266
+ ### Patch Changes
267
+
268
+ - 93bd5a0: feat (ai/ui): add writeSource to createDataStream
269
+
270
+ ## 4.1.44
271
+
272
+ ### Patch Changes
273
+
274
+ - f8e7df2: fix (ai/core): add `startWithReasoning` option to `extractReasoningMiddleware`
275
+
276
+ ## 4.1.43
277
+
278
+ ### Patch Changes
279
+
280
+ - ef2e23b: feat (ai/core): add experimental repairText function to generateObject
281
+
282
+ ## 4.1.42
283
+
284
+ ### Patch Changes
285
+
286
+ - Updated dependencies [2761f06]
287
+ - @ai-sdk/provider@1.0.8
288
+ - @ai-sdk/provider-utils@2.1.9
289
+ - @ai-sdk/ui-utils@1.1.15
290
+ - @ai-sdk/react@1.1.17
291
+
292
+ ## 4.1.41
293
+
294
+ ### Patch Changes
295
+
296
+ - Updated dependencies [60c3220]
297
+ - @ai-sdk/react@1.1.16
298
+
299
+ ## 4.1.40
300
+
301
+ ### Patch Changes
302
+
303
+ - Updated dependencies [c43df41]
304
+ - @ai-sdk/react@1.1.15
305
+
306
+ ## 4.1.39
307
+
308
+ ### Patch Changes
309
+
310
+ - 075a9a9: fix (ai): improve tsdoc on custom provider
311
+
312
+ ## 4.1.38
313
+
314
+ ### Patch Changes
315
+
316
+ - 4c9c194: chore (ai): add description to provider-defined tools for better accessibility
317
+ - 2e898b4: chore (ai): move mockId test helper into provider utils
318
+ - Updated dependencies [2e898b4]
319
+ - @ai-sdk/provider-utils@2.1.8
320
+ - @ai-sdk/react@1.1.14
321
+ - @ai-sdk/ui-utils@1.1.14
322
+
323
+ ## 4.1.37
324
+
325
+ ### Patch Changes
326
+
327
+ - c1e10d1: chore: export UIMessage type
328
+
329
+ ## 4.1.36
330
+
331
+ ### Patch Changes
332
+
333
+ - Updated dependencies [3ff4ef8]
334
+ - @ai-sdk/provider-utils@2.1.7
335
+ - @ai-sdk/react@1.1.13
336
+ - @ai-sdk/ui-utils@1.1.13
337
+
338
+ ## 4.1.35
339
+
340
+ ### Patch Changes
341
+
342
+ - 166e09e: feat (ai/ui): forward source parts to useChat
343
+ - Updated dependencies [166e09e]
344
+ - @ai-sdk/ui-utils@1.1.12
345
+ - @ai-sdk/react@1.1.12
346
+
347
+ ## 4.1.34
348
+
349
+ ### Patch Changes
350
+
351
+ - dc49119: chore: deprecate ai/react
352
+
353
+ ## 4.1.33
354
+
355
+ ### Patch Changes
356
+
357
+ - 74f0f0e: chore (ai/core): move providerMetadata to stable
358
+
359
+ ## 4.1.32
360
+
361
+ ### Patch Changes
362
+
363
+ - c128ca5: fix (ai/core): fix streamText onFinish messages with structured output
364
+
365
+ ## 4.1.31
366
+
367
+ ### Patch Changes
368
+
369
+ - b30b1cc: feat (ai/core): add onError callback to streamObject
370
+
371
+ ## 4.1.30
372
+
373
+ ### Patch Changes
374
+
375
+ - 4ee5b6f: fix (core): remove invalid providerOptions from streamObject onFinish callback
376
+
377
+ ## 4.1.29
378
+
379
+ ### Patch Changes
380
+
381
+ - 605de49: feat (ai/core): export callback types
382
+
383
+ ## 4.1.28
384
+
385
+ ### Patch Changes
386
+
387
+ - 6eb7fc4: feat (ai/core): url source support
388
+
389
+ ## 4.1.27
390
+
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies [318b351]
394
+ - @ai-sdk/ui-utils@1.1.11
395
+ - @ai-sdk/react@1.1.11
396
+
397
+ ## 4.1.26
398
+
399
+ ### Patch Changes
400
+
401
+ - 34983d4: fix (ai/core): bind supportsUrl when creating wrapper
402
+
403
+ ## 4.1.25
404
+
405
+ ### Patch Changes
406
+
407
+ - 5a21310: fix (ai/core): use ai types on custom provider to prevent ts error
408
+
409
+ ## 4.1.24
410
+
411
+ ### Patch Changes
412
+
413
+ - 38142b8: feat (ai/core): introduce streamText consumeStream
414
+
415
+ ## 4.1.23
416
+
417
+ ### Patch Changes
418
+
419
+ - b08f7c1: fix (ai/core): suppress errors in textStream
420
+
421
+ ## 4.1.22
422
+
423
+ ### Patch Changes
424
+
425
+ - 2bec72a: feat (ai/core): add onError callback to streamText
426
+
427
+ ## 4.1.21
428
+
429
+ ### Patch Changes
430
+
431
+ - d387989: feat (ai/core): re-export zodSchema
432
+
433
+ ## 4.1.20
434
+
435
+ ### Patch Changes
436
+
437
+ - bcc61d4: feat (ui): introduce message parts for useChat
438
+ - Updated dependencies [bcc61d4]
439
+ - @ai-sdk/ui-utils@1.1.10
440
+ - @ai-sdk/react@1.1.10
441
+
442
+ ## 4.1.19
443
+
444
+ ### Patch Changes
445
+
446
+ - Updated dependencies [6b8cc14]
447
+ - @ai-sdk/ui-utils@1.1.9
448
+ - @ai-sdk/react@1.1.9
449
+
450
+ ## 4.1.18
451
+
452
+ ### Patch Changes
453
+
454
+ - 6a1acfe: fix (ai/core): revert '@internal' tag on function definitions due to build impacts
455
+
456
+ ## 4.1.17
457
+
458
+ ### Patch Changes
459
+
460
+ - 5af8cdb: fix (ai/core): support this reference in model.supportsUrl implementations
461
+
462
+ ## 4.1.16
463
+
464
+ ### Patch Changes
465
+
466
+ - 7e299a4: feat (ai/core): wrapLanguageModel can apply multiple middlewares
467
+
468
+ ## 4.1.15
469
+
470
+ ### Patch Changes
471
+
472
+ - d89c3b9: feat (provider): add image model support to provider specification
473
+ - d89c3b9: feat (core): type ahead for model ids with custom provider
474
+ - 08f54fc: chore (ai/core): move custom provider to stable
475
+ - Updated dependencies [d89c3b9]
476
+ - @ai-sdk/provider@1.0.7
477
+ - @ai-sdk/provider-utils@2.1.6
478
+ - @ai-sdk/ui-utils@1.1.8
479
+ - @ai-sdk/react@1.1.8
480
+
481
+ ## 4.1.14
482
+
483
+ ### Patch Changes
484
+
485
+ - ca89615: fix (ai/core): only append assistant response at the end when there is a final user message
486
+
487
+ ## 4.1.13
488
+
489
+ ### Patch Changes
490
+
491
+ - 999085e: feat (ai/core): add write function to DataStreamWriter
492
+
493
+ ## 4.1.12
494
+
495
+ ### Patch Changes
496
+
497
+ - 0d2d9bf: fix (ui): single assistant message with multiple tool steps
498
+ - Updated dependencies [0d2d9bf]
499
+ - Updated dependencies [0d2d9bf]
500
+ - @ai-sdk/react@1.1.7
501
+ - @ai-sdk/ui-utils@1.1.7
502
+
503
+ ## 4.1.11
504
+
505
+ ### Patch Changes
506
+
507
+ - 4c58da5: chore (core): move providerOptions to stable
508
+
509
+ ## 4.1.10
510
+
511
+ ### Patch Changes
512
+
513
+ - bf2c9c6: feat (core): move middleware to stable
514
+
515
+ ## 4.1.9
516
+
517
+ ### Patch Changes
518
+
519
+ - 3a602ca: chore (core): rename CoreTool to Tool
520
+ - Updated dependencies [3a602ca]
521
+ - @ai-sdk/provider-utils@2.1.5
522
+ - @ai-sdk/ui-utils@1.1.6
523
+ - @ai-sdk/react@1.1.6
524
+
525
+ ## 4.1.8
526
+
527
+ ### Patch Changes
528
+
529
+ - 92f5f36: feat (core): add extractReasoningMiddleware
530
+
531
+ ## 4.1.7
532
+
533
+ ### Patch Changes
534
+
535
+ - 066206e: feat (provider-utils): move delay to provider-utils from ai
536
+ - Updated dependencies [066206e]
537
+ - @ai-sdk/provider-utils@2.1.4
538
+ - @ai-sdk/react@1.1.5
539
+ - @ai-sdk/ui-utils@1.1.5
540
+
541
+ ## 4.1.6
542
+
543
+ ### Patch Changes
544
+
545
+ - Updated dependencies [39e5c1f]
546
+ - @ai-sdk/provider-utils@2.1.3
547
+ - @ai-sdk/react@1.1.4
548
+ - @ai-sdk/ui-utils@1.1.4
549
+
550
+ ## 4.1.5
551
+
552
+ ### Patch Changes
553
+
554
+ - 9ce598c: feat (ai/ui): add reasoning support to useChat
555
+ - Updated dependencies [9ce598c]
556
+ - @ai-sdk/ui-utils@1.1.3
557
+ - @ai-sdk/react@1.1.3
558
+
559
+ ## 4.1.4
560
+
561
+ ### Patch Changes
562
+
563
+ - caaad11: feat (ai/core): re-export languagemodelv1 types for middleware implementations
564
+ - caaad11: feat (ai/core): expose TelemetrySettings type
565
+
566
+ ## 4.1.3
567
+
568
+ ### Patch Changes
569
+
570
+ - 7f30a77: feat (core): export core message schemas
571
+ - 4298996: feat (core): add helper for merging single client message
572
+
573
+ ## 4.1.2
574
+
575
+ ### Patch Changes
576
+
577
+ - 3c5fafa: chore (ai/core): move streamText toolCallStreaming option to stable
578
+ - 3a58a2e: feat (ai/core): throw NoImageGeneratedError from generateImage when no predictions are returned.
579
+ - Updated dependencies [ed012d2]
580
+ - Updated dependencies [6f4d063]
581
+ - Updated dependencies [3a58a2e]
582
+ - @ai-sdk/provider-utils@2.1.2
583
+ - @ai-sdk/react@1.1.2
584
+ - @ai-sdk/provider@1.0.6
585
+ - @ai-sdk/ui-utils@1.1.2
586
+
587
+ ## 4.1.1
588
+
589
+ ### Patch Changes
590
+
591
+ - 0a699f1: feat: add reasoning token support
592
+ - Updated dependencies [e7a9ec9]
593
+ - Updated dependencies [0a699f1]
594
+ - @ai-sdk/ui-utils@1.1.1
595
+ - @ai-sdk/provider-utils@2.1.1
596
+ - @ai-sdk/provider@1.0.5
597
+ - @ai-sdk/react@1.1.1
598
+
599
+ ## 4.1.0
600
+
601
+ ### Minor Changes
602
+
603
+ - 62ba5ad: release: AI SDK 4.1
604
+
605
+ ### Patch Changes
606
+
607
+ - Updated dependencies [62ba5ad]
608
+ - @ai-sdk/provider-utils@2.1.0
609
+ - @ai-sdk/react@1.1.0
610
+ - @ai-sdk/ui-utils@1.1.0
611
+
612
+ ## 4.0.41
613
+
614
+ ### Patch Changes
615
+
616
+ - Updated dependencies [44f04d5]
617
+ - @ai-sdk/react@1.0.14
618
+
619
+ ## 4.0.40
620
+
621
+ ### Patch Changes
622
+
623
+ - 33592d2: fix (ai/core): switch to json schema 7 target for zod to json schema conversion
624
+ - Updated dependencies [33592d2]
625
+ - @ai-sdk/ui-utils@1.0.12
626
+ - @ai-sdk/react@1.0.13
627
+
628
+ ## 4.0.39
629
+
630
+ ### Patch Changes
631
+
632
+ - 00114c5: feat: expose IDGenerator and createIdGenerator
633
+ - 00114c5: feat (ui): generate and forward message ids for response messages
634
+ - Updated dependencies [00114c5]
635
+ - Updated dependencies [00114c5]
636
+ - @ai-sdk/provider-utils@2.0.8
637
+ - @ai-sdk/ui-utils@1.0.11
638
+ - @ai-sdk/react@1.0.12
639
+
640
+ ## 4.0.38
641
+
642
+ ### Patch Changes
643
+
644
+ - 0118fa7: fix (ai/core): handle empty tool invocation array in convertToCoreMessages
645
+
646
+ ## 4.0.37
647
+
648
+ ### Patch Changes
649
+
650
+ - 8304ed8: feat (ai/core): Add option `throwErrorForEmptyVectors` to cosineSimilarity
651
+ - ed28182: feat (ai/ui): add appendResponseMessages helper
652
+
653
+ ## 4.0.36
654
+
655
+ ### Patch Changes
656
+
657
+ - Updated dependencies [37f4510]
658
+ - @ai-sdk/ui-utils@1.0.10
659
+ - @ai-sdk/react@1.0.11
660
+
661
+ ## 4.0.35
4
662
 
5
663
  ### Patch Changes
6
664
 
7
- - 8777c42: console log latency
665
+ - 3491f78: feat (ai/core): support multiple stream text transforms
8
666
 
9
667
  ## 4.0.34
10
668
 
package/README.md CHANGED
@@ -43,25 +43,38 @@ 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, Vue, and SolidJS.
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.
47
+
48
+ You need to install the package for your framework:
49
+
50
+ ```shell
51
+ npm install @ai-sdk/react
52
+ ```
47
53
 
48
54
  ###### @/app/page.tsx (Next.js App Router)
49
55
 
50
56
  ```tsx
51
57
  'use client';
52
58
 
53
- import { useChat } from 'ai/react';
59
+ import { useChat } from '@ai-sdk/react';
54
60
 
55
61
  export default function Page() {
56
- const { messages, input, handleSubmit, handleInputChange, isLoading } =
62
+ const { messages, input, handleSubmit, handleInputChange, status } =
57
63
  useChat();
58
64
 
59
65
  return (
60
66
  <div>
61
67
  {messages.map(message => (
62
68
  <div key={message.id}>
63
- <div>{message.role}</div>
64
- <div>{message.content}</div>
69
+ <strong>{`${message.role}: `}</strong>
70
+ {message.parts.map((part, index) => {
71
+ switch (part.type) {
72
+ case 'text':
73
+ return <span key={index}>{part.text}</span>;
74
+
75
+ // other cases can handle images, tool calls, etc
76
+ }
77
+ })}
65
78
  </div>
66
79
  ))}
67
80
 
@@ -70,7 +83,7 @@ export default function Page() {
70
83
  value={input}
71
84
  placeholder="Send a message..."
72
85
  onChange={handleInputChange}
73
- disabled={isLoading}
86
+ disabled={status !== 'ready'}
74
87
  />
75
88
  </form>
76
89
  </div>