ai 6.0.77 → 6.0.79

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,20 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.79
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a2208a2]
8
+ - @ai-sdk/gateway@3.0.40
9
+
10
+ ## 6.0.78
11
+
12
+ ### Patch Changes
13
+
14
+ - 59fcf30: fix(ai): make experimental_context required in ToolLoopAgentOnFinishCallback
15
+
16
+ This fixes a type inconsistency where `ToolLoopAgentOnFinishCallback` had `experimental_context` as optional while `StreamTextOnFinishCallback` and `GenerateTextOnFinishCallback` had it as required. Since `ToolLoopAgent` delegates to `streamText`/`generateText`, and both always pass `experimental_context` when invoking the callback, the types should match.
17
+
3
18
  ## 6.0.77
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -2959,13 +2959,13 @@ type ToolLoopAgentOnFinishCallback<TOOLS extends ToolSet = {}> = (event: StepRes
2959
2959
  */
2960
2960
  readonly totalUsage: LanguageModelUsage;
2961
2961
  /**
2962
- * Context that is passed into tool calls.
2962
+ * Context that is passed into tool execution.
2963
2963
  *
2964
2964
  * Experimental (can break in patch releases).
2965
2965
  *
2966
2966
  * @default undefined
2967
2967
  */
2968
- experimental_context?: unknown;
2968
+ experimental_context: unknown;
2969
2969
  }) => PromiseLike<void> | void;
2970
2970
 
2971
2971
  /**
package/dist/index.d.ts CHANGED
@@ -2959,13 +2959,13 @@ type ToolLoopAgentOnFinishCallback<TOOLS extends ToolSet = {}> = (event: StepRes
2959
2959
  */
2960
2960
  readonly totalUsage: LanguageModelUsage;
2961
2961
  /**
2962
- * Context that is passed into tool calls.
2962
+ * Context that is passed into tool execution.
2963
2963
  *
2964
2964
  * Experimental (can break in patch releases).
2965
2965
  *
2966
2966
  * @default undefined
2967
2967
  */
2968
- experimental_context?: unknown;
2968
+ experimental_context: unknown;
2969
2969
  }) => PromiseLike<void> | void;
2970
2970
 
