/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: b782f07bc1ff
 */
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 { ContentChunk$inboundSchema } from "./contentchunk.js";
import { ToolCall$inboundSchema } from "./toolcall.js";
/** @internal */
export const DeltaMessageContent$inboundSchema = smartUnion([z.string(), z.array(ContentChunk$inboundSchema)]);
export function deltaMessageContentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DeltaMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeltaMessageContent' from JSON`);
}
/** @internal */
export const DeltaMessage$inboundSchema = z
    .object({
    role: z.nullable(z.string()).optional(),
    content: z.nullable(smartUnion([z.string(), z.array(ContentChunk$inboundSchema)])).optional(),
    tool_calls: z.nullable(z.array(ToolCall$inboundSchema)).optional(),
    tool_call_id: z.nullable(z.string()).optional(),
    index: z.nullable(z.int()).optional(),
    metadata: z.nullable(z.record(z.string(), z.any())).optional(),
}).transform((v) => {
    return remap$(v, {
        "tool_calls": "toolCalls",
        "tool_call_id": "toolCallId",
    });
});
export function deltaMessageFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DeltaMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeltaMessage' from JSON`);
}
//# sourceMappingURL=deltamessage.js.map