/* * 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 = { /** * The text of the reasoning. */ text: string; type?: "reasoning_text" | undefined; }; /** @internal */ export const ReasoningText$inboundSchema: z.ZodType< ReasoningText, z.ZodTypeDef, unknown > = z.object({ text: z.string(), type: z.literal("reasoning_text").default("reasoning_text"), }); /** @internal */ export type ReasoningText$Outbound = { text: string; type: "reasoning_text"; }; /** @internal */ export const ReasoningText$outboundSchema: z.ZodType< ReasoningText$Outbound, z.ZodTypeDef, ReasoningText > = z.object({ text: z.string(), type: z.literal("reasoning_text").default("reasoning_text" as const), }); 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`, ); }