Add finalize_storages to sample code
This commit is contained in:
parent
e0f0d23e5a
commit
0c6e80cce9
1 changed files with 44 additions and 36 deletions
|
|
@ -92,6 +92,8 @@ async def initialize_rag():
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
rag = None
|
||||||
|
try:
|
||||||
# Initialize RAG instance
|
# Initialize RAG instance
|
||||||
rag = await initialize_rag()
|
rag = await initialize_rag()
|
||||||
|
|
||||||
|
|
@ -137,9 +139,15 @@ async def main():
|
||||||
"What are the top themes in this story?", param=QueryParam(mode="hybrid")
|
"What are the top themes in this story?", param=QueryParam(mode="hybrid")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"An error occurred: {e}")
|
||||||
|
finally:
|
||||||
|
if rag:
|
||||||
|
await rag.finalize_storages()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Configure logging before running the main function
|
# Configure logging before running the main function
|
||||||
configure_logging()
|
configure_logging()
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
print("\nDone!")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue