Merge pull request #168 from Dormiveglia-elf/hotfix/asynchronous

[hotfix-#163] Fix asynchronous problem
This commit is contained in:
zrguo 2024-10-30 09:38:21 +08:00 committed by GitHub
commit d86938647a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"),
)