ai 7.0.0-beta.105 → 7.0.0-beta.106

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,12 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.0-beta.106
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [03dc15c]
8
+ - @ai-sdk/gateway@4.0.0-beta.58
9
+
3
10
  ## 7.0.0-beta.105
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1261,7 +1261,7 @@ import {
1261
1261
  } from "@ai-sdk/provider-utils";
1262
1262
 
1263
1263
  // src/version.ts
1264
- var VERSION = true ? "7.0.0-beta.105" : "0.0.0-test";
1264
+ var VERSION = true ? "7.0.0-beta.106" : "0.0.0-test";
1265
1265
 
1266
1266
  // src/util/download/download.ts
1267
1267
  var download = async ({
@@ -196,7 +196,7 @@ import {
196
196
  } from "@ai-sdk/provider-utils";
197
197
 
198
198
  // src/version.ts
199
- var VERSION = true ? "7.0.0-beta.105" : "0.0.0-test";
199
+ var VERSION = true ? "7.0.0-beta.106" : "0.0.0-test";
200
200
 
201
201
  // src/util/download/download.ts
202
202
  var download = async ({
@@ -345,6 +345,19 @@ const result = await agent.stream({
345
345
  });
346
346
  ```
347
347
 
348
+ If you want the agent to keep running until it has finished calling tools, you can also use `isLoopFinished()`:
349
+
350
+ ```ts
351
+ import { isLoopFinished } from "ai";
352
+
353
+ const result = await agent.stream({
354
+ messages,
355
+ stopWhen: isLoopFinished(),
356
+ });
357
+ ```
358
+
359
+ `isLoopFinished()` lets the agent run until all tool calls have completed, but you should still pair it with `maxSteps` to avoid runaway loops. See https://ai-sdk.dev/v7/docs/reference/ai-sdk-core/loop-finished#isloopfinished.
360
+
348
361
  By default, the agent loops until the model stops calling tools (no maximum).
349
362
 
350
363
  ## Structured Output
@@ -74,7 +74,7 @@ To see `ToolLoopAgent` in action, check out [these examples](#examples).
74
74
  type: 'StopCondition | StopCondition[]',
75
75
  isOptional: true,
76
76
  description:
77
- 'Condition(s) for ending the agent loop. Default: isStepCount(20).',
77
+ 'Condition(s) for ending the agent loop. Default: isStepCount(20). Use `isLoopFinished()` to let the agent run until all tool calls have completed, but beware of potential runaway loops. See https://ai-sdk.dev/v7/docs/reference/ai-sdk-core/loop-finished#isloopfinished.',
78
78
  },
79
79
  {
80
80
  name: 'activeTools',
@@ -88,7 +88,7 @@ To see `WorkflowAgent` in action, check out [these examples](#examples).
88
88
  name: 'stopWhen',
89
89
  type: 'StopCondition | StopCondition[]',
90
90
  isOptional: true,
91
- description: 'Default stop condition for the agent loop. Per-stream values override this default.',
91
+ description: 'Default stop condition for the agent loop. Per-stream values override this default. Use `isLoopFinished()` to let the agent run until all tool calls have completed, but beware of potential runaway loops. See https://ai-sdk.dev/v7/docs/reference/ai-sdk-core/loop-finished#isloopfinished.',
92
92
  },
93
93
  {
94
94
  name: 'activeTools',
@@ -409,7 +409,7 @@ const result = await agent.stream({
409
409
  name: 'stopWhen',
410
410
  type: 'StopCondition | StopCondition[]',
411
411
  isOptional: true,
412
- description: 'Condition(s) for ending the agent loop.',
412
+ description: 'Condition(s) for ending the agent loop. Use `isLoopFinished()` to let the agent run until all tool calls have completed, but beware of potential runaway loops. See https://ai-sdk.dev/v7/docs/reference/ai-sdk-core/loop-finished#isloopfinished.',
413
413
  },
414
414
 
415
415
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.0-beta.105",
3
+ "version": "7.0.0-beta.106",
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.0-beta.57",
45
+ "@ai-sdk/gateway": "4.0.0-beta.58",
46
46
  "@ai-sdk/provider": "4.0.0-beta.12",
47
47
  "@ai-sdk/provider-utils": "5.0.0-beta.22"
48
48
  },