Repository navigation
【修复】对话总结意图跳过知识库检索 - #3919
Open
Jonesxq wants to merge 1 commit into
Open
【修复】对话总结意图跳过知识库检索#3919Jonesxq wants to merge 1 commit into
Jonesxq wants to merge 1 commit into
Conversation
|
为什么总结要查知识库 总结知识库里的内容:比如“帮我总结一下这份文档的要点”,那必须先把文档内容检索出来才能总结。 总结当前对话或某个话题:即使总结对象是对话,模型也往往需要回查知识库里的相关材料,确保总结有据可依,而不是仅凭记忆。 把总结型请求归为“需要检索”,是宁可多查、不可漏查的保守策略——多检索一次的成本,远低于总结时漏掉关键信息、给出错误结论的代价。 |
Contributor
Author
|
@jdzhang1221 你说得对,这里不能只凭 更合适的做法是区分总结对象以及是否需要知识库依据,再决定路由。这个边界我之前考虑得不够充分,感谢指出。 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
对话总结类请求被分类为
summarize,但随后仍触发知识库向量检索、重排等流程,增加延迟并可能把知识库内容混入对话总结。修改内容
IntentSummarize不再被NeedsRetrieval()判定为需要知识库检索。验证
gofmt和git diff --check通过。go test ./internal/types ./internal/application/service/chat_pipeline在当前 Windows 环境未能进入测试阶段:环境CGO_ENABLED=0,而现有internal/utils/inject.go依赖pg_query_go的 CGO 实现(Parse/Deparse),编译失败。此失败与本次改动无关。Fixes #3918
修复前后 Trace 对比
图一:修复前 — summarize 意图仍执行知识库检索、重排。
图二:修复后 — 检索阶段已跳过。