Feat: microlearning implementation

This commit is contained in:
RaymondVerhoef
2026-05-25 18:32:45 +02:00
parent 18e98380d9
commit 042dfb2d92
4 changed files with 386 additions and 59 deletions

View File

@@ -341,3 +341,92 @@ export const ARTICLE_PATCH_TOOLS = [
REMOVE_SECTION_TOOL,
REPLACE_TAKEAWAYS_TOOL,
];
// ── Micro Learning generation tools ───────────────────────────────────────────
export const EMIT_CONCEPT_EXPLAINER_TOOL = {
name: 'emit_concept_explainer',
description: 'Return a structured concept explanation with multiple sections. Each section moves from definition → importance → practical application. The final section must include a concrete workplace example.',
input_schema: {
type: 'object',
properties: {
sections: {
type: 'array',
items: {
type: 'object',
properties: {
title: { type: 'string', description: 'Section heading.' },
content: { type: 'string', description: 'Section body in HTML. Use <p>, <ul>, <li>, <strong> tags for formatting. At least 3 sentences.' },
},
required: ['title', 'content'],
},
minItems: 3,
description: 'At least 3 sections: What it is, Why it matters, Practical example.',
},
},
required: ['sections'],
},
};
export const EMIT_SCENARIO_QUIZ_TOOL = {
name: 'emit_scenario_quiz',
description: 'Return a realistic workplace scenario with 34 plausible answer options. Exactly one option is correct. Each option must have a detailed explanation teaching why it is right or wrong.',
input_schema: {
type: 'object',
properties: {
scenario: { type: 'string', description: 'A realistic workplace situation (35 sentences) where the employee must decide what to do.' },
options: {
type: 'array',
items: {
type: 'object',
properties: {
text: { type: 'string', description: 'The action the employee could take.' },
isCorrect: { type: 'boolean', description: 'True for exactly one option.' },
explanation: { type: 'string', description: 'Why this option is correct or incorrect (23 sentences). Teach, do not just state.' },
},
required: ['text', 'isCorrect', 'explanation'],
},
minItems: 3,
maxItems: 4,
},
},
required: ['scenario', 'options'],
},
};
export const EMIT_FLASHCARD_SET_TOOL = {
name: 'emit_flashcard_set',
description: 'Return a set of 510 flashcards covering key facts, terms, and relationships from the topic. Mix question types: definitions, applications, and relationships.',
input_schema: {
type: 'object',
properties: {
cards: {
type: 'array',
items: {
type: 'object',
properties: {
front: { type: 'string', description: 'The question or prompt shown on the front of the card.' },
back: { type: 'string', description: 'The answer revealed on the back of the card.' },
},
required: ['front', 'back'],
},
minItems: 5,
maxItems: 10,
},
},
required: ['cards'],
},
};
export const EMIT_REFLECTION_PROMPT_TOOL = {
name: 'emit_reflection_prompt',
description: 'Return an open-ended reflection question that asks the employee to connect the topic to their own professional experience, plus a model answer showing the expected depth and specificity.',
input_schema: {
type: 'object',
properties: {
prompt: { type: 'string', description: 'An open-ended question that cannot be answered with a fact. It must require the employee to think about their own context.' },
model_answer: { type: 'string', description: 'An example of a thoughtful, specific response (35 sentences). This is not a rubric — it illustrates depth.' },
},
required: ['prompt', 'model_answer'],
},
};