"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.CreateEmbeddingResponseBody$inboundSchema = exports.CreateEmbeddingUsage$inboundSchema = exports.CreateEmbeddingData$inboundSchema = exports.Embedding$inboundSchema = exports.CreateEmbeddingRouterEmbeddingsObject$inboundSchema = exports.CreateEmbeddingObject$inboundSchema = exports.CreateEmbeddingRequestBody$outboundSchema = exports.CreateEmbeddingOrq$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsTimeout$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsLoadBalancer$outboundSchema = exports.CreateEmbeddingLoadBalancerRouterEmbeddings1$outboundSchema = exports.CreateEmbeddingLoadBalancerRouterEmbeddingsModels$outboundSchema = exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsRetry$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsCache$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsType$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsFallbacks$outboundSchema = exports.CreateEmbeddingTimeout$outboundSchema = exports.CreateEmbeddingLoadBalancer$outboundSchema = exports.CreateEmbeddingLoadBalancer1$outboundSchema = exports.CreateEmbeddingLoadBalancerModels$outboundSchema = exports.CreateEmbeddingLoadBalancerType$outboundSchema = exports.CreateEmbeddingCache$outboundSchema = exports.CreateEmbeddingType$outboundSchema = exports.CreateEmbeddingRetry$outboundSchema = exports.CreateEmbeddingFallbacks$outboundSchema = exports.EncodingFormat$outboundSchema = exports.CreateEmbeddingInput$outboundSchema = exports.CreateEmbeddingRouterEmbeddingsObject = exports.CreateEmbeddingObject = exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType = exports.CreateEmbeddingRouterEmbeddingsType = exports.CreateEmbeddingLoadBalancerType = exports.CreateEmbeddingType = exports.EncodingFormat = void 0;
exports.createEmbeddingInputToJSON = createEmbeddingInputToJSON;
exports.createEmbeddingFallbacksToJSON = createEmbeddingFallbacksToJSON;
exports.createEmbeddingRetryToJSON = createEmbeddingRetryToJSON;
exports.createEmbeddingCacheToJSON = createEmbeddingCacheToJSON;
exports.createEmbeddingLoadBalancerModelsToJSON = createEmbeddingLoadBalancerModelsToJSON;
exports.createEmbeddingLoadBalancer1ToJSON = createEmbeddingLoadBalancer1ToJSON;
exports.createEmbeddingLoadBalancerToJSON = createEmbeddingLoadBalancerToJSON;
exports.createEmbeddingTimeoutToJSON = createEmbeddingTimeoutToJSON;
exports.createEmbeddingRouterEmbeddingsFallbacksToJSON = createEmbeddingRouterEmbeddingsFallbacksToJSON;
exports.createEmbeddingRouterEmbeddingsCacheToJSON = createEmbeddingRouterEmbeddingsCacheToJSON;
exports.createEmbeddingRouterEmbeddingsRetryToJSON = createEmbeddingRouterEmbeddingsRetryToJSON;
exports.createEmbeddingLoadBalancerRouterEmbeddingsModelsToJSON = createEmbeddingLoadBalancerRouterEmbeddingsModelsToJSON;
exports.createEmbeddingLoadBalancerRouterEmbeddings1ToJSON = createEmbeddingLoadBalancerRouterEmbeddings1ToJSON;
exports.createEmbeddingRouterEmbeddingsLoadBalancerToJSON = createEmbeddingRouterEmbeddingsLoadBalancerToJSON;
exports.createEmbeddingRouterEmbeddingsTimeoutToJSON = createEmbeddingRouterEmbeddingsTimeoutToJSON;
exports.createEmbeddingOrqToJSON = createEmbeddingOrqToJSON;
exports.createEmbeddingRequestBodyToJSON = createEmbeddingRequestBodyToJSON;
exports.embeddingFromJSON = embeddingFromJSON;
exports.createEmbeddingDataFromJSON = createEmbeddingDataFromJSON;
exports.createEmbeddingUsageFromJSON = createEmbeddingUsageFromJSON;
exports.createEmbeddingResponseBodyFromJSON = createEmbeddingResponseBodyFromJSON;
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"));
/**
 * Type of the document element
 */
exports.EncodingFormat = {
    Base64: "base64",
    Float: "float",
};
exports.CreateEmbeddingType = {
    ExactMatch: "exact_match",
};
exports.CreateEmbeddingLoadBalancerType = {
    WeightBased: "weight_based",
};
exports.CreateEmbeddingRouterEmbeddingsType = {
    ExactMatch: "exact_match",
};
exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType = {
    WeightBased: "weight_based",
};
exports.CreateEmbeddingObject = {
    List: "list",
};
/**
 * The object type, which is always `embedding`.
 */
