Interface DynamicStructuredToolInput<T>

Interface for the input parameters of the DynamicStructuredTool class.

interface DynamicStructuredToolInput<T> {
    callbacks?: Callbacks;
    description: string;
    func: ((input: T extends ZodObjectAny
        ? TypeOf<T<T>>
        : T, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<any>);
    metadata?: Record<string, unknown>;
    name: string;
    responseFormat?: string;
    returnDirect?: boolean;
    schema: T extends ZodObjectAny
        ? T<T>
        : T;
    tags?: string[];
    verbose?: boolean;
    verboseParsingErrors?: boolean;
}

Type Parameters

  • T extends ZodObjectAny | Record<string, any> = ZodObjectAny

Hierarchy (view full)

Properties

callbacks?: Callbacks
description: string
func: ((input: T extends ZodObjectAny
    ? TypeOf<T<T>>
    : T, runManager?: CallbackManagerForToolRun, config?: RunnableConfig) => Promise<any>)
metadata?: Record<string, unknown>
name: string
responseFormat?: string

The tool response format.

If "content" then the output of the tool is interpreted as the contents of a ToolMessage. If "content_and_artifact" then the output is expected to be a two-tuple corresponding to the (content, artifact) of a ToolMessage.

"content"
returnDirect?: boolean
schema: T extends ZodObjectAny
    ? T<T>
    : T
tags?: string[]
verbose?: boolean
verboseParsingErrors?: boolean

Whether to show full details in the thrown parsing errors.

false