UNPKG

competitor-intel-toolkit

Version:

Automated competitive intelligence: live web scraping + AI analysis. Know what your competitors are doing.

46 lines (36 loc) 1.14 kB
/** * Test Gemini integration */ const AIAnalyzer = require('./src/ai-analyzer'); async function test() { console.log('Testing Gemini AI integration...\n'); // Test with Gemini const geminiKey = process.env.GEMINI_API_KEY; if (!geminiKey) { console.error('❌ GEMINI_API_KEY not set'); process.exit(1); } const analyzer = new AIAnalyzer('gemini', geminiKey); if (!analyzer.isEnabled()) { console.error('❌ Analyzer not enabled'); process.exit(1); } console.log('✓ Gemini analyzer initialized'); console.log(` Provider: ${analyzer.provider}`); console.log(` Model: ${analyzer.model}\n`); // Test simple generation console.log('Testing simple content generation...'); const result = await analyzer.generateContent('Say "Hello from Gemini!" in a creative way.'); if (result) { console.log('✓ Generation successful:'); console.log(result); console.log('\n✅ Gemini integration working!'); } else { console.error('❌ Generation failed'); process.exit(1); } } test().catch(error => { console.error('❌ Test failed:', error.message); process.exit(1); });