mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 02:40:12 +08:00
Chat, mastery, question FINISH and notes each carried their own copy of
the dollar-delimiter rule. They now reference {{shared:math_latex}}
(deeptutor/services/prompt/fragments), expanded by PromptManager at load
time; the notes capability expands the marker in its system.md, and
code-built prompts use shared_fragment(). The English notes prompt gains
the rule (and the mermaid line) its Chinese twin already had. The chat
loop no longer repeats the 'concise Markdown' line that runtime_policy
states.
Refs #2975
42 lines
919 B
Python
42 lines
919 B
Python
"""
|
|
Prompt Service
|
|
==============
|
|
|
|
Unified prompt management for all DeepTutor modules.
|
|
|
|
Usage:
|
|
from deeptutor.services.prompt import get_prompt_manager, PromptManager
|
|
|
|
# Get singleton manager
|
|
pm = get_prompt_manager()
|
|
|
|
# Load prompts for an agent
|
|
prompts = pm.load_prompts("solve", "solve_agent", language="en")
|
|
|
|
# Get specific prompt
|
|
system_prompt = pm.get_prompt(prompts, "system", "base")
|
|
"""
|
|
|
|
from .language import (
|
|
append_language_directive,
|
|
is_chinese,
|
|
language_directive,
|
|
language_label,
|
|
normalize_language,
|
|
)
|
|
from .lookup import prompt_text
|
|
from .manager import PromptManager, get_prompt_manager
|
|
from .shared import shared_fragment
|
|
|
|
__all__ = [
|
|
"PromptManager",
|
|
"append_language_directive",
|
|
"get_prompt_manager",
|
|
"is_chinese",
|
|
"language_directive",
|
|
"language_label",
|
|
"normalize_language",
|
|
"prompt_text",
|
|
"shared_fragment",
|
|
]
|