ai 7.0.0-beta.85 → 7.0.0-beta.86
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 +6 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/03-agents/04-loop-control.mdx +2 -2
- package/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/71-has-tool-call.mdx +24 -6
- package/docs/07-reference/01-ai-sdk-core/index.mdx +1 -1
- package/docs/08-migration-guides/26-migration-guide-5-0.mdx +5 -2
- package/package.json +1 -1
- package/src/generate-text/stop-condition.ts +5 -5
package/CHANGELOG.md
CHANGED
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
|
|
1251
|
+
* contains a tool call with any of the specified names.
|
|
1252
1252
|
*
|
|
1253
|
-
* @param toolName - The
|
|
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
|
|
1251
|
+
* contains a tool call with any of the specified names.
|
|
1252
1252
|
*
|
|
1253
|
-
* @param toolName - The
|
|
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.
|
|
1403
|
+
var VERSION = true ? "7.0.0-beta.86" : "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
|
|
4034
|
+
(toolCall) => toolName.includes(toolCall.toolName)
|
|
4035
4035
|
)) != null ? _c : false;
|
|
4036
4036
|
};
|
|
4037
4037
|
}
|