-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-integration.js
More file actions
67 lines (54 loc) · 2.97 KB
/
test-integration.js
File metadata and controls
67 lines (54 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env node
/**
* Integration Test Script
*
* Quick test to verify AI integration is working
*/
import { config } from './src/config/environment.js';
console.log('\n╔═══════════════════════════════════════════════════════════╗');
console.log('║ AI Integration Test ║');
console.log('╚═══════════════════════════════════════════════════════════╝\n');
// Check environment
console.log('📋 Environment Check:\n');
console.log(`✓ Node.js: ${process.version}`);
console.log(`✓ Environment: ${config.server.nodeEnv}`);
console.log(`✓ Port: ${config.server.port}`);
// Check AI configuration
console.log('\n🤖 AI Configuration:\n');
if (config.ai.groqApiKey && config.ai.groqApiKey !== '') {
console.log('✅ GROQ_API_KEY: Configured');
console.log(`✓ Primary Model: ${config.ai.primaryModel}`);
console.log(`✓ Fast Model: ${config.ai.fastModel}`);
} else {
console.log('❌ GROQ_API_KEY: Not configured');
console.log('\n⚠️ AI features will be disabled!');
console.log('\nTo enable AI features:');
console.log('1. Get API key from https://console.groq.com/keys');
console.log('2. Add to .env: GROQ_API_KEY=gsk_your_key_here');
console.log('3. Restart the server\n');
}
// Check Redis
console.log('\n💾 Redis Configuration:\n');
console.log(`✓ Host: ${config.redis.url}`);
// Check RabbitMQ
console.log('\n📨 RabbitMQ Configuration:\n');
console.log(`✓ URL: ${config.rabbitmq.url}`);
console.log(' (Optional - AI job queue will be disabled if not available)');
// Check MongoDB
console.log('\n🗄️ MongoDB Configuration:\n');
console.log(`✓ URI: ${config.database.uri}`);
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
console.log('\n📚 Next Steps:\n');
if (config.ai.groqApiKey && config.ai.groqApiKey !== '') {
console.log('1. Start the server: npm run dev');
console.log('2. Check health: curl http://localhost:3000/health');
console.log('3. Test AI endpoint: curl -X POST http://localhost:3000/api/v1/ai/sentiment \\');
console.log(' -H "Content-Type: application/json" \\');
console.log(' -d \'{"text":"Stock market rallies"}\'');
console.log('4. Open WebSocket chat: examples/websocket-client.html');
} else {
console.log('1. Configure GROQ_API_KEY in .env');
console.log('2. Start the server: npm run dev');
console.log('3. Server will run without AI features');
}
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');