Spaces:
Sleeping
Sleeping
PROTHAM commited on
Commit ·
54c7f90
1
Parent(s): a0037f9
fix: Dockerfile to root, port 7860, README frontmatter
Browse files- Dockerfile +22 -0
- README.md +3 -15
- __pycache__/__init__.cpython-312.pyc +0 -0
- __pycache__/client.cpython-312.pyc +0 -0
- __pycache__/models.cpython-312.pyc +0 -0
- api_debug_env.egg-info/PKG-INFO +0 -15
- api_debug_env.egg-info/SOURCES.txt +0 -17
- api_debug_env.egg-info/dependency_links.txt +0 -1
- api_debug_env.egg-info/requires.txt +0 -11
- api_debug_env.egg-info/top_level.txt +0 -3
- graders/__pycache__/__init__.cpython-312.pyc +0 -0
- graders/__pycache__/grader.cpython-312.pyc +0 -0
- reset.json +0 -1
- server/__pycache__/__init__.cpython-312.pyc +0 -0
- server/__pycache__/api_debug_environment.cpython-312.pyc +0 -0
- server/__pycache__/app.cpython-312.pyc +0 -0
- server/__pycache__/mock_api.cpython-312.pyc +0 -0
- server/api_debug_environment.py +1 -1
- step.json +0 -1
- tasks/__pycache__/__init__.cpython-312.pyc +0 -0
- tasks/__pycache__/easy.cpython-312.pyc +0 -0
- tasks/__pycache__/hard.cpython-312.pyc +0 -0
- tasks/__pycache__/medium.cpython-312.pyc +0 -0
- tasks/__pycache__/registry.cpython-312.pyc +0 -0
- test_imports.py +0 -13
- test_server.py +0 -20
- uv.lock +0 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
RUN useradd -m -u 1000 envuser
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
RUN apt-get update && apt-get install -y gcc curl && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
COPY server/requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
+
|
| 11 |
+
COPY . .
|
| 12 |
+
RUN pip install --no-cache-dir -e .
|
| 13 |
+
|
| 14 |
+
ENV PYTHONPATH=/app
|
| 15 |
+
|
| 16 |
+
USER envuser
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
|
| 19 |
+
HEALTHCHECK --interval=20s --timeout=8s --start-period=40s --retries=3 \
|
| 20 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 21 |
+
|
| 22 |
+
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|
README.md
CHANGED
|
@@ -1,24 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
title: API Debug Env
|
| 4 |
-
|
| 5 |
emoji: 🔧
|
| 6 |
-
|
| 7 |
colorFrom: blue
|
| 8 |
-
|
| 9 |
colorTo: green
|
| 10 |
-
|
| 11 |
sdk: docker
|
| 12 |
-
|
| 13 |
pinned: false
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
\# API Debug Environment
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
An OpenEnv environment where AI agents learn to debug broken HTTP API requests.
|
| 24 |
-
|
|
|
|
| 1 |
+
---
|
|
|
|
| 2 |
title: API Debug Env
|
|
|
|
| 3 |
emoji: 🔧
|
|
|
|
| 4 |
colorFrom: blue
|
|
|
|
| 5 |
colorTo: green
|
|
|
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
+
---
|
| 9 |
|
| 10 |
+
# API Debug Environment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
An OpenEnv environment where AI agents learn to debug broken HTTP API requests.
|
|
|
__pycache__/__init__.cpython-312.pyc
DELETED
|
Binary file (317 Bytes)
|
|
|
__pycache__/client.cpython-312.pyc
DELETED
|
Binary file (851 Bytes)
|
|
|
__pycache__/models.cpython-312.pyc
DELETED
|
Binary file (2.35 kB)
|
|
|
api_debug_env.egg-info/PKG-INFO
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
Metadata-Version: 2.4
|
| 2 |
-
Name: api-debug-env
|
| 3 |
-
Version: 1.0.0
|
| 4 |
-
Summary: OpenEnv environment for AI-powered HTTP API debugging
|
| 5 |
-
Requires-Python: >=3.10
|
| 6 |
-
Requires-Dist: openenv-core>=0.2.3
|
| 7 |
-
Requires-Dist: fastapi>=0.104.0
|
| 8 |
-
Requires-Dist: uvicorn>=0.24.0
|
| 9 |
-
Requires-Dist: pydantic>=2.0.0
|
| 10 |
-
Requires-Dist: httpx>=0.27.0
|
| 11 |
-
Requires-Dist: python-dotenv>=1.0.0
|
| 12 |
-
Requires-Dist: openai>=1.0.0
|
| 13 |
-
Provides-Extra: dev
|
| 14 |
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
| 15 |
-
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api_debug_env.egg-info/SOURCES.txt
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
pyproject.toml
|
| 2 |
-
api_debug_env.egg-info/PKG-INFO
|
| 3 |
-
api_debug_env.egg-info/SOURCES.txt
|
| 4 |
-
api_debug_env.egg-info/dependency_links.txt
|
| 5 |
-
api_debug_env.egg-info/requires.txt
|
| 6 |
-
api_debug_env.egg-info/top_level.txt
|
| 7 |
-
graders/__init__.py
|
| 8 |
-
graders/grader.py
|
| 9 |
-
server/__init__.py
|
| 10 |
-
server/api_debug_environment.py
|
| 11 |
-
server/app.py
|
| 12 |
-
server/mock_api.py
|
| 13 |
-
tasks/__init__.py
|
| 14 |
-
tasks/easy.py
|
| 15 |
-
tasks/hard.py
|
| 16 |
-
tasks/medium.py
|
| 17 |
-
tasks/registry.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api_debug_env.egg-info/dependency_links.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
|
|
|
|
|
|
api_debug_env.egg-info/requires.txt
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
openenv-core>=0.2.3
|
| 2 |
-
fastapi>=0.104.0
|
| 3 |
-
uvicorn>=0.24.0
|
| 4 |
-
pydantic>=2.0.0
|
| 5 |
-
httpx>=0.27.0
|
| 6 |
-
python-dotenv>=1.0.0
|
| 7 |
-
openai>=1.0.0
|
| 8 |
-
|
| 9 |
-
[dev]
|
| 10 |
-
pytest>=7.0
|
| 11 |
-
pytest-asyncio>=0.21
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api_debug_env.egg-info/top_level.txt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
graders
|
| 2 |
-
server
|
| 3 |
-
tasks
|
|
|
|
|
|
|
|
|
|
|
|
graders/__pycache__/__init__.cpython-312.pyc
DELETED
|
Binary file (148 Bytes)
|
|
|
graders/__pycache__/grader.cpython-312.pyc
DELETED
|
Binary file (2.97 kB)
|
|
|
reset.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"task_id": "easy"}
|
|
|
|
|
|
server/__pycache__/__init__.cpython-312.pyc
DELETED
|
Binary file (147 Bytes)
|
|
|
server/__pycache__/api_debug_environment.cpython-312.pyc
DELETED
|
Binary file (4.62 kB)
|
|
|
server/__pycache__/app.cpython-312.pyc
DELETED
|
Binary file (834 Bytes)
|
|
|
server/__pycache__/mock_api.cpython-312.pyc
DELETED
|
Binary file (7.12 kB)
|
|
|
server/api_debug_environment.py
CHANGED
|
@@ -11,7 +11,7 @@ from tasks.registry import TASK_REGISTRY
|
|
| 11 |
from graders.grader import APIGrader
|
| 12 |
|
| 13 |
GRADER = APIGrader()
|
| 14 |
-
MOCK_BASE = "http://localhost:
|
| 15 |
|
| 16 |
|
| 17 |
class APIDebugEnvironment(Environment):
|
|
|
|
| 11 |
from graders.grader import APIGrader
|
| 12 |
|
| 13 |
GRADER = APIGrader()
|
| 14 |
+
MOCK_BASE = "http://localhost:7860"
|
| 15 |
|
| 16 |
|
| 17 |
class APIDebugEnvironment(Environment):
|
step.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"action": {"method":"GET","url":"/mock_api/users","headers":{"Authorization":"Bearer demo_token_123"},"body":null,"query_params":{}}}
|
|
|
|
|
|
tasks/__pycache__/__init__.cpython-312.pyc
DELETED
|
Binary file (146 Bytes)
|
|
|
tasks/__pycache__/easy.cpython-312.pyc
DELETED
|
Binary file (1.17 kB)
|
|
|
tasks/__pycache__/hard.cpython-312.pyc
DELETED
|
Binary file (1.31 kB)
|
|
|
tasks/__pycache__/medium.cpython-312.pyc
DELETED
|
Binary file (1.24 kB)
|
|
|
tasks/__pycache__/registry.cpython-312.pyc
DELETED
|
Binary file (357 Bytes)
|
|
|
test_imports.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
try:
|
| 2 |
-
from models import APIAction, APIObservation, APIState
|
| 3 |
-
print('models OK')
|
| 4 |
-
from client import APIDebugEnv
|
| 5 |
-
print('client OK')
|
| 6 |
-
from tasks.registry import TASK_REGISTRY
|
| 7 |
-
print('tasks OK')
|
| 8 |
-
from graders.grader import APIGrader
|
| 9 |
-
print('grader OK')
|
| 10 |
-
print('ALL IMPORTS PASS')
|
| 11 |
-
except Exception as e:
|
| 12 |
-
import traceback
|
| 13 |
-
traceback.print_exc()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_server.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
| 1 |
-
from fastapi.testclient import TestClient
|
| 2 |
-
from server.app import app
|
| 3 |
-
|
| 4 |
-
client = TestClient(app)
|
| 5 |
-
|
| 6 |
-
def test_health():
|
| 7 |
-
response = client.get("/health")
|
| 8 |
-
assert response.status_code == 200
|
| 9 |
-
print("health OK")
|
| 10 |
-
|
| 11 |
-
def test_reset():
|
| 12 |
-
response = client.post("/reset", json={"task_id": "easy"})
|
| 13 |
-
assert response.status_code == 200
|
| 14 |
-
assert "task_description" in response.json()
|
| 15 |
-
print("easy reset OK")
|
| 16 |
-
|
| 17 |
-
if __name__ == "__main__":
|
| 18 |
-
test_health()
|
| 19 |
-
test_reset()
|
| 20 |
-
print("All tests passed.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uv.lock
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|