| 744 | """Starts the API server.""" |
| 745 | # Use a reusable TCP server to avoid "address in use" errors on restart |
| 746 | class ReusableTCPServer(socketserver.TCPServer): |
| 747 | allow_reuse_address = True |
| 748 | |
| 749 | with ReusableTCPServer(("", port), AdvancedRagApiHandler) as httpd: |
| 750 | print(f"🚀 Starting Advanced RAG API server on port {port}") |