langchain.js
    Preparing search index...

    Function toolStrategy

    Define how to transform the response format from a tool call.

    The response format to transform

    The options to use for the transformation

    Whether to handle errors from the tool call

    The transformed response format

    • Type Parameters

      • T extends InteropZodType<any>

      Parameters

      • responseFormat: T
      • Optionaloptions: ToolStrategyOptions

      Returns TypedToolStrategy<T extends InteropZodType<U> ? U : never>

    • Type Parameters

      • T extends readonly InteropZodType<any>[]

      Parameters

      • responseFormat: T
      • Optionaloptions: ToolStrategyOptions

      Returns TypedToolStrategy<
          {
              [K in string
              | number
              | symbol]: T[K<K>] extends InteropZodType<U> ? U : never
          }[number],
      >

    • Parameters

      • responseFormat: JsonSchemaFormat
      • Optionaloptions: ToolStrategyOptions

      Returns TypedToolStrategy<Record<string, unknown>>

    • Parameters

      • responseFormat: JsonSchemaFormat[]
      • Optionaloptions: ToolStrategyOptions

      Returns TypedToolStrategy<Record<string, unknown>>