/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import {} from '@google/genai';
import {} from './contentGenerator.js';
import { normalizeModelId } from '../utils/modelUtils.js';
export class ModelMappingContentGenerator {
    wrapped;
    mappings;
    constructor(wrapped, mappings) {
        this.wrapped = wrapped;
        this.mappings = mappings;
    }
    getWrapped() {
        return this.wrapped;
    }
    get userTier() {
        return this.wrapped.userTier;
    }
    get userTierName() {
        return this.wrapped.userTierName;
    }
    get paidTier() {
        return this.wrapped.paidTier;
    }
    mapModel(req) {
        if (req.model) {
            const normalizedModel = normalizeModelId(req.model);
            if (this.mappings[normalizedModel]) {
                return {
                    ...req,
                    model: req.model.startsWith('models/')
                        ? `models/${this.mappings[normalizedModel]}`
                        : this.mappings[normalizedModel],
                };
            }
        }
        return req;
    }
    generateContent(request, userPromptId, role) {
        return this.wrapped.generateContent(this.mapModel(request), userPromptId, role);
    }
    generateContentStream(request, userPromptId, role) {
        return this.wrapped.generateContentStream(this.mapModel(request), userPromptId, role);
    }
    countTokens(request) {
        return this.wrapped.countTokens(this.mapModel(request));
    }
    embedContent(request) {
        return this.wrapped.embedContent(this.mapModel(request));
    }
}
//# sourceMappingURL=modelMappingContentGenerator.js.map