/* * 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 ReasoningText = { type: "reasoning_text"; text: string; }; /** @internal */ export const ReasoningText$inboundSchema: z.ZodType< ReasoningText, z.ZodTypeDef, unknown > = z.object({ type: z.literal("reasoning_text"), text: z.string(), }); /** @internal */ export type ReasoningText$Outbound = { type: "reasoning_text"; text: string; }; /** @internal */ export const ReasoningText$outboundSchema: z.ZodType< ReasoningText$Outbound, z.ZodTypeDef, ReasoningText > = z.object({ type: z.literal("reasoning_text"), text: z.string(), }); export function reasoningTextToJSON(reasoningText: ReasoningText): string { return JSON.stringify(ReasoningText$outboundSchema.parse(reasoningText)); } export function reasoningTextFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReasoningText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReasoningText' from JSON`, ); }