refactor(ux): consolidate BMAD skills, update design system, and clean up Prisma generated client
This commit is contained in:
26
keep-notes/test-chat-backend.ts
Normal file
26
keep-notes/test-chat-backend.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { prisma } from './lib/prisma';
|
||||
import { getSystemConfig } from './lib/config';
|
||||
import { getAIProvider } from './lib/ai/factory';
|
||||
|
||||
async function run() {
|
||||
const config = await getSystemConfig();
|
||||
const provider = getAIProvider(config);
|
||||
|
||||
const currentMessages = [
|
||||
{ role: 'user', content: 'hello' },
|
||||
{ role: 'assistant', content: 'Hi there' },
|
||||
{ role: 'user', content: 'help me' }
|
||||
];
|
||||
|
||||
const systemPrompt = "Tu es l'assistant de Keep Notes.";
|
||||
|
||||
try {
|
||||
const aiResponse = await provider.chat(currentMessages, systemPrompt);
|
||||
console.log("SUCCESS:", aiResponse.text.substring(0, 100));
|
||||
} catch (err: any) {
|
||||
console.error("FAILURE:", err.message);
|
||||
if (err.cause) console.error("CAUSE:", err.cause);
|
||||
if (err.data) console.error("DATA:", err.data);
|
||||
}
|
||||
}
|
||||
run();
|
||||
Reference in New Issue
Block a user