"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.liveApi = exports.transactions = exports.audios = exports.videos = exports.images = exports.embeddings = exports.completions = void 0;
exports.completion = completion;
function makeEntries(type, ids, provider, pricing, deprecation) {
    return ids.map((id) => {
        const p = pricing[id] ?? {};
        const deprecated = deprecation?.deprecated ?? p.deprecated;
        const deprecationDate = deprecation?.deprecationDate ?? p.deprecationDate;
        const limitedAvailability = deprecation?.limitedAvailability ?? p.limitedAvailability;
        const replacedBy = deprecation?.replacedBy ?? p.replacedBy;
        const { deprecated: _d, deprecationDate: _dd, limitedAvailability: _la, replacedBy: _rb, reasoningLevels: _rl, useResponsesApi: _ura, ...pricingOnly } = p;
        return {
            id,
            provider,
            type,
            pricing: { input: 0, output: 0, ...pricingOnly },
            deprecated,
            deprecationDate,
            limitedAvailability,
            replacedBy,
        };
    });
}
const completions = (ids, provider, pricing, dep) => makeEntries("completion", ids, provider, pricing, dep);
exports.completions = completions;
const embeddings = (ids, provider, pricing, dep) => makeEntries("embedding", ids, provider, pricing, dep);
exports.embeddings = embeddings;
const images = (ids, provider, pricing, dep) => makeEntries("image", ids, provider, pricing, dep);
exports.images = images;
const videos = (ids, provider, pricing, dep) => makeEntries("video", ids, provider, pricing, dep);
exports.videos = videos;
const audios = (ids, provider, pricing, dep) => makeEntries("audio", ids, provider, pricing, dep);
exports.audios = audios;
const transactions = (ids, provider, pricing, dep) => makeEntries("transaction", ids, provider, pricing, dep);
exports.transactions = transactions;
const liveApi = (ids, provider, pricing, dep) => makeEntries("live", ids, provider, pricing, dep);
exports.liveApi = liveApi;
function completion(id, provider, pricing = {}, deprecation) {
    return {
        id, provider, type: "completion",
        pricing: { input: 0, output: 0, ...pricing },
        deprecated: deprecation?.deprecated,
        deprecationDate: deprecation?.deprecationDate,
        limitedAvailability: deprecation?.limitedAvailability,
        replacedBy: deprecation?.replacedBy,
    };
}
//# sourceMappingURL=types.js.map