File size: 480 Bytes
b1b7d54
 
 
 
 
 
 
 
 
 
 
98dd525
78305aa
98dd525
718899a
78305aa
 
 
b1b7d54
 
 
98dd525
b1b7d54
98dd525
 
78305aa
 
b1b7d54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
    }