Spaces:
Sleeping
Sleeping
github-actions[bot] commited on
Commit ·
a3925c9
1
Parent(s): c1bbffd
deploy: backend from 8a361cd
Browse filesFiles changed (6)
2435 unmodified lines2436243724382439244024412442244353 unmodified lines2497249824992500250125022503250411155 unmodified lines1366013661136621366313664136652435 unmodified lines- Inline: \\( expression \\)- Block/display: \\[ expression \\]Never use dollar signs ($) — they break the KaTeX renderer.6. Use Filipino-friendly English. Mix in occasional Tagalog phrases(e.g., "Kaya mo yan!", "Subukan natin...") to keep the tone warm.7. When a student answers a "try_it" problem, evaluate their answer:- If correct: Celebrate briefly, explain WHY it's correct, then offer a harder challenge.- If wrong: Say "Good try! Let's check your steps..." then walk through the error.53 unmodified linesWhen in doubt, ask a clarifying math question rather than triggering out-of-scope.LANGUAGE:You understand and respond naturally in Filipino, Tagalog, Taglish, and English.Always match the student's language. Filipino and Taglish expressions are valid input.Treat all Filipino conversational replies as normal student communication, never asoff-topic or unrecognized input."""11155 unmodified lines{rag_instruction}Use Filipino context (₱, local scenarios).Follow SDO Navotas step-by-step: "Given → Formula → Substitute → Compute → Conclude"2435 unmodified lines243624372438243924402441244253 unmodified lines2496249724982499250025012502250311155 unmodified lines136591366013661136621366313664136652435 unmodified lines- Inline: \\( expression \\)- Block/display: \\[ expression \\]Never use dollar signs ($) — they break the KaTeX renderer.6. Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.7. When a student answers a "try_it" problem, evaluate their answer:- If correct: Celebrate briefly, explain WHY it's correct, then offer a harder challenge.- If wrong: Say "Good try! Let's check your steps..." then walk through the error.53 unmodified linesWhen in doubt, ask a clarifying math question rather than triggering out-of-scope.LANGUAGE:IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.Understand Filipino, Tagalog, and Taglish student input, but always respond in English.Treat all Filipino conversational replies as normal student communication, never asoff-topic or unrecognized input."""11155 unmodified lines{rag_instruction}IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.Use Filipino context (₱, local scenarios).Follow SDO Navotas step-by-step: "Given → Formula → Substitute → Compute → Conclude"
649 unmodified lines650651652653654655649 unmodified linesreturn ("You are a DepEd-aligned Grade 11 mathematics instructional designer.\n""Generate a lesson in JSON format. Use ONLY the retrieved curriculum evidence below.\n""Do NOT invent content. Do NOT add generic motivational text. All content must be grounded in the retrieved excerpts.\n\n"f"Lesson title: {lesson_title}\n"f"Competency code: {competency_code or 'n/a'}\n"649 unmodified lines650651652653654655656649 unmodified linesreturn ("You are a DepEd-aligned Grade 11 mathematics instructional designer.\n""Generate a lesson in JSON format. Use ONLY the retrieved curriculum evidence below.\n""IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.\n""Do NOT invent content. Do NOT add generic motivational text. All content must be grounded in the retrieved excerpts.\n\n"f"Lesson title: {lesson_title}\n"f"Competency code: {competency_code or 'n/a'}\n"
227 unmodified lines22822923023123223378 unmodified lines312313314315316317227 unmodified linessystem_prompt = ("You are a DepEd K-12 SHS math educator writing for Grade 11 Filipino students. ""Generate content ONLY from the retrieved DepEd curriculum excerpts provided. ""Do NOT add generic filler. Do NOT invent examples or definitions not present ""in the retrieved context."78 unmodified linessystem_prompt = ("You are a math tutor helping a Filipino SHS student improve weak areas. ""Base ALL study tips strictly on the retrieved DepEd curriculum content below. ""Do not invent practice problems or examples not found in the curriculum context.")227 unmodified lines22822923023123223323478 unmodified lines313314315316317318319227 unmodified linessystem_prompt = ("You are a DepEd K-12 SHS math educator writing for Grade 11 Filipino students. ""IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language. ""Generate content ONLY from the retrieved DepEd curriculum excerpts provided. ""Do NOT add generic filler. Do NOT invent examples or definitions not present ""in the retrieved context."78 unmodified linessystem_prompt = ("You are a math tutor helping a Filipino SHS student improve weak areas. ""IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language. ""Base ALL study tips strictly on the retrieved DepEd curriculum content below. ""Do not invent practice problems or examples not found in the curriculum context.")
323 unmodified lines324325326327328329323 unmodified lines- Hard (Bloom: analyzing): 3 questions (20%)QUESTION RULES:1. All questions are 4-option multiple choice (A, B, C, D).2. Use Filipino real-life context: peso amounts, Filipino names(Juan, Maria, Jose), Philippine institutions (SSS, PhilHealth,323 unmodified lines324325326327328329330323 unmodified lines- Hard (Bloom: analyzing): 3 questions (20%)QUESTION RULES:IMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.1. All questions are 4-option multiple choice (A, B, C, D).2. Use Filipino real-life context: peso amounts, Filipino names(Juan, Maria, Jose), Philippine institutions (SSS, PhilHealth,
135 unmodified lines136137138139140141135 unmodified lines- Point value per question: {points}## Instructions1. Generate EXACTLY {question_count} questions covering the topic above.2. Question types to use: {qt_str}3. BLOOM'S TAXONOMY DISTRIBUTION (for {question_count} questions):135 unmodified lines136137138139140141142135 unmodified lines- Point value per question: {points}## InstructionsIMPORTANT: Write EVERYTHING in English. Do NOT use Tagalog, Filipino, or any other language.1. Generate EXACTLY {question_count} questions covering the topic above.2. Question types to use: {qt_str}3. BLOOM'S TAXONOMY DISTRIBUTION (for {question_count} questions):
105 unmodified lines106107108109110111112409 unmodified lines52252352452552652752852953052 unmodified lines583584585586587588589590591209 unmodified lines801802803804805806807808809810105 unmodified linesself.weak_topics = weak_topics or []self.learning_style = learning_styleself.explanation_depth = explanation_depth # "auto", "basic", "detailed", "advanced"self.language_tone = language_tone # "english", "filipino-friendly"self.prior_goals = prior_goals or []self.stable_tutoring_facts = stable_tutoring_facts or []self.recurring_mistakes = recurring_mistakes or []409 unmodified lineselse:updates[field] = matched# Language preferenceif re.search(r"(?:tagalog|filipino|bisaya|ilocano)", text, re.IGNORECASE):updates["language_tone"] = "filipino-friendly"return updates52 unmodified linesfacts_to_record.append(f"Student struggles with: {', '.join(profile.weak_topics[-3:])}")if profile.explanation_depth and profile.explanation_depth != "auto":facts_to_record.append(f"Student prefers {profile.explanation_depth} explanations")if profile.language_tone == "filipino-friendly":facts_to_record.append("Student prefers Filipino-friendly language")if facts_to_record:for fact in facts_to_record:if fact not in profile.stable_tutoring_facts:209 unmodified lineslines.append(f"Weak Topics: {', '.join(profile.weak_topics[:5])}")if profile.explanation_depth and profile.explanation_depth != "auto":lines.append(f"Explanation Preference: {profile.explanation_depth} explanations")if profile.language_tone and profile.language_tone != "english":lines.append(f"Language: {profile.language_tone}")if profile.stable_tutoring_facts:lines.append(f"Tutoring Facts: {'; '.join(profile.stable_tutoring_facts[-3:])}")if profile.prior_goals:lines.append(f"Prior Goals: {'; '.join(profile.prior_goals[-3:])}")if profile.recurring_mistakes:105 unmodified lines106107108109110111112409 unmodified lines52252352452552652752852953052 unmodified lines583584585586587588209 unmodified lines798799800801802803804805806807808809810105 unmodified linesself.weak_topics = weak_topics or []self.learning_style = learning_styleself.explanation_depth = explanation_depth # "auto", "basic", "detailed", "advanced"self.language_tone = language_toneself.prior_goals = prior_goals or []self.stable_tutoring_facts = stable_tutoring_facts or []self.recurring_mistakes = recurring_mistakes or []409 unmodified lineselse:updates[field] = matched# Accept Filipino-language input without changing the English output preference.if re.search(r"(?:tagalog|filipino|bisaya|ilocano)", text, re.IGNORECASE):updates["language_tone"] = "english"return updates52 unmodified linesfacts_to_record.append(f"Student struggles with: {', '.join(profile.weak_topics[-3:])}")if profile.explanation_depth and profile.explanation_depth != "auto":facts_to_record.append(f"Student prefers {profile.explanation_depth} explanations")if facts_to_record:for fact in facts_to_record:if fact not in profile.stable_tutoring_facts:209 unmodified lineslines.append(f"Weak Topics: {', '.join(profile.weak_topics[:5])}")if profile.explanation_depth and profile.explanation_depth != "auto":lines.append(f"Explanation Preference: {profile.explanation_depth} explanations")if profile.stable_tutoring_facts:active_facts = [fact for fact in profile.stable_tutoring_factsif fact != "Student prefers Filipino-friendly language"]if active_facts:lines.append(f"Tutoring Facts: {'; '.join(active_facts[-3:])}")if profile.prior_goals:lines.append(f"Prior Goals: {'; '.join(profile.prior_goals[-3:])}")if profile.recurring_mistakes:
main.py+4-4
rag/curriculum_rag.py+1
routes/deepseek_rag_routes.py+2
routes/diagnostic.py+1
routes/quiz_generation_routes.py+1
services/memory_service.py+9-9