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

Function convertToOpenAITool

  • convertToOpenAITool(tool): ToolDefinition
  • Formats a StructuredTool instance into a format that is compatible with OpenAI tool 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 tool.

    Parameters

    • tool: Record<string, any> | StructuredToolInterface<ZodAny>

    Returns ToolDefinition

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

Settings

Member Visibility

Theme

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

Generated using TypeDoc