feat(agent): 医院信息子代理改为本地文件知识库并接入双 bot
- 一院一 Markdown 档案(data/hospitals),索引与章节自动维护;读取支持 section 与 24k 截断,写入校验日期与单条长度,别名精确冲突时不新建 - 子代理按 allowWrite 分可写/只读工具集与提示词:管理端与陪诊员可写,就诊人端只读(物理移除写入工具) - 新增 scripts/import_hospitals.js 存量导入:压缩医生为一行、默认前 60 位,支持 dry-run、幂等与冲突报告,生成 112 家医院档案 - 管理端图片识别原文沿用原样回显策略,不再经模型二次整理 - npm test 212 项通过(新增知识库 12 项、导入 3 项)
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
httpGetTool, createEscortRecordQueryTool, createHealthProfileQueryTool,
|
||||
createEmployeeQueryTool, createEmployeeReviewQueryTool
|
||||
} from "../../infra/tools/index.js";
|
||||
import { createHospitalInfoSubagent } from "../../subagent/hospital_info.js";
|
||||
|
||||
// 图片识别原文回显的分片长度:与模型流式输出的单帧量级接近,
|
||||
// 避免把很长的报告塞进一帧,也让客户端能逐段追加展示
|
||||
@@ -228,9 +229,9 @@ export default class EscortAgent {
|
||||
createHealthProfileQueryTool(userInfo),
|
||||
createEmployeeQueryTool(userInfo),
|
||||
createEmployeeReviewQueryTool(userInfo)],
|
||||
// organization(机构/医院)是公共数据、没有 userId,不属于用户本人数据,
|
||||
// 因此不在 bot-escort 注入任何机构库查询能力;公开信息走 web 工具
|
||||
subagents: [],
|
||||
// organization(机构/医院)不在用户库中,不注入任何机构数据库查询能力;
|
||||
// 医院公开信息交给只读的 hospital-info 子代理,读两端共享的本地档案
|
||||
subagents: [createHospitalInfoSubagent(this.flashModel, { allowWrite: false })],
|
||||
skills: ["./agent/infra/skills/"],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user