优化属性图检索功能及支持OpenAI线上模型
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Dict,Any
|
||||
from llama_index.core import PropertyGraphIndex
|
||||
from llama_index.core.storage.storage_context import StorageContext
|
||||
from llama_index.core import load_index_from_storage
|
||||
from app.engine.graph.graphStore import RAGPropertyGraphStore
|
||||
|
||||
logger = logging.getLogger("uvicorn")
|
||||
|
||||
@@ -33,6 +34,7 @@ def getPropertyGraphIndex(prjFlag:str):
|
||||
prjCachePath = GRAPH_STORAGE_DIR + f"/{prjFlag}"
|
||||
if not os.path.exists(prjCachePath):
|
||||
return None
|
||||
storeContext = StorageContext.from_defaults(persist_dir = prjCachePath,vector_store = get_vector_store(prjFlag))
|
||||
storeContext = StorageContext.from_defaults(persist_dir = prjCachePath,vector_store = get_vector_store(prjFlag),
|
||||
property_graph_store = RAGPropertyGraphStore.from_persist_dir(prjCachePath))
|
||||
index = load_index_from_storage(storeContext)
|
||||
return index
|
||||
Reference in New Issue
Block a user