Skip to main content
Module

x/openai/helpers/zod.ts>zodFunction

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
function zodFunction
import { zodFunction } from "https://deno.land/x/openai@v4.58.1/helpers/zod.ts";

Creates a chat completion function tool that can be invoked automatically by the chat completion .runTools() method or automatically parsed by .parse() / .stream().

Type Parameters

Parameters extends ZodType

Parameters

options: { name: string; parameters: Parameters; function?: ((args: zodInfer<Parameters>) => unknown | Promise<unknown>) | undefined; description?: string | undefined; }

Returns

AutoParseableTool<{ arguments: Parameters; name: string; function: (args: zodInfer<Parameters>) => unknown; }>