ai 7.0.0-beta.85 → 7.0.0-beta.87

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,19 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.0-beta.87
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [bdbd322]
8
+ - Updated dependencies [8f53ccf]
9
+ - @ai-sdk/gateway@4.0.0-beta.48
10
+
11
+ ## 7.0.0-beta.86
12
+
13
+ ### Patch Changes
14
+
15
+ - 5a6f514: feat(ai): support several tools in hasToolCall stop condition
16
+
3
17
  ## 7.0.0-beta.85
4
18
 
5
19
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -1248,11 +1248,11 @@ declare function isStepCount(stepCount: number): StopCondition<any, any>;
1248
1248
  declare function isLoopFinished(): StopCondition<any, any>;
1249
1249
  /**
1250
1250
  * Creates a stop condition that returns `true` when the most recent step
1251
- * contains a tool call with the specified name.
1251
+ * contains a tool call with any of the specified names.
1252
1252
  *
1253
- * @param toolName - The name of the tool that should stop the loop.
1253
+ * @param toolName - The names of the tools that should stop the loop.
1254
1254
  */
1255
- declare function hasToolCall<TOOLS extends ToolSet>(toolName: keyof TOOLS | (string & {})): StopCondition<TOOLS, any>;
1255
+ declare function hasToolCall<TOOLS extends ToolSet>(...toolName: Array<keyof TOOLS | (string & {})>): StopCondition<TOOLS, any>;
1256
1256
 
1257
1257
  type ActiveTools<TOOLS extends ToolSet, ACTIVE_TOOL_NAMES extends readonly (keyof TOOLS)[] | undefined> = [ACTIVE_TOOL_NAMES] extends [readonly (keyof TOOLS)[]] ? Pick<TOOLS, ACTIVE_TOOL_NAMES[number]> : TOOLS;
1258
1258
  /**
package/dist/index.d.ts CHANGED
@@ -1248,11 +1248,11 @@ declare function isStepCount(stepCount: number): StopCondition<any, any>;
1248
1248
  declare function isLoopFinished(): StopCondition<any, any>;
1249
1249
  /**
1250
1250
  * Creates a stop condition that returns `true` when the most recent step
1251
- * contains a tool call with the specified name.
1251
+ * contains a tool call with any of the specified names.
1252
1252
  *
1253
- * @param toolName - The name of the tool that should stop the loop.
1253
+ * @param toolName - The names of the tools that should stop the loop.
1254
1254
  */
1255
- declare function hasToolCall<TOOLS extends ToolSet>(toolName: keyof TOOLS | (string & {})): StopCondition<TOOLS, any>;
1255
+ declare function hasToolCall<TOOLS extends ToolSet>(...toolName: Array<keyof TOOLS | (string & {})>): StopCondition<TOOLS, any>;
1256
1256
 
1257
1257
  type ActiveTools<TOOLS extends ToolSet, ACTIVE_TOOL_NAMES extends readonly (keyof TOOLS)[] | undefined> = [ACTIVE_TOOL_NAMES] extends [readonly (keyof TOOLS)[]] ? Pick<TOOLS, ACTIVE_TOOL_NAMES[number]> : TOOLS;
1258
1258
  /**
package/dist/index.js CHANGED
@@ -1400,7 +1400,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1400
1400
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1401
1401
 
1402
1402
  // src/version.ts
1403
- var VERSION = true ? "7.0.0-beta.85" : "0.0.0-test";
1403
+ var VERSION = true ? "7.0.0-beta.87" : "0.0.0-test";
1404
1404
 
1405
1405
  // src/util/download/download.ts
1406
1406
  var download = async ({
@@ -4027,11 +4027,11 @@ function isStepCount(stepCount) {
4027
4027
  function isLoopFinished() {
4028
4028
  return () => false;
4029
4029
  }
4030
- function hasToolCall(toolName) {
4030
+ function hasToolCall(...toolName) {
4031
4031
  return ({ steps }) => {
4032
4032
  var _a21, _b, _c;
4033
4033
  return (_c = (_b = (_a21 = steps[steps.length - 1]) == null ? void 0 : _a21.toolCalls) == null ? void 0 : _b.some(
4034
- (toolCall) => toolCall.toolName === toolName
4034
+ (toolCall) => toolName.includes(toolCall.toolName)
4035
4035
  )) != null ? _c : false;
4036
4036
  };
4037
4037
  }