-
Notifications
You must be signed in to change notification settings - Fork 995
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (36 loc) · 1.13 KB
/
main.py
File metadata and controls
44 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import logging
logging.basicConfig(level=logging.INFO)
# Eagerly import presidio_analyzer so the module is fully initialised before
# concurrent requests trigger lazy imports from different threads (which would
# hit a circular-import race in the presidio_analyzer package).
try:
import presidio_analyzer # noqa: F401
except ImportError:
pass # Optional dependency – endpoints will return clear errors if missing
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import (
decision,
evaluation,
llm,
presidio_service,
review,
upload,
)
app = FastAPI(title="Presidio Evaluation Flow API", version="0.1.0")
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:5173"],
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(upload.router)
app.include_router(review.router)
app.include_router(evaluation.router)
app.include_router(decision.router)
app.include_router(llm.router)
app.include_router(presidio_service.router)
@app.get("/api/health")
async def health():
"""Return service health status."""
return {"status": "ok"}