/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ResponseFormat, ResponseFormat$inboundSchema, ResponseFormat$Outbound, ResponseFormat$outboundSchema, } from "./responseformat.js"; export const Verbosity = { Low: "low", Medium: "medium", High: "high", } as const; export type Verbosity = ClosedEnum; export type TextConfiguration = { format: ResponseFormat; verbosity?: Verbosity | undefined; }; /** @internal */ export const Verbosity$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Verbosity); /** @internal */ export const Verbosity$outboundSchema: z.ZodNativeEnum = Verbosity$inboundSchema; /** @internal */ export const TextConfiguration$inboundSchema: z.ZodType< TextConfiguration, z.ZodTypeDef, unknown > = z.object({ format: ResponseFormat$inboundSchema, verbosity: Verbosity$inboundSchema.default("medium"), }); /** @internal */ export type TextConfiguration$Outbound = { format: ResponseFormat$Outbound; verbosity: string; }; /** @internal */ export const TextConfiguration$outboundSchema: z.ZodType< TextConfiguration$Outbound, z.ZodTypeDef, TextConfiguration > = z.object({ format: ResponseFormat$outboundSchema, verbosity: Verbosity$outboundSchema.default("medium"), }); export function textConfigurationToJSON( textConfiguration: TextConfiguration, ): string { return JSON.stringify( TextConfiguration$outboundSchema.parse(textConfiguration), ); } export function textConfigurationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TextConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextConfiguration' from JSON`, ); }