"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvokeDeploymentRequest2Ttl$outboundSchema = exports.InvokeDeploymentRequest2MessagesType$outboundSchema = exports.MessagesAssistantMessage$outboundSchema = exports.MessagesToolCalls$outboundSchema = exports.MessagesFunction$outboundSchema = exports.MessagesType$outboundSchema = exports.MessagesAudio$outboundSchema = exports.InvokeDeploymentRequestMessages4Content$outboundSchema = exports.InvokeDeploymentRequestContentMessages42$outboundSchema = exports.MessagesToolMessage$outboundSchema = exports.MessagesCacheControl$outboundSchema = exports.MessagesTtl$outboundSchema = exports.InvokeDeploymentRequestMessagesType$outboundSchema = exports.InvokeDeploymentRequestMessages5Content$outboundSchema = exports.InvokeDeploymentRequestContentMessages52$outboundSchema = exports.PrefixMessages$outboundSchema = exports.SystemMessage$outboundSchema = exports.Content$outboundSchema = exports.DeveloperMessage$outboundSchema = exports.PrefixMessagesContent$outboundSchema = exports.UserMessage$outboundSchema = exports.InvokeDeploymentRequestPrefixMessagesContent$outboundSchema = exports.Two$outboundSchema = exports.Four$outboundSchema = exports.TwoCacheControl$outboundSchema = exports.TwoTtl$outboundSchema = exports.InvokeDeploymentRequest2PrefixMessagesType$outboundSchema = exports.AssistantMessage$outboundSchema = exports.ToolCalls$outboundSchema = exports.PrefixMessagesFunction$outboundSchema = exports.PrefixMessagesType$outboundSchema = exports.Audio$outboundSchema = exports.InvokeDeploymentRequestPrefixMessages4Content$outboundSchema = exports.Content2$outboundSchema = exports.ToolMessage$outboundSchema = exports.PrefixMessagesCacheControl$outboundSchema = exports.PrefixMessagesTtl$outboundSchema = exports.InvokeDeploymentRequestPrefixMessagesType$outboundSchema = exports.InvokeDeploymentRequestPrefixMessages5Content$outboundSchema = exports.InvokeDeploymentRequestContent2$outboundSchema = exports.InvokeDeploymentRequest2Ttl = exports.InvokeDeploymentRequest2MessagesType = exports.MessagesType = exports.MessagesTtl = exports.InvokeDeploymentRequestMessagesType = exports.TwoTtl = exports.InvokeDeploymentRequest2PrefixMessagesType = exports.PrefixMessagesType = exports.PrefixMessagesTtl = exports.InvokeDeploymentRequestPrefixMessagesType = void 0;
exports.Lte$outboundSchema = exports.OneIn$outboundSchema = exports.In$outboundSchema = exports.OneNin$outboundSchema = exports.Nin$outboundSchema = exports.Exists$outboundSchema = exports.KnowledgeFilterAnd$outboundSchema = exports.And$outboundSchema = exports.InvokeDeploymentRequestAndEq$outboundSchema = exports.AndEq$outboundSchema = exports.InvokeDeploymentRequestAndNe$outboundSchema = exports.AndNe$outboundSchema = exports.AndGt$outboundSchema = exports.AndGte$outboundSchema = exports.AndLt$outboundSchema = exports.AndLte$outboundSchema = exports.InvokeDeploymentRequestAndIn$outboundSchema = exports.AndIn$outboundSchema = exports.InvokeDeploymentRequestAndNin$outboundSchema = exports.AndNin$outboundSchema = exports.AndExists$outboundSchema = exports.KnowledgeFilterOr$outboundSchema = exports.Or$outboundSchema = exports.InvokeDeploymentRequestOrEq$outboundSchema = exports.OrEq$outboundSchema = exports.InvokeDeploymentRequestOrNe$outboundSchema = exports.OrNe$outboundSchema = exports.OrGt$outboundSchema = exports.OrGte$outboundSchema = exports.OrLt$outboundSchema = exports.OrLte$outboundSchema = exports.InvokeDeploymentRequestOrIn$outboundSchema = exports.OrIn$outboundSchema = exports.InvokeDeploymentRequestOrNin$outboundSchema = exports.OrNin$outboundSchema = exports.OrExists$outboundSchema = exports.Thread$outboundSchema = exports.InvokeOptions$outboundSchema = exports.Documents$outboundSchema = exports.Metadata$outboundSchema = exports.Messages$outboundSchema = exports.MessagesSystemMessage$outboundSchema = exports.MessagesContent$outboundSchema = exports.MessagesDeveloperMessage$outboundSchema = exports.InvokeDeploymentRequestMessagesContent$outboundSchema = exports.MessagesUserMessage$outboundSchema = exports.InvokeDeploymentRequestMessages3Content$outboundSchema = exports.InvokeDeploymentRequestContentMessages2$outboundSchema = exports.Two4$outboundSchema = exports.InvokeDeploymentRequest2CacheControl$outboundSchema = void 0;
exports.InvokeDeploymentRequest$outboundSchema = exports.KnowledgeFilter$outboundSchema = exports.One$outboundSchema = exports.OneEq$outboundSchema = exports.Eq$outboundSchema = exports.OneNe$outboundSchema = exports.Ne$outboundSchema = exports.Gt$outboundSchema = exports.Gte$outboundSchema = exports.Lt$outboundSchema = void 0;
exports.invokeDeploymentRequestContent2ToJSON = invokeDeploymentRequestContent2ToJSON;
exports.invokeDeploymentRequestPrefixMessages5ContentToJSON = invokeDeploymentRequestPrefixMessages5ContentToJSON;
exports.prefixMessagesCacheControlToJSON = prefixMessagesCacheControlToJSON;
exports.toolMessageToJSON = toolMessageToJSON;
exports.content2ToJSON = content2ToJSON;
exports.invokeDeploymentRequestPrefixMessages4ContentToJSON = invokeDeploymentRequestPrefixMessages4ContentToJSON;
exports.audioToJSON = audioToJSON;
exports.prefixMessagesFunctionToJSON = prefixMessagesFunctionToJSON;
exports.toolCallsToJSON = toolCallsToJSON;
exports.assistantMessageToJSON = assistantMessageToJSON;
exports.twoCacheControlToJSON = twoCacheControlToJSON;
exports.fourToJSON = fourToJSON;
exports.twoToJSON = twoToJSON;
exports.invokeDeploymentRequestPrefixMessagesContentToJSON = invokeDeploymentRequestPrefixMessagesContentToJSON;
exports.userMessageToJSON = userMessageToJSON;
exports.prefixMessagesContentToJSON = prefixMessagesContentToJSON;
exports.developerMessageToJSON = developerMessageToJSON;
exports.contentToJSON = contentToJSON;
exports.systemMessageToJSON = systemMessageToJSON;
exports.prefixMessagesToJSON = prefixMessagesToJSON;
exports.invokeDeploymentRequestContentMessages52ToJSON = invokeDeploymentRequestContentMessages52ToJSON;
exports.invokeDeploymentRequestMessages5ContentToJSON = invokeDeploymentRequestMessages5ContentToJSON;
exports.messagesCacheControlToJSON = messagesCacheControlToJSON;
exports.messagesToolMessageToJSON = messagesToolMessageToJSON;
exports.invokeDeploymentRequestContentMessages42ToJSON = invokeDeploymentRequestContentMessages42ToJSON;
exports.invokeDeploymentRequestMessages4ContentToJSON = invokeDeploymentRequestMessages4ContentToJSON;
exports.messagesAudioToJSON = messagesAudioToJSON;
exports.messagesFunctionToJSON = messagesFunctionToJSON;
exports.messagesToolCallsToJSON = messagesToolCallsToJSON;
exports.messagesAssistantMessageToJSON = messagesAssistantMessageToJSON;
exports.invokeDeploymentRequest2CacheControlToJSON = invokeDeploymentRequest2CacheControlToJSON;
exports.two4ToJSON = two4ToJSON;
exports.invokeDeploymentRequestContentMessages2ToJSON = invokeDeploymentRequestContentMessages2ToJSON;
exports.invokeDeploymentRequestMessages3ContentToJSON = invokeDeploymentRequestMessages3ContentToJSON;
exports.messagesUserMessageToJSON = messagesUserMessageToJSON;
exports.invokeDeploymentRequestMessagesContentToJSON = invokeDeploymentRequestMessagesContentToJSON;
exports.messagesDeveloperMessageToJSON = messagesDeveloperMessageToJSON;
exports.messagesContentToJSON = messagesContentToJSON;
exports.messagesSystemMessageToJSON = messagesSystemMessageToJSON;
exports.messagesToJSON = messagesToJSON;
exports.metadataToJSON = metadataToJSON;
exports.documentsToJSON = documentsToJSON;
exports.invokeOptionsToJSON = invokeOptionsToJSON;
exports.threadToJSON = threadToJSON;
exports.orExistsToJSON = orExistsToJSON;
exports.orNinToJSON = orNinToJSON;
exports.invokeDeploymentRequestOrNinToJSON = invokeDeploymentRequestOrNinToJSON;
exports.orInToJSON = orInToJSON;
exports.invokeDeploymentRequestOrInToJSON = invokeDeploymentRequestOrInToJSON;
exports.orLteToJSON = orLteToJSON;
exports.orLtToJSON = orLtToJSON;
exports.orGteToJSON = orGteToJSON;
exports.orGtToJSON = orGtToJSON;
exports.orNeToJSON = orNeToJSON;
exports.invokeDeploymentRequestOrNeToJSON = invokeDeploymentRequestOrNeToJSON;
exports.orEqToJSON = orEqToJSON;
exports.invokeDeploymentRequestOrEqToJSON = invokeDeploymentRequestOrEqToJSON;
exports.orToJSON = orToJSON;
exports.knowledgeFilterOrToJSON = knowledgeFilterOrToJSON;
exports.andExistsToJSON = andExistsToJSON;
exports.andNinToJSON = andNinToJSON;
exports.invokeDeploymentRequestAndNinToJSON = invokeDeploymentRequestAndNinToJSON;
exports.andInToJSON = andInToJSON;
exports.invokeDeploymentRequestAndInToJSON = invokeDeploymentRequestAndInToJSON;
exports.andLteToJSON = andLteToJSON;
exports.andLtToJSON = andLtToJSON;
exports.andGteToJSON = andGteToJSON;
exports.andGtToJSON = andGtToJSON;
exports.andNeToJSON = andNeToJSON;
exports.invokeDeploymentRequestAndNeToJSON = invokeDeploymentRequestAndNeToJSON;
exports.andEqToJSON = andEqToJSON;
exports.invokeDeploymentRequestAndEqToJSON = invokeDeploymentRequestAndEqToJSON;
exports.andToJSON = andToJSON;
exports.knowledgeFilterAndToJSON = knowledgeFilterAndToJSON;
exports.existsToJSON = existsToJSON;
exports.ninToJSON = ninToJSON;
exports.oneNinToJSON = oneNinToJSON;
exports.inToJSON = inToJSON;
exports.oneInToJSON = oneInToJSON;
exports.lteToJSON = lteToJSON;
exports.ltToJSON = ltToJSON;
exports.gteToJSON = gteToJSON;
exports.gtToJSON = gtToJSON;
exports.neToJSON = neToJSON;
exports.oneNeToJSON = oneNeToJSON;
exports.eqToJSON = eqToJSON;
exports.oneEqToJSON = oneEqToJSON;
exports.oneToJSON = oneToJSON;
exports.knowledgeFilterToJSON = knowledgeFilterToJSON;
exports.invokeDeploymentRequestToJSON = invokeDeploymentRequestToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const audiocontentpartschema_js_1 = require("./audiocontentpartschema.js");
const filecontentpartschema_js_1 = require("./filecontentpartschema.js");
const imagecontentpartschema_js_1 = require("./imagecontentpartschema.js");
const publicidentity_js_1 = require("./publicidentity.js");
const reasoningpartschema_js_1 = require("./reasoningpartschema.js");
const redactedreasoningpartschema_js_1 = require("./redactedreasoningpartschema.js");
const refusalpartschema_js_1 = require("./refusalpartschema.js");
const textcontentpartschema_js_1 = require("./textcontentpartschema.js");
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.InvokeDeploymentRequestPrefixMessagesType = {
    Ephemeral: "ephemeral",
};
/**
 * The time-to-live for the cache control breakpoint. This may be one of the following values:
 *
 * @remarks
 *
 * - `5m`: 5 minutes
 * - `1h`: 1 hour
 *
 * Defaults to `5m`. Only supported by `Anthropic` Claude models.
 */
exports.PrefixMessagesTtl = {
    Fivem: "5m",
    Oneh: "1h",
};
/**
 * The type of the tool. Currently, only `function` is supported.
 */
exports.PrefixMessagesType = {
    Function: "function",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.InvokeDeploymentRequest2PrefixMessagesType = {
    Ephemeral: "ephemeral",
};
/**
 * The time-to-live for the cache control breakpoint. This may be one of the following values:
 *
 * @remarks
 *
 * - `5m`: 5 minutes
 * - `1h`: 1 hour
 *
 * Defaults to `5m`. Only supported by `Anthropic` Claude models.
 */
exports.TwoTtl = {
    Fivem: "5m",
    Oneh: "1h",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.InvokeDeploymentRequestMessagesType = {
    Ephemeral: "ephemeral",
};
/**
 * The time-to-live for the cache control breakpoint. This may be one of the following values:
 *
 * @remarks
 *
 * - `5m`: 5 minutes
 * - `1h`: 1 hour
 *
 * Defaults to `5m`. Only supported by `Anthropic` Claude models.
 */
exports.MessagesTtl = {
    Fivem: "5m",
    Oneh: "1h",
};
/**
 * The type of the tool. Currently, only `function` is supported.
 */
exports.MessagesType = {
    Function: "function",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.InvokeDeploymentRequest2MessagesType = {
    Ephemeral: "ephemeral",
};
/**
 * The time-to-live for the cache control breakpoint. This may be one of the following values:
 *
 * @remarks
 *
 * - `5m`: 5 minutes
 * - `1h`: 1 hour
 *
 * Defaults to `5m`. Only supported by `Anthropic` Claude models.
 */
exports.InvokeDeploymentRequest2Ttl = {
    Fivem: "5m",
    Oneh: "1h",
};
/** @internal */
exports.InvokeDeploymentRequestContent2$outboundSchema = textcontentpartschema_js_1.TextContentPartSchema$outboundSchema;
function invokeDeploymentRequestContent2ToJSON(invokeDeploymentRequestContent2) {
    return JSON.stringify(exports.InvokeDeploymentRequestContent2$outboundSchema.parse(invokeDeploymentRequestContent2));
}
/** @internal */
exports.InvokeDeploymentRequestPrefixMessages5Content$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function invokeDeploymentRequestPrefixMessages5ContentToJSON(invokeDeploymentRequestPrefixMessages5Content) {
    return JSON.stringify(exports.InvokeDeploymentRequestPrefixMessages5Content$outboundSchema.parse(invokeDeploymentRequestPrefixMessages5Content));
}
/** @internal */
exports.InvokeDeploymentRequestPrefixMessagesType$outboundSchema = z
    .nativeEnum(exports.InvokeDeploymentRequestPrefixMessagesType);
/** @internal */
exports.PrefixMessagesTtl$outboundSchema = z.nativeEnum(exports.PrefixMessagesTtl);
/** @internal */
exports.PrefixMessagesCacheControl$outboundSchema = z.object({
    type: exports.InvokeDeploymentRequestPrefixMessagesType$outboundSchema,
    ttl: exports.PrefixMessagesTtl$outboundSchema.default("5m"),
});
function prefixMessagesCacheControlToJSON(prefixMessagesCacheControl) {
    return JSON.stringify(exports.PrefixMessagesCacheControl$outboundSchema.parse(prefixMessagesCacheControl));
}
/** @internal */
exports.ToolMessage$outboundSchema = z.object({
    role: z.literal("tool"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    toolCallId: z.nullable(z.string()),
    cacheControl: z.lazy(() => exports.PrefixMessagesCacheControl$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCallId: "tool_call_id",
        cacheControl: "cache_control",
    });
});
function toolMessageToJSON(toolMessage) {
    return JSON.stringify(exports.ToolMessage$outboundSchema.parse(toolMessage));
}
/** @internal */
exports.Content2$outboundSchema = z.union([
    textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
    reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
    redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
]);
function content2ToJSON(content2) {
    return JSON.stringify(exports.Content2$outboundSchema.parse(content2));
}
/** @internal */
exports.InvokeDeploymentRequestPrefixMessages4Content$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
        reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
        redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
    ])),
]);
function invokeDeploymentRequestPrefixMessages4ContentToJSON(invokeDeploymentRequestPrefixMessages4Content) {
    return JSON.stringify(exports.InvokeDeploymentRequestPrefixMessages4Content$outboundSchema.parse(invokeDeploymentRequestPrefixMessages4Content));
}
/** @internal */
exports.Audio$outboundSchema = z.object({
    id: z.string(),
});
function audioToJSON(audio) {
    return JSON.stringify(exports.Audio$outboundSchema.parse(audio));
}
/** @internal */
exports.PrefixMessagesType$outboundSchema = z.nativeEnum(exports.PrefixMessagesType);
/** @internal */
exports.PrefixMessagesFunction$outboundSchema = z.object({
    name: z.string().optional(),
    arguments: z.string().optional(),
});
function prefixMessagesFunctionToJSON(prefixMessagesFunction) {
    return JSON.stringify(exports.PrefixMessagesFunction$outboundSchema.parse(prefixMessagesFunction));
}
/** @internal */
exports.ToolCalls$outboundSchema = z.object({
    id: z.string(),
    type: exports.PrefixMessagesType$outboundSchema,
    function: z.lazy(() => exports.PrefixMessagesFunction$outboundSchema),
    thoughtSignature: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        thoughtSignature: "thought_signature",
    });
});
function toolCallsToJSON(toolCalls) {
    return JSON.stringify(exports.ToolCalls$outboundSchema.parse(toolCalls));
}
/** @internal */
exports.AssistantMessage$outboundSchema = z.object({
    content: z.nullable(z.union([
        z.string(),
        z.array(z.union([
            textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
            reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
            redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
        ])),
    ])).optional(),
    refusal: z.nullable(z.string()).optional(),
    role: z.literal("assistant"),
    name: z.string().optional(),
    audio: z.nullable(z.lazy(() => exports.Audio$outboundSchema)).optional(),
    toolCalls: z.array(z.lazy(() => exports.ToolCalls$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCalls: "tool_calls",
    });
});
function assistantMessageToJSON(assistantMessage) {
    return JSON.stringify(exports.AssistantMessage$outboundSchema.parse(assistantMessage));
}
/** @internal */
exports.InvokeDeploymentRequest2PrefixMessagesType$outboundSchema = z
    .nativeEnum(exports.InvokeDeploymentRequest2PrefixMessagesType);
