Padmanav commited on
Commit
755f80a
·
1 Parent(s): ec13d59

fix: wrap slowapi handler in typed async function to satisfy mypy signature check

Browse files
Files changed (1) hide show
  1. app/api/main.py +5 -0
app/api/main.py CHANGED
@@ -6,6 +6,11 @@ from slowapi.errors import RateLimitExceeded
6
  from app.api.limiter import limiter
7
  import os
8
  from prometheus_fastapi_instrumentator import Instrumentator
 
 
 
 
 
9
 
10
  app = FastAPI(
11
  title="AI Code Review Agent",
 
6
  from app.api.limiter import limiter
7
  import os
8
  from prometheus_fastapi_instrumentator import Instrumentator
9
+ from starlette.requests import Request
10
+ from starlette.responses import Response
11
+
12
+ async def _rate_limit_exceeded_handler(request: Request, exc: Exception) -> Response:
13
+ return await _slowapi_handler(request, exc) # type: ignore[arg-type]
14
 
15
  app = FastAPI(
16
  title="AI Code Review Agent",