File size: 527 Bytes
aae1204
 
 
 
17bbb3c
aae1204
17bbb3c
 
 
 
aae1204
 
17bbb3c
50b300c
17bbb3c
aae1204
 
17bbb3c
 
 
 
 
 
 
2ec850e
 
 
50b300c
 
 
 
 
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
29
30
31
32
from fastapi import FastAPI

app = FastAPI()

state = {}

@app.get("/")
def home():
    return {"status": "running"}

@app.post("/reset")
def reset():
    global state
    state = {"email": "Sample email"}
    return state

@app.post("/step")
def step(action: dict):
    return {
        "observation": state,
        "reward": 0.5,
        "done": False,
        "info": {}
    }

def main():
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=7860)

# 🚨 THIS LINE IS THE FIX
if __name__ == "__main__":
    main()