pragunk commited on
Commit
640c830
·
verified ·
1 Parent(s): 84d3714

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -34
app.py DELETED
@@ -1,34 +0,0 @@
1
- from fastapi import FastAPI
2
- from adaptive_cache.env import AdaptiveCacheEnv, Action
3
- import uvicorn
4
-
5
- app = FastAPI(title="Adaptive Cache Manager OpenEnv")
6
- env = AdaptiveCacheEnv()
7
-
8
- @app.get("/")
9
- def read_root():
10
- return {
11
- "status": "Online",
12
- "environment": "Adaptive Cache Manager",
13
- "openenv_compliant": True
14
- }
15
-
16
- # FIXED: Changed from @app.get to @app.post
17
- @app.post("/reset")
18
- def reset_env():
19
- obs = env.reset()
20
- return {"observation": obs.model_dump()}
21
-
22
- # ADDED: A step endpoint just in case the grader looks for it
23
- @app.post("/step")
24
- def step_env(action: Action):
25
- obs, reward, done, info = env.step(action)
26
- return {
27
- "observation": obs.model_dump(),
28
- "reward": reward,
29
- "done": done,
30
- "info": info
31
- }
32
-
33
- if __name__ == "__main__":
34
- uvicorn.run(app, host="0.0.0.0", port=7860)