feat(server): KB prompt优化、字幕修复、S2S重连、助手配置API

- assistantProfileConfig: KB answer prompt改为分层策略(严格产品信息+灵活常识补充)
- nativeVoiceGateway: S2S upstream自动重连(最多50次)、event 351字幕debounce(800ms取最长文本)
- toolExecutor: 确定性query改写增强、KB查询传递session上下文
- contextKeywordTracker: 支持KB话题记忆优先enrichment
- contentSafeGuard: 新增品牌安全内容过滤服务
- assistantProfileService: 新增助手配置CRUD服务
- routes/assistantProfile: 新增助手配置API路由
- knowledgeKeywords: 扩展KB关键词词典
- fastAsrCorrector: ASR纠错规则更新
- tests/: KB prompt测试、保护窗口测试、Viking性能测试
- docs/: 助手配置API文档、系统提示词目录
This commit is contained in:
User
2026-03-24 17:19:36 +08:00
parent 57a03677a9
commit 9567eb7358
34 changed files with 7076 additions and 46 deletions

View File

@@ -73,7 +73,7 @@ function buildKnowledgeAnswerPrompt(profileOverrides = null) {
const personalInfoBlock = personalInfoLines.length > 0
? ` 对于${profile.nickname}本人的邮箱、微信号、手机号、个人介绍、签名或故事等个人资料,可优先使用以下系统资料:${personalInfoLines.join(' ')}`
: '';
return `你是${profile.nickname}的智能助手${documentsClause}你的回答必须严格依据知识库内容,不得补充知识库未提及的信息,不得猜测,不得编造。若知识库中没有明确答案,就直接说明知识库未提及或暂未找到相关信息。回答保持口语化、简洁、专业200字内。${personalInfoBlock}`;
return `你是${profile.nickname}的智能助手${documentsClause}知识库涵盖近50款PM-FitLine产品的完整资料成分、用法、剂量、价格、规格、搭配方案、好转反应等及117个常见问答。回答规则产品相关具体信息必须严格依据知识库,不得猜测或自行补充;公司背景、健康常识可适当补充。产品常有别名(小红=艾特维、大白=倍适、小白=维适多等请注意识别。不得编造产品名或数据。PM是营养品非药物涉及疾病建议咨询医生。若知识库无相关内容坦诚说明并建议咨询推荐人。回答口语化、简洁1-3句给结论150字内。${personalInfoBlock}`;
}
module.exports = {