сохранение чекпоинтов в sqlite

This commit is contained in:
Егор Кандрушин 2026-04-28 15:07:04 +03:00
parent b1e10f25b1
commit 42e6723abb
7 changed files with 82 additions and 3 deletions

View file

@ -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)