将属性图流程同步至主流程中
This commit is contained in:
@@ -103,10 +103,12 @@ 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))
|
||||
index = PropertyGraphIndex(
|
||||
nodes =documents,
|
||||
kg_extractors = [PrjGraphExtractor(prjName)],
|
||||
embed_model = Settings.embed_model,
|
||||
storage_context = storeContext,
|
||||
show_progress= True
|
||||
)
|
||||
os.makedirs(filePath,exist_ok = True)
|
||||
@@ -126,7 +128,11 @@ class PropertyGraphChache:
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_settings()
|
||||
llm_query = os.getenv('LLM_QUERY_WAY','rag')
|
||||
from phoenix.trace import using_project
|
||||
with using_project(os.getenv("PHOENIX_PROJECT_NAME") + "_generate") as obj:
|
||||
generate_datasource()
|
||||
PropertyGraphChache().generate()
|
||||
if llm_query == 'graph':
|
||||
PropertyGraphChache().generate()
|
||||
else:
|
||||
generate_datasource()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user