Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/helpers/zod.ts>zodFunction

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Latest
function zodFunction
import { zodFunction } from "https://deno.land/x/openai@v4.69.0/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; }>