• Preparing search index...
  • The search index is not available
LangChain.js - v0.2.8
  • LangChain.js
  • langchain-core/utils/function_calling
  • convertToOpenAIFunction

Function convertToOpenAIFunction

  • convertToOpenAIFunction(tool): FunctionDefinition
  • Formats a StructuredTool instance into a format that is compatible with OpenAI function calling. It uses the zodToJsonSchema function to convert the schema of the StructuredTool into a JSON schema, which is then used as the parameters for the OpenAI function.

    Parameters

    • tool: StructuredToolInterface<ZodAny>

    Returns FunctionDefinition

    • Defined in langchain-core/src/utils/function_calling.ts:11

Settings

Member Visibility

Theme

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

Generated using TypeDoc