/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type TextResponseFormat = { type: "text"; }; /** @internal */ export const TextResponseFormat$inboundSchema: z.ZodType< TextResponseFormat, z.ZodTypeDef, unknown > = z.object({ type: z.literal("text"), }); /** @internal */ export type TextResponseFormat$Outbound = { type: "text"; }; /** @internal */ export const TextResponseFormat$outboundSchema: z.ZodType< TextResponseFormat$Outbound, z.ZodTypeDef, TextResponseFormat > = z.object({ type: z.literal("text"), }); export function textResponseFormatToJSON( textResponseFormat: TextResponseFormat, ): string { return JSON.stringify( TextResponseFormat$outboundSchema.parse(textResponseFormat), ); } export function textResponseFormatFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TextResponseFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextResponseFormat' from JSON`, ); }