Spaces:
Sleeping
Sleeping
updated for details
Browse files
app.py
CHANGED
|
@@ -40,15 +40,32 @@ app = FastAPI(
|
|
| 40 |
)
|
| 41 |
|
| 42 |
|
| 43 |
-
@app.get("/", tags=["Health"], summary="Root endpoint", description="
|
| 44 |
def root():
|
| 45 |
"""
|
| 46 |
-
Root endpoint
|
| 47 |
|
| 48 |
Returns:
|
| 49 |
-
dict:
|
| 50 |
"""
|
| 51 |
-
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
@app.get("/health", tags=["Health"], summary="Health check", description="Detailed health status of the API service.")
|
|
|
|
| 40 |
)
|
| 41 |
|
| 42 |
|
| 43 |
+
@app.get("/", tags=["Health"], summary="Root endpoint", description="API welcome page with endpoint information and usage guide.")
|
| 44 |
def root():
|
| 45 |
"""
|
| 46 |
+
Root endpoint providing API information and available endpoints.
|
| 47 |
|
| 48 |
Returns:
|
| 49 |
+
dict: API welcome message with endpoint details and usage information.
|
| 50 |
"""
|
| 51 |
+
return {
|
| 52 |
+
"message": "Welcome to ML Inference API",
|
| 53 |
+
"description": "Accept CSV or JSON files, convert to DataFrame, and run model inference.",
|
| 54 |
+
"version": "1.0.0",
|
| 55 |
+
"endpoints": {
|
| 56 |
+
"/": "This page - API information",
|
| 57 |
+
"/health": "Health check endpoint",
|
| 58 |
+
"/api-inference": "POST - Upload CSV or JSON file for model inference",
|
| 59 |
+
"/docs": "Interactive API documentation (Swagger UI)",
|
| 60 |
+
"/redoc": "Alternative API documentation (ReDoc)"
|
| 61 |
+
},
|
| 62 |
+
"usage": {
|
| 63 |
+
"supported_formats": ["CSV", "JSON"],
|
| 64 |
+
"example_curl": "curl -X POST '/api-inference' -F 'file=@data.csv'",
|
| 65 |
+
"documentation_url": "/docs"
|
| 66 |
+
},
|
| 67 |
+
"status": "ok"
|
| 68 |
+
}
|
| 69 |
|
| 70 |
|
| 71 |
@app.get("/health", tags=["Health"], summary="Health check", description="Detailed health status of the API service.")
|