MCPcopy
hub / github.com/PromtEngineer/localGPT / start_server

Function start_server

rag_system/api_server.py:743–753  ·  view source on GitHub ↗

Starts the API server.

(port=8001)

Source from the content-addressed store, hash-verified

741 self.wfile.write(response.encode('utf-8'))
742
743def start_server(port=8001):
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}")
751 print(f"💬 Chat endpoint: http://localhost:{port}/chat")
752 print(f"✨ Indexing endpoint: http://localhost:{port}/index")
753 httpd.serve_forever()
754
755if __name__ == "__main__":
756 # To run this server: python -m rag_system.api_server

Callers 2

run_api_serverFunction · 0.90
api_server.pyFile · 0.85

Calls 1

ReusableTCPServerClass · 0.70

Tested by

no test coverage detected