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

Function tool

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

    Type Parameters

    • T extends ZodAny = ZodAny
    • RunOutput = any

      The output type for the tool. This corresponds to the output type when the tool is invoked.

    Parameters

    • func: RunnableFunc<output<T>, RunOutput | ContentAndArtifact>

      The function to invoke when the tool is called.

    • fields: ToolWrapperParams<T>

      An object containing the following properties:

    Returns DynamicStructuredTool<T, RunOutput>

    A new StructuredTool instance.

    Function

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

Settings

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

Generated using TypeDoc