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

  • 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.

    ⚠️ Deprecated ⚠️

    Use .invoke() instead. Will be removed in 0.3.0.

    This feature is deprecated and will be removed in the future.

    It is not recommended for use.

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

Generated using TypeDoc