/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export const ResponseOutputItemRole = { Assistant: "assistant", } as const; export type ResponseOutputItemRole = ClosedEnum; export type ResponseOutputItem = { id?: string | undefined; type: string; status?: string | undefined; role?: ResponseOutputItemRole | undefined; content?: Array<{ [k: string]: any }> | undefined; text?: string | undefined; callId?: string | undefined; name?: string | undefined; arguments?: string | undefined; summary?: Array<{ [k: string]: any }> | undefined; encryptedContent?: string | undefined; imageUrl?: string | undefined; audioUrl?: string | undefined; videoUrl?: string | undefined; embedding?: Array | undefined; jobId?: string | undefined; progress?: number | undefined; mimeType?: string | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const ResponseOutputItemRole$inboundSchema: z.ZodMiniEnum< typeof ResponseOutputItemRole > = z.enum(ResponseOutputItemRole); /** @internal */ export const ResponseOutputItem$inboundSchema: z.ZodMiniType< ResponseOutputItem, unknown > = z.pipe( z.catchall( z.object({ id: types.optional(types.string()), type: types.string(), status: types.optional(types.string()), role: types.optional(ResponseOutputItemRole$inboundSchema), content: types.optional(z.array(z.record(z.string(), z.any()))), text: types.optional(types.string()), call_id: types.optional(types.string()), name: types.optional(types.string()), arguments: types.optional(types.string()), summary: types.optional(z.array(z.record(z.string(), z.any()))), encrypted_content: types.optional(types.string()), image_url: types.optional(types.string()), audio_url: types.optional(types.string()), video_url: types.optional(types.string()), embedding: types.optional(z.array(types.number())), job_id: types.optional(types.string()), progress: types.optional(types.number()), mime_type: types.optional(types.string()), }), z.any(), ), z.transform((v) => { return remap$(v, { "call_id": "callId", "encrypted_content": "encryptedContent", "image_url": "imageUrl", "audio_url": "audioUrl", "video_url": "videoUrl", "job_id": "jobId", "mime_type": "mimeType", }); }), ); export function responseOutputItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponseOutputItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseOutputItem' from JSON`, ); }