Spaces:
Sleeping
Sleeping
Commit ·
47894fa
1
Parent(s): 5aeebf2
fix: imports and model names
Browse files- app.py +3 -5
- arena_environment.py +1 -1
app.py
CHANGED
|
@@ -1,11 +1,9 @@
|
|
| 1 |
"""DevOps Arena FastAPI server."""
|
| 2 |
-
import sys, os
|
| 3 |
-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
| 4 |
|
| 5 |
from fastapi import FastAPI
|
| 6 |
from pydantic import BaseModel
|
| 7 |
-
from
|
| 8 |
-
from models import
|
| 9 |
|
| 10 |
app = FastAPI(title="DevOps Arena Environment API")
|
| 11 |
env = ArenaEnvironment()
|
|
@@ -24,7 +22,7 @@ def reset():
|
|
| 24 |
|
| 25 |
@app.post("/step")
|
| 26 |
def step(req: StepRequest):
|
| 27 |
-
action =
|
| 28 |
obs = env.step(action)
|
| 29 |
return {"observation": obs.model_dump(), "reward": obs.reward, "done": obs.done}
|
| 30 |
|
|
|
|
| 1 |
"""DevOps Arena FastAPI server."""
|
|
|
|
|
|
|
| 2 |
|
| 3 |
from fastapi import FastAPI
|
| 4 |
from pydantic import BaseModel
|
| 5 |
+
from arena_environment import ArenaEnvironment
|
| 6 |
+
from models import DevAction
|
| 7 |
|
| 8 |
app = FastAPI(title="DevOps Arena Environment API")
|
| 9 |
env = ArenaEnvironment()
|
|
|
|
| 22 |
|
| 23 |
@app.post("/step")
|
| 24 |
def step(req: StepRequest):
|
| 25 |
+
action = DevAction(**req.action)
|
| 26 |
obs = env.step(action)
|
| 27 |
return {"observation": obs.model_dump(), "reward": obs.reward, "done": obs.done}
|
| 28 |
|
arena_environment.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
import os, shutil, subprocess, tempfile, json
|
| 3 |
from models import DevAction, DevObservation, EpisodeState
|
| 4 |
from tasks import TASKS
|
| 5 |
-
from
|
| 6 |
|
| 7 |
class ArenaEnvironment:
|
| 8 |
def __init__(self):
|
|
|
|
| 2 |
import os, shutil, subprocess, tempfile, json
|
| 3 |
from models import DevAction, DevObservation, EpisodeState
|
| 4 |
from tasks import TASKS
|
| 5 |
+
from verifier import verify_episode
|
| 6 |
|
| 7 |
class ArenaEnvironment:
|
| 8 |
def __init__(self):
|