feat(agent): 接入本人数据查询工具,补齐会话清理、历史裁剪与输出护栏

- bot-escort 注入 health_profile / employee / employee_review 查询,均绑定登录用户,只返回本人数据

- bot-escort 移除 hospital-info 子代理:机构信息属公共数据,改走 web 检索

- bot-escort-admin 补 employee / employee_review 管理端查询

- clear 指令单独回执,避免客户端只等到 end 帧无法区分是否已清空

- 温度与历史上限改为可配置(bot 临时对象由 task.js 传入),默认咨询端 0.3、管理端 0

- 用户资料指纹变化时重建 agent,避免继续用旧姓名/手机号/地址作答

- 流式输出接 guard 护栏,tool 结果入历史前截断
This commit is contained in:
lik
2026-11-01 11:42:40 +08:00
parent f3a1ef89bc
commit 50e7e7b0c7
3 changed files with 146 additions and 67 deletions
+5 -2
View File
@@ -7,7 +7,7 @@ class ChatTask {
apiKey: options.apiKey,
baseURL: options.baseURL,
modelName: options.modelName,
temperature: options.temperature ?? 0.7,
temperature: options.temperature ?? 0.3,
maxIterations: options.maxIterations || 10,
};
@@ -23,7 +23,10 @@ class ChatTask {
// LRU:重新插入以更新使用顺序
this.agents.delete(userId);
} else {
agent = new EscortAgent();
agent = new EscortAgent({
temperature: this.options.temperature,
maxHistoryChars: this.options.maxHistoryChars,
});
}
this.agents.set(userId, agent);