Spaces:
Sleeping
Sleeping
Commit ·
45151ca
1
Parent(s): cb330aa
final update
Browse files- README.md +10 -0
- api/app.py +28 -1
- pyproject.toml +31 -0
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# SYNAPSE-X
|
| 2 |
|
| 3 |
**SYNAPSE-X** is a reproducible benchmark for real-world operational decision-making under uncertainty, deadlines, and constrained resources. It models the choices an autonomous assistant or ops agent faces in incident response, escalation handling, and moderation triage — not just "what has highest value," but *what should be done now*, with limited time, imperfect information, and failure spillover across dependent tasks.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: SYNAPSE-X
|
| 3 |
+
emoji: 🧠
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
app_port: 7860
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
# SYNAPSE-X
|
| 12 |
|
| 13 |
**SYNAPSE-X** is a reproducible benchmark for real-world operational decision-making under uncertainty, deadlines, and constrained resources. It models the choices an autonomous assistant or ops agent faces in incident response, escalation handling, and moderation triage — not just "what has highest value," but *what should be done now*, with limited time, imperfect information, and failure spillover across dependent tasks.
|
api/app.py
CHANGED
|
@@ -19,6 +19,7 @@ from typing import Any, Dict, Optional
|
|
| 19 |
|
| 20 |
from fastapi import FastAPI, HTTPException
|
| 21 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 22 |
from pydantic import BaseModel, ValidationError
|
| 23 |
|
| 24 |
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
@@ -44,6 +45,32 @@ app.add_middleware(
|
|
| 44 |
allow_headers=["*"],
|
| 45 |
)
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
_env: Optional[SynapseXEnvironment] = None
|
| 48 |
|
| 49 |
|
|
@@ -175,4 +202,4 @@ def grade_endpoint(req: GradeRequest):
|
|
| 175 |
if __name__ == "__main__":
|
| 176 |
import uvicorn
|
| 177 |
port = int(os.environ.get("PORT", 7860))
|
| 178 |
-
uvicorn.run("api.app:app", host="0.0.0.0", port=port, reload=False)
|
|
|
|
| 19 |
|
| 20 |
from fastapi import FastAPI, HTTPException
|
| 21 |
from fastapi.middleware.cors import CORSMiddleware
|
| 22 |
+
from fastapi.responses import HTMLResponse, RedirectResponse
|
| 23 |
from pydantic import BaseModel, ValidationError
|
| 24 |
|
| 25 |
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
| 45 |
allow_headers=["*"],
|
| 46 |
)
|
| 47 |
|
| 48 |
+
# ---------------------------------------------------------------------------
|
| 49 |
+
# Root — GET / → redirect to interactive docs
|
| 50 |
+
# ---------------------------------------------------------------------------
|
| 51 |
+
@app.get("/", response_class=HTMLResponse, include_in_schema=False)
|
| 52 |
+
def root():
|
| 53 |
+
return HTMLResponse(content="""
|
| 54 |
+
<!DOCTYPE html>
|
| 55 |
+
<html>
|
| 56 |
+
<head>
|
| 57 |
+
<meta charset="utf-8">
|
| 58 |
+
<title>SYNAPSE-X</title>
|
| 59 |
+
<meta http-equiv="refresh" content="0; url=/docs">
|
| 60 |
+
<style>
|
| 61 |
+
body { font-family: sans-serif; background: #0f172a; color: #e2e8f0;
|
| 62 |
+
display: flex; align-items: center; justify-content: center;
|
| 63 |
+
height: 100vh; margin: 0; }
|
| 64 |
+
a { color: #818cf8; }
|
| 65 |
+
</style>
|
| 66 |
+
</head>
|
| 67 |
+
<body>
|
| 68 |
+
<p>Redirecting to <a href="/docs">SYNAPSE-X API docs</a>…</p>
|
| 69 |
+
</body>
|
| 70 |
+
</html>
|
| 71 |
+
""")
|
| 72 |
+
|
| 73 |
+
|
| 74 |
_env: Optional[SynapseXEnvironment] = None
|
| 75 |
|
| 76 |
|
|
|
|
| 202 |
if __name__ == "__main__":
|
| 203 |
import uvicorn
|
| 204 |
port = int(os.environ.get("PORT", 7860))
|
| 205 |
+
uvicorn.run("api.app:app", host="0.0.0.0", port=port, reload=False)
|
pyproject.toml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools>=68", "wheel"]
|
| 3 |
+
build-backend = "setuptools.backends.legacy:build"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "synapse-x"
|
| 7 |
+
version = "1.0.0"
|
| 8 |
+
description = "SYNAPSE-X: Predictive decision intelligence environment — OpenEnv Hackathon"
|
| 9 |
+
readme = "README.md"
|
| 10 |
+
license = { text = "MIT" }
|
| 11 |
+
requires-python = ">=3.10"
|
| 12 |
+
dependencies = [
|
| 13 |
+
"fastapi==0.115.0",
|
| 14 |
+
"uvicorn[standard]==0.30.6",
|
| 15 |
+
"pydantic==2.8.2",
|
| 16 |
+
"openai==1.45.0",
|
| 17 |
+
"httpx==0.27.2",
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
[project.optional-dependencies]
|
| 21 |
+
dev = ["pytest", "httpx"]
|
| 22 |
+
|
| 23 |
+
[project.scripts]
|
| 24 |
+
synapse-x = "app:main"
|
| 25 |
+
|
| 26 |
+
[tool.setuptools.packages.find]
|
| 27 |
+
where = ["."]
|
| 28 |
+
include = ["env*", "agents*", "api*", "scripts*"]
|
| 29 |
+
|
| 30 |
+
[tool.setuptools.package-data]
|
| 31 |
+
"*" = ["*.yaml", "*.json", "*.md"]
|