Spaces:
Sleeping
Sleeping
fix
Browse files- __pycache__/server.cpython-312.pyc +0 -0
- server.py +39 -1
__pycache__/server.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/server.cpython-312.pyc and b/__pycache__/server.cpython-312.pyc differ
|
|
|
server.py
CHANGED
|
@@ -29,8 +29,46 @@ env = EmailTriageEnv()
|
|
| 29 |
|
| 30 |
@app.get("/health")
|
| 31 |
async def health():
|
| 32 |
-
return {"status": "
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# ✅ FIXED RESET (IMPORTANT)
|
| 36 |
@app.post("/reset")
|
|
|
|
| 29 |
|
| 30 |
@app.get("/health")
|
| 31 |
async def health():
|
| 32 |
+
return {"status": "healthy"}
|
| 33 |
|
| 34 |
+
@app.get("/metadata")
|
| 35 |
+
async def metadata():
|
| 36 |
+
return {
|
| 37 |
+
"name": "OpenEnv Email Triage",
|
| 38 |
+
"description": "AI-powered email triage environment that classifies emails by urgency, category, and action."
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
@app.post("/mcp")
|
| 42 |
+
async def mcp():
|
| 43 |
+
return {
|
| 44 |
+
"jsonrpc": "2.0",
|
| 45 |
+
"result": {
|
| 46 |
+
"message": "MCP endpoint active"
|
| 47 |
+
},
|
| 48 |
+
"id": 1
|
| 49 |
+
}
|
| 50 |
+
@app.get("/schema")
|
| 51 |
+
async def schema():
|
| 52 |
+
return {
|
| 53 |
+
"action": {
|
| 54 |
+
"urgency": [e.value for e in UrgencyLevel],
|
| 55 |
+
"category": [e.value for e in EmailCategory],
|
| 56 |
+
"action": [e.value for e in EmailAction],
|
| 57 |
+
"draft_reply": "string (optional)",
|
| 58 |
+
"forward_to": "string (optional)",
|
| 59 |
+
"reasoning": "string (optional)"
|
| 60 |
+
},
|
| 61 |
+
"observation": {
|
| 62 |
+
"current_email": "object",
|
| 63 |
+
"done": "boolean",
|
| 64 |
+
"info": "object"
|
| 65 |
+
},
|
| 66 |
+
"state": {
|
| 67 |
+
"emails_processed": "int",
|
| 68 |
+
"current_step": "int",
|
| 69 |
+
"task_id": "string"
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
|
| 73 |
# ✅ FIXED RESET (IMPORTANT)
|
| 74 |
@app.post("/reset")
|