Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Update knowledge_retrieval_node.py (#24111)

AuditAIH2a43e634e83f
diff --git a/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py b/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py
index cda14463999..5e5c9f520ef 100644
--- a/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py
+++ b/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py
@@ -388,6 +388,15 @@ class KnowledgeRetrievalNode(BaseNode):
"segment_id": segment.id,
"retriever_from": "workflow",
"score": record.score or 0.0,
+ "child_chunks": [
+ {
+ "id": str(getattr(chunk, "id", "")),
+ "content": str(getattr(chunk, "content", "")),
+ "position": int(getattr(chunk, "position", 0)),
+ "score": float(getattr(chunk, "score", 0.0)),
+ }
+ for chunk in (record.child_chunks or [])
+ ],
"segment_hit_count": segment.hit_count,
"segment_word_count": segment.word_count,
"segment_position": segment.position,