feat: implement AI-driven learning content generation service and interactive leaderboard functionality

This commit is contained in:
RaymondVerhoef
2026-05-11 20:16:56 +02:00
parent 0cf5758742
commit 2597dc751a
9 changed files with 727 additions and 176 deletions

View File

@@ -12,18 +12,18 @@ export const anthropicApi = {
// Check if simulation mode is on
const useSimulation = storage.get('admin:use_simulation') === true;
if (useSimulation) {
console.log('[API] Simulatie mode actief. Mock data wordt geretourneerd.');
console.log('[API] Simulation mode active. Mock data will be returned.');
return await simulateResponse();
}
const apiKey = storage.get('admin:anthropic_key') || import.meta.env.VITE_ANTHROPIC_API_KEY;
if (!apiKey) {
throw new Error('Geen Anthropic API key gevonden. Ga naar Admin -> Settings.');
throw new Error('No Anthropic API key found. Please configure it in Admin -> Settings.');
}
// Model is configurable from Admin > Settings, defaults to the original spec model
const model = storage.get('admin:model') || DEFAULT_MODEL;
console.log(`[API] Aanroep met model: ${model}`);
console.log(`[API] Calling with model: ${model}`);
let retries = 0;
while (retries <= maxRetries) {