File size: 860 Bytes
71a1c53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""

Code Debug Environment Models

------------------------------

Action, Observation, and State types for the Code Debug environment.

"""

from __future__ import annotations

from openenv.core.env_server.interfaces import Action, Observation, State


class DebugAction(Action):
    """Agent submits corrected Python code."""

    code: str


class DebugObservation(Observation):
    """Result of grading the agent's code against the test suite."""

    task_name: str = ""
    buggy_code: str = ""
    task_description: str = ""
    current_code: str = ""
    test_results: str = ""
    tests_passed: int = 0
    tests_total: int = 0
    stderr: str = ""


class DebugState(State):
    """Tracks episode progress for the debugging task."""

    current_task: str = ""
    best_tests_passed: int = 0
    tests_total: int = 0