• Preparing search index...
  • The search index is not available
LangChain.js - v0.2.12
  • LangChain.js
  • langchain-core/tools
  • tool

Function tool

  • tool<T>(func, fields): DynamicTool
  • Creates a new StructuredTool instance with the provided function, name, description, and schema.

    Type Parameters

    • T extends ZodString = ZodString

      The input schema for the tool. Either any Zod object, or a Zod string.

    Parameters

    • func: RunnableFunc<output<T>, any>

      The function to invoke when the tool is called.

    • fields: ToolWrapperParams<T>

      An object containing the following properties:

    Returns DynamicTool

    A new StructuredTool instance.

    Function

    • Defined in langchain-core/src/tools/index.ts:497
  • tool<T>(func, fields): DynamicStructuredTool<T>
  • Type Parameters

    • T extends ZodObjectAny = ZodObjectAny

    Parameters

    • func: RunnableFunc<output<T>, any>
    • fields: ToolWrapperParams<T>

    Returns DynamicStructuredTool<T>

    • Defined in langchain-core/src/tools/index.ts:502

Settings

Member Visibility
LangChain.js - v0.2.12
  • Loading...

Generated using TypeDoc