LogicGoInfotechSpaces commited on
Commit
03e04f0
·
verified ·
1 Parent(s): da9047d

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +2 -32
app/main.py CHANGED
@@ -29,8 +29,8 @@ app = FastAPI(
29
  app.include_router(api_router, prefix="/api/v1")
30
 
31
 
32
- @app.get("/health", tags=["Health"])
33
- async def health_check() -> JSONResponse | Dict[str, Any]:
34
  checks: Dict[str, bool] = {"mongo": False, "openai": False}
35
  errors: Dict[str, str] = {}
36
 
@@ -67,33 +67,3 @@ async def _check_mongo() -> None:
67
 
68
  async def _check_openai() -> None:
69
  await openai_client.models.list()
70
-
71
- # from contextlib import asynccontextmanager
72
-
73
- # from fastapi import FastAPI
74
-
75
- # from app.api.routes import router as api_router
76
- # from app.db.mongo import close_mongo_connection, connect_to_mongo
77
-
78
-
79
- # @asynccontextmanager
80
- # async def lifespan(_: FastAPI):
81
- # await connect_to_mongo()
82
- # try:
83
- # yield
84
- # finally:
85
- # await close_mongo_connection()
86
-
87
-
88
- # app = FastAPI(
89
- # title="Auto Categorizer API",
90
- # version="1.0.0",
91
- # lifespan=lifespan,
92
- # )
93
-
94
- # app.include_router(api_router, prefix="/api/v1")
95
-
96
-
97
- # @app.get("/health", tags=["Health"])
98
- # async def health_check() -> dict[str, str]:
99
- # return {"status": "ok"}
 
29
  app.include_router(api_router, prefix="/api/v1")
30
 
31
 
32
+ @app.get("/health", tags=["Health"], response_model=None)
33
+ async def health_check() -> Dict[str, Any]:
34
  checks: Dict[str, bool] = {"mongo": False, "openai": False}
35
  errors: Dict[str, str] = {}
36
 
 
67
 
68
  async def _check_openai() -> None:
69
  await openai_client.models.list()