сохранение чекпоинтов в sqlite
This commit is contained in:
parent
b1e10f25b1
commit
42e6723abb
7 changed files with 82 additions and 3 deletions
|
|
@ -4,12 +4,14 @@ from fastapi import FastAPI
|
|||
|
||||
from src.api.external import router as ws_router
|
||||
from src.agent import AgentService
|
||||
from src.agent.checkpointer import create_checkpointer
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
AgentService() # инициализируем синглтон
|
||||
yield
|
||||
async with create_checkpointer():
|
||||
AgentService() # инициализируем синглтон
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue