重构七天训练营老师

This commit is contained in:
2026-06-10 19:32:03 +08:00
parent 3b7abb9796
commit 826de3d7bb
17 changed files with 3893 additions and 17 deletions

View File

@@ -1,13 +1,33 @@
from pathlib import Path
from agent_base.agent_base import HuiYuBaseAgent
from common.models import minimax_model
from common.profile_loader import load_profile
from .kb_tools import list_kb, load_kb, search_kb
# ============================================================
# L2 助教 — 训练营老师(进阶层)
# L2 助教 — 1280七天训练营辅导老师回复助手
# ============================================================
# 从外部文件加载主提示词(业务逻辑,可频繁修改)
_PROMPT_PATH = Path(__file__).parent / "prompt.md"
_MAIN_PROMPT = _PROMPT_PATH.read_text(encoding="utf-8")
# 从外部文件加载知识库工具调用指令(工具规范,不建议频繁修改)
_KB_INSTR_PATH = Path(__file__).parent / "kb_instructions.md"
_KB_INSTRUCTIONS = _KB_INSTR_PATH.read_text(encoding="utf-8")
# 组合提示词:主提示词 + 工具调用指令
# 这样分离后,修改 prompt.md 不会影响工具调用功能
_COMBINED_PROMPT = f"""{_MAIN_PROMPT}
---
{_KB_INSTRUCTIONS}
"""
root_agent = HuiYuBaseAgent(
name="l2_training_camp_agent",
model=minimax_model,
description="L2 进阶助教,带领学员从'知道'走向'体验到',掌握万能释放公式和戏剧三角形等工具",
instruction=load_profile("l2_training_camp.md"),
description="1280七天训练营辅导老师回复助手帮助辅导老师判断学员状态、生成回复话术、提醒安全边界",
instruction=_COMBINED_PROMPT,
tools=[list_kb, load_kb, search_kb],
)