From b1caf1c028add02dc0ffe6fc35ceeeb0f0d00c81 Mon Sep 17 00:00:00 2001 From: Malin Date: Mon, 30 Mar 2026 21:02:38 +0200 Subject: [PATCH] fix: improve summarization prompt to preserve names and context --- tldr-summarizer.user.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tldr-summarizer.user.js b/tldr-summarizer.user.js index d2c8be3..08b2988 100644 --- a/tldr-summarizer.user.js +++ b/tldr-summarizer.user.js @@ -194,8 +194,19 @@ // Trim text to keep API costs low; ~4000 chars ≈ ~1000 tokens const text = rawText.trim().slice(0, 4500); - const systemPrompt = 'You are a concise summarizer. Write a 2-4 sentence TL;DR paragraph. Always mention who or what the content is about, the key events or arguments, and why it matters. Preserve names, dates, and context. Do not use bullet points. Do not add preamble like "This article is about" — just start summarizing.'; - const prompt = `<|system|>${systemPrompt}<|user|>Summarize this:\n\n${text}<|assistant|>`; + const prompt = `Summarize the following text in 2-3 sentences in English. + +Rules: +- You MUST use the full name of every person mentioned — never say "the subject", "he", "she", or "an unnamed figure" without first stating their name. +- Include what they did, when, and why it matters historically or contextually. +- If the source text is in another language, still write the summary in English. +- Do not use bullet points. Write a single flowing paragraph. +- Start directly with the person's name or the topic — no preamble. + +Text: +${text} + +Summary:`; GM_xmlhttpRequest({ method: 'POST',