latest
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user