iitian commited on
Commit
26a0544
Β·
1 Parent(s): b23936a

fix: structural changes for OpenEnv multi-mode deployment

Browse files
Files changed (3) hide show
  1. pyproject.toml +32 -0
  2. server/app.py +7 -3
  3. uv.lock +0 -0
pyproject.toml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cloud-security-auditor"
7
+ version = "0.1.0"
8
+ description = "A real-world cloud security audit environment for AI agents."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ dependencies = [
12
+ "openenv-core>=0.1.1",
13
+ "fastapi",
14
+ "uvicorn",
15
+ "pydantic",
16
+ "python-multipart",
17
+ "openai",
18
+ "requests"
19
+ ]
20
+
21
+ [project.optional-dependencies]
22
+ dev = [
23
+ "pytest",
24
+ "black",
25
+ "isort"
26
+ ]
27
+
28
+ [project.scripts]
29
+ server = "server.app:main"
30
+
31
+ [tool.setuptools]
32
+ packages = ["server"]
server/app.py CHANGED
@@ -11,7 +11,8 @@ import os
11
  env = CloudAuditEnv()
12
 
13
  # Create the FastAPI app using openenv-core
14
- app = create_fastapi_app(env, CloudAction, CloudObservation)
 
15
 
16
  # ── Override /reset to properly pass task_id ────────────────────────────────
17
  # openenv-core's built-in /reset handler ignores request body fields (known TODO).
@@ -37,6 +38,9 @@ async def read_index():
37
  async def get_state():
38
  return env.state()
39
 
40
- if __name__ == "__main__":
41
  import uvicorn
42
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
 
 
 
11
  env = CloudAuditEnv()
12
 
13
  # Create the FastAPI app using openenv-core
14
+ # Wrap env in a lambda to satisfy HF's "must be a callable" requirement
15
+ app = create_fastapi_app(lambda: env, CloudAction, CloudObservation)
16
 
17
  # ── Override /reset to properly pass task_id ────────────────────────────────
18
  # openenv-core's built-in /reset handler ignores request body fields (known TODO).
 
38
  async def get_state():
39
  return env.state()
40
 
41
+ def main():
42
  import uvicorn
43
+ uvicorn.run("server.app:app", host="0.0.0.0", port=7860, reload=True)
44
+
45
+ if __name__ == "__main__":
46
+ main()
uv.lock ADDED
The diff for this file is too large to render. See raw diff