From 51d6334f8a4bdb2d3e21b65a3745f8fade80eb16 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 12:34:43 +0000 Subject: [PATCH] fix: plafond strict 8 slides max + contrainte zod .max(8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - JAMAIS plus de 8 slides quelle que soit la note - Zod schema: .max(8) coupe l'array si le modèle déborde - Prompt: ignore markdown/URLs dans le comptage de mots - Chart seulement si vraies données numériques dans la note Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- memento-note/lib/ai/tools/slides.tool.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/memento-note/lib/ai/tools/slides.tool.ts b/memento-note/lib/ai/tools/slides.tool.ts index f6001ea..bc13054 100644 --- a/memento-note/lib/ai/tools/slides.tool.ts +++ b/memento-note/lib/ai/tools/slides.tool.ts @@ -45,17 +45,21 @@ Available slide types: - "summary": title, items[] (conclusion with checkmarks) RULES: -- Adapt the number of slides to the content: 3-4 slides for short notes (<200 words), 5-7 for medium, 8-12 for long/rich notes +- MAXIMUM 8 slides total — NEVER exceed 8, even for long notes +- Count only plain-text words, ignore markdown syntax, URLs, and metadata +- For short notes (<100 plain words): 3-4 slides max +- For medium notes (100-300 plain words): 5-6 slides max +- For any other note: 7-8 slides max — HARD LIMIT - First slide MUST be type "title" - Last slide MUST be type "summary" -- Include at least 1 "chart" or "stats" slide +- Include at most 1 "chart" or "stats" slide — only if real numeric data exists in the note - Use VARIED types — never 2 identical types in a row - All text content must come from the source notes (never invent data) - Each bullet/card must be a real sentence (15+ words, not generic)`, inputSchema: z.object({ title: z.string().describe('Short presentation title (6 words max)'), theme: z.string().optional().describe('Visual recipe: architectural-saas, midnight-cathedral, aurora-borealis, venture-pitch, clinical-precision, coastal-morning, etc.'), - slides: z.array(slideSchema).describe('Array of slide objects, each with a "type" field'), + slides: z.array(slideSchema).max(8).describe('Array of slide objects, 3-8 slides MAX'), }), execute: async ({ title, theme, slides }) => {