优化属性图检索功能及支持OpenAI线上模型

This commit is contained in:
wanyaokun
2024-09-20 17:34:38 +08:00
parent 092f7230c1
commit f7260da6d9
12 changed files with 350 additions and 76 deletions
+3 -1
View File
@@ -16,6 +16,7 @@ from llama_index.core.storage import StorageContext
from llama_index.core.storage.docstore import SimpleDocumentStore
from llama_index.core import PropertyGraphIndex
from app.engine.graph.extractor import PrjGraphExtractor
from app.engine.graph.graphStore import RAGPropertyGraphStore
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
@@ -103,7 +104,8 @@ class PropertyGraphChache:
def simplePropertyGraph(self,prjName:str,prjFlag:str,filePath:str):
documents = get_documents(prjFlag)
storeContext = StorageContext.from_defaults(vector_store=get_vector_store(prjFlag))
storeContext = StorageContext.from_defaults(vector_store=get_vector_store(prjFlag),
property_graph_store = RAGPropertyGraphStore())
index = PropertyGraphIndex(
nodes =documents,
kg_extractors = [PrjGraphExtractor(prjName)],