/ simple_ai_proxy.py
simple_ai_proxy.py
 1  from fastapi import FastAPI
 2  import uvicorn
 3  import os
 4  
 5  app = FastAPI()
 6  
 7  @app.get("/")
 8  def root():
 9      return {
10          "status": "AI Proxy Working",
11          "port": 8345,
12          "apis_configured": [
13              "Google: " + ("✅" if os.getenv("GOOGLE_API_KEY") else "❌"),
14              "HuggingFace: " + ("✅" if os.getenv("HUGGINGFACE_TOKEN") else "❌"),
15              "Groq: " + ("✅" if os.getenv("GROQ_API_KEY") else "❌")
16          ]
17      }
18  
19  @app.get("/health")
20  def health():
21      return {"healthy": True, "service": "ai_proxy"}
22  
23  @app.get("/test")
24  def test():
25      return {"message": "✅ AI Proxy is running correctly!"}
26  
27  print("🤖 AI Proxy starting on port 8345...")
28  print("✅ Access: http://localhost:8345")
29  print("✅ Health: http://localhost:8345/health")
30  uvicorn.run(app, host="0.0.0.0", port=8345)