"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.MessagesAudio$outboundSchema = exports.DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema = exports.DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema = exports.MessagesToolMessage$outboundSchema = exports.MessagesCacheControl$outboundSchema = exports.MessagesTtl$outboundSchema = exports.DeploymentInvokeMessagesType$outboundSchema = exports.DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema = exports.DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema = exports.PrefixMessages$outboundSchema = exports.SystemMessage$outboundSchema = exports.PrefixMessagesContent$outboundSchema = exports.DeveloperMessage$outboundSchema = exports.DeploymentInvokePrefixMessagesContent$outboundSchema = exports.UserMessage$outboundSchema = exports.DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema = exports.Content2$outboundSchema = exports.Four$outboundSchema = exports.CacheControl$outboundSchema = exports.Ttl$outboundSchema = exports.DeploymentInvoke2DeploymentsType$outboundSchema = exports.AssistantMessage$outboundSchema = exports.PrefixMessagesToolCalls$outboundSchema = exports.PrefixMessagesFunction$outboundSchema = exports.PrefixMessagesType$outboundSchema = exports.Audio$outboundSchema = exports.DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema = exports.DeploymentInvokeContent2$outboundSchema = exports.ToolMessage$outboundSchema = exports.PrefixMessagesCacheControl$outboundSchema = exports.PrefixMessagesTtl$outboundSchema = exports.DeploymentInvokePrefixMessagesType$outboundSchema = exports.DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema = exports.DeploymentInvokeContentDeployments2$outboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType = exports.MessageRole = exports.DeploymentInvokeMessageRole = exports.DeploymentInvokeMessageDeploymentsRole = exports.Provider = exports.DeploymentInvokeObject = exports.TwoTtl = exports.DeploymentInvoke2DeploymentsRequestRequestBodyType = exports.MessagesType = exports.MessagesTtl = exports.DeploymentInvokeMessagesType = exports.Ttl = exports.DeploymentInvoke2DeploymentsType = exports.PrefixMessagesType = exports.PrefixMessagesTtl = exports.DeploymentInvokePrefixMessagesType = void 0;
exports.And$outboundSchema = exports.KnowledgeFilterAnd$outboundSchema = exports.AndEq$outboundSchema = exports.DeploymentInvokeAndEq$outboundSchema = exports.AndNe$outboundSchema = exports.DeploymentInvokeAndNe$outboundSchema = exports.AndGt$outboundSchema = exports.AndGte$outboundSchema = exports.AndLt$outboundSchema = exports.AndLte$outboundSchema = exports.AndIn$outboundSchema = exports.DeploymentInvokeAndIn$outboundSchema = exports.AndNin$outboundSchema = exports.DeploymentInvokeAndNin$outboundSchema = exports.AndExists$outboundSchema = exports.Or$outboundSchema = exports.KnowledgeFilterOr$outboundSchema = exports.OrEq$outboundSchema = exports.DeploymentInvokeOrEq$outboundSchema = exports.OrNe$outboundSchema = exports.DeploymentInvokeOrNe$outboundSchema = exports.OrGt$outboundSchema = exports.OrGte$outboundSchema = exports.OrLt$outboundSchema = exports.OrLte$outboundSchema = exports.OrIn$outboundSchema = exports.DeploymentInvokeOrIn$outboundSchema = exports.OrNin$outboundSchema = exports.DeploymentInvokeOrNin$outboundSchema = exports.OrExists$outboundSchema = exports.Thread$outboundSchema = exports.InvokeOptions$outboundSchema = exports.Documents$outboundSchema = exports.Metadata$outboundSchema = exports.DeploymentInvokeMessages$outboundSchema = exports.MessagesSystemMessage$outboundSchema = exports.MessagesContent$outboundSchema = exports.MessagesDeveloperMessage$outboundSchema = exports.DeploymentInvokeMessagesContent$outboundSchema = exports.MessagesUserMessage$outboundSchema = exports.DeploymentInvokeMessagesDeploymentsContent$outboundSchema = exports.DeploymentInvokeContentDeploymentsRequest2$outboundSchema = exports.Two4$outboundSchema = exports.TwoCacheControl$outboundSchema = exports.TwoTtl$outboundSchema = exports.DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema = exports.MessagesAssistantMessage$outboundSchema = exports.MessagesToolCalls$outboundSchema = exports.MessagesFunction$outboundSchema = exports.MessagesType$outboundSchema = void 0;
exports.DeploymentInvokeResponseBody$inboundSchema = exports.Choices$inboundSchema = exports.Message$inboundSchema = exports.Message1$inboundSchema = exports.MessageToolCalls$inboundSchema = exports.MessageFunction$inboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema = exports.MessageRole$inboundSchema = exports.Message2$inboundSchema = exports.DeploymentInvokeMessageRole$inboundSchema = exports.Message3$inboundSchema = exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema = exports.Usage$inboundSchema = exports.CompletionTokensDetails$inboundSchema = exports.PromptTokensDetails$inboundSchema = exports.Retrievals$inboundSchema = exports.DeploymentInvokeMetadata$inboundSchema = exports.Telemetry$inboundSchema = exports.Provider$inboundSchema = exports.DeploymentInvokeObject$inboundSchema = exports.DeploymentInvokeRequestBody$outboundSchema = exports.KnowledgeFilter$outboundSchema = exports.KnowledgeFilter1$outboundSchema = exports.Eq$outboundSchema = exports.OneEq$outboundSchema = exports.Ne$outboundSchema = exports.OneNe$outboundSchema = exports.Gt$outboundSchema = exports.Gte$outboundSchema = exports.Lt$outboundSchema = exports.Lte$outboundSchema = exports.In$outboundSchema = exports.OneIn$outboundSchema = exports.Nin$outboundSchema = exports.OneNin$outboundSchema = exports.Exists$outboundSchema = void 0;
exports.deploymentInvokeContentDeployments2ToJSON = deploymentInvokeContentDeployments2ToJSON;
exports.deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContentToJSON = deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContentToJSON;
exports.prefixMessagesCacheControlToJSON = prefixMessagesCacheControlToJSON;
exports.toolMessageToJSON = toolMessageToJSON;
exports.deploymentInvokeContent2ToJSON = deploymentInvokeContent2ToJSON;
exports.deploymentInvokePrefixMessagesDeploymentsRequestContentToJSON = deploymentInvokePrefixMessagesDeploymentsRequestContentToJSON;
exports.audioToJSON = audioToJSON;
exports.prefixMessagesFunctionToJSON = prefixMessagesFunctionToJSON;
exports.prefixMessagesToolCallsToJSON = prefixMessagesToolCallsToJSON;
exports.assistantMessageToJSON = assistantMessageToJSON;
exports.cacheControlToJSON = cacheControlToJSON;
exports.fourToJSON = fourToJSON;
exports.content2ToJSON = content2ToJSON;
exports.deploymentInvokePrefixMessagesDeploymentsContentToJSON = deploymentInvokePrefixMessagesDeploymentsContentToJSON;
exports.userMessageToJSON = userMessageToJSON;
exports.deploymentInvokePrefixMessagesContentToJSON = deploymentInvokePrefixMessagesContentToJSON;
exports.developerMessageToJSON = developerMessageToJSON;
exports.prefixMessagesContentToJSON = prefixMessagesContentToJSON;
exports.systemMessageToJSON = systemMessageToJSON;
exports.prefixMessagesToJSON = prefixMessagesToJSON;
exports.deploymentInvokeContentDeploymentsRequestRequestBodyMessages2ToJSON = deploymentInvokeContentDeploymentsRequestRequestBodyMessages2ToJSON;
exports.deploymentInvokeMessagesDeploymentsRequestRequestBodyContentToJSON = deploymentInvokeMessagesDeploymentsRequestRequestBodyContentToJSON;
exports.messagesCacheControlToJSON = messagesCacheControlToJSON;
exports.messagesToolMessageToJSON = messagesToolMessageToJSON;
exports.deploymentInvokeContentDeploymentsRequestRequestBody2ToJSON = deploymentInvokeContentDeploymentsRequestRequestBody2ToJSON;
exports.deploymentInvokeMessagesDeploymentsRequestContentToJSON = deploymentInvokeMessagesDeploymentsRequestContentToJSON;
exports.messagesAudioToJSON = messagesAudioToJSON;
exports.messagesFunctionToJSON = messagesFunctionToJSON;
exports.messagesToolCallsToJSON = messagesToolCallsToJSON;
exports.messagesAssistantMessageToJSON = messagesAssistantMessageToJSON;
exports.twoCacheControlToJSON = twoCacheControlToJSON;
exports.two4ToJSON = two4ToJSON;
exports.deploymentInvokeContentDeploymentsRequest2ToJSON = deploymentInvokeContentDeploymentsRequest2ToJSON;
exports.deploymentInvokeMessagesDeploymentsContentToJSON = deploymentInvokeMessagesDeploymentsContentToJSON;
exports.messagesUserMessageToJSON = messagesUserMessageToJSON;
exports.deploymentInvokeMessagesContentToJSON = deploymentInvokeMessagesContentToJSON;
exports.messagesDeveloperMessageToJSON = messagesDeveloperMessageToJSON;
exports.messagesContentToJSON = messagesContentToJSON;
exports.messagesSystemMessageToJSON = messagesSystemMessageToJSON;
exports.deploymentInvokeMessagesToJSON = deploymentInvokeMessagesToJSON;
exports.metadataToJSON = metadataToJSON;
exports.documentsToJSON = documentsToJSON;
exports.invokeOptionsToJSON = invokeOptionsToJSON;
exports.threadToJSON = threadToJSON;
exports.orExistsToJSON = orExistsToJSON;
exports.deploymentInvokeOrNinToJSON = deploymentInvokeOrNinToJSON;
exports.orNinToJSON = orNinToJSON;
exports.deploymentInvokeOrInToJSON = deploymentInvokeOrInToJSON;
exports.orInToJSON = orInToJSON;
exports.orLteToJSON = orLteToJSON;
exports.orLtToJSON = orLtToJSON;
exports.orGteToJSON = orGteToJSON;
exports.orGtToJSON = orGtToJSON;
exports.deploymentInvokeOrNeToJSON = deploymentInvokeOrNeToJSON;
exports.orNeToJSON = orNeToJSON;
exports.deploymentInvokeOrEqToJSON = deploymentInvokeOrEqToJSON;
exports.orEqToJSON = orEqToJSON;
exports.knowledgeFilterOrToJSON = knowledgeFilterOrToJSON;
exports.orToJSON = orToJSON;
exports.andExistsToJSON = andExistsToJSON;
exports.deploymentInvokeAndNinToJSON = deploymentInvokeAndNinToJSON;
exports.andNinToJSON = andNinToJSON;
exports.deploymentInvokeAndInToJSON = deploymentInvokeAndInToJSON;
exports.andInToJSON = andInToJSON;
exports.andLteToJSON = andLteToJSON;
exports.andLtToJSON = andLtToJSON;
exports.andGteToJSON = andGteToJSON;
exports.andGtToJSON = andGtToJSON;
exports.deploymentInvokeAndNeToJSON = deploymentInvokeAndNeToJSON;
exports.andNeToJSON = andNeToJSON;
exports.deploymentInvokeAndEqToJSON = deploymentInvokeAndEqToJSON;
exports.andEqToJSON = andEqToJSON;
exports.knowledgeFilterAndToJSON = knowledgeFilterAndToJSON;
exports.andToJSON = andToJSON;
exports.existsToJSON = existsToJSON;
exports.oneNinToJSON = oneNinToJSON;
exports.ninToJSON = ninToJSON;
exports.oneInToJSON = oneInToJSON;
exports.inToJSON = inToJSON;
exports.lteToJSON = lteToJSON;
exports.ltToJSON = ltToJSON;
exports.gteToJSON = gteToJSON;
exports.gtToJSON = gtToJSON;
exports.oneNeToJSON = oneNeToJSON;
exports.neToJSON = neToJSON;
exports.oneEqToJSON = oneEqToJSON;
exports.eqToJSON = eqToJSON;
exports.knowledgeFilter1ToJSON = knowledgeFilter1ToJSON;
exports.knowledgeFilterToJSON = knowledgeFilterToJSON;
exports.deploymentInvokeRequestBodyToJSON = deploymentInvokeRequestBodyToJSON;
exports.telemetryFromJSON = telemetryFromJSON;
exports.deploymentInvokeMetadataFromJSON = deploymentInvokeMetadataFromJSON;
exports.retrievalsFromJSON = retrievalsFromJSON;
exports.promptTokensDetailsFromJSON = promptTokensDetailsFromJSON;
exports.completionTokensDetailsFromJSON = completionTokensDetailsFromJSON;
exports.usageFromJSON = usageFromJSON;
exports.message3FromJSON = message3FromJSON;
exports.message2FromJSON = message2FromJSON;
exports.messageFunctionFromJSON = messageFunctionFromJSON;
exports.messageToolCallsFromJSON = messageToolCallsFromJSON;
exports.message1FromJSON = message1FromJSON;
exports.messageFromJSON = messageFromJSON;
exports.choicesFromJSON = choicesFromJSON;
exports.deploymentInvokeResponseBodyFromJSON = deploymentInvokeResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.DeploymentInvokePrefixMessagesType = {
    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.DeploymentInvoke2DeploymentsType = {
    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.Ttl = {
    Fivem: "5m",
    Oneh: "1h",
};
/**
 * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
 */
exports.DeploymentInvokeMessagesType = {
    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.DeploymentInvoke2DeploymentsRequestRequestBodyType = {
    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",
};
/**
 * Indicates the type of model used to generate the response
 */
exports.DeploymentInvokeObject = {
    Chat: "chat",
    Completion: "completion",
    Image: "image",
};
/**
 * The provider used to generate the response
 */
exports.Provider = {
    Openai: "openai",
    Groq: "groq",
    Cohere: "cohere",
    Azure: "azure",
    Aws: "aws",
    Google: "google",
    GoogleAi: "google-ai",
    Huggingface: "huggingface",
    Togetherai: "togetherai",
    Perplexity: "perplexity",
    Anthropic: "anthropic",
    Leonardoai: "leonardoai",
    Fal: "fal",
    Nvidia: "nvidia",
    Jina: "jina",
    Elevenlabs: "elevenlabs",
    Litellm: "litellm",
    Cerebras: "cerebras",
    Openailike: "openailike",
    Bytedance: "bytedance",
    Mistral: "mistral",
    Deepseek: "deepseek",
    Contextualai: "contextualai",
    Moonshotai: "moonshotai",
    Zai: "zai",
    Minimax: "minimax",
    Xai: "xai",
    Alibaba: "alibaba",
    Tensorix: "tensorix",
    Scaleway: "scaleway",
    Hcompany: "hcompany",
    Inceptron: "inceptron",
    Wafer: "wafer",
    Slack: "slack",
    Orq: "orq",
};
/**
 * The role of the prompt message
 */
exports.DeploymentInvokeMessageDeploymentsRole = {
    System: "system",
    Developer: "developer",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
/**
 * The role of the prompt message
 */
exports.DeploymentInvokeMessageRole = {
    System: "system",
    Developer: "developer",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
/**
 * The role of the prompt message
 */
exports.MessageRole = {
    System: "system",
    Developer: "developer",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
exports.DeploymentInvokeMessageDeploymentsResponseType = {
    Function: "function",
};
/** @internal */
exports.DeploymentInvokeContentDeployments2$outboundSchema = components.TextContentPartSchema$outboundSchema;
function deploymentInvokeContentDeployments2ToJSON(deploymentInvokeContentDeployments2) {
    return JSON.stringify(exports.DeploymentInvokeContentDeployments2$outboundSchema.parse(deploymentInvokeContentDeployments2));
}
/** @internal */
exports.DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema = z.union([
    z.string(),
    z.array(components.TextContentPartSchema$outboundSchema),
]);
function deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContentToJSON(deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent) {
    return JSON.stringify(exports.DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema
        .parse(deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent));
}
/** @internal */
exports.DeploymentInvokePrefixMessagesType$outboundSchema = z.nativeEnum(exports.DeploymentInvokePrefixMessagesType);
/** @internal */
exports.PrefixMessagesTtl$outboundSchema = z.nativeEnum(exports.PrefixMessagesTtl);
/** @internal */
exports.PrefixMessagesCacheControl$outboundSchema = z.object({
    type: exports.DeploymentInvokePrefixMessagesType$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(components.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.DeploymentInvokeContent2$outboundSchema = z.union([
    components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    components.RefusalPartSchema$outboundSchema,
    components.ReasoningPartSchema$outboundSchema,
    components.RedactedReasoningPartSchema$outboundSchema,
]);
function deploymentInvokeContent2ToJSON(deploymentInvokeContent2) {
    return JSON.stringify(exports.DeploymentInvokeContent2$outboundSchema.parse(deploymentInvokeContent2));
}
/** @internal */
exports.DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        components.RefusalPartSchema$outboundSchema,
        components.ReasoningPartSchema$outboundSchema,
        components.RedactedReasoningPartSchema$outboundSchema,
    ])),
]);
function deploymentInvokePrefixMessagesDeploymentsRequestContentToJSON(deploymentInvokePrefixMessagesDeploymentsRequestContent) {
    return JSON.stringify(exports.DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema
        .parse(deploymentInvokePrefixMessagesDeploymentsRequestContent));
}
/** @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.PrefixMessagesToolCalls$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 prefixMessagesToolCallsToJSON(prefixMessagesToolCalls) {
    return JSON.stringify(exports.PrefixMessagesToolCalls$outboundSchema.parse(prefixMessagesToolCalls));
}
/** @internal */
exports.AssistantMessage$outboundSchema = z.object({
    content: z.nullable(z.union([
        z.string(),
        z.array(z.union([
            components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            components.RefusalPartSchema$outboundSchema,
            components.ReasoningPartSchema$outboundSchema,
            components.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.PrefixMessagesToolCalls$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.DeploymentInvoke2DeploymentsType$outboundSchema = z.nativeEnum(exports.DeploymentInvoke2DeploymentsType);
/** @internal */
exports.Ttl$outboundSchema = z.nativeEnum(exports.Ttl);
/** @internal */
exports.CacheControl$outboundSchema = z.object({
    type: exports.DeploymentInvoke2DeploymentsType$outboundSchema,
    ttl: exports.Ttl$outboundSchema.default("5m"),
});
function cacheControlToJSON(cacheControl) {
    return JSON.stringify(exports.CacheControl$outboundSchema.parse(cacheControl));
}
/** @internal */
exports.Four$outboundSchema = z.object({
    type: z.literal("file"),
    cacheControl: z.lazy(() => exports.CacheControl$outboundSchema).optional(),
    file: components.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.Content2$outboundSchema = z.union([
    components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    components.ImageContentPartSchema$outboundSchema,
    components.AudioContentPartSchema$outboundSchema,
    z.lazy(() => exports.Four$outboundSchema),
]);
function content2ToJSON(content2) {
    return JSON.stringify(exports.Content2$outboundSchema.parse(content2));
}
/** @internal */
exports.DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        components.ImageContentPartSchema$outboundSchema,
        components.AudioContentPartSchema$outboundSchema,
        z.lazy(() => exports.Four$outboundSchema),
    ])),
]);
function deploymentInvokePrefixMessagesDeploymentsContentToJSON(deploymentInvokePrefixMessagesDeploymentsContent) {
    return JSON.stringify(exports.DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema.parse(deploymentInvokePrefixMessagesDeploymentsContent));
}
/** @internal */
exports.UserMessage$outboundSchema = z.object({
    role: z.literal("user"),
    name: z.string().optional(),
    content: z.union([
        z.string(),
        z.array(z.union([
            components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            components.ImageContentPartSchema$outboundSchema,
            components.AudioContentPartSchema$outboundSchema,
            z.lazy(() => exports.Four$outboundSchema),
        ])),
    ]),
});
function userMessageToJSON(userMessage) {
    return JSON.stringify(exports.UserMessage$outboundSchema.parse(userMessage));
}
/** @internal */
exports.DeploymentInvokePrefixMessagesContent$outboundSchema = z.union([
    z.string(),
    z.array(components.TextContentPartSchema$outboundSchema),
]);
function deploymentInvokePrefixMessagesContentToJSON(deploymentInvokePrefixMessagesContent) {
    return JSON.stringify(exports.DeploymentInvokePrefixMessagesContent$outboundSchema.parse(deploymentInvokePrefixMessagesContent));
}
/** @internal */
exports.DeveloperMessage$outboundSchema = z.object({
    role: z.literal("developer"),
    content: z.union([
        z.string(),
        z.array(components.TextContentPartSchema$outboundSchema),
    ]),
    name: z.string().optional(),
});
function developerMessageToJSON(developerMessage) {
    return JSON.stringify(exports.DeveloperMessage$outboundSchema.parse(developerMessage));
}
/** @internal */
exports.PrefixMessagesContent$outboundSchema = z.union([
    z.string(),
    z.array(components.TextContentPartSchema$outboundSchema),
]);
function prefixMessagesContentToJSON(prefixMessagesContent) {
    return JSON.stringify(exports.PrefixMessagesContent$outboundSchema.parse(prefixMessagesContent));
}
/** @internal */
exports.SystemMessage$outboundSchema = z.object({
    role: z.literal("system"),
    content: z.union([
        z.string(),
        z.array(components.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.DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema = components.TextContentPartSchema$outboundSchema;
function deploymentInvokeContentDeploymentsRequestRequestBodyMessages2ToJSON(deploymentInvokeContentDeploymentsRequestRequestBodyMessages2) {
    return JSON.stringify(exports.DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema
        .parse(deploymentInvokeContentDeploymentsRequestRequestBodyMessages2));
}
/** @internal */
exports.DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema = z.union([
    z.string(),
    z.array(components.TextContentPartSchema$outboundSchema),
]);
function deploymentInvokeMessagesDeploymentsRequestRequestBodyContentToJSON(deploymentInvokeMessagesDeploymentsRequestRequestBodyContent) {
    return JSON.stringify(exports.DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema
        .parse(deploymentInvokeMessagesDeploymentsRequestRequestBodyContent));
}
/** @internal */
exports.DeploymentInvokeMessagesType$outboundSchema = z.nativeEnum(exports.DeploymentInvokeMessagesType);
/** @internal */
exports.MessagesTtl$outboundSchema = z
    .nativeEnum(exports.MessagesTtl);
/** @internal */
exports.MessagesCacheControl$outboundSchema = z.object({
    type: exports.DeploymentInvokeMessagesType$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(components.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.DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema = z.union([
    components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    components.RefusalPartSchema$outboundSchema,
    components.ReasoningPartSchema$outboundSchema,
    components.RedactedReasoningPartSchema$outboundSchema,
]);
function deploymentInvokeContentDeploymentsRequestRequestBody2ToJSON(deploymentInvokeContentDeploymentsRequestRequestBody2) {
    return JSON.stringify(exports.DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema.parse(deploymentInvokeContentDeploymentsRequestRequestBody2));
}
/** @internal */
exports.DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        components.RefusalPartSchema$outboundSchema,
        components.ReasoningPartSchema$outboundSchema,
        components.RedactedReasoningPartSchema$outboundSchema,
    ])),
]);
function deploymentInvokeMessagesDeploymentsRequestContentToJSON(deploymentInvokeMessagesDeploymentsRequestContent) {
    return JSON.stringify(exports.DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema.parse(deploymentInvokeMessagesDeploymentsRequestContent));
}
/** @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([
            components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            components.RefusalPartSchema$outboundSchema,
            components.ReasoningPartSchema$outboundSchema,
            components.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.DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema = z
    .nativeEnum(exports.DeploymentInvoke2DeploymentsRequestRequestBodyType);
/** @internal */
exports.TwoTtl$outboundSchema = z
    .nativeEnum(exports.TwoTtl);
/** @internal */
exports.TwoCacheControl$outboundSchema = z.object({
    type: exports.DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema,
    ttl: exports.TwoTtl$outboundSchema.default("5m"),
});
function twoCacheControlToJSON(twoCacheControl) {
    return JSON.stringify(exports.TwoCacheControl$outboundSchema.parse(twoCacheControl));
}
/** @internal */
exports.Two4$outboundSchema = z.object({
    type: z.literal("file"),
    cacheControl: z.lazy(() => exports.TwoCacheControl$outboundSchema).optional(),
    file: components.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.DeploymentInvokeContentDeploymentsRequest2$outboundSchema = z.union([
    components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
    components.ImageContentPartSchema$outboundSchema,
    components.AudioContentPartSchema$outboundSchema,
    z.lazy(() => exports.Two4$outboundSchema),
]);
function deploymentInvokeContentDeploymentsRequest2ToJSON(deploymentInvokeContentDeploymentsRequest2) {
    return JSON.stringify(exports.DeploymentInvokeContentDeploymentsRequest2$outboundSchema.parse(deploymentInvokeContentDeploymentsRequest2));
}
/** @internal */
exports.DeploymentInvokeMessagesDeploymentsContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
        components.ImageContentPartSchema$outboundSchema,
        components.AudioContentPartSchema$outboundSchema,
        z.lazy(() => exports.Two4$outboundSchema),
    ])),
]);
function deploymentInvokeMessagesDeploymentsContentToJSON(deploymentInvokeMessagesDeploymentsContent) {
    return JSON.stringify(exports.DeploymentInvokeMessagesDeploymentsContent$outboundSchema.parse(deploymentInvokeMessagesDeploymentsContent));
}
/** @internal */
exports.MessagesUserMessage$outboundSchema = z.object({
    role: z.literal("user"),
    name: z.string().optional(),
    content: z.union([
        z.string(),
        z.array(z.union([
            components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
            components.ImageContentPartSchema$outboundSchema,
            components.AudioContentPartSchema$outboundSchema,
            z.lazy(() => exports.Two4$outboundSchema),
        ])),
    ]),
});
function messagesUserMessageToJSON(messagesUserMessage) {
    return JSON.stringify(exports.MessagesUserMessage$outboundSchema.parse(messagesUserMessage));
}
/** @internal */
exports.DeploymentInvokeMessagesContent$outboundSchema = z.union([
    z.string(),
    z.array(components.TextContentPartSchema$outboundSchema),
]);
function deploymentInvokeMessagesContentToJSON(deploymentInvokeMessagesContent) {
    return JSON.stringify(exports.DeploymentInvokeMessagesContent$outboundSchema.parse(deploymentInvokeMessagesContent));
}
/** @internal */
exports.MessagesDeveloperMessage$outboundSchema = z.object({
    role: z.literal("developer"),
    content: z.union([
        z.string(),
        z.array(components.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(components.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(components.TextContentPartSchema$outboundSchema),
    ]),
    name: z.string().optional(),
});
function messagesSystemMessageToJSON(messagesSystemMessage) {
    return JSON.stringify(exports.MessagesSystemMessage$outboundSchema.parse(messagesSystemMessage));
}
/** @internal */
exports.DeploymentInvokeMessages$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 deploymentInvokeMessagesToJSON(deploymentInvokeMessages) {
    return JSON.stringify(exports.DeploymentInvokeMessages$outboundSchema.parse(deploymentInvokeMessages));
}
/** @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.DeploymentInvokeOrNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeOrNinToJSON(deploymentInvokeOrNin) {
    return JSON.stringify(exports.DeploymentInvokeOrNin$outboundSchema.parse(deploymentInvokeOrNin));
}
/** @internal */
exports.OrNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function orNinToJSON(orNin) {
    return JSON.stringify(exports.OrNin$outboundSchema.parse(orNin));
}
/** @internal */
exports.DeploymentInvokeOrIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeOrInToJSON(deploymentInvokeOrIn) {
    return JSON.stringify(exports.DeploymentInvokeOrIn$outboundSchema.parse(deploymentInvokeOrIn));
}
/** @internal */
exports.OrIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function orInToJSON(orIn) {
    return JSON.stringify(exports.OrIn$outboundSchema.parse(orIn));
}
/** @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.DeploymentInvokeOrNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeOrNeToJSON(deploymentInvokeOrNe) {
    return JSON.stringify(exports.DeploymentInvokeOrNe$outboundSchema.parse(deploymentInvokeOrNe));
}
/** @internal */
exports.OrNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function orNeToJSON(orNe) {
    return JSON.stringify(exports.OrNe$outboundSchema.parse(orNe));
}
/** @internal */
exports.DeploymentInvokeOrEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeOrEqToJSON(deploymentInvokeOrEq) {
    return JSON.stringify(exports.DeploymentInvokeOrEq$outboundSchema.parse(deploymentInvokeOrEq));
}
/** @internal */
exports.OrEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function orEqToJSON(orEq) {
    return JSON.stringify(exports.OrEq$outboundSchema.parse(orEq));
}
/** @internal */
exports.KnowledgeFilterOr$outboundSchema = z.union([
    z.lazy(() => exports.OrEq$outboundSchema),
    z.lazy(() => exports.OrNe$outboundSchema),
    z.lazy(() => exports.OrGt$outboundSchema),
    z.lazy(() => exports.OrGte$outboundSchema),
    z.lazy(() => exports.OrLt$outboundSchema),
    z.lazy(() => exports.OrLte$outboundSchema),
    z.lazy(() => exports.OrIn$outboundSchema),
    z.lazy(() => exports.OrNin$outboundSchema),
    z.lazy(() => exports.OrExists$outboundSchema),
]);
function knowledgeFilterOrToJSON(knowledgeFilterOr) {
    return JSON.stringify(exports.KnowledgeFilterOr$outboundSchema.parse(knowledgeFilterOr));
}
/** @internal */
exports.Or$outboundSchema = z
    .object({
    or: z.array(z.record(z.union([
        z.lazy(() => exports.OrEq$outboundSchema),
        z.lazy(() => exports.OrNe$outboundSchema),
        z.lazy(() => exports.OrGt$outboundSchema),
        z.lazy(() => exports.OrGte$outboundSchema),
        z.lazy(() => exports.OrLt$outboundSchema),
        z.lazy(() => exports.OrLte$outboundSchema),
        z.lazy(() => exports.OrIn$outboundSchema),
        z.lazy(() => exports.OrNin$outboundSchema),
        z.lazy(() => exports.OrExists$outboundSchema),
    ]))),
});
function orToJSON(or) {
    return JSON.stringify(exports.Or$outboundSchema.parse(or));
}
/** @internal */
exports.AndExists$outboundSchema = z.object({
    exists: z.boolean(),
});
function andExistsToJSON(andExists) {
    return JSON.stringify(exports.AndExists$outboundSchema.parse(andExists));
}
/** @internal */
exports.DeploymentInvokeAndNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeAndNinToJSON(deploymentInvokeAndNin) {
    return JSON.stringify(exports.DeploymentInvokeAndNin$outboundSchema.parse(deploymentInvokeAndNin));
}
/** @internal */
exports.AndNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function andNinToJSON(andNin) {
    return JSON.stringify(exports.AndNin$outboundSchema.parse(andNin));
}
/** @internal */
exports.DeploymentInvokeAndIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeAndInToJSON(deploymentInvokeAndIn) {
    return JSON.stringify(exports.DeploymentInvokeAndIn$outboundSchema.parse(deploymentInvokeAndIn));
}
/** @internal */
exports.AndIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function andInToJSON(andIn) {
    return JSON.stringify(exports.AndIn$outboundSchema.parse(andIn));
}
/** @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.DeploymentInvokeAndNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeAndNeToJSON(deploymentInvokeAndNe) {
    return JSON.stringify(exports.DeploymentInvokeAndNe$outboundSchema.parse(deploymentInvokeAndNe));
}
/** @internal */
exports.AndNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function andNeToJSON(andNe) {
    return JSON.stringify(exports.AndNe$outboundSchema.parse(andNe));
}
/** @internal */
exports.DeploymentInvokeAndEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function deploymentInvokeAndEqToJSON(deploymentInvokeAndEq) {
    return JSON.stringify(exports.DeploymentInvokeAndEq$outboundSchema.parse(deploymentInvokeAndEq));
}
/** @internal */
exports.AndEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function andEqToJSON(andEq) {
    return JSON.stringify(exports.AndEq$outboundSchema.parse(andEq));
}
/** @internal */
exports.KnowledgeFilterAnd$outboundSchema = z.union([
    z.lazy(() => exports.AndEq$outboundSchema),
    z.lazy(() => exports.AndNe$outboundSchema),
    z.lazy(() => exports.AndGt$outboundSchema),
    z.lazy(() => exports.AndGte$outboundSchema),
    z.lazy(() => exports.AndLt$outboundSchema),
    z.lazy(() => exports.AndLte$outboundSchema),
    z.lazy(() => exports.AndIn$outboundSchema),
    z.lazy(() => exports.AndNin$outboundSchema),
    z.lazy(() => exports.AndExists$outboundSchema),
]);
function knowledgeFilterAndToJSON(knowledgeFilterAnd) {
    return JSON.stringify(exports.KnowledgeFilterAnd$outboundSchema.parse(knowledgeFilterAnd));
}
/** @internal */
exports.And$outboundSchema = z
    .object({
    and: z.array(z.record(z.union([
        z.lazy(() => exports.AndEq$outboundSchema),
        z.lazy(() => exports.AndNe$outboundSchema),
        z.lazy(() => exports.AndGt$outboundSchema),
        z.lazy(() => exports.AndGte$outboundSchema),
        z.lazy(() => exports.AndLt$outboundSchema),
        z.lazy(() => exports.AndLte$outboundSchema),
        z.lazy(() => exports.AndIn$outboundSchema),
        z.lazy(() => exports.AndNin$outboundSchema),
        z.lazy(() => exports.AndExists$outboundSchema),
    ]))),
});
function andToJSON(and) {
    return JSON.stringify(exports.And$outboundSchema.parse(and));
}
/** @internal */
exports.Exists$outboundSchema = z.object({
    exists: z.boolean(),
});
function existsToJSON(exists) {
    return JSON.stringify(exports.Exists$outboundSchema.parse(exists));
}
/** @internal */
exports.OneNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function oneNinToJSON(oneNin) {
    return JSON.stringify(exports.OneNin$outboundSchema.parse(oneNin));
}
/** @internal */
exports.Nin$outboundSchema = z
    .object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function ninToJSON(nin) {
    return JSON.stringify(exports.Nin$outboundSchema.parse(nin));
}
/** @internal */
exports.OneIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function oneInToJSON(oneIn) {
    return JSON.stringify(exports.OneIn$outboundSchema.parse(oneIn));
}
/** @internal */
exports.In$outboundSchema = z
    .object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function inToJSON(value) {
    return JSON.stringify(exports.In$outboundSchema.parse(value));
}
/** @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.OneNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function oneNeToJSON(oneNe) {
    return JSON.stringify(exports.OneNe$outboundSchema.parse(oneNe));
}
/** @internal */
exports.Ne$outboundSchema = z
    .object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function neToJSON(ne) {
    return JSON.stringify(exports.Ne$outboundSchema.parse(ne));
}
/** @internal */
exports.OneEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function oneEqToJSON(oneEq) {
    return JSON.stringify(exports.OneEq$outboundSchema.parse(oneEq));
}
/** @internal */
exports.Eq$outboundSchema = z
    .object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function eqToJSON(eq) {
    return JSON.stringify(exports.Eq$outboundSchema.parse(eq));
}
/** @internal */
exports.KnowledgeFilter1$outboundSchema = z.union([
    z.lazy(() => exports.Eq$outboundSchema),
    z.lazy(() => exports.Ne$outboundSchema),
    z.lazy(() => exports.Gt$outboundSchema),
    z.lazy(() => exports.Gte$outboundSchema),
    z.lazy(() => exports.Lt$outboundSchema),
    z.lazy(() => exports.Lte$outboundSchema),
    z.lazy(() => exports.In$outboundSchema),
    z.lazy(() => exports.Nin$outboundSchema),
    z.lazy(() => exports.Exists$outboundSchema),
]);
function knowledgeFilter1ToJSON(knowledgeFilter1) {
    return JSON.stringify(exports.KnowledgeFilter1$outboundSchema.parse(knowledgeFilter1));
}
/** @internal */
exports.KnowledgeFilter$outboundSchema = z.union([
    z.lazy(() => exports.And$outboundSchema),
    z.lazy(() => exports.Or$outboundSchema),
    z.record(z.union([
        z.lazy(() => exports.Eq$outboundSchema),
        z.lazy(() => exports.Ne$outboundSchema),
        z.lazy(() => exports.Gt$outboundSchema),
        z.lazy(() => exports.Gte$outboundSchema),
        z.lazy(() => exports.Lt$outboundSchema),
        z.lazy(() => exports.Lte$outboundSchema),
        z.lazy(() => exports.In$outboundSchema),
        z.lazy(() => exports.Nin$outboundSchema),
        z.lazy(() => exports.Exists$outboundSchema),
    ])),
]);
function knowledgeFilterToJSON(knowledgeFilter) {
    return JSON.stringify(exports.KnowledgeFilter$outboundSchema.parse(knowledgeFilter));
}
/** @internal */
exports.DeploymentInvokeRequestBody$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: components.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.And$outboundSchema),
        z.lazy(() => exports.Or$outboundSchema),
        z.record(z.union([
            z.lazy(() => exports.Eq$outboundSchema),
            z.lazy(() => exports.Ne$outboundSchema),
            z.lazy(() => exports.Gt$outboundSchema),
            z.lazy(() => exports.Gte$outboundSchema),
            z.lazy(() => exports.Lt$outboundSchema),
            z.lazy(() => exports.Lte$outboundSchema),
            z.lazy(() => exports.In$outboundSchema),
            z.lazy(() => exports.Nin$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 deploymentInvokeRequestBodyToJSON(deploymentInvokeRequestBody) {
    return JSON.stringify(exports.DeploymentInvokeRequestBody$outboundSchema.parse(deploymentInvokeRequestBody));
}
/** @internal */
exports.DeploymentInvokeObject$inboundSchema = z.nativeEnum(exports.DeploymentInvokeObject);
/** @internal */
exports.Provider$inboundSchema = z
    .nativeEnum(exports.Provider);
/** @internal */
exports.Telemetry$inboundSchema = z.object({
    trace_id: z.string(),
    span_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "trace_id": "traceId",
        "span_id": "spanId",
    });
});
function telemetryFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Telemetry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Telemetry' from JSON`);
}
/** @internal */
exports.DeploymentInvokeMetadata$inboundSchema = z.object({
    file_name: z.string(),
    page_number: z.nullable(z.number()),
    file_type: z.string(),
    rerank_score: z.number().optional(),
    search_score: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "file_name": "fileName",
        "page_number": "pageNumber",
        "file_type": "fileType",
        "rerank_score": "rerankScore",
        "search_score": "searchScore",
    });
});
function deploymentInvokeMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentInvokeMetadata' from JSON`);
}
/** @internal */
exports.Retrievals$inboundSchema = z.object({
    document: z.string(),
    metadata: z.lazy(() => exports.DeploymentInvokeMetadata$inboundSchema),
});
function retrievalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Retrievals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Retrievals' from JSON`);
}
/** @internal */
exports.PromptTokensDetails$inboundSchema = z.object({
    cached_tokens: z.nullable(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cached_tokens": "cachedTokens",
    });
});
function promptTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptTokensDetails' from JSON`);
}
/** @internal */
exports.CompletionTokensDetails$inboundSchema = z.object({
    reasoning_tokens: z.nullable(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "reasoning_tokens": "reasoningTokens",
    });
});
function completionTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionTokensDetails' from JSON`);
}
/** @internal */
exports.Usage$inboundSchema = z
    .object({
    total_tokens: z.number().optional(),
    prompt_tokens: z.number().optional(),
    completion_tokens: z.number().optional(),
    prompt_tokens_details: z.lazy(() => exports.PromptTokensDetails$inboundSchema)
        .optional(),
    completion_tokens_details: z.nullable(z.lazy(() => exports.CompletionTokensDetails$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "total_tokens": "totalTokens",
        "prompt_tokens": "promptTokens",
        "completion_tokens": "completionTokens",
        "prompt_tokens_details": "promptTokensDetails",
        "completion_tokens_details": "completionTokensDetails",
    });
});
function usageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Usage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Usage' from JSON`);
}
/** @internal */
exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageDeploymentsRole);
/** @internal */
exports.Message3$inboundSchema = z.object({
    type: z.literal("image"),
    role: exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema,
    url: z.string(),
});
function message3FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message3' from JSON`);
}
/** @internal */
exports.DeploymentInvokeMessageRole$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageRole);
/** @internal */
exports.Message2$inboundSchema = z.object({
    type: z.literal("content"),
    role: exports.DeploymentInvokeMessageRole$inboundSchema,
    content: z.nullable(z.string()),
    reasoning: z.string().optional(),
    reasoning_signature: z.string().optional(),
    redacted_reasoning: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "reasoning_signature": "reasoningSignature",
        "redacted_reasoning": "redactedReasoning",
    });
});
function message2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message2' from JSON`);
}
/** @internal */
exports.MessageRole$inboundSchema = z
    .nativeEnum(exports.MessageRole);
