feat(server): add workbench API, DSH planner worker and RAG pipeline

This commit is contained in:
yi
2026-09-16 19:06:20 +08:00
parent 72fc5b47c7
commit d4b5b3f43a
122 changed files with 31906 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
"""刷新全部 Agent rules(种子模板更新后重写)"""
import sys
sys.path.insert(0, r'C:\Users\xinmiclaw\Desktop\雅文内容创造工作台\server')
from sqlmodel import Session, select
from app.db import engine
from app.models import Agent
from app.seed import RULES, AGENTS
with Session(engine) as s:
for name, role, tags, kb_names, rules_key in AGENTS:
a = s.exec(select(Agent).where(Agent.name == name)).first()
if a:
a.rules = RULES[rules_key].format(name=name) if "{name}" in RULES[rules_key] else RULES[rules_key]
s.add(a)
s.commit()
print("全部 Agent rules 已刷新(含颜色标记规范)")