ai 7.0.15 → 7.0.17

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.
@@ -85,7 +85,7 @@ import {
85
85
  } from "@ai-sdk/provider-utils";
86
86
 
87
87
  // src/version.ts
88
- var VERSION = true ? "7.0.15" : "0.0.0-test";
88
+ var VERSION = true ? "7.0.17" : "0.0.0-test";
89
89
 
90
90
  // src/util/download/download.ts
91
91
  var download = async ({
@@ -326,12 +326,12 @@ When the user clicks the "Regenerate" button, the AI provider will regenerate th
326
326
  <Note>This feature is currently only available for React.</Note>
327
327
 
328
328
  By default, the `useChat` hook will trigger a render every time a new chunk is received.
329
- You can throttle the UI updates with the `experimental_throttle` option.
329
+ You can throttle the UI updates with the `throttle` option.
330
330
 
331
331
  ```tsx filename="page.tsx" highlight="2-3"
332
332
  const { messages, ... } = useChat({
333
333
  // Throttle the messages and data updates to 50ms:
334
- experimental_throttle: 50
334
+ throttle: 50
335
335
  })
336
336
  ```
337
337
 
@@ -143,12 +143,12 @@ When the user clicks the "Stop" button, the fetch request will be aborted. This
143
143
  <Note>This feature is currently only available for React.</Note>
144
144
 
145
145
  By default, the `useCompletion` hook will trigger a render every time a new chunk is received.
146
- You can throttle the UI updates with the `experimental_throttle` option.
146
+ You can throttle the UI updates with the `throttle` option.
147
147
 
148
148
  ```tsx filename="page.tsx" highlight="2-3"
149
149
  const { completion, ... } = useCompletion({
150
150
  // Throttle the completion and data updates to 50ms:
151
- experimental_throttle: 50
151
+ throttle: 50
152
152
  })
153
153
  ```
154
154
 
@@ -334,7 +334,7 @@ Allows you to easily create a conversational user interface for your chatbot app
334
334
  'Optional callback function that is called when a data part is received.',
335
335
  },
336
336
  {
337
- name: 'experimental_throttle',
337
+ name: 'throttle',
338
338
  type: 'number',
339
339
  isOptional: true,
340
340
  description:
@@ -113,7 +113,7 @@ Allows you to create text completion based capabilities for your application. It
113
113
  'Optional. A custom fetch function to be used for the API call. Defaults to the global fetch function.',
114
114
  },
115
115
  {
116
- name: 'experimental_throttle',
116
+ name: 'throttle',
117
117
  type: 'number',
118
118
  isOptional: true,
119
119
  description:
@@ -18,14 +18,14 @@ need updating (e.g. Markdown). Throttling can mitigate this.
18
18
 
19
19
  ## Solution
20
20
 
21
- Use the `experimental_throttle` option to throttle the UI updates:
21
+ Use the `throttle` option to throttle the UI updates:
22
22
 
23
23
  ### `useChat`
24
24
 
25
25
  ```tsx filename="page.tsx" highlight="2-3"
26
26
  const { messages, ... } = useChat({
27
27
  // Throttle the messages and data updates to 50ms:
28
- experimental_throttle: 50
28
+ throttle: 50
29
29
  })
30
30
  ```
31
31
 
@@ -34,6 +34,6 @@ const { messages, ... } = useChat({
34
34
  ```tsx filename="page.tsx" highlight="2-3"
35
35
  const { completion, ... } = useCompletion({
36
36
  // Throttle the completion and data updates to 50ms:
37
- experimental_throttle: 50
37
+ throttle: 50
38
38
  })
39
39
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.15",
3
+ "version": "7.0.17",
4
4
  "type": "module",
5
5
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@ai-sdk/gateway": "4.0.12",
45
+ "@ai-sdk/gateway": "4.0.13",
46
46
  "@ai-sdk/provider": "4.0.2",
47
47
  "@ai-sdk/provider-utils": "5.0.5"
48
48
  },
package/src/ui/chat.ts CHANGED
@@ -493,7 +493,7 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
493
493
  ? {
494
494
  ...part,
495
495
  state: 'approval-responded',
496
- approval: { id, approved, reason },
496
+ approval: { ...part.approval, id, approved, reason },
497
497
  }
498
498
  : part;
499
499