You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,9 +16,21 @@ export type CustomToolDefinition<
16
16
description: string
17
17
endsAgentStep: boolean
18
18
exampleInputs: Input[]
19
-
handler: (params: Args)=>Promise<Output>
19
+
execute: (params: Args)=>Promise<Output>
20
20
}
21
21
22
+
/**
23
+
* Creates a CustomToolDefinition object
24
+
*
25
+
* @param toolName the name of the tool
26
+
* @param inputSchema a Zod4 schema describing the input of the tool.
27
+
* @param outputSchema a Zod4 schema describing the output of the tool.
28
+
* @param description a description of the tool to be passed to the LLM. This should describe what the tool does and when to use it.
29
+
* @param endsAgentStep whether the tool ends the agent step. If `true`, this will be used as a "stop sequence" for the LLM. i.e. it will not be able to call any other tools after this one in a single step and must wait for the tool results. Used for tools that give more information to the LLM.
30
+
* @param exampleInputs an array of example inputs for the tool.
31
+
* @param execute what to do when the tool is called.
32
+
* @returns The CustomToolDefinition object
33
+
*/
22
34
exportfunctiongetCustomToolDefinition<
23
35
ToolNameextendsstring,
24
36
Args,
@@ -31,15 +43,15 @@ export function getCustomToolDefinition<
0 commit comments