Spaces:
Sleeping
Sleeping
Commit ·
347bcc3
1
Parent(s): bbd9ae1
debugged the task validation error
Browse files
app/__pycache__/grader.cpython-313.pyc
CHANGED
|
Binary files a/app/__pycache__/grader.cpython-313.pyc and b/app/__pycache__/grader.cpython-313.pyc differ
|
|
|
app/__pycache__/main.cpython-313.pyc
CHANGED
|
Binary files a/app/__pycache__/main.cpython-313.pyc and b/app/__pycache__/main.cpython-313.pyc differ
|
|
|
app/main.py
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, HTTPException
|
|
|
|
| 2 |
|
| 3 |
from app.env import AICodeReviewEnvironment
|
| 4 |
-
from app.models import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
app = FastAPI(
|
| 7 |
title="Synapse Code Auditor",
|
|
@@ -17,6 +29,47 @@ def health() -> dict[str, str]:
|
|
| 17 |
return {"status": "healthy", "service": "synapse-code-auditor"}
|
| 18 |
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
@app.post("/reset", response_model=ResetResponse)
|
| 21 |
def reset(request: ResetRequest | None = None) -> ResetResponse:
|
| 22 |
request = request or ResetRequest()
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
|
| 3 |
from fastapi import FastAPI, HTTPException
|
| 4 |
+
from fastapi.responses import PlainTextResponse
|
| 5 |
|
| 6 |
from app.env import AICodeReviewEnvironment
|
| 7 |
+
from app.models import (
|
| 8 |
+
Action,
|
| 9 |
+
EnvState,
|
| 10 |
+
Observation,
|
| 11 |
+
ResetRequest,
|
| 12 |
+
ResetResponse,
|
| 13 |
+
StateResponse,
|
| 14 |
+
StepRequest,
|
| 15 |
+
StepResult,
|
| 16 |
+
)
|
| 17 |
|
| 18 |
app = FastAPI(
|
| 19 |
title="Synapse Code Auditor",
|
|
|
|
| 29 |
return {"status": "healthy", "service": "synapse-code-auditor"}
|
| 30 |
|
| 31 |
|
| 32 |
+
@app.get("/")
|
| 33 |
+
def root() -> dict[str, str]:
|
| 34 |
+
return {"name": app.title, "status": "ready", "docs": "/docs"}
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
@app.get("/robots.txt", include_in_schema=False)
|
| 38 |
+
def robots() -> PlainTextResponse:
|
| 39 |
+
return PlainTextResponse("User-agent: *\nDisallow:\n")
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
@app.get("/metadata")
|
| 43 |
+
def metadata() -> dict[str, Any]:
|
| 44 |
+
return {
|
| 45 |
+
"name": app.title,
|
| 46 |
+
"description": app.description,
|
| 47 |
+
"version": app.version,
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
@app.get("/schema")
|
| 52 |
+
def schema() -> dict[str, Any]:
|
| 53 |
+
return {
|
| 54 |
+
"action": Action.model_json_schema(),
|
| 55 |
+
"observation": Observation.model_json_schema(),
|
| 56 |
+
"state": EnvState.model_json_schema(),
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@app.post("/mcp")
|
| 61 |
+
def mcp(payload: dict[str, Any] | None = None) -> dict[str, Any]:
|
| 62 |
+
return {
|
| 63 |
+
"jsonrpc": "2.0",
|
| 64 |
+
"result": {
|
| 65 |
+
"ok": True,
|
| 66 |
+
"message": "OpenEnv-compatible MCP endpoint is available.",
|
| 67 |
+
"payload": payload or {},
|
| 68 |
+
},
|
| 69 |
+
"id": None,
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
|
| 73 |
@app.post("/reset", response_model=ResetResponse)
|
| 74 |
def reset(request: ResetRequest | None = None) -> ResetResponse:
|
| 75 |
request = request or ResetRequest()
|