This commit is contained in:
jin
2024-11-25 13:32:33 +08:00
11 changed files with 194 additions and 244 deletions

View File

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