@ai-sdk/provider-utils 5.0.16 → 5.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.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types/tool-caller.ts +3 -5
package/package.json
CHANGED
package/src/types/tool-caller.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { ProviderOptions } from './provider-options';
|
|
|
2
2
|
import type { Tool } from './tool';
|
|
3
3
|
import type { ToolSet } from './tool-set';
|
|
4
4
|
|
|
5
|
-
const toolCallerSymbol = Symbol.for('vercel.ai.experimental.toolCaller');
|
|
6
|
-
|
|
7
5
|
export type ToolCallerDefinition =
|
|
8
6
|
| {
|
|
9
7
|
type: 'local';
|
|
@@ -17,14 +15,14 @@ export type ToolCallerDefinition =
|
|
|
17
15
|
};
|
|
18
16
|
|
|
19
17
|
export type ToolCallerTool<TOOL extends Tool = Tool> = TOOL & {
|
|
20
|
-
readonly
|
|
18
|
+
readonly experimental_toolCaller: ToolCallerDefinition;
|
|
21
19
|
};
|
|
22
20
|
|
|
23
21
|
export function toolCaller<TOOL extends Tool>(
|
|
24
22
|
tool: TOOL,
|
|
25
23
|
definition: ToolCallerDefinition,
|
|
26
24
|
): ToolCallerTool<TOOL> {
|
|
27
|
-
return Object.defineProperty({ ...tool },
|
|
25
|
+
return Object.defineProperty({ ...tool }, 'experimental_toolCaller', {
|
|
28
26
|
value: definition,
|
|
29
27
|
}) as ToolCallerTool<TOOL>;
|
|
30
28
|
}
|
|
@@ -32,5 +30,5 @@ export function toolCaller<TOOL extends Tool>(
|
|
|
32
30
|
export function getToolCaller(
|
|
33
31
|
tool: Tool | undefined,
|
|
34
32
|
): ToolCallerDefinition | undefined {
|
|
35
|
-
return (tool as ToolCallerTool | undefined)?.
|
|
33
|
+
return (tool as ToolCallerTool | undefined)?.experimental_toolCaller;
|
|
36
34
|
}
|