Base interface implemented by all runnables. Used for cross-compatibility between different versions of LangChain core.

Should not change on patch releases.

interface ToolInterface {
    description: string;
    name: string;
    returnDirect: boolean;
    schema: ZodObject<any, any, any, any, {}> | ZodEffects<ZodObject<any, any, any, any, {}>, any, {}>;
    batch(inputs, options?, batchOptions?): Promise<string[]>;
    batch(inputs, options?, batchOptions?): Promise<(string | Error)[]>;
    batch(inputs, options?, batchOptions?): Promise<(string | Error)[]>;
    call(arg, callbacks?): Promise<string>;
    getName(suffix?): string;
    invoke(input, options?): Promise<string>;
    stream(input, options?): Promise<IterableReadableStreamInterface<string>>;
    transform(generator, options): AsyncGenerator<string, any, unknown>;
}

Hierarchy (view full)

Properties

description: string
name: string
returnDirect: boolean
schema: ZodObject<any, any, any, any, {}> | ZodEffects<ZodObject<any, any, any, any, {}>, any, {}>

Methods

  • Calls the tool with the provided argument and callbacks. It handles string inputs specifically.

    Parameters

    • arg: undefined | string | {}

      The input argument for the tool, which can be a string, undefined, or an input of the tool's schema.

    • Optional callbacks: CallbackManager | (BaseCallbackHandlerMethodsClass | BaseCallbackHandler)[] | RunnableConfig

      Optional callbacks for the tool.

    Returns Promise<string>

    A Promise that resolves with a string.

Generated using TypeDoc