@@ -48,7 +48,7 @@ def test_graph_from_file_local(model_name):
4848 merged_file_path = os .path .join (MERGED_DIR , file_name )
4949
5050 local_file_result = extract_graph_from_file_local_file (
51- URI , USERNAME , PASSWORD , DATABASE , model_name , merged_file_path , file_name , '' , ''
51+ URI , USERNAME , PASSWORD , DATABASE , model_name , merged_file_path , file_name , '' , '' , None
5252 )
5353 logging .info ("Local file processing complete" )
5454 print (local_file_result )
@@ -64,34 +64,40 @@ def test_graph_from_file_local(model_name):
6464 return local_file_result
6565
6666def test_graph_from_wikipedia (model_name ):
67- """Test graph creation from a Wikipedia page."""
68- wiki_query = 'https://en.wikipedia.org/wiki/Ram_Mandir'
69- source_type = 'Wikipedia'
70- file_name = "Ram_Mandir"
71- create_source_node_graph_url_wikipedia (graph , model_name , wiki_query , source_type )
72-
73- wiki_result = extract_graph_from_file_Wikipedia (URI , USERNAME , PASSWORD , DATABASE , model_name , file_name , 1 , 'en' , '' , '' )
74- logging .info ("Wikipedia test done" )
75- print (wiki_result )
76-
77- try :
78- assert wiki_result ['status' ] == 'Completed'
79- assert wiki_result ['nodeCount' ] > 0
80- assert wiki_result ['relationshipCount' ] > 0
81- print ("Success" )
82- except AssertionError as e :
83- print ("Fail: " , e )
67+ # try:
68+ """Test graph creation from a Wikipedia page."""
69+ wiki_query = 'https://en.wikipedia.org/wiki/Ram_Mandir'
70+ source_type = 'Wikipedia'
71+ file_name = "Ram_Mandir"
72+ create_source_node_graph_url_wikipedia (graph , model_name , wiki_query , source_type )
73+
74+ wiki_result = extract_graph_from_file_Wikipedia (URI , USERNAME , PASSWORD , DATABASE , model_name , file_name , 'en' ,file_name , '' , '' ,None )
75+ logging .info ("Wikipedia test done" )
76+ print (wiki_result )
77+ try :
78+ assert wiki_result ['status' ] == 'Completed'
79+ assert wiki_result ['nodeCount' ] > 0
80+ assert wiki_result ['relationshipCount' ] > 0
81+ print ("Success" )
82+ except AssertionError as e :
83+ print ("Fail: " , e )
84+
85+ return wiki_result
86+ # except Exception as ex:
87+ # print(ex)
88+
8489
85- return wiki_result
90+
8691
8792def test_graph_website (model_name ):
8893 """Test graph creation from a Website page."""
8994 #graph, model, source_url, source_type
9095 source_url = 'https://www.amazon.com/'
9196 source_type = 'web-url'
97+ file_name = []
9298 create_source_node_graph_web_url (graph , model_name , source_url , source_type )
9399
94- weburl_result = extract_graph_from_web_page (URI , USERNAME , PASSWORD , DATABASE , model_name , source_url , '' , '' )
100+ weburl_result = extract_graph_from_web_page (URI , USERNAME , PASSWORD , DATABASE , model_name , source_url ,file_name , '' , '' , None )
95101 logging .info ("WebUrl test done" )
96102 print (weburl_result )
97103
@@ -202,18 +208,18 @@ def test_populate_graph_schema_from_text(model):
202208def run_tests ():
203209 final_list = []
204210 error_list = []
205- models = ['openai-gpt-3.5' , 'openai-gpt-4o ' ]
211+ models = ['openai-gpt-4o' , 'gemini-1.5-pro ' ]
206212
207213 for model_name in models :
208214 try :
209- final_list .append (test_graph_from_file_local (model_name ))
210- final_list .append (test_graph_from_wikipedia (model_name ))
211- final_list .append (test_populate_graph_schema_from_text (model_name ))
212- final_list .append (test_graph_website (model_name ))
213- final_list .append (test_graph_from_youtube_video (model_name ))
214- final_list .append (test_chatbot_qna (model_name ))
215- final_list .append (test_chatbot_qna (model_name , mode = 'vector' ))
216- final_list .append (test_chatbot_qna (model_name , mode = 'graph+vector+fulltext' ))
215+ final_list .append (test_graph_from_file_local (model_name ))
216+ final_list .append (test_graph_from_wikipedia (model_name ))
217+ final_list .append (test_populate_graph_schema_from_text (model_name ))
218+ final_list .append (test_graph_website (model_name ))
219+ # final_list.append(test_graph_from_youtube_video(model_name))
220+ # final_list.append(test_chatbot_qna(model_name))
221+ # final_list.append(test_chatbot_qna(model_name, mode='vector'))
222+ # final_list.append(test_chatbot_qna(model_name, mode='graph+vector+fulltext'))
217223 except Exception as e :
218224 error_list .append ((model_name , str (e )))
219225 # #Compare and log diffrences in graph results
@@ -223,6 +229,7 @@ def run_tests():
223229 lst_element_id = [dis_elementid ]
224230 delt = delete_disconected_nodes (lst_element_id )
225231 dup = get_duplicate_nodes ()
232+ print (final_list )
226233 # schma = test_populate_graph_schema_from_text(model)
227234 # Save final results to CSV
228235 df = pd .DataFrame (final_list )
0 commit comments