This commit is contained in:
Krikorios
2025-07-14 10:14:20 +04:00
parent 890acbd5bc
commit 868c9b252c
21 changed files with 615 additions and 97 deletions
+26
View File
@@ -0,0 +1,26 @@
import dotenv from 'dotenv';
// Load environment variables from .env.local
dotenv.config({ path: '.env.local' });
import UTASChatBot from '../src/lib/chatbot';
async function runTests() {
const apiKey = process.env.OPENROUTER_API_KEY;
if (!apiKey) {
console.error('Missing OPENROUTER_API_KEY in environment');
process.exit(1);
}
const bot = new UTASChatBot(apiKey);
console.log('=== English Test ===');
const engResponse = await bot.generateResponse('Hello, what scholarships do you offer?');
console.log(engResponse);
console.log('\n=== Arabic Test ===');
const arResponse = await bot.generateResponse('ما هي المنح المتاحة؟');
console.log(arResponse);
}
runTests().catch(err => {
console.error('Error during chatbot tests:', err);
process.exit(1);
});