Team Ai
Apppublic

openenv/coding_env

sourceHugging Faceupdated 3mo agoView on Hugging Face
21likes
models.py41 linesDownload Raw Back to coding_env
1"""2envs/coding_env/models.py3--------------------------------4Action/Observation types for the Coding environment.5"""6 7from __future__ import annotations8 9from dataclasses import dataclass10from typing import Any, Optional11 12from core.env_server import Action, Observation, State13 14 15@dataclass16class CodeAction(Action):17    """18    Represents a single code execution request.19    """20 21    code: str22    # Optional: future fields like 'lint': bool, 'timeout_s': float, etc.23 24 25@dataclass26class CodeObservation(Observation):27    """28    Result of executing code in the environment.29    """30 31    stdout: str = ""32    stderr: str = ""33    exit_code: int = 034 35 36@dataclass37class CodeState(State):38    """State for CodeAct environment with persistent execution context."""39 40    last_exit_code: int = 041