/* * 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"; import { CodeInterpreterOutputImage, CodeInterpreterOutputImage$inboundSchema, CodeInterpreterOutputImage$Outbound, CodeInterpreterOutputImage$outboundSchema, } from "./codeinterpreteroutputimage.js"; import { CodeInterpreterOutputLogs, CodeInterpreterOutputLogs$inboundSchema, CodeInterpreterOutputLogs$Outbound, CodeInterpreterOutputLogs$outboundSchema, } from "./codeinterpreteroutputlogs.js"; export type CodeInterpreterOutput = | CodeInterpreterOutputLogs | CodeInterpreterOutputImage; /** @internal */ export const CodeInterpreterOutput$inboundSchema: z.ZodType< CodeInterpreterOutput, z.ZodTypeDef, unknown > = z.union([ CodeInterpreterOutputLogs$inboundSchema, CodeInterpreterOutputImage$inboundSchema, ]); /** @internal */ export type CodeInterpreterOutput$Outbound = | CodeInterpreterOutputLogs$Outbound | CodeInterpreterOutputImage$Outbound; /** @internal */ export const CodeInterpreterOutput$outboundSchema: z.ZodType< CodeInterpreterOutput$Outbound, z.ZodTypeDef, CodeInterpreterOutput > = z.union([ CodeInterpreterOutputLogs$outboundSchema, CodeInterpreterOutputImage$outboundSchema, ]); export function codeInterpreterOutputToJSON( codeInterpreterOutput: CodeInterpreterOutput, ): string { return JSON.stringify( CodeInterpreterOutput$outboundSchema.parse(codeInterpreterOutput), ); } export function codeInterpreterOutputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CodeInterpreterOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CodeInterpreterOutput' from JSON`, ); }