File size: 1,124 Bytes
a356502
f920a21
 
 
 
a356502
4be2000
a356502
46c2649
a356502
46c2649
f920a21
46c2649
f920a21
46c2649
f920a21
46c2649
f920a21
 
46c2649
 
 
 
 
f920a21
 
46c2649
f920a21
46c2649
f920a21
46c2649
 
 
 
f920a21
46c2649
f920a21
 
46c2649
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f920a21
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: OpenEnv - coding_env
emoji: 🤖
colorFrom: blue
colorTo: yellow
sdk: docker
app_port: 8000
---
# CodingEnv HTTP Server

This directory contains the HTTP server implementation for the CodingEnvironment.

## Running Locally

### Prerequisites
```bash
pip install fastapi uvicorn
```

### Start the server
```bash
# From the project root (/Users/pankit/git/envtorch)
cd src
uvicorn envs.coding_env.server.app:app --reload --host 0.0.0.0 --port 8000
```

The server will be available at `http://localhost:8000`

### API Endpoints

- `POST /reset` - Reset the environment
- `POST /step` - Execute a code action
- `GET /state` - Get current environment state
- `GET /health` - Health check

### Test with curl

```bash
# Health check
curl http://localhost:8000/health

# Reset
curl -X POST http://localhost:8000/reset \
  -H "Content-Type: application/json" \
  -d '{}'

# Execute code
curl -X POST http://localhost:8000/step \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "code": "print(\"Hello from HTTP!\")"
    },
    "timeout_s": 15
  }'

# Get state
curl http://localhost:8000/state
```