/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 06c32b85d8c1
 */
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 { AgentHandoffEntry$inboundSchema, } from "./agenthandoffentry.js";
import { FunctionCallEntry$inboundSchema, } from "./functioncallentry.js";
import { FunctionResultEntry$inboundSchema, } from "./functionresultentry.js";
import { MessageInputEntry$inboundSchema, } from "./messageinputentry.js";
import { MessageOutputEntry$inboundSchema, } from "./messageoutputentry.js";
import { ToolExecutionEntry$inboundSchema, } from "./toolexecutionentry.js";
/** @internal */
export const Entry$inboundSchema = smartUnion([
    AgentHandoffEntry$inboundSchema,
    FunctionCallEntry$inboundSchema,
    MessageInputEntry$inboundSchema,
    FunctionResultEntry$inboundSchema,
    ToolExecutionEntry$inboundSchema,
    MessageOutputEntry$inboundSchema,
]);
export function entryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Entry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entry' from JSON`);
}
/** @internal */
export const ConversationHistory$inboundSchema = z.object({
    object: z.literal("conversation.history").default("conversation.history"),
    conversation_id: z.string(),
    entries: z.array(smartUnion([
        AgentHandoffEntry$inboundSchema,
        FunctionCallEntry$inboundSchema,
        MessageInputEntry$inboundSchema,
        FunctionResultEntry$inboundSchema,
        ToolExecutionEntry$inboundSchema,
        MessageOutputEntry$inboundSchema,
    ])),
}).transform((v) => {
    return remap$(v, {
        "conversation_id": "conversationId",
    });
});
export function conversationHistoryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationHistory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationHistory' from JSON`);
}
//# sourceMappingURL=conversationhistory.js.map