/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 43cd30dc4254
 */
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 { ConversationUsageInfo$inboundSchema, } from "./conversationusageinfo.js";
import { FunctionCallEntry$inboundSchema, } from "./functioncallentry.js";
import { MessageOutputEntry$inboundSchema, } from "./messageoutputentry.js";
import { ToolExecutionEntry$inboundSchema, } from "./toolexecutionentry.js";
/** @internal */
export const ConversationResponseOutput$inboundSchema = smartUnion([
    AgentHandoffEntry$inboundSchema,
    FunctionCallEntry$inboundSchema,
    ToolExecutionEntry$inboundSchema,
    MessageOutputEntry$inboundSchema,
]);
export function conversationResponseOutputFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationResponseOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationResponseOutput' from JSON`);
}
/** @internal */
export const ConversationResponse$inboundSchema = z.object({
    object: z.literal("conversation.response").default("conversation.response"),
    conversation_id: z.string(),
    outputs: z.array(smartUnion([
        AgentHandoffEntry$inboundSchema,
        FunctionCallEntry$inboundSchema,
        ToolExecutionEntry$inboundSchema,
        MessageOutputEntry$inboundSchema,
    ])),
    usage: ConversationUsageInfo$inboundSchema,
    guardrails: z.nullable(z.array(z.record(z.string(), z.any()))).optional(),
}).transform((v) => {
    return remap$(v, {
        "conversation_id": "conversationId",
    });
});
export function conversationResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ConversationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConversationResponse' from JSON`);
}
//# sourceMappingURL=conversationresponse.js.map