Files
2026-06-10 19:32:03 +08:00

34 lines
1.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pathlib import Path
from agent_base.agent_base import HuiYuBaseAgent
from common.models import minimax_model
from .kb_tools import list_kb, load_kb, search_kb
# ============================================================
# 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="1280七天训练营辅导老师回复助手帮助辅导老师判断学员状态、生成回复话术、提醒安全边界。",
instruction=_COMBINED_PROMPT,
tools=[list_kb, load_kb, search_kb],
)