/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 5d322ff91b16
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { smartUnion } from "../../types/smartUnion.js";
import { ContentChunk$outboundSchema, } from "./contentchunk.js";
/** @internal */
export const ToolMessageContent$outboundSchema = smartUnion([z.string(), z.array(ContentChunk$outboundSchema)]);
export function toolMessageContentToJSON(toolMessageContent) {
    return JSON.stringify(ToolMessageContent$outboundSchema.parse(toolMessageContent));
}
/** @internal */
export const ToolMessage$outboundSchema = z.object({
    role: z.literal("tool"),
    content: z.nullable(smartUnion([z.string(), z.array(ContentChunk$outboundSchema)])),
    toolCallId: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        toolCallId: "tool_call_id",
    });
});
export function toolMessageToJSON(toolMessage) {
    return JSON.stringify(ToolMessage$outboundSchema.parse(toolMessage));
}
//# sourceMappingURL=toolmessage.js.map