浏览代码

Update knowledge_retrieval_node.py (#24111)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
tags/1.8.0
AuditAIH 2 个月前
父节点
当前提交
2a43e634e8
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9
    0
      api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py

+ 9
- 0
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,

正在加载...
取消
保存