swebench-ind / models.py
YUS200619's picture
Upload folder using huggingface_hub
fdce872 verified
"""
Data models for the SWEbench-IN Environment.
Defines the Action and Observation types used by the OpenEnv server
and client for the SWEbench-IN RL environment.
"""
from openenv.core.env_server.types import Action, Observation
from pydantic import Field
from typing import Optional, Dict, Any
class SWEbenchINAction(Action):
"""Action for the SWEbench-IN environment."""
type: str = Field(
...,
description="Action type: run_command, read_file, write_file, run_tests, "
"check_server, reply_slack, reply_email, reply_hr, close_case"
)
args: str = Field(
default="",
description="Action arguments (command, path, content, etc.)"
)
class SWEbenchINObservation(Observation):
"""Observation from the SWEbench-IN environment."""
text: str = Field(default="", description="Observation text from the environment")
reward: Optional[float] = Field(default=None, description="Step reward")
done: bool = Field(default=False, description="Whether the episode is done")
step_count: int = Field(default=0, description="Current step count")
max_steps: int = Field(default=15, description="Maximum steps for this task")
tests_passing_ratio: float = Field(default=0.0, description="Ratio of tests passing")
server_running: bool = Field(default=False, description="Whether the server is running")
reward_breakdown: Dict[str, float] = Field(
default_factory=dict,
description="Breakdown of reward components"
)