11 lines
372 B
Python
11 lines
372 B
Python
from __future__ import annotations
|
|
from functools import lru_cache
|
|
from pathlib import Path
|
|
import yaml
|
|
|
|
@lru_cache(maxsize=16)
|
|
def load_domain_prompt(name: str) -> str:
|
|
path = Path(__file__).resolve().parents[2] / "config" / "prompts" / f"{name}.yaml"
|
|
data = yaml.safe_load(path.read_text(encoding="utf-8")) or {}
|
|
return str(data.get("system") or "").strip()
|