增加五位助教老师
This commit is contained in:
26
common/profile_loader.py
Normal file
26
common/profile_loader.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Profile 加载器 — 从 profiles/ 目录读取 Markdown 文件作为 Agent 的 instruction
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
PROFILES_DIR = Path(__file__).parent.parent / "profiles"
|
||||
|
||||
|
||||
def load_profile(filename: str) -> str:
|
||||
"""
|
||||
加载指定名称的 profile 文件内容。
|
||||
|
||||
Args:
|
||||
filename: profile 文件名,如 "l1_live_course.md"
|
||||
|
||||
Returns:
|
||||
profile 文件的完整文本内容
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: profile 文件不存在
|
||||
"""
|
||||
filepath = PROFILES_DIR / filename
|
||||
if not filepath.exists():
|
||||
raise FileNotFoundError(f"Profile 文件不存在: {filepath}")
|
||||
return filepath.read_text(encoding="utf-8")
|
||||
Reference in New Issue
Block a user