/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * ContentGenerator implementation that delegates to external providers
 */
export class ProviderContentGenerator {
    providerManager;
    _config;
    constructor(providerManager, _config) {
        this.providerManager = providerManager;
        this._config = _config;
        // Config parameter is reserved for future use
        void this._config;
    }
    getWrapper() {
        const provider = this.providerManager.getActiveProvider();
        if (!provider) {
            throw new Error('No active provider');
        }
        throw new Error('GeminiCompatibleWrapper has been removed - direct IContent interface is now used');
    }
    async generateContent(_request) {
        // The getWrapper method always throws, so we'll never reach this return
        this.getWrapper();
        throw new Error('This should never be reached');
    }
    async generateContentStream(_request) {
        // The getWrapper method always throws, so we'll never reach this return
        this.getWrapper();
        throw new Error('This should never be reached');
    }
    async countTokens(request) {
        // Rough estimation for providers that don't support token counting
        let text = '';
        if (typeof request.contents === 'string') {
            text = request.contents;
        }
        else if (Array.isArray(request.contents)) {
            text = request.contents
                .flatMap((c) => c.parts || [])
                .map((p) => p.text || '')
                .join(' ');
        }
        // Very rough approximation: ~4 characters per token
        const estimatedTokens = Math.ceil(text.length / 4);
        return {
            totalTokens: estimatedTokens,
        };
    }
    async embedContent(_request) {
        throw new Error('Embeddings not supported for providers');
    }
}
//# sourceMappingURL=ProviderContentGenerator.js.map