mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 03:50:42 +00:00
feat: add document structure into GraphRAG (#2033)
Co-authored-by: Appointat <kuda.czk@antgroup.com> Co-authored-by: tpoisonooo <khj.application@aliyun.com> Co-authored-by: vritser <vritser@163.com>
This commit is contained in:
@@ -12,7 +12,6 @@ from dbgpt.app.knowledge.document_db import (
|
||||
KnowledgeDocumentEntity,
|
||||
)
|
||||
from dbgpt.app.knowledge.request.request import (
|
||||
ChunkEditRequest,
|
||||
ChunkQueryRequest,
|
||||
DocumentQueryRequest,
|
||||
DocumentRecallTestRequest,
|
||||
@@ -650,12 +649,17 @@ class KnowledgeService:
|
||||
{
|
||||
"id": node.vid,
|
||||
"communityId": node.get_prop("_community_id"),
|
||||
"name": node.vid,
|
||||
"type": "",
|
||||
"name": node.name,
|
||||
"type": node.get_prop("type") or "",
|
||||
}
|
||||
)
|
||||
for edge in graph.edges():
|
||||
res["edges"].append(
|
||||
{"source": edge.sid, "target": edge.tid, "name": edge.name, "type": ""}
|
||||
{
|
||||
"source": edge.sid,
|
||||
"target": edge.tid,
|
||||
"name": edge.name,
|
||||
"type": edge.get_prop("type") or "",
|
||||
}
|
||||
)
|
||||
return res
|
||||
|
Reference in New Issue
Block a user