/** @internal */
exports.TwoTtl$outboundSchema = z
    .nativeEnum(exports.TwoTtl);
/** @internal */
exports.TwoCacheControl$outboundSchema = z.object({
    type: exports.InvokeDeploymentRequest2PrefixMessagesType$outboundSchema,
    ttl: exports.TwoTtl$outboundSchema.default("5m"),
});
function twoCacheControlToJSON(twoCacheControl) {
    return JSON.stringify(exports.TwoCacheControl$outboundSchema.parse(twoCacheControl));
}
/** @internal */
exports.Four$outboundSchema = z.object({
    type: z.literal("file"),
    cacheControl: z.lazy(() => exports.TwoCacheControl$outboundSchema).optional(),
    file: filecontentpartschema_js_1.FileContentPartSchema$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cacheControl: "cache_control",
    });
});
function fourToJSON(four) {
    return JSON.stringify(exports.Four$outboundSchema.parse(four));
}
/** @internal */
exports.Two$outboundSchema = z
    .union([
    textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
    audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
    z.lazy(() => exports.Four$outboundSchema),
]);
function twoToJSON(two) {
    return JSON.stringify(exports.Two$outboundSchema.parse(two));
}
/** @internal */
exports.InvokeDeploymentRequestPrefixMessagesContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
        audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
        z.lazy(() => exports.Four$outboundSchema),
    ])),
]);
function invokeDeploymentRequestPrefixMessagesContentToJSON(invokeDeploymentRequestPrefixMessagesContent) {
    return JSON.stringify(exports.InvokeDeploymentRequestPrefixMessagesContent$outboundSchema.parse(invokeDeploymentRequestPrefixMessagesContent));
}
/** @internal */
exports.UserMessage$outboundSchema = z.object({
    role: z.literal("user"),
    name: z.string().optional(),
    content: z.union([
        z.string(),
        z.array(z.union([
            textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
            audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
            z.lazy(() => exports.Four$outboundSchema),
        ])),
    ]),
});
function userMessageToJSON(userMessage) {
    return JSON.stringify(exports.UserMessage$outboundSchema.parse(userMessage));
}
/** @internal */
exports.PrefixMessagesContent$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function prefixMessagesContentToJSON(prefixMessagesContent) {
    return JSON.stringify(exports.PrefixMessagesContent$outboundSchema.parse(prefixMessagesContent));
}
/** @internal */
exports.DeveloperMessage$outboundSchema = z.object({
    role: z.literal("developer"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    name: z.string().optional(),
});
function developerMessageToJSON(developerMessage) {
    return JSON.stringify(exports.DeveloperMessage$outboundSchema.parse(developerMessage));
}
/** @internal */
exports.Content$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function contentToJSON(content) {
    return JSON.stringify(exports.Content$outboundSchema.parse(content));
}
/** @internal */
exports.SystemMessage$outboundSchema = z.object({
    role: z.literal("system"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    name: z.string().optional(),
});
function systemMessageToJSON(systemMessage) {
    return JSON.stringify(exports.SystemMessage$outboundSchema.parse(systemMessage));
}
/** @internal */
exports.PrefixMessages$outboundSchema = z.union([
    z.lazy(() => exports.SystemMessage$outboundSchema),
    z.lazy(() => exports.DeveloperMessage$outboundSchema),
    z.lazy(() => exports.UserMessage$outboundSchema),
    z.lazy(() => exports.AssistantMessage$outboundSchema),
    z.lazy(() => exports.ToolMessage$outboundSchema),
]);
function prefixMessagesToJSON(prefixMessages) {
    return JSON.stringify(exports.PrefixMessages$outboundSchema.parse(prefixMessages));
}
/** @internal */
exports.InvokeDeploymentRequestContentMessages52$outboundSchema = textcontentpartschema_js_1.TextContentPartSchema$outboundSchema;
function invokeDeploymentRequestContentMessages52ToJSON(invokeDeploymentRequestContentMessages52) {
    return JSON.stringify(exports.InvokeDeploymentRequestContentMessages52$outboundSchema.parse(invokeDeploymentRequestContentMessages52));
}
/** @internal */
exports.InvokeDeploymentRequestMessages5Content$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function invokeDeploymentRequestMessages5ContentToJSON(invokeDeploymentRequestMessages5Content) {
    return JSON.stringify(exports.InvokeDeploymentRequestMessages5Content$outboundSchema.parse(invokeDeploymentRequestMessages5Content));
}
/** @internal */
exports.InvokeDeploymentRequestMessagesType$outboundSchema = z.nativeEnum(exports.InvokeDeploymentRequestMessagesType);
/** @internal */
exports.MessagesTtl$outboundSchema = z
    .nativeEnum(exports.MessagesTtl);
/** @internal */
exports.MessagesCacheControl$outboundSchema = z.object({
    type: exports.InvokeDeploymentRequestMessagesType$outboundSchema,
    ttl: exports.MessagesTtl$outboundSchema.default("5m"),
});
function messagesCacheControlToJSON(messagesCacheControl) {
    return JSON.stringify(exports.MessagesCacheControl$outboundSchema.parse(messagesCacheControl));
}
/** @internal */
exports.MessagesToolMessage$outboundSchema = z.object({
    role: z.literal("tool"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    toolCallId: z.nullable(z.string()),
    cacheControl: z.lazy(() => exports.MessagesCacheControl$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCallId: "tool_call_id",
        cacheControl: "cache_control",
    });
});
function messagesToolMessageToJSON(messagesToolMessage) {
    return JSON.stringify(exports.MessagesToolMessage$outboundSchema.parse(messagesToolMessage));
}
/** @internal */
exports.InvokeDeploymentRequestContentMessages42$outboundSchema = z.union([
    textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
    reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
    redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
]);
function invokeDeploymentRequestContentMessages42ToJSON(invokeDeploymentRequestContentMessages42) {
    return JSON.stringify(exports.InvokeDeploymentRequestContentMessages42$outboundSchema.parse(invokeDeploymentRequestContentMessages42));
}
/** @internal */
exports.InvokeDeploymentRequestMessages4Content$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
        reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
        redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
    ])),
]);
function invokeDeploymentRequestMessages4ContentToJSON(invokeDeploymentRequestMessages4Content) {
    return JSON.stringify(exports.InvokeDeploymentRequestMessages4Content$outboundSchema.parse(invokeDeploymentRequestMessages4Content));
}
/** @internal */
exports.MessagesAudio$outboundSchema = z.object({
    id: z.string(),
});
function messagesAudioToJSON(messagesAudio) {
    return JSON.stringify(exports.MessagesAudio$outboundSchema.parse(messagesAudio));
}
/** @internal */
exports.MessagesType$outboundSchema = z.nativeEnum(exports.MessagesType);
/** @internal */
exports.MessagesFunction$outboundSchema = z.object({
    name: z.string().optional(),
    arguments: z.string().optional(),
});
function messagesFunctionToJSON(messagesFunction) {
    return JSON.stringify(exports.MessagesFunction$outboundSchema.parse(messagesFunction));
}
/** @internal */
exports.MessagesToolCalls$outboundSchema = z.object({
    id: z.string(),
    type: exports.MessagesType$outboundSchema,
    function: z.lazy(() => exports.MessagesFunction$outboundSchema),
    thoughtSignature: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        thoughtSignature: "thought_signature",
    });
});
function messagesToolCallsToJSON(messagesToolCalls) {
    return JSON.stringify(exports.MessagesToolCalls$outboundSchema.parse(messagesToolCalls));
}
/** @internal */
exports.MessagesAssistantMessage$outboundSchema = z.object({
    content: z.nullable(z.union([
        z.string(),
        z.array(z.union([
            textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            refusalpartschema_js_1.RefusalPartSchema$outboundSchema,
            reasoningpartschema_js_1.ReasoningPartSchema$outboundSchema,
            redactedreasoningpartschema_js_1.RedactedReasoningPartSchema$outboundSchema,
        ])),
    ])).optional(),
    refusal: z.nullable(z.string()).optional(),
    role: z.literal("assistant"),
    name: z.string().optional(),
    audio: z.nullable(z.lazy(() => exports.MessagesAudio$outboundSchema)).optional(),
    toolCalls: z.array(z.lazy(() => exports.MessagesToolCalls$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCalls: "tool_calls",
    });
});
function messagesAssistantMessageToJSON(messagesAssistantMessage) {
    return JSON.stringify(exports.MessagesAssistantMessage$outboundSchema.parse(messagesAssistantMessage));
}
/** @internal */
exports.InvokeDeploymentRequest2MessagesType$outboundSchema = z.nativeEnum(exports.InvokeDeploymentRequest2MessagesType);
/** @internal */
exports.InvokeDeploymentRequest2Ttl$outboundSchema = z.nativeEnum(exports.InvokeDeploymentRequest2Ttl);
/** @internal */
exports.InvokeDeploymentRequest2CacheControl$outboundSchema = z.object({
    type: exports.InvokeDeploymentRequest2MessagesType$outboundSchema,
    ttl: exports.InvokeDeploymentRequest2Ttl$outboundSchema.default("5m"),
});
function invokeDeploymentRequest2CacheControlToJSON(invokeDeploymentRequest2CacheControl) {
    return JSON.stringify(exports.InvokeDeploymentRequest2CacheControl$outboundSchema.parse(invokeDeploymentRequest2CacheControl));
}
/** @internal */
exports.Two4$outboundSchema = z.object({
    type: z.literal("file"),
    cacheControl: z.lazy(() => exports.InvokeDeploymentRequest2CacheControl$outboundSchema).optional(),
    file: filecontentpartschema_js_1.FileContentPartSchema$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cacheControl: "cache_control",
    });
});
function two4ToJSON(two4) {
    return JSON.stringify(exports.Two4$outboundSchema.parse(two4));
}
/** @internal */
exports.InvokeDeploymentRequestContentMessages2$outboundSchema = z.union([
    textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
    audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
    z.lazy(() => exports.Two4$outboundSchema),
]);
function invokeDeploymentRequestContentMessages2ToJSON(invokeDeploymentRequestContentMessages2) {
    return JSON.stringify(exports.InvokeDeploymentRequestContentMessages2$outboundSchema.parse(invokeDeploymentRequestContentMessages2));
}
/** @internal */
exports.InvokeDeploymentRequestMessages3Content$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
        audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
        z.lazy(() => exports.Two4$outboundSchema),
    ])),
]);
function invokeDeploymentRequestMessages3ContentToJSON(invokeDeploymentRequestMessages3Content) {
    return JSON.stringify(exports.InvokeDeploymentRequestMessages3Content$outboundSchema.parse(invokeDeploymentRequestMessages3Content));
}
/** @internal */
exports.MessagesUserMessage$outboundSchema = z.object({
    role: z.literal("user"),
    name: z.string().optional(),
    content: z.union([
        z.string(),
        z.array(z.union([
            textcontentpartschema_js_1.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            imagecontentpartschema_js_1.ImageContentPartSchema$outboundSchema,
            audiocontentpartschema_js_1.AudioContentPartSchema$outboundSchema,
            z.lazy(() => exports.Two4$outboundSchema),
        ])),
    ]),
});
function messagesUserMessageToJSON(messagesUserMessage) {
    return JSON.stringify(exports.MessagesUserMessage$outboundSchema.parse(messagesUserMessage));
}
/** @internal */
exports.InvokeDeploymentRequestMessagesContent$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function invokeDeploymentRequestMessagesContentToJSON(invokeDeploymentRequestMessagesContent) {
    return JSON.stringify(exports.InvokeDeploymentRequestMessagesContent$outboundSchema.parse(invokeDeploymentRequestMessagesContent));
}
/** @internal */
exports.MessagesDeveloperMessage$outboundSchema = z.object({
    role: z.literal("developer"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    name: z.string().optional(),
});
function messagesDeveloperMessageToJSON(messagesDeveloperMessage) {
    return JSON.stringify(exports.MessagesDeveloperMessage$outboundSchema.parse(messagesDeveloperMessage));
}
/** @internal */
exports.MessagesContent$outboundSchema = z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]);
function messagesContentToJSON(messagesContent) {
    return JSON.stringify(exports.MessagesContent$outboundSchema.parse(messagesContent));
}
/** @internal */
exports.MessagesSystemMessage$outboundSchema = z.object({
    role: z.literal("system"),
    content: z.union([z.string(), z.array(textcontentpartschema_js_1.TextContentPartSchema$outboundSchema)]),
    name: z.string().optional(),
});
function messagesSystemMessageToJSON(messagesSystemMessage) {
    return JSON.stringify(exports.MessagesSystemMessage$outboundSchema.parse(messagesSystemMessage));
}
/** @internal */
exports.Messages$outboundSchema = z.union([
    z.lazy(() => exports.MessagesSystemMessage$outboundSchema),
    z.lazy(() => exports.MessagesDeveloperMessage$outboundSchema),
    z.lazy(() => exports.MessagesUserMessage$outboundSchema),
    z.lazy(() => exports.MessagesAssistantMessage$outboundSchema),
    z.lazy(() => exports.MessagesToolMessage$outboundSchema),
]);
function messagesToJSON(messages) {
    return JSON.stringify(exports.Messages$outboundSchema.parse(messages));
}
/** @internal */
exports.Metadata$outboundSchema = z.object({
    fileName: z.string().optional(),
    fileType: z.string().optional(),
    pageNumber: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        fileName: "file_name",
        fileType: "file_type",
        pageNumber: "page_number",
    });
});
function metadataToJSON(metadata) {
    return JSON.stringify(exports.Metadata$outboundSchema.parse(metadata));
}
/** @internal */
exports.Documents$outboundSchema = z.object({
    text: z.string(),
    metadata: z.lazy(() => exports.Metadata$outboundSchema).optional(),
});
function documentsToJSON(documents) {
    return JSON.stringify(exports.Documents$outboundSchema.parse(documents));
}
/** @internal */
exports.InvokeOptions$outboundSchema = z.object({
    includeRetrievals: z.boolean().default(false),
    includeUsage: z.boolean().default(false),
    mockResponse: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        includeRetrievals: "include_retrievals",
        includeUsage: "include_usage",
        mockResponse: "mock_response",
    });
});
function invokeOptionsToJSON(invokeOptions) {
    return JSON.stringify(exports.InvokeOptions$outboundSchema.parse(invokeOptions));
}
/** @internal */
exports.Thread$outboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
function threadToJSON(thread) {
    return JSON.stringify(exports.Thread$outboundSchema.parse(thread));
}
/** @internal */
exports.OrExists$outboundSchema = z.object({
    exists: z.boolean(),
});
function orExistsToJSON(orExists) {
    return JSON.stringify(exports.OrExists$outboundSchema.parse(orExists));
}
/** @internal */
exports.OrNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function orNinToJSON(orNin) {
    return JSON.stringify(exports.OrNin$outboundSchema.parse(orNin));
}
/** @internal */
exports.InvokeDeploymentRequestOrNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function invokeDeploymentRequestOrNinToJSON(invokeDeploymentRequestOrNin) {
    return JSON.stringify(exports.InvokeDeploymentRequestOrNin$outboundSchema.parse(invokeDeploymentRequestOrNin));
}
/** @internal */
exports.OrIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function orInToJSON(orIn) {
    return JSON.stringify(exports.OrIn$outboundSchema.parse(orIn));
}
/** @internal */
exports.InvokeDeploymentRequestOrIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function invokeDeploymentRequestOrInToJSON(invokeDeploymentRequestOrIn) {
    return JSON.stringify(exports.InvokeDeploymentRequestOrIn$outboundSchema.parse(invokeDeploymentRequestOrIn));
}
/** @internal */
exports.OrLte$outboundSchema = z.object({
    lte: z.number(),
});
function orLteToJSON(orLte) {
    return JSON.stringify(exports.OrLte$outboundSchema.parse(orLte));
}
/** @internal */
exports.OrLt$outboundSchema = z.object({
    lt: z.number(),
});
function orLtToJSON(orLt) {
    return JSON.stringify(exports.OrLt$outboundSchema.parse(orLt));
}
/** @internal */
exports.OrGte$outboundSchema = z.object({
    gte: z.number(),
});
function orGteToJSON(orGte) {
    return JSON.stringify(exports.OrGte$outboundSchema.parse(orGte));
}
/** @internal */
exports.OrGt$outboundSchema = z.object({
    gt: z.number(),
});
function orGtToJSON(orGt) {
    return JSON.stringify(exports.OrGt$outboundSchema.parse(orGt));
}
/** @internal */
exports.OrNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function orNeToJSON(orNe) {
    return JSON.stringify(exports.OrNe$outboundSchema.parse(orNe));
}
/** @internal */
exports.InvokeDeploymentRequestOrNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function invokeDeploymentRequestOrNeToJSON(invokeDeploymentRequestOrNe) {
    return JSON.stringify(exports.InvokeDeploymentRequestOrNe$outboundSchema.parse(invokeDeploymentRequestOrNe));
}
/** @internal */
exports.OrEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function orEqToJSON(orEq) {
    return JSON.stringify(exports.OrEq$outboundSchema.parse(orEq));
}
/** @internal */
exports.InvokeDeploymentRequestOrEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function invokeDeploymentRequestOrEqToJSON(invokeDeploymentRequestOrEq) {
    return JSON.stringify(exports.InvokeDeploymentRequestOrEq$outboundSchema.parse(invokeDeploymentRequestOrEq));
}
/** @internal */
exports.Or$outboundSchema = z
    .union([
    z.lazy(() => exports.InvokeDeploymentRequestOrEq$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestOrNe$outboundSchema),
    z.lazy(() => exports.OrGt$outboundSchema),
    z.lazy(() => exports.OrGte$outboundSchema),
    z.lazy(() => exports.OrLt$outboundSchema),
    z.lazy(() => exports.OrLte$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestOrIn$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestOrNin$outboundSchema),
    z.lazy(() => exports.OrExists$outboundSchema),
]);
function orToJSON(or) {
    return JSON.stringify(exports.Or$outboundSchema.parse(or));
}
/** @internal */
exports.KnowledgeFilterOr$outboundSchema = z.object({
    or: z.array(z.record(z.union([
        z.lazy(() => exports.InvokeDeploymentRequestOrEq$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestOrNe$outboundSchema),
        z.lazy(() => exports.OrGt$outboundSchema),
        z.lazy(() => exports.OrGte$outboundSchema),
        z.lazy(() => exports.OrLt$outboundSchema),
        z.lazy(() => exports.OrLte$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestOrIn$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestOrNin$outboundSchema),
        z.lazy(() => exports.OrExists$outboundSchema),
    ]))),
});
function knowledgeFilterOrToJSON(knowledgeFilterOr) {
    return JSON.stringify(exports.KnowledgeFilterOr$outboundSchema.parse(knowledgeFilterOr));
}
/** @internal */
exports.AndExists$outboundSchema = z.object({
    exists: z.boolean(),
});
function andExistsToJSON(andExists) {
    return JSON.stringify(exports.AndExists$outboundSchema.parse(andExists));
}
/** @internal */
exports.AndNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function andNinToJSON(andNin) {
    return JSON.stringify(exports.AndNin$outboundSchema.parse(andNin));
}
/** @internal */
exports.InvokeDeploymentRequestAndNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function invokeDeploymentRequestAndNinToJSON(invokeDeploymentRequestAndNin) {
    return JSON.stringify(exports.InvokeDeploymentRequestAndNin$outboundSchema.parse(invokeDeploymentRequestAndNin));
}
/** @internal */
exports.AndIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function andInToJSON(andIn) {
    return JSON.stringify(exports.AndIn$outboundSchema.parse(andIn));
}
/** @internal */
exports.InvokeDeploymentRequestAndIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function invokeDeploymentRequestAndInToJSON(invokeDeploymentRequestAndIn) {
    return JSON.stringify(exports.InvokeDeploymentRequestAndIn$outboundSchema.parse(invokeDeploymentRequestAndIn));
}
/** @internal */
exports.AndLte$outboundSchema = z.object({
    lte: z.number(),
});
function andLteToJSON(andLte) {
    return JSON.stringify(exports.AndLte$outboundSchema.parse(andLte));
}
/** @internal */
exports.AndLt$outboundSchema = z.object({
    lt: z.number(),
});
function andLtToJSON(andLt) {
    return JSON.stringify(exports.AndLt$outboundSchema.parse(andLt));
}
/** @internal */
exports.AndGte$outboundSchema = z.object({
    gte: z.number(),
});
function andGteToJSON(andGte) {
    return JSON.stringify(exports.AndGte$outboundSchema.parse(andGte));
}
/** @internal */
exports.AndGt$outboundSchema = z.object({
    gt: z.number(),
});
function andGtToJSON(andGt) {
    return JSON.stringify(exports.AndGt$outboundSchema.parse(andGt));
}
/** @internal */
exports.AndNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function andNeToJSON(andNe) {
    return JSON.stringify(exports.AndNe$outboundSchema.parse(andNe));
}
/** @internal */
exports.InvokeDeploymentRequestAndNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function invokeDeploymentRequestAndNeToJSON(invokeDeploymentRequestAndNe) {
    return JSON.stringify(exports.InvokeDeploymentRequestAndNe$outboundSchema.parse(invokeDeploymentRequestAndNe));
}
/** @internal */
exports.AndEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function andEqToJSON(andEq) {
    return JSON.stringify(exports.AndEq$outboundSchema.parse(andEq));
}
/** @internal */
exports.InvokeDeploymentRequestAndEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function invokeDeploymentRequestAndEqToJSON(invokeDeploymentRequestAndEq) {
    return JSON.stringify(exports.InvokeDeploymentRequestAndEq$outboundSchema.parse(invokeDeploymentRequestAndEq));
}
/** @internal */
exports.And$outboundSchema = z
    .union([
    z.lazy(() => exports.InvokeDeploymentRequestAndEq$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestAndNe$outboundSchema),
    z.lazy(() => exports.AndGt$outboundSchema),
    z.lazy(() => exports.AndGte$outboundSchema),
    z.lazy(() => exports.AndLt$outboundSchema),
    z.lazy(() => exports.AndLte$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestAndIn$outboundSchema),
    z.lazy(() => exports.InvokeDeploymentRequestAndNin$outboundSchema),
    z.lazy(() => exports.AndExists$outboundSchema),
]);
function andToJSON(and) {
    return JSON.stringify(exports.And$outboundSchema.parse(and));
}
/** @internal */
exports.KnowledgeFilterAnd$outboundSchema = z.object({
    and: z.array(z.record(z.union([
        z.lazy(() => exports.InvokeDeploymentRequestAndEq$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestAndNe$outboundSchema),
        z.lazy(() => exports.AndGt$outboundSchema),
        z.lazy(() => exports.AndGte$outboundSchema),
        z.lazy(() => exports.AndLt$outboundSchema),
        z.lazy(() => exports.AndLte$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestAndIn$outboundSchema),
        z.lazy(() => exports.InvokeDeploymentRequestAndNin$outboundSchema),
        z.lazy(() => exports.AndExists$outboundSchema),
    ]))),
});
function knowledgeFilterAndToJSON(knowledgeFilterAnd) {
    return JSON.stringify(exports.KnowledgeFilterAnd$outboundSchema.parse(knowledgeFilterAnd));
}
/** @internal */
exports.Exists$outboundSchema = z.object({
    exists: z.boolean(),
});
function existsToJSON(exists) {
    return JSON.stringify(exports.Exists$outboundSchema.parse(exists));
}
/** @internal */
exports.Nin$outboundSchema = z
    .union([z.string(), z.number(), z.boolean()]);
function ninToJSON(nin) {
    return JSON.stringify(exports.Nin$outboundSchema.parse(nin));
}
/** @internal */
exports.OneNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function oneNinToJSON(oneNin) {
    return JSON.stringify(exports.OneNin$outboundSchema.parse(oneNin));
}
/** @internal */
exports.In$outboundSchema = z
    .union([z.string(), z.number(), z.boolean()]);
function inToJSON(value) {
    return JSON.stringify(exports.In$outboundSchema.parse(value));
}
/** @internal */
exports.OneIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function oneInToJSON(oneIn) {
    return JSON.stringify(exports.OneIn$outboundSchema.parse(oneIn));
}
/** @internal */
exports.Lte$outboundSchema = z
    .object({
    lte: z.number(),
});
function lteToJSON(lte) {
    return JSON.stringify(exports.Lte$outboundSchema.parse(lte));
}
/** @internal */
exports.Lt$outboundSchema = z
    .object({
    lt: z.number(),
});
function ltToJSON(lt) {
    return JSON.stringify(exports.Lt$outboundSchema.parse(lt));
}
/** @internal */
exports.Gte$outboundSchema = z
    .object({
    gte: z.number(),
});
function gteToJSON(gte) {
    return JSON.stringify(exports.Gte$outboundSchema.parse(gte));
}
/** @internal */
exports.Gt$outboundSchema = z
    .object({
    gt: z.number(),
});
function gtToJSON(gt) {
    return JSON.stringify(exports.Gt$outboundSchema.parse(gt));
}
/** @internal */
exports.Ne$outboundSchema = z
    .union([z.string(), z.number(), z.boolean()]);
