From 4761a736fd3dd0ba1e4512768dc53de7918a855c Mon Sep 17 00:00:00 2001 From: Zhenyu Pan <120090196@link.cuhk.edu.cn> Date: Tue, 29 Oct 2024 23:29:47 +0800 Subject: [PATCH] [hotfix-#163] Fix asynchronous problem --- examples/lightrag_openai_compatible_demo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/lightrag_openai_compatible_demo.py b/examples/lightrag_openai_compatible_demo.py index 2470fc0..1422e2c 100644 --- a/examples/lightrag_openai_compatible_demo.py +++ b/examples/lightrag_openai_compatible_demo.py @@ -69,25 +69,25 @@ async def main(): ) with open("./book.txt", "r", encoding="utf-8") as f: - rag.insert(f.read()) + await rag.ainsert(f.read()) # Perform naive search print( - rag.query( + await rag.aquery( "What are the top themes in this story?", param=QueryParam(mode="naive") ) ) # Perform local search print( - rag.query( + await rag.aquery( "What are the top themes in this story?", param=QueryParam(mode="local") ) ) # Perform global search print( - rag.query( + await rag.aquery( "What are the top themes in this story?", param=QueryParam(mode="global"), ) @@ -95,7 +95,7 @@ async def main(): # Perform hybrid search print( - rag.query( + await rag.aquery( "What are the top themes in this story?", param=QueryParam(mode="hybrid"), )