/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b36c9deaf6ca */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { smartUnion } from "../../types/smartUnion.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Answer = string | number; export type JudgeOutput = { analysis: string; answer: string | number; }; /** @internal */ export const Answer$inboundSchema: z.ZodType = smartUnion([ z.string(), z.number(), ]); export function answerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Answer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answer' from JSON`, ); } /** @internal */ export const JudgeOutput$inboundSchema: z.ZodType = z .object({ analysis: z.string(), answer: smartUnion([z.string(), z.number()]), }); export function judgeOutputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => JudgeOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JudgeOutput' from JSON`, ); }