function neToJSON(ne) {
    return JSON.stringify(exports.Ne$outboundSchema.parse(ne));
}
/** @internal */
exports.OneNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function oneNeToJSON(oneNe) {
    return JSON.stringify(exports.OneNe$outboundSchema.parse(oneNe));
}
/** @internal */
exports.Eq$outboundSchema = z
    .union([z.string(), z.number(), z.boolean()]);
function eqToJSON(eq) {
    return JSON.stringify(exports.Eq$outboundSchema.parse(eq));
}
/** @internal */
exports.OneEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function oneEqToJSON(oneEq) {
    return JSON.stringify(exports.OneEq$outboundSchema.parse(oneEq));
}
/** @internal */
exports.One$outboundSchema = z
    .union([
    z.lazy(() => exports.OneEq$outboundSchema),
    z.lazy(() => exports.OneNe$outboundSchema),
    z.lazy(() => exports.Gt$outboundSchema),
    z.lazy(() => exports.Gte$outboundSchema),
    z.lazy(() => exports.Lt$outboundSchema),
    z.lazy(() => exports.Lte$outboundSchema),
    z.lazy(() => exports.OneIn$outboundSchema),
    z.lazy(() => exports.OneNin$outboundSchema),
    z.lazy(() => exports.Exists$outboundSchema),
]);
function oneToJSON(one) {
    return JSON.stringify(exports.One$outboundSchema.parse(one));
}
/** @internal */
exports.KnowledgeFilter$outboundSchema = z.union([
    z.lazy(() => exports.KnowledgeFilterAnd$outboundSchema),
    z.lazy(() => exports.KnowledgeFilterOr$outboundSchema),
    z.record(z.union([
        z.lazy(() => exports.OneEq$outboundSchema),
        z.lazy(() => exports.OneNe$outboundSchema),
        z.lazy(() => exports.Gt$outboundSchema),
        z.lazy(() => exports.Gte$outboundSchema),
        z.lazy(() => exports.Lt$outboundSchema),
        z.lazy(() => exports.Lte$outboundSchema),
        z.lazy(() => exports.OneIn$outboundSchema),
        z.lazy(() => exports.OneNin$outboundSchema),
        z.lazy(() => exports.Exists$outboundSchema),
    ])),
]);
function knowledgeFilterToJSON(knowledgeFilter) {
    return JSON.stringify(exports.KnowledgeFilter$outboundSchema.parse(knowledgeFilter));
}
/** @internal */
exports.InvokeDeploymentRequest$outboundSchema = z.object({
    key: z.string(),
    stream: z.boolean().default(false),
    inputs: z.record(z.any()).optional(),
    context: z.record(z.any()).optional(),
    prefixMessages: z.array(z.union([
        z.lazy(() => exports.SystemMessage$outboundSchema),
        z.lazy(() => exports.DeveloperMessage$outboundSchema),
        z.lazy(() => exports.UserMessage$outboundSchema),
        z.lazy(() => exports.AssistantMessage$outboundSchema),
        z.lazy(() => exports.ToolMessage$outboundSchema),
    ])).optional(),
    messages: z.array(z.union([
        z.lazy(() => exports.MessagesSystemMessage$outboundSchema),
        z.lazy(() => exports.MessagesDeveloperMessage$outboundSchema),
        z.lazy(() => exports.MessagesUserMessage$outboundSchema),
        z.lazy(() => exports.MessagesAssistantMessage$outboundSchema),
        z.lazy(() => exports.MessagesToolMessage$outboundSchema),
    ])).optional(),
    identity: publicidentity_js_1.PublicIdentity$outboundSchema.optional(),
    fileIds: z.array(z.string()).optional(),
    metadata: z.record(z.any()).optional(),
    extraParams: z.record(z.any()).optional(),
    documents: z.array(z.lazy(() => exports.Documents$outboundSchema)).optional(),
    invokeOptions: z.lazy(() => exports.InvokeOptions$outboundSchema).optional(),
    thread: z.lazy(() => exports.Thread$outboundSchema).optional(),
    knowledgeFilter: z.union([
        z.lazy(() => exports.KnowledgeFilterAnd$outboundSchema),
        z.lazy(() => exports.KnowledgeFilterOr$outboundSchema),
        z.record(z.union([
            z.lazy(() => exports.OneEq$outboundSchema),
            z.lazy(() => exports.OneNe$outboundSchema),
            z.lazy(() => exports.Gt$outboundSchema),
            z.lazy(() => exports.Gte$outboundSchema),
            z.lazy(() => exports.Lt$outboundSchema),
            z.lazy(() => exports.Lte$outboundSchema),
            z.lazy(() => exports.OneIn$outboundSchema),
            z.lazy(() => exports.OneNin$outboundSchema),
            z.lazy(() => exports.Exists$outboundSchema),
        ])),
    ]).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        prefixMessages: "prefix_messages",
        fileIds: "file_ids",
        extraParams: "extra_params",
        invokeOptions: "invoke_options",
        knowledgeFilter: "knowledge_filter",
    });
});
function invokeDeploymentRequestToJSON(invokeDeploymentRequest) {
    return JSON.stringify(exports.InvokeDeploymentRequest$outboundSchema.parse(invokeDeploymentRequest));
}
//# sourceMappingURL=invokedeploymentrequest.js.map