exports.CreateEmbeddingRouterEmbeddingsObject = {
    Embedding: "embedding",
};
/** @internal */
exports.CreateEmbeddingInput$outboundSchema = z.union([z.string(), z.array(z.string())]);
function createEmbeddingInputToJSON(createEmbeddingInput) {
    return JSON.stringify(exports.CreateEmbeddingInput$outboundSchema.parse(createEmbeddingInput));
}
/** @internal */
exports.EncodingFormat$outboundSchema = z.nativeEnum(exports.EncodingFormat);
/** @internal */
exports.CreateEmbeddingFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createEmbeddingFallbacksToJSON(createEmbeddingFallbacks) {
    return JSON.stringify(exports.CreateEmbeddingFallbacks$outboundSchema.parse(createEmbeddingFallbacks));
}
/** @internal */
exports.CreateEmbeddingRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function createEmbeddingRetryToJSON(createEmbeddingRetry) {
    return JSON.stringify(exports.CreateEmbeddingRetry$outboundSchema.parse(createEmbeddingRetry));
}
/** @internal */
exports.CreateEmbeddingType$outboundSchema = z.nativeEnum(exports.CreateEmbeddingType);
/** @internal */
exports.CreateEmbeddingCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateEmbeddingType$outboundSchema,
});
function createEmbeddingCacheToJSON(createEmbeddingCache) {
    return JSON.stringify(exports.CreateEmbeddingCache$outboundSchema.parse(createEmbeddingCache));
}
/** @internal */
exports.CreateEmbeddingLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateEmbeddingLoadBalancerType);
/** @internal */
exports.CreateEmbeddingLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createEmbeddingLoadBalancerModelsToJSON(createEmbeddingLoadBalancerModels) {
    return JSON.stringify(exports.CreateEmbeddingLoadBalancerModels$outboundSchema.parse(createEmbeddingLoadBalancerModels));
}
/** @internal */
exports.CreateEmbeddingLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateEmbeddingLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateEmbeddingLoadBalancerModels$outboundSchema)),
});
function createEmbeddingLoadBalancer1ToJSON(createEmbeddingLoadBalancer1) {
    return JSON.stringify(exports.CreateEmbeddingLoadBalancer1$outboundSchema.parse(createEmbeddingLoadBalancer1));
}
/** @internal */
exports.CreateEmbeddingLoadBalancer$outboundSchema = z.lazy(() => exports.CreateEmbeddingLoadBalancer1$outboundSchema);
function createEmbeddingLoadBalancerToJSON(createEmbeddingLoadBalancer) {
    return JSON.stringify(exports.CreateEmbeddingLoadBalancer$outboundSchema.parse(createEmbeddingLoadBalancer));
}
/** @internal */
exports.CreateEmbeddingTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createEmbeddingTimeoutToJSON(createEmbeddingTimeout) {
    return JSON.stringify(exports.CreateEmbeddingTimeout$outboundSchema.parse(createEmbeddingTimeout));
}
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createEmbeddingRouterEmbeddingsFallbacksToJSON(createEmbeddingRouterEmbeddingsFallbacks) {
    return JSON.stringify(exports.CreateEmbeddingRouterEmbeddingsFallbacks$outboundSchema.parse(createEmbeddingRouterEmbeddingsFallbacks));
}
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsType$outboundSchema = z.nativeEnum(exports.CreateEmbeddingRouterEmbeddingsType);
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.CreateEmbeddingRouterEmbeddingsType$outboundSchema,
});
function createEmbeddingRouterEmbeddingsCacheToJSON(createEmbeddingRouterEmbeddingsCache) {
    return JSON.stringify(exports.CreateEmbeddingRouterEmbeddingsCache$outboundSchema.parse(createEmbeddingRouterEmbeddingsCache));
}
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function createEmbeddingRouterEmbeddingsRetryToJSON(createEmbeddingRouterEmbeddingsRetry) {
    return JSON.stringify(exports.CreateEmbeddingRouterEmbeddingsRetry$outboundSchema.parse(createEmbeddingRouterEmbeddingsRetry));
}
/** @internal */
exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType$outboundSchema = z
    .nativeEnum(exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType);
