• Creates a new StructuredTool instance with the provided function, name, description, and schema.

    Type Parameters

    • RunInput extends ZodAny

      The input schema for the tool.

    • RunOutput extends unknown = unknown

    Parameters

    • func: RunnableFunc<RunInput, RunOutput>

      The function to invoke when the tool is called.

    • fields: {
          name: string;
          schema: RunInput;
          description?: string;
      }

      An object containing the following properties:

      • name: string

        The name of the tool.

      • schema: RunInput

        The Zod schema defining the input for the tool.

      • Optional description?: string

        The description of the tool.

    Returns _Tool<RunInput, RunOutput>

    A new StructuredTool instance.

    Function

Generated using TypeDoc