diff --git a/With these changes, you should now have Swagger UI integrated into your FastAPI application. You can access it by navigating to `http:/your-app-url/docs` in your web browser. b/With these changes, you should now have Swagger UI integrated into your FastAPI application. You can access it by navigating to `http:/your-app-url/docs` in your web browser. new file mode 100644 index 0000000..e69de29 diff --git a/app.py b/app.py index c1d3b8e..2c2036b 100644 --- a/app.py +++ b/app.py @@ -1,11 +1,21 @@ from fastapi import FastAPI, File, UploadFile import tempfile import os +from fastapi.openapi.docs import get_swagger_ui_html # Assuming Celery is already set up and imported correctly in the project. from tasks import delete_temp_file # Import your Celery task here. -app = FastAPI() +app = FastAPI( + title="AI TIST API", + description="This is a simple API for AI TIST.", + version="1.0.0", + docs_url="/docs", # Enable Swagger UI +) + +@app.get("/docs") +async def custom_swagger_ui_html(): + return get_swagger_ui_html(openapi_url=app.openapi_url, title=app.title + " - Swagger UI") @app.post("/uploadfile/") async def upload_file(file: UploadFile = File(...)):