/** @internal */
exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema = z
    .nativeEnum(exports.DeploymentInvokeMessageDeploymentsResponseType);
/** @internal */
exports.MessageFunction$inboundSchema = z.object({
    name: z.string(),
    arguments: z.string(),
});
function messageFunctionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageFunction' from JSON`);
}
/** @internal */
exports.MessageToolCalls$inboundSchema = z.object({
    id: z.string().optional(),
    index: z.number().optional(),
    type: exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema,
    function: z.lazy(() => exports.MessageFunction$inboundSchema),
});
function messageToolCallsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageToolCalls$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageToolCalls' from JSON`);
}
/** @internal */
exports.Message1$inboundSchema = z.object({
    type: z.literal("tool_calls"),
    role: exports.MessageRole$inboundSchema,
    content: z.nullable(z.string()).optional(),
    tool_calls: z.array(z.lazy(() => exports.MessageToolCalls$inboundSchema)),
    reasoning: z.string().optional(),
    reasoning_signature: z.string().optional(),
    redacted_reasoning: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tool_calls": "toolCalls",
        "reasoning_signature": "reasoningSignature",
        "redacted_reasoning": "redactedReasoning",
    });
});
function message1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message1' from JSON`);
}
/** @internal */
exports.Message$inboundSchema = z.union([
    z.lazy(() => exports.Message1$inboundSchema),
    z.lazy(() => exports.Message2$inboundSchema),
    z.lazy(() => exports.Message3$inboundSchema),
]);
function messageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message' from JSON`);
}
/** @internal */
exports.Choices$inboundSchema = z.object({
    index: z.number(),
    message: z.union([
        z.lazy(() => exports.Message1$inboundSchema),
        z.lazy(() => exports.Message2$inboundSchema),
        z.lazy(() => exports.Message3$inboundSchema),
    ]),
    finish_reason: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "finish_reason": "finishReason",
    });
});
function choicesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Choices$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Choices' from JSON`);
}
/** @internal */
exports.DeploymentInvokeResponseBody$inboundSchema = z.object({
    id: z.string(),
    created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    object: exports.DeploymentInvokeObject$inboundSchema,
    model: z.string(),
    provider: exports.Provider$inboundSchema,
    is_final: z.boolean(),
    integration_id: z.string().optional(),
    telemetry: z.lazy(() => exports.Telemetry$inboundSchema),
    finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    system_fingerprint: z.nullable(z.string()).optional(),
    retrievals: z.array(z.lazy(() => exports.Retrievals$inboundSchema)).optional(),
    provider_response: z.any().optional(),
    usage: z.nullable(z.lazy(() => exports.Usage$inboundSchema)).optional(),
    choices: z.array(z.lazy(() => exports.Choices$inboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "is_final": "isFinal",
        "integration_id": "integrationId",
        "system_fingerprint": "systemFingerprint",
        "provider_response": "providerResponse",
    });
});
function deploymentInvokeResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DeploymentInvokeResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentInvokeResponseBody' from JSON`);
}
//# sourceMappingURL=deploymentinvoke.js.map