diff --git a/src/routes/learningAI.js b/src/routes/learningAI.js index 8b18b55..b6c5714 100644 --- a/src/routes/learningAI.js +++ b/src/routes/learningAI.js @@ -55,7 +55,7 @@ function buildGeneratePrompt(opts) { var { topic, docText, contentType, questionCount, refinement, wordCount, slideCount } = opts; var source = docText - ? 'Based on the following document/resource text, generate educational content.\n\nDOCUMENT:\n"""\n' + docText.substring(0, 12000) + '\n"""\n' + ? 'Based on the following document/resource text, generate educational content.\n\nDOCUMENT:\n"""\n' + docText.substring(0, 50000) + '\n"""\n' : 'Generate educational content on the following topic for a medical professional audience (pediatrics / primary care).\n\nTOPIC: ' + topic + '\n'; var refineInstr = refinement ? '\n\nAdditional instructions for tone/style/focus: ' + refinement : ''; @@ -206,7 +206,7 @@ router.post('/ai-generate', upload.single('file'), async function(req, res) { { role: 'system', content: 'You are a medical education content generator. Return ONLY the requested JSON or Marp markdown — no preamble, no commentary, no code fences, no thinking. Start your response with { or --- as appropriate.' }, { role: 'user', content: prompt } ], - { model: model, temperature: 0.4, maxTokens: 6000 } + { model: model, temperature: 0.4, maxTokens: 8000 } ); var raw = result.content.trim();