// Compare LLMValidator vs direct IAEngine instances
import { default as IAEngine } from './src/DRS/services/IAEngine.js';
import { default as LLMValidator } from './src/DRS/services/LLMValidator.js';

async function compareInstances() {
    console.log('🔧 Comparing LLMValidator vs direct IAEngine...');

    // Test 1: Direct IAEngine (works)
    console.log('\n1️⃣ Testing direct IAEngine...');
    const directEngine = new IAEngine();
    await new Promise(resolve => setTimeout(resolve, 1000));

    console.log('Direct IAEngine keys:', Object.keys(directEngine.apiKeys || {}));
    console.log('Direct DeepSeek key exists:', !!directEngine.apiKeys?.DEEPSEEK_API_KEY);

    // Test 2: LLMValidator's IAEngine
    console.log('\n2️⃣ Testing LLMValidator IAEngine...');
    const validator = new LLMValidator();
    await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for initialization

    console.log('LLMValidator engine keys:', Object.keys(validator.iaEngine.apiKeys || {}));
    console.log('LLMValidator DeepSeek key exists:', !!validator.iaEngine.apiKeys?.DEEPSEEK_API_KEY);
    console.log('LLMValidator mock mode?:', validator.iaEngine.apiKeys?.mock);

    // Test actual calls
    try {
        console.log('\n3️⃣ Testing direct call via LLMValidator IAEngine...');
        const result = await validator.iaEngine.validateEducationalContent('Test', {
            preferredProvider: 'deepseek'
        });
        console.log('✅ LLMValidator IAEngine direct call works:', result.provider);
    } catch (error) {
        console.log('❌ LLMValidator IAEngine direct call failed:', error.message);
    }
}

compareInstances().catch(console.error);