2971
2971
  /**
package/dist/index.js CHANGED
@@ -1210,7 +1210,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1210
1210
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1211
1211
 
1212
1212
  // src/version.ts
1213
- var VERSION = true ? "6.0.77" : "0.0.0-test";
1213
+ var VERSION = true ? "6.0.79" : "0.0.0-test";
1214
1214
 
1215
1215
  // src/util/download/download.ts
1216
1216
  var download = async ({ url }) => {
package/dist/index.mjs CHANGED
@@ -1100,7 +1100,7 @@ import {
1100
1100
  } from "@ai-sdk/provider-utils";
1101
1101
 
1102
1102
  // src/version.ts
1103
- var VERSION = true ? "6.0.77" : "0.0.0-test";
1103
+ var VERSION = true ? "6.0.79" : "0.0.0-test";
1104
1104
 
1105
1105
  // src/util/download/download.ts
1106
1106
  var download = async ({ url }) => {
@@ -153,7 +153,7 @@ var import_provider_utils2 = require("@ai-sdk/provider-utils");
153
153
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
154
154
 
155
155
  // src/version.ts
156
- var VERSION = true ? "6.0.77" : "0.0.0-test";
156
+ var VERSION = true ? "6.0.79" : "0.0.0-test";
157
157
 
158
158
  // src/util/download/download.ts
159
159
  var download = async ({ url }) => {
@@ -128,7 +128,7 @@ import {
128
128
  } from "@ai-sdk/provider-utils";
129
129
 
130
130
  // src/version.ts
131
- var VERSION = true ? "6.0.77" : "0.0.0-test";
131
+ var VERSION = true ? "6.0.79" : "0.0.0-test";
132
132
 
133
133
  // src/util/download/download.ts
134
134
  var download = async ({ url }) => {
@@ -257,7 +257,7 @@ Let's enhance your chatbot by adding a simple weather tool.
257
257
 
258
258
  Modify your `app/api/chat/route.ts` file to include the new weather tool:
259
259
 
260
- ```tsx filename="app/api/chat/route.ts" highlight="2,11-25"
260
+ ```tsx filename="app/api/chat/route.ts" highlight="1,11-25"
261
261
  import { streamText, UIMessage, convertToModelMessages, tool } from 'ai';
262
262
  __PROVIDER_IMPORT__;
263
263
  import { z } from 'zod';
@@ -314,7 +314,7 @@ Notice the blank response in the UI? This is because instead of generating a tex
314
314
 
315
315
  To display the tool invocation in your UI, update your `app/page.tsx` file:
316
316
 
317
- ```tsx filename="app/page.tsx" highlight="16-21"
317
+ ```tsx filename="app/page.tsx" highlight="18-22"
318
318
  'use client';
319
319
 
320
320
  import { useChat } from '@ai-sdk/react';
@@ -376,7 +376,7 @@ To solve this, you can enable multi-step tool calls using `stopWhen`. By default
376
376
 
377
377
  Modify your `app/api/chat/route.ts` file to include the `stopWhen` condition:
378
378
 
379
- ```tsx filename="app/api/chat/route.ts"
379
+ ```tsx filename="app/api/chat/route.ts" highlight="16"
380
380
  import {
381
381
  streamText,
382
382
  UIMessage,
@@ -431,7 +431,7 @@ By setting `stopWhen: stepCountIs(5)`, you're allowing the model to use up to 5
431
431
 
432
432
  Update your `app/api/chat/route.ts` file to add a new tool to convert the temperature from Fahrenheit to Celsius:
433
433
 
434
- ```tsx filename="app/api/chat/route.ts" highlight="34-47"
434
+ ```tsx filename="app/api/chat/route.ts" highlight="31-46"
435
435
  import {
436
436
  streamText,
437
437
  UIMessage,
@@ -488,7 +488,7 @@ export async function POST(req: Request) {
488
488
 
489
489
  update your `app/page.tsx` file to render the new temperature conversion tool:
490
490
 
491
- ```tsx filename="app/page.tsx" highlight="21"
491
+ ```tsx filename="app/page.tsx" highlight="19"
492
492
  'use client';
493
493
 
494
494
  import { useChat } from '@ai-sdk/react';
@@ -252,7 +252,7 @@ For example, if a user asks about the current weather, without tools, the model
252
252
 
253
253
  Let's start by giving your chatbot a weather tool. Update your Route Handler (`app/api/chat/route.ts`):
254
254
 
255
- ```tsx filename="app/api/chat/route.ts"
255
+ ```tsx filename="app/api/chat/route.ts" highlight="1,11-25"
256
256
  import { streamText, UIMessage, convertToModelMessages, tool } from 'ai';
257
257
  __PROVIDER_IMPORT__;
258
258
  import { z } from 'zod';
@@ -369,7 +369,7 @@ To solve this, you can enable multi-step tool calls using `stopWhen`. By default
369
369
 
370
370
  Modify your `app/api/chat/route.ts` file to include the `stopWhen` condition:
371
371
 
372
- ```tsx filename="app/api/chat/route.ts"
372
+ ```tsx filename="app/api/chat/route.ts" highlight="16"
373
373
  import {
374
374
  streamText,
375
375
  UIMessage,
@@ -416,7 +416,7 @@ By setting `stopWhen: stepCountIs(5)`, you're allowing the model to use up to 5
416
416
 
417
417
  Update your `app/api/chat/route.ts` file to add a new tool to convert the temperature from Fahrenheit to Celsius:
418
418
 
419
- ```tsx filename="app/api/chat/route.ts" highlight="26-39"
419
+ ```tsx filename="app/api/chat/route.ts" highlight="31-46"
420
420
  import {
421
421
  streamText,
422
422
  UIMessage,
@@ -473,7 +473,7 @@ export async function POST(req: Request) {
473
473
 
474
474
  Update your `pages/index.tsx` file to render the new temperature conversion tool:
475
475
 
476
- ```tsx filename="pages/index.tsx" highlight="21"
476
+ ```tsx filename="pages/index.tsx" highlight="17"
477
477
  import { useChat } from '@ai-sdk/react';
478
478
  import { useState } from 'react';
479
479
 
@@ -352,6 +352,7 @@ try {
352
352
  | [FAL](/providers/ai-sdk-providers/fal#video-models) | `luma-dream-machine/ray-2` | Text-to-video, image-to-video |
353
353
  | [FAL](/providers/ai-sdk-providers/fal#video-models) | `minimax-video` | Text-to-video |
354
354
  | [Google](/providers/ai-sdk-providers/google#video-models) | `veo-2.0-generate-001` | Text-to-video, up to 4 videos per call |
355
+ | [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-3.1-generate-001` | Text-to-video, audio generation |
355
356
  | [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-2.0-generate-001` | Text-to-video, up to 4 videos per call |
356
357
  | [Replicate](/providers/ai-sdk-providers/replicate#video-models) | `minimax/video-01` | Text-to-video |
357
358
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.77",
3
+ "version": "6.0.79",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/api": "1.9.0",
48
- "@ai-sdk/gateway": "3.0.39",
48
+ "@ai-sdk/gateway": "3.0.40",
49
49
  "@ai-sdk/provider": "3.0.8",
50
50
  "@ai-sdk/provider-utils": "4.0.14"
51
51
  },
@@ -20,12 +20,12 @@ export type ToolLoopAgentOnFinishCallback<TOOLS extends ToolSet = {}> = (
20
20
  readonly totalUsage: LanguageModelUsage;
21
21
 
22
22
  /**
23
- * Context that is passed into tool calls.
23
+ * Context that is passed into tool execution.
24
24
  *
25
25
  * Experimental (can break in patch releases).
26
26
  *
27
27
  * @default undefined
28
28
  */
29
- experimental_context?: unknown;
29
+ experimental_context: unknown;
30
30
  },
31
31
  ) => PromiseLike<void> | void;