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

Function tool

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

    Type Parameters

    • RunInput extends ZodAny = ZodAny

      The input schema for the tool.

    Parameters

    • func: RunnableFunc<TypeOf<RunInput>, string>

      The function to invoke when the tool is called.

    • fields: ToolWrapperParams<RunInput>

      An object containing the following properties:

    Returns DynamicStructuredTool<RunInput>

    A new StructuredTool instance.

    Function

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

Settings

Member Visibility

Theme

LangChain.js - v0.2.8
  • Loading...

Generated using TypeDoc