langchain.js
    Preparing search index...

    Type Alias DescriptionFactory

    DescriptionFactory: z.infer<typeof DescriptionFunctionSchema>

    Function type that dynamically generates a description for a tool call approval request.

    The tool call being reviewed

    The current agent state

    The agent runtime context

    A string description or Promise that resolves to a string description

    import { type DescriptionFactory, type ToolCall } from "langchain";

    const descriptionFactory: DescriptionFactory = (toolCall, state, runtime) => {
    return `Please review: ${toolCall.name}(${JSON.stringify(toolCall.args)})`;
    };