"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.DeploymentInvokeResponseBody$outboundSchema = exports.DeploymentInvokeResponseBody$inboundSchema = exports.DeploymentInvokeChoices$outboundSchema = exports.DeploymentInvokeChoices$inboundSchema = exports.Message$outboundSchema = exports.Message$inboundSchema = exports.Message1$outboundSchema = exports.Message1$inboundSchema = exports.MessageToolCalls$outboundSchema = exports.MessageToolCalls$inboundSchema = exports.MessageFunction$outboundSchema = exports.MessageFunction$inboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType$outboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema = exports.DeploymentInvokeMessageDeploymentsRole$outboundSchema = exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema = exports.MessageType$outboundSchema = exports.MessageType$inboundSchema = exports.Message2$outboundSchema = exports.Message2$inboundSchema = exports.MessageRole$outboundSchema = exports.MessageRole$inboundSchema = exports.DeploymentInvokeMessageType$outboundSchema = exports.DeploymentInvokeMessageType$inboundSchema = exports.Message3$outboundSchema = exports.Message3$inboundSchema = exports.DeploymentInvokeMessageRole$outboundSchema = exports.DeploymentInvokeMessageRole$inboundSchema = exports.DeploymentInvokeMessageDeploymentsType$outboundSchema = exports.DeploymentInvokeMessageDeploymentsType$inboundSchema = exports.Retrievals$outboundSchema = exports.Retrievals$inboundSchema = exports.DeploymentInvokeMetadata$outboundSchema = exports.DeploymentInvokeMetadata$inboundSchema = exports.DeploymentInvokeProvider$outboundSchema = exports.DeploymentInvokeProvider$inboundSchema = exports.DeploymentInvokeObject$outboundSchema = exports.DeploymentInvokeObject$inboundSchema = exports.DeploymentInvokeGlobals$outboundSchema = exports.DeploymentInvokeGlobals$inboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType = exports.DeploymentInvokeMessageDeploymentsRole = exports.MessageType = exports.MessageRole = exports.DeploymentInvokeMessageType = exports.DeploymentInvokeMessageRole = exports.DeploymentInvokeMessageDeploymentsType = exports.DeploymentInvokeProvider = exports.DeploymentInvokeObject = void 0;
exports.deploymentInvokeGlobalsToJSON = deploymentInvokeGlobalsToJSON;
exports.deploymentInvokeGlobalsFromJSON = deploymentInvokeGlobalsFromJSON;
exports.deploymentInvokeMetadataToJSON = deploymentInvokeMetadataToJSON;
exports.deploymentInvokeMetadataFromJSON = deploymentInvokeMetadataFromJSON;
exports.retrievalsToJSON = retrievalsToJSON;
exports.retrievalsFromJSON = retrievalsFromJSON;
exports.message3ToJSON = message3ToJSON;
exports.message3FromJSON = message3FromJSON;
exports.message2ToJSON = message2ToJSON;
exports.message2FromJSON = message2FromJSON;
exports.messageFunctionToJSON = messageFunctionToJSON;
exports.messageFunctionFromJSON = messageFunctionFromJSON;
exports.messageToolCallsToJSON = messageToolCallsToJSON;
exports.messageToolCallsFromJSON = messageToolCallsFromJSON;
exports.message1ToJSON = message1ToJSON;
exports.message1FromJSON = message1FromJSON;
exports.messageToJSON = messageToJSON;
exports.messageFromJSON = messageFromJSON;
exports.deploymentInvokeChoicesToJSON = deploymentInvokeChoicesToJSON;
exports.deploymentInvokeChoicesFromJSON = deploymentInvokeChoicesFromJSON;
exports.deploymentInvokeResponseBodyToJSON = deploymentInvokeResponseBodyToJSON;
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");
/**
 * 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.DeploymentInvokeProvider = {
    Cohere: "cohere",
    Openai: "openai",
    Anthropic: "anthropic",
    Huggingface: "huggingface",
    Replicate: "replicate",
    Google: "google",
    GoogleAi: "google-ai",
    Azure: "azure",
    Aws: "aws",
    Anyscale: "anyscale",
    Perplexity: "perplexity",
    Groq: "groq",
    Fal: "fal",
    Leonardoai: "leonardoai",
    Nvidia: "nvidia",
    Jina: "jina",
    Togetherai: "togetherai",
    Elevenlabs: "elevenlabs",
    Litellm: "litellm",
    Openailike: "openailike",
    Cerebras: "cerebras",
    Bytedance: "bytedance",
    Mistral: "mistral",
};
exports.DeploymentInvokeMessageDeploymentsType = {
    Image: "image",
};
/**
 * The role of the prompt message
 */
exports.DeploymentInvokeMessageRole = {
    System: "system",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
exports.DeploymentInvokeMessageType = {
    Content: "content",
};
/**
 * The role of the prompt message
 */
exports.MessageRole = {
    System: "system",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
exports.MessageType = {
    ToolCalls: "tool_calls",
};
/**
 * The role of the prompt message
 */
exports.DeploymentInvokeMessageDeploymentsRole = {
    System: "system",
    Assistant: "assistant",
    User: "user",
    Exception: "exception",
    Tool: "tool",
    Prompt: "prompt",
    Correction: "correction",
    ExpectedOutput: "expected_output",
};
exports.DeploymentInvokeMessageDeploymentsResponseType = {
    Function: "function",
};
/** @internal */
exports.DeploymentInvokeGlobals$inboundSchema = z.object({
    environment: z.string().optional(),
    contactId: z.string().optional(),
});
/** @internal */
exports.DeploymentInvokeGlobals$outboundSchema = z.object({
    environment: z.string().optional(),
    contactId: z.string().optional(),
});
function deploymentInvokeGlobalsToJSON(deploymentInvokeGlobals) {
    return JSON.stringify(exports.DeploymentInvokeGlobals$outboundSchema.parse(deploymentInvokeGlobals));
}
function deploymentInvokeGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DeploymentInvokeGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentInvokeGlobals' from JSON`);
}
/** @internal */
exports.DeploymentInvokeObject$inboundSchema = z.nativeEnum(exports.DeploymentInvokeObject);
/** @internal */
exports.DeploymentInvokeObject$outboundSchema = exports.DeploymentInvokeObject$inboundSchema;
/** @internal */
exports.DeploymentInvokeProvider$inboundSchema = z.nativeEnum(exports.DeploymentInvokeProvider);
/** @internal */
exports.DeploymentInvokeProvider$outboundSchema = exports.DeploymentInvokeProvider$inboundSchema;
/** @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",
    });
});
/** @internal */
exports.DeploymentInvokeMetadata$outboundSchema = z.object({
    fileName: z.string(),
    pageNumber: z.nullable(z.number()),
    fileType: z.string(),
    rerankScore: z.number().optional(),
    searchScore: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        fileName: "file_name",
        pageNumber: "page_number",
        fileType: "file_type",
        rerankScore: "rerank_score",
        searchScore: "search_score",
    });
});
function deploymentInvokeMetadataToJSON(deploymentInvokeMetadata) {
    return JSON.stringify(exports.DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata));
}
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),
});
/** @internal */
exports.Retrievals$outboundSchema = z.object({
    document: z.string(),
    metadata: z.lazy(() => exports.DeploymentInvokeMetadata$outboundSchema),
});
function retrievalsToJSON(retrievals) {
    return JSON.stringify(exports.Retrievals$outboundSchema.parse(retrievals));
}
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.DeploymentInvokeMessageDeploymentsType$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageDeploymentsType);
/** @internal */
exports.DeploymentInvokeMessageDeploymentsType$outboundSchema = exports.DeploymentInvokeMessageDeploymentsType$inboundSchema;
/** @internal */
exports.DeploymentInvokeMessageRole$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageRole);
/** @internal */
exports.DeploymentInvokeMessageRole$outboundSchema = exports.DeploymentInvokeMessageRole$inboundSchema;
/** @internal */
exports.Message3$inboundSchema = z.object({
    type: exports.DeploymentInvokeMessageDeploymentsType$inboundSchema,
    role: exports.DeploymentInvokeMessageRole$inboundSchema,
    url: z.string(),
});
/** @internal */
exports.Message3$outboundSchema = z.object({
    type: exports.DeploymentInvokeMessageDeploymentsType$outboundSchema,
    role: exports.DeploymentInvokeMessageRole$outboundSchema,
    url: z.string(),
});
function message3ToJSON(message3) {
    return JSON.stringify(exports.Message3$outboundSchema.parse(message3));
}
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.DeploymentInvokeMessageType$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageType);
/** @internal */
exports.DeploymentInvokeMessageType$outboundSchema = exports.DeploymentInvokeMessageType$inboundSchema;
/** @internal */
exports.MessageRole$inboundSchema = z
    .nativeEnum(exports.MessageRole);
/** @internal */
exports.MessageRole$outboundSchema = exports.MessageRole$inboundSchema;
/** @internal */
exports.Message2$inboundSchema = z.object({
    type: exports.DeploymentInvokeMessageType$inboundSchema,
    role: exports.MessageRole$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",
    });
});
/** @internal */
exports.Message2$outboundSchema = z.object({
    type: exports.DeploymentInvokeMessageType$outboundSchema,
    role: exports.MessageRole$outboundSchema,
    content: z.nullable(z.string()),
    reasoning: z.string().optional(),
    reasoningSignature: z.string().optional(),
    redactedReasoning: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        reasoningSignature: "reasoning_signature",
        redactedReasoning: "redacted_reasoning",
    });
});
function message2ToJSON(message2) {
    return JSON.stringify(exports.Message2$outboundSchema.parse(message2));
}
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.MessageType$inboundSchema = z
    .nativeEnum(exports.MessageType);
/** @internal */
exports.MessageType$outboundSchema = exports.MessageType$inboundSchema;
/** @internal */
exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema = z.nativeEnum(exports.DeploymentInvokeMessageDeploymentsRole);
/** @internal */
exports.DeploymentInvokeMessageDeploymentsRole$outboundSchema = exports.DeploymentInvokeMessageDeploymentsRole$inboundSchema;
/** @internal */
exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema = z
    .nativeEnum(exports.DeploymentInvokeMessageDeploymentsResponseType);
/** @internal */
exports.DeploymentInvokeMessageDeploymentsResponseType$outboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
/** @internal */
exports.MessageFunction$inboundSchema = z.object({
    name: z.string(),
    arguments: z.string(),
});
/** @internal */
exports.MessageFunction$outboundSchema = z.object({
    name: z.string(),
    arguments: z.string(),
});
function messageFunctionToJSON(messageFunction) {
    return JSON.stringify(exports.MessageFunction$outboundSchema.parse(messageFunction));
}
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),
});
/** @internal */
exports.MessageToolCalls$outboundSchema = z.object({
    id: z.string().optional(),
    index: z.number().optional(),
    type: exports.DeploymentInvokeMessageDeploymentsResponseType$outboundSchema,
    function: z.lazy(() => exports.MessageFunction$outboundSchema),
});
function messageToolCallsToJSON(messageToolCalls) {
    return JSON.stringify(exports.MessageToolCalls$outboundSchema.parse(messageToolCalls));
}
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: exports.MessageType$inboundSchema,
    role: exports.DeploymentInvokeMessageDeploymentsRole$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",
    });
});
/** @internal */
exports.Message1$outboundSchema = z.object({
    type: exports.MessageType$outboundSchema,
    role: exports.DeploymentInvokeMessageDeploymentsRole$outboundSchema,
    content: z.nullable(z.string()).optional(),
    toolCalls: z.array(z.lazy(() => exports.MessageToolCalls$outboundSchema)),
    reasoning: z.string().optional(),
    reasoningSignature: z.string().optional(),
    redactedReasoning: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolCalls: "tool_calls",
        reasoningSignature: "reasoning_signature",
        redactedReasoning: "redacted_reasoning",
    });
});
function message1ToJSON(message1) {
    return JSON.stringify(exports.Message1$outboundSchema.parse(message1));
}
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),
]);
/** @internal */
exports.Message$outboundSchema = z.union([
    z.lazy(() => exports.Message1$outboundSchema),
    z.lazy(() => exports.Message2$outboundSchema),
    z.lazy(() => exports.Message3$outboundSchema),
]);
function messageToJSON(message) {
    return JSON.stringify(exports.Message$outboundSchema.parse(message));
}
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.DeploymentInvokeChoices$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",
    });
});
/** @internal */
exports.DeploymentInvokeChoices$outboundSchema = z.object({
    index: z.number(),
    message: z.union([
        z.lazy(() => exports.Message1$outboundSchema),
        z.lazy(() => exports.Message2$outboundSchema),
        z.lazy(() => exports.Message3$outboundSchema),
    ]),
    finishReason: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        finishReason: "finish_reason",
    });
});
function deploymentInvokeChoicesToJSON(deploymentInvokeChoices) {
    return JSON.stringify(exports.DeploymentInvokeChoices$outboundSchema.parse(deploymentInvokeChoices));
}
function deploymentInvokeChoicesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DeploymentInvokeChoices$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentInvokeChoices' 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.DeploymentInvokeProvider$inboundSchema,
    is_final: z.boolean(),
    integration_id: z.string().optional(),
    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(),
    choices: z.array(z.lazy(() => exports.DeploymentInvokeChoices$inboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "is_final": "isFinal",
        "integration_id": "integrationId",
        "system_fingerprint": "systemFingerprint",
        "provider_response": "providerResponse",
    });
});
/** @internal */
exports.DeploymentInvokeResponseBody$outboundSchema = z.object({
    id: z.string(),
    created: z.date().transform(v => v.toISOString()),
    object: exports.DeploymentInvokeObject$outboundSchema,
    model: z.string(),
    provider: exports.DeploymentInvokeProvider$outboundSchema,
    isFinal: z.boolean(),
    integrationId: z.string().optional(),
    finalized: z.date().transform(v => v.toISOString()).optional(),
    systemFingerprint: z.nullable(z.string()).optional(),
    retrievals: z.array(z.lazy(() => exports.Retrievals$outboundSchema)).optional(),
    providerResponse: z.any().optional(),
    choices: z.array(z.lazy(() => exports.DeploymentInvokeChoices$outboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        isFinal: "is_final",
        integrationId: "integration_id",
        systemFingerprint: "system_fingerprint",
        providerResponse: "provider_response",
    });
});
function deploymentInvokeResponseBodyToJSON(deploymentInvokeResponseBody) {
    return JSON.stringify(exports.DeploymentInvokeResponseBody$outboundSchema.parse(deploymentInvokeResponseBody));
}
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