UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

14 lines (11 loc) 245 B
import { ZodEnumDef } from 'zod'; export type JsonSchema7EnumType = { type: 'string'; enum: string[]; }; export function parseEnumDef(def: ZodEnumDef): JsonSchema7EnumType { return { type: 'string', enum: [...def.values], }; }