Update lightrag_api_oracle_demo..py

This commit is contained in:
zrguo 2024-11-12 15:38:16 +08:00 committed by GitHub
parent 5a1e657d50
commit d904f2abd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -149,13 +149,13 @@ class Response(BaseModel):
# API routes # API routes
rag = None # 定义为全局对象 rag = None
@asynccontextmanager @asynccontextmanager
async def lifespan(app: FastAPI): async def lifespan(app: FastAPI):
global rag global rag
rag = await init() # 在应用启动时初始化 `rag` rag = await init()
print("done!") print("done!")
yield yield