сохранение состояние между вызовами
This commit is contained in:
parent
635986ba70
commit
d4d775305f
5 changed files with 63 additions and 36 deletions
12
src/main.py
12
src/main.py
|
|
@ -1,8 +1,16 @@
|
|||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from src.agent import get_agent_service
|
||||
from src.api.external import router as ws_router
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
app.include_router(ws_router)
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
get_agent_service()
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
app.include_router(ws_router)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue