Interface Tool<Input, Output>

Simple interface used to define a tool.

interface Tool<Input, Output> {
    description?: string;
    execute?: ((args) => Promise<Output>);
    name: string;
    parameters?: AnyZodObject;
}

Type Parameters

Properties

description?: string

Description of the tool does. This is often passed to your LLM.

execute?: ((args) => Promise<Output>)

Function that is executed when the tool is called

Type declaration

    • (args): Promise<Output>
    • Parameters

      • args: Input

        Input parameters to the tool

      Returns Promise<Output>

Returns

Output of the tool

name: string

Name of the function / tool.

parameters?: AnyZodObject

Schema for the input to your tool.