Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import requests | |
| # 🌐 Change this to your backend URL: | |
| BACKEND_URL = "http://localhost:8080/reason" # if local | |
| # Or if deployed: "https://<your-backend-url>/reason" | |
| def reason(query): | |
| try: | |
| response = requests.post(BACKEND_URL, json={"query": query}, timeout=60) | |
| response.raise_for_status() | |
| data = response.json() | |
| return data.get("response", "⚠️ No response field in backend reply") | |
| except Exception as e: | |
| return f"⚠️ Error contacting backend: {e}" | |
| iface = gr.Interface( | |
| fn=reason, | |
| inputs=gr.Textbox(label="Enter your research query"), | |
| outputs="text", | |
| title="AEGIS Agentic Reasoner", | |
| description="This interface sends your query to the AEGIS backend for reasoning." | |
| ) | |
| iface.launch() | |