Merge pull request #1051 from SuanmoSuanyangTechnology/feature/agent-tool_xjn

feat(workflow)
This commit is contained in:
山程漫悟
2026-05-07 19:12:39 +08:00
committed by GitHub
3 changed files with 11 additions and 8 deletions

View File

@@ -363,11 +363,12 @@ class KnowledgeRetrievalNode(BaseNode):
seen_doc_ids = set()
for chunk in final_rs:
meta = chunk.metadata or {}
doc_id = meta.get("document_id") or meta.get("doc_id")
if doc_id and doc_id not in seen_doc_ids:
seen_doc_ids.add(doc_id)
document_id = meta.get("document_id")
if document_id and document_id not in seen_doc_ids:
seen_doc_ids.add(document_id)
citations.append({
"document_id": str(doc_id),
"document_id": str(document_id),
"doc_id": meta.get("doc_id", ""),
"file_name": meta.get("file_name", ""),
"knowledge_id": str(meta.get("knowledge_id", kb_config.kb_id)),
"score": meta.get("score", 0.0),