Update server.py
Browse files
server.py
CHANGED
|
@@ -1,13 +1,28 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
-
|
| 6 |
@app.post("/reset")
|
| 7 |
async def reset():
|
| 8 |
return {"status": "ok"}
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
return {"message": "email triage Rl environment is running"}
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
import gradio as gr
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
+
# --- API endpoints (required) ---
|
| 7 |
@app.post("/reset")
|
| 8 |
async def reset():
|
| 9 |
return {"status": "ok"}
|
| 10 |
|
| 11 |
+
@app.get("/status")
|
| 12 |
+
async def status():
|
| 13 |
+
return {"status": "online"}
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
# --- Gradio UI ---
|
| 17 |
+
def demo_fn(task):
|
| 18 |
+
return f"Running task: {task} (UI restored 🚀)"
|
| 19 |
+
|
| 20 |
+
demo = gr.Interface(
|
| 21 |
+
fn=demo_fn,
|
| 22 |
+
inputs=gr.Dropdown(["easy", "medium", "hard"]),
|
| 23 |
+
outputs="text",
|
| 24 |
+
title="Email Gatekeeper"
|
| 25 |
+
)
|
| 26 |
|
| 27 |
+
# ✅ Mount UI at root
|
| 28 |
+
app = gr.mount_gradio_app(app, demo, path="/")
|
|
|