mirror of
				https://github.com/HKUDS/LightRAG.git
				synced 2025-10-31 01:39:56 +00:00 
			
		
		
		
	[hotfix-#163] Fix asynchronous problem
This commit is contained in:
		
							parent
							
								
									ea5e63e402
								
							
						
					
					
						commit
						4761a736fd
					
				| @ -69,25 +69,25 @@ async def main(): | |||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         with open("./book.txt", "r", encoding="utf-8") as f: |         with open("./book.txt", "r", encoding="utf-8") as f: | ||||||
|             rag.insert(f.read()) |             await rag.ainsert(f.read()) | ||||||
| 
 | 
 | ||||||
|         # Perform naive search |         # Perform naive search | ||||||
|         print( |         print( | ||||||
|             rag.query( |             await rag.aquery( | ||||||
|                 "What are the top themes in this story?", param=QueryParam(mode="naive") |                 "What are the top themes in this story?", param=QueryParam(mode="naive") | ||||||
|             ) |             ) | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         # Perform local search |         # Perform local search | ||||||
|         print( |         print( | ||||||
|             rag.query( |             await rag.aquery( | ||||||
|                 "What are the top themes in this story?", param=QueryParam(mode="local") |                 "What are the top themes in this story?", param=QueryParam(mode="local") | ||||||
|             ) |             ) | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         # Perform global search |         # Perform global search | ||||||
|         print( |         print( | ||||||
|             rag.query( |             await rag.aquery( | ||||||
|                 "What are the top themes in this story?", |                 "What are the top themes in this story?", | ||||||
|                 param=QueryParam(mode="global"), |                 param=QueryParam(mode="global"), | ||||||
|             ) |             ) | ||||||
| @ -95,7 +95,7 @@ async def main(): | |||||||
| 
 | 
 | ||||||
|         # Perform hybrid search |         # Perform hybrid search | ||||||
|         print( |         print( | ||||||
|             rag.query( |             await rag.aquery( | ||||||
|                 "What are the top themes in this story?", |                 "What are the top themes in this story?", | ||||||
|                 param=QueryParam(mode="hybrid"), |                 param=QueryParam(mode="hybrid"), | ||||||
|             ) |             ) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Zhenyu Pan
						Zhenyu Pan