From a8f99adacadf8eff4489cd182422c7f853a3b6a4 Mon Sep 17 00:00:00 2001 From: wanyaokun <12345678> Date: Sat, 14 Sep 2024 09:49:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B1=9E=E6=80=A7=E5=9B=BE?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.env.example | 12 +++++++++++- backend/app/engine/graph/propertyGraph.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index 9be4eb2..231ef29 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -65,6 +65,13 @@ VECTOR_STORE_TYPE=chroma # The name of the collection in your vector database VECTOR_STORE_COLLECTION=default +GRAPH_STORE_TYPE = + +#---------- neo4j - PropertyGraph ---------------- +NEO4J_USERNAME = neo4j +NEO4J_PASSWORD = neo4j +NEO4J_URL = bolt://10.1.6.40:7687 + # The API endpoint for your vector database # VECTOR_STORE_HOST= @@ -76,6 +83,7 @@ VECTOR_STORE_COLLECTION=default # Otherwise, use VECTOR_STORE__HOST and VECTOR_STORE__PORT config above VECTOR_STORE_PATH=./storage_vector BM_RETRIEVER_PATH =./storage_bm +GRAPH_STORAGE_PATH =./storage_graph PHOENIX_API_KEY=123456 @@ -110,4 +118,6 @@ PROJECT_TITLE = "您好,我是博微工程理解小助手,您可以问我有 CHAT_UPLOAD_FILECACHE = "./output/uploaded" JIEBA_DATA=./nltk_data -NLTK_DATA=./nltk_data \ No newline at end of file +NLTK_DATA=./nltk_data + +PYTHONUTF8=1 \ No newline at end of file diff --git a/backend/app/engine/graph/propertyGraph.py b/backend/app/engine/graph/propertyGraph.py index a76b3dd..accad65 100644 --- a/backend/app/engine/graph/propertyGraph.py +++ b/backend/app/engine/graph/propertyGraph.py @@ -40,7 +40,7 @@ class PropertyGraph: if GRAPH_STORE_TYPE == 'neo4j': index = PropertyGraphIndex.from_existing(property_graph_store= get_Neo4j_Graph_Store(self._prjFlag)) else: - GRAPH_STORAGE_DIR = os.getenv("GRAPH_STORAGE_DIR", "storage_graph") + GRAPH_STORAGE_DIR = os.getenv("GRAPH_STORAGE_PATH", "storage_graph") prjCachePath = GRAPH_STORAGE_DIR + f"/{self._prjFlag}" if not os.path.exists(prjCachePath): return None