/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 951387040c37
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { OutputContentChunks$inboundSchema, } from "./outputcontentchunks.js";
/** @internal */
export const MessageOutputEventContent$inboundSchema = smartUnion([z.string(), OutputContentChunks$inboundSchema]);
export function messageOutputEventContentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MessageOutputEventContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageOutputEventContent' from JSON`);
}
/** @internal */
export const MessageOutputEvent$inboundSchema = z.object({
    type: z.literal("message.output.delta"),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    output_index: z.int().default(0),
    id: z.string(),
    content_index: z.int().default(0),
    model: z.nullable(z.string()).optional(),
    agent_id: z.nullable(z.string()).optional(),
    role: z.literal("assistant").default("assistant"),
    content: smartUnion([z.string(), OutputContentChunks$inboundSchema]),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "output_index": "outputIndex",
        "content_index": "contentIndex",
        "agent_id": "agentId",
    });
});
export function messageOutputEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MessageOutputEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageOutputEvent' from JSON`);
}
//# sourceMappingURL=messageoutputevent.js.map