DAFT - v1.0.0
    Preparing search index...

    Interface ToolConfig<I, O>

    Configuration object for creating a tool.

    Used with the defineTool helper function.

    const tool = defineTool({
    name: 'summarize',
    input: {} as { text: string },
    output: {} as { summary: string },
    description: 'Summarize text',
    run: async (input) => ({ output: { summary: input.text.slice(0, 100) } })
    });
    interface ToolConfig<I, O> {
        name: string;
        input: I;
        output: O;
        description?: string;
        run: (input: I) => Promise<{ output: O; usage?: Partial<Usage> }>;
    }

    Type Parameters

    • I

      Input type for the tool

    • O

      Output type for the tool

    Index

    Properties

    name: string

    Unique identifier for this tool.

    input: I

    Type signature for input data.

    output: O

    Type signature for output data.

    description?: string

    Human-readable description.

    run: (input: I) => Promise<{ output: O; usage?: Partial<Usage> }>

    Function to execute the tool.