diff --git a/src/postman/AI_Lab_API.postman_collection.json b/postman/AI_Lab_API.postman_collection.json similarity index 100% rename from src/postman/AI_Lab_API.postman_collection.json rename to postman/AI_Lab_API.postman_collection.json diff --git a/src/postman/AI_Lab_API.postman_environment.json b/postman/AI_Lab_API.postman_environment.json similarity index 100% rename from src/postman/AI_Lab_API.postman_environment.json rename to postman/AI_Lab_API.postman_environment.json diff --git a/serve_ui.py b/serve_ui.py deleted file mode 100644 index 31ea966..0000000 --- a/serve_ui.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -""" -Simple HTTP server to serve the UI files -""" -import http.server -import socketserver -import os -import webbrowser -from pathlib import Path - -# Change to the ui directory -ui_dir = Path(__file__).parent / "ui" -os.chdir(ui_dir) - -PORT = 3000 - -class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): - def end_headers(self): - self.send_header('Access-Control-Allow-Origin', '*') - self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') - self.send_header('Access-Control-Allow-Headers', 'Content-Type') - super().end_headers() - -if __name__ == "__main__": - with socketserver.TCPServer(("", PORT), MyHTTPRequestHandler) as httpd: - print(f"🌐 Serving UI at http://localhost:{PORT}") - print(f"📁 Serving files from: {ui_dir.absolute()}") - print("💡 Make sure the API server is running on http://localhost:8000") - print("🔄 Press Ctrl+C to stop") - - # Try to open browser - try: - webbrowser.open(f"http://localhost:{PORT}") - except: - pass - - httpd.serve_forever() \ No newline at end of file diff --git a/src/api/app.py b/src/api/app.py index 5f1c8ab..69a134e 100644 --- a/src/api/app.py +++ b/src/api/app.py @@ -56,7 +56,16 @@ app = FastAPI( title="AI Lab API", description="API for various AI/ML pipelines using transformers", version="1.0.0", - lifespan=lifespan + lifespan=lifespan, + swagger_ui_parameters={ + "defaultModelsExpandDepth": -1, + "syntaxHighlight.theme": "obsidian", + "tryItOutEnabled": True, + "requestSnippetsEnabled": True, + "persistAuthorization": True, + "displayRequestDuration": True, + "defaultModelRendering": "model" + } ) # Add CORS middleware