app.py 522 B

1234567891011121314151617
  1. from fastapi import FastAPI
  2. from app.api.routes import router
  3. from app.bootstrap.settings import SessionServiceSettings
  4. from app.db.session import build_session_factory
  5. def create_app() -> FastAPI:
  6. settings = SessionServiceSettings()
  7. app = FastAPI(
  8. title="agent-platform session-service",
  9. version="0.1.0",
  10. )
  11. app.state.settings = settings
  12. app.state.session_factory = build_session_factory(settings)
  13. app.include_router(router, prefix="/sessions", tags=["sessions"])
  14. return app