"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$inboundSchema = exports.DeploymentInvokeChoices$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.DeploymentInvokeUsage$inboundSchema = exports.CompletionTokensDetails$inboundSchema = exports.PromptTokensDetails$inboundSchema = exports.Retrievals$inboundSchema = exports.DeploymentInvokeMetadata$inboundSchema = exports.Provider$inboundSchema = exports.DeploymentInvokeObject$inboundSchema = exports.DeploymentInvokeMessageDeploymentsResponseType = exports.MessageRole = exports.DeploymentInvokeMessageRole = exports.DeploymentInvokeMessageDeploymentsRole = exports.Provider = exports.DeploymentInvokeObject = void 0;
exports.deploymentInvokeMetadataFromJSON = deploymentInvokeMetadataFromJSON;
exports.retrievalsFromJSON = retrievalsFromJSON;
exports.promptTokensDetailsFromJSON = promptTokensDetailsFromJSON;
exports.completionTokensDetailsFromJSON = completionTokensDetailsFromJSON;
exports.deploymentInvokeUsageFromJSON = deploymentInvokeUsageFromJSON;
exports.message3FromJSON = message3FromJSON;
exports.message2FromJSON = message2FromJSON;
exports.messageFunctionFromJSON = messageFunctionFromJSON;
exports.messageToolCallsFromJSON = messageToolCallsFromJSON;
exports.message1FromJSON = message1FromJSON;
exports.messageFromJSON = messageFromJSON;
exports.deploymentInvokeChoicesFromJSON = deploymentInvokeChoicesFromJSON;
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.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",
    Alibaba: "alibaba",
    Slack: "slack",
};
/**
 * 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",
};
/**
 * 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",
};
/**
 * 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.DeploymentInvokeMessageDeploymentsResponseType = {
    Function: "function",
};
/** @internal */
exports.DeploymentInvokeObject$inboundSchema = z.nativeEnum(exports.DeploymentInvokeObject);
/** @internal */
exports.Provider$inboundSchema = z
    .nativeEnum(exports.Provider);
/** @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.DeploymentInvokeUsage$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 deploymentInvokeUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DeploymentInvokeUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentInvokeUsage' 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.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",
    });
});
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.Provider$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(),
    usage: z.nullable(z.lazy(() => exports.DeploymentInvokeUsage$inboundSchema))
        .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",
    });
});
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