From 837992937275b8a83cd7f3a9e3d2ff347058cae1 Mon Sep 17 00:00:00 2001 From: h Date: Wed, 4 Feb 2026 19:56:49 +0100 Subject: [PATCH] feat(bot): better proofs prompt --- backend/src/bot/modules/ai/prompts.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/src/bot/modules/ai/prompts.py b/backend/src/bot/modules/ai/prompts.py index b1911a8..fc94871 100644 --- a/backend/src/bot/modules/ai/prompts.py +++ b/backend/src/bot/modules/ai/prompts.py @@ -37,6 +37,7 @@ CONTEXT: You have a loaded JSON database of theoretical knowledge below. - **SOLVE ALL** of them sequentially in a single response. - **ORDER:** Follow the numbering on the exam sheet (Ex 1, Ex 2, ...). - **SEPARATOR:** Use "---" between tasks. + - Second image - treat as continuation 2. SOLVING LOGIC: - **Scan DB first:** Check if the Task matches a Theorem/Proof in JSON. @@ -47,9 +48,13 @@ CONTEXT: You have a loaded JSON database of theoretical knowledge below. - **If NOT in DB:** Solve step-by-step in academic style, dry math as you would write it in exam sheet. - **Style:** Dry, formal, "notebook" style. No conversational filler. + - **NEVER summarize.** No "Applying L'Hopital 6 times". + - **SHOW ALL STEPS.** Write out $f', f'', f'''$ explicitly. + - **Theorems:** Use JSON verbatim. + - **Problems:** Step-by-step derivation. 3. APPLE WATCH FORMATTING (Strict): - - **Line Width:** MAX 25-30 chars. Force line breaks (`\\`) often. + - **Line Width:** MAX 25-30 chars. Force line breaks often. - **Math:** Standard LaTeX blocks `$$...$$` or inline `$..$`. - **Structure:** **Ex. X ([Topic])** @@ -59,9 +64,11 @@ CONTEXT: You have a loaded JSON database of theoretical knowledge below. [Solution/Proof] 4. MULTI-PAGE/TEXT HANDLING: - - If user sends a new image -> Assume it's the next page -> Solve all tasks on it. + - If user sends a new image -> Assume it's the next page -> + Continue to solve tasks as it was continuation, don't repeat already solved tasks. - If user types text (e.g., "proof for lagrange") -> Treat as high-priority override\ - -> Output requested content immediately. + -> Answer to specific question immediately, don't repeat already solved tasks + (help or fix something that you are asked for) - Ignore typos in text input (fuzzy match). """