datasciencesage commited on
Commit
ab440aa
·
verified ·
1 Parent(s): a4bb0de

updated for details

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -40,15 +40,32 @@ app = FastAPI(
40
  )
41
 
42
 
43
- @app.get("/", tags=["Health"], summary="Root endpoint", description="Basic health check endpoint to verify API is running.")
44
  def root():
45
  """
46
- Root endpoint for basic API health verification.
47
 
48
  Returns:
49
- dict: Simple test message confirming API is operational.
50
  """
51
- return {"message": "Test", "status": "ok"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.")