/** @internal */
exports.CreateEmbeddingLoadBalancerRouterEmbeddingsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createEmbeddingLoadBalancerRouterEmbeddingsModelsToJSON(createEmbeddingLoadBalancerRouterEmbeddingsModels) {
    return JSON.stringify(exports.CreateEmbeddingLoadBalancerRouterEmbeddingsModels$outboundSchema.parse(createEmbeddingLoadBalancerRouterEmbeddingsModels));
}
/** @internal */
exports.CreateEmbeddingLoadBalancerRouterEmbeddings1$outboundSchema = z.object({
    type: exports.CreateEmbeddingLoadBalancerRouterEmbeddingsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateEmbeddingLoadBalancerRouterEmbeddingsModels$outboundSchema)),
});
function createEmbeddingLoadBalancerRouterEmbeddings1ToJSON(createEmbeddingLoadBalancerRouterEmbeddings1) {
    return JSON.stringify(exports.CreateEmbeddingLoadBalancerRouterEmbeddings1$outboundSchema.parse(createEmbeddingLoadBalancerRouterEmbeddings1));
}
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateEmbeddingLoadBalancerRouterEmbeddings1$outboundSchema);
function createEmbeddingRouterEmbeddingsLoadBalancerToJSON(createEmbeddingRouterEmbeddingsLoadBalancer) {
    return JSON.stringify(exports.CreateEmbeddingRouterEmbeddingsLoadBalancer$outboundSchema.parse(createEmbeddingRouterEmbeddingsLoadBalancer));
}
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createEmbeddingRouterEmbeddingsTimeoutToJSON(createEmbeddingRouterEmbeddingsTimeout) {
    return JSON.stringify(exports.CreateEmbeddingRouterEmbeddingsTimeout$outboundSchema.parse(createEmbeddingRouterEmbeddingsTimeout));
}
/** @internal */
exports.CreateEmbeddingOrq$outboundSchema = z.object({
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateEmbeddingRouterEmbeddingsFallbacks$outboundSchema)).optional(),
    cache: z.lazy(() => exports.CreateEmbeddingRouterEmbeddingsCache$outboundSchema)
        .optional(),
    retry: z.lazy(() => exports.CreateEmbeddingRouterEmbeddingsRetry$outboundSchema)
        .optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    loadBalancer: z.lazy(() => exports.CreateEmbeddingLoadBalancerRouterEmbeddings1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateEmbeddingRouterEmbeddingsTimeout$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createEmbeddingOrqToJSON(createEmbeddingOrq) {
    return JSON.stringify(exports.CreateEmbeddingOrq$outboundSchema.parse(createEmbeddingOrq));
}
/** @internal */
exports.CreateEmbeddingRequestBody$outboundSchema = z.object({
    input: z.union([z.string(), z.array(z.string())]),
    model: z.string(),
    encodingFormat: exports.EncodingFormat$outboundSchema.default("float"),
    dimensions: z.number().optional(),
    user: z.string().optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateEmbeddingFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateEmbeddingRetry$outboundSchema).optional(),
    cache: z.lazy(() => exports.CreateEmbeddingCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateEmbeddingLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateEmbeddingTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateEmbeddingOrq$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        encodingFormat: "encoding_format",
        loadBalancer: "load_balancer",
    });
});
function createEmbeddingRequestBodyToJSON(createEmbeddingRequestBody) {
    return JSON.stringify(exports.CreateEmbeddingRequestBody$outboundSchema.parse(createEmbeddingRequestBody));
}
/** @internal */
exports.CreateEmbeddingObject$inboundSchema = z.nativeEnum(exports.CreateEmbeddingObject);
/** @internal */
exports.CreateEmbeddingRouterEmbeddingsObject$inboundSchema = z.nativeEnum(exports.CreateEmbeddingRouterEmbeddingsObject);
/** @internal */
exports.Embedding$inboundSchema = z.union([z.array(z.number()), z.string()]);
function embeddingFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Embedding$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Embedding' from JSON`);
}
/** @internal */
exports.CreateEmbeddingData$inboundSchema = z.object({
    object: exports.CreateEmbeddingRouterEmbeddingsObject$inboundSchema,
    embedding: z.union([z.array(z.number()), z.string()]),
    index: z.number(),
});
function createEmbeddingDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateEmbeddingData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingData' from JSON`);
}
/** @internal */
exports.CreateEmbeddingUsage$inboundSchema = z.object({
    prompt_tokens: z.number(),
    total_tokens: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "prompt_tokens": "promptTokens",
        "total_tokens": "totalTokens",
    });
});
function createEmbeddingUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateEmbeddingUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingUsage' from JSON`);
}
/** @internal */
exports.CreateEmbeddingResponseBody$inboundSchema = z.object({
    object: exports.CreateEmbeddingObject$inboundSchema,
    data: z.array(z.lazy(() => exports.CreateEmbeddingData$inboundSchema)),
    model: z.string(),
    usage: z.lazy(() => exports.CreateEmbeddingUsage$inboundSchema),
});
function createEmbeddingResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateEmbeddingResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingResponseBody' from JSON`);
}
//# sourceMappingURL=createembedding.js.map