/ ai_proxy_wrapper.py
ai_proxy_wrapper.py
1 from fastapi import FastAPI 2 import uvicorn 3 import subprocess 4 import json 5 6 app = FastAPI() 7 8 @app.get("/") 9 def root(): 10 return {"service": "AI Orchestrator Proxy", "port": 8345} 11 12 @app.get("/orchestrate/{prompt}") 13 def orchestrate(prompt: str): 14 # Run your orchestrator with the prompt 15 result = subprocess.run( 16 ["python3", "ai_orchestrator.py", prompt], 17 capture_output=True, 18 text=True 19 ) 20 return {"prompt": prompt, "output": result.stdout} 21 22 print("🚀 AI Orchestrator Proxy on port 8345") 23 uvicorn.run(app, host="0.0.0.0", port=8345)