Function formatToOpenAITool

  • 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: StructuredToolInterface<ZodObject<any, any, any, any, {}>>

    Returns ToolDefinition

Generated using TypeDoc