Update knowledge_retrieval_node.py (#24111)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
805b698c2e
commit
2a43e634e8
1 changed files with 9 additions and 0 deletions
|
|
@ -388,6 +388,15 @@ class KnowledgeRetrievalNode(BaseNode):
|
||||||
"segment_id": segment.id,
|
"segment_id": segment.id,
|
||||||
"retriever_from": "workflow",
|
"retriever_from": "workflow",
|
||||||
"score": record.score or 0.0,
|
"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_hit_count": segment.hit_count,
|
||||||
"segment_word_count": segment.word_count,
|
"segment_word_count": segment.word_count,
|
||||||
"segment_position": segment.position,
|
"segment_position": segment.position,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue