mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-18 08:17:38 +00:00
feat:rag_graph
This commit is contained in:
parent
aff0553b7e
commit
39219a4fdc
@ -129,6 +129,11 @@ class RAGGraphEngine:
|
||||
)
|
||||
|
||||
result = [future.result() for future in future_tasks]
|
||||
# for triplet in triplets:
|
||||
# subj, _, obj = triplet
|
||||
# self.graph_store.upsert_triplet(*triplet)
|
||||
# self.graph_store.upsert_triplet(*triplet)
|
||||
# index_struct.add_node([subj, obj], text_node)
|
||||
return index_struct
|
||||
# for doc in documents:
|
||||
# triplets = self._extract_triplets(doc.page_content)
|
||||
@ -162,8 +167,9 @@ class RAGGraphEngine:
|
||||
print(
|
||||
f"current thread-{thread_id} end extract triplets tasks, triplets-{triplets}"
|
||||
)
|
||||
for triplet in triplets:
|
||||
subj, _, obj = triplet
|
||||
self.graph_store.upsert_triplet(*triplet)
|
||||
self.graph_store.upsert_triplet(*triplet)
|
||||
index_struct.add_node([subj, obj], text_node)
|
||||
return triplets
|
||||
# for triplet in triplets:
|
||||
# subj, _, obj = triplet
|
||||
# self.graph_store.upsert_triplet(*triplet)
|
||||
# self.graph_store.upsert_triplet(*triplet)
|
||||
# index_struct.add_node([subj, obj], text_node)
|
||||
|
@ -145,7 +145,7 @@ class RAGGraphSearch(BaseSearch):
|
||||
if len(sorted_nodes_with_scores) == 0:
|
||||
logger.info("> No nodes found by keywords, returning empty response.")
|
||||
return [
|
||||
NodeWithScore(node=TextNode(text="No relationships found."), score=1.0)
|
||||
Document(page_content="No relationships found.")
|
||||
]
|
||||
|
||||
# add relationships as Node
|
||||
|
Loading…
Reference in New Issue
Block a user