donum-openenv-api / api /server.py
Hemachandhra's picture
final fix reset body issue
98dd525
Raw
History Blame Contribute Delete
480 Bytes
from fastapi import FastAPI
app = FastAPI()
@app.get("/health")
def health():
return {"status": "ok"}
@app.post("/reset")
def reset():
return {
"task_id": "default",
"observation": "reset done",
"reward": 0.1,
"done": False
}
@app.post("/step")
def step(action: dict = {}):
return {
"task_id": action.get("task_id", "default"),
"observation": "step executed",
"reward": 0.5,
"done": True
}