修改属性图节点的层级结构,新增子父级关系

This commit is contained in:
wanyaokun
2024-09-24 17:11:20 +08:00
parent e0fc5381d8
commit aace9ce292
7 changed files with 494 additions and 188 deletions
+6 -1
View File
@@ -3,7 +3,6 @@ from llama_index.vector_stores.chroma import ChromaVectorStore
from llama_index.vector_stores.qdrant import QdrantVectorStore
from qdrant_client import qdrant_client
from llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore
qclient = None
def get_qdrant_vector_store(docType:str):
@@ -74,6 +73,12 @@ def get_vector_store(docType:str):
return store
def get_Neo4j_Graph_Store(docType:str):
from neo4j import GraphDatabase
driver = GraphDatabase.driver(os.getenv('NEO4J_URL'), auth=(os.getenv('NEO4J_USERNAME'), os.getenv('NEO4J_PASSWORD')))
with driver.session() as session:
session.run("MATCH (n) DETACH DELETE n")
driver.close()
neo4jStore = Neo4jPropertyGraphStore(
username= os.getenv('NEO4J_USERNAME'),
password= os.getenv('NEO4J_PASSWORD'),