20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
import { chatService } from './lib/ai/services/chat.service';
|
|
import { prisma } from './lib/prisma';
|
|
|
|
async function run() {
|
|
try {
|
|
// 1. Fetch the user who owns 'sepehr' or get any user
|
|
const user = await prisma.user.findFirst();
|
|
if (!user) {
|
|
console.log('No user found');
|
|
return;
|
|
}
|
|
|
|
// Simulate chat function (we need to mock auth unfortunately, because chatService uses auth())
|
|
// Let's modify chatService temporarily or duplicate its logic.
|
|
} catch (err) {
|
|
console.error(err);
|
|
}
|
|
}
|
|
run();
|