feat(auto-reply): 优化自动回复逻辑和知识库功能
- 将默认回复详细程度从"detailed"调整为"medium",前后端保持一致 - 新增话题切换检测逻辑,当用户主动要求换话题时提供引导回复 - 优化上下文处理机制,仅在指代型追问时注入历史对话,避免模型复读旧内容 - 改进知识库检索逻辑,区分自包含问题和指代型问题的上下文需求 - 完善知识库完整性指令,确保回复详细程度与知识展开程度一致 - 重构知识库重建逻辑,支持递归扫描子目录中的文件,修复索引为空的问题 - 增强素材匹配算法,引入强信号检测机制,避免仅凭模糊匹配误发素材 - 新增素材开场白AI生成功能,支持图片、视频、文档等类型智能描述 - 改进知识库重建通知,显示具体的文件数、分片数及失败统计信息
This commit is contained in:
@@ -191,6 +191,12 @@ func (e *AutoReplyEngine) processJob(job AutoReplyJob) {
|
||||
return
|
||||
}
|
||||
e.rememberUserMessage(msg)
|
||||
if isPureTopicSwitchMessage(msg.Content) {
|
||||
if err := e.replyTextWithTimings(msg, topicSwitchGuidanceAnswer(), "topic_switch_guidance", nil, currentTimings()); err != nil {
|
||||
e.setLastErrorWithScope(autoReplyErrorScopeRecords, "topic switch reply failed: "+err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
if answer, ok := greetingAnswer(msg.Content); ok {
|
||||
if err := sendAutoReplyText(uint32(msg.ClientID), msg.ConversationID, answer); err != nil {
|
||||
e.handoffWithTimings(msg, "send_greeting_failed: "+err.Error(), nil, currentTimings())
|
||||
|
||||
Reference in New Issue
Block a user