auto-sync: 2026-05-30 10:50:09

This commit is contained in:
cfdaily
2026-05-30 10:50:09 +08:00
parent 9d08dd16ab
commit 579802fbe6
+27
View File
@@ -349,6 +349,33 @@ curl -X POST http://{self.api_host}:{self.api_port}/api/projects/{project_id}/ta
api_port=self.api_port,
)
def _inject_agent_identity(self, agent_id: str) -> str:
"""#03: 注入 Agent 身份+专长"""
caps = "通用"
router = getattr(self, '_router_ref', None)
if router:
profile = router.agent_profiles.get(agent_id)
if profile and getattr(profile, 'capabilities_zh', None):
caps = ", ".join(profile.capabilities_zh)
return f"你是 {agent_id},专长: {caps}"
def _get_guardrails_summary(self) -> str:
"""#03: 从 GuardrailEngine 提取红线摘要"""
if not self.guardrails:
return "无特殊限制"
try:
return "".join(r.get("name", r.get("rule_id", "")) for r in self.guardrails.rules[:6])
except Exception:
return "无特殊限制"
def _get_agent_profile(self, agent_id: str):
"""获取 Agent 能力画像"""
router = getattr(self, '_router_ref', None)
if router:
return router.agent_profiles.get(agent_id)
return None
def _build_mail_prompt(self, task_id: str, title: str, description: str,
must_haves: str, agent_id: str) -> str:
"""构建 Mail 专用精简模板"""