coderbug/micro_swe_gym
0
1"""2Micro-SWE Gym — Pydantic data models.3Compliant with OpenEnv spec v1.4"""5from typing import Literal6from pydantic import BaseModel, Field7 8 9class MicroSweGymAction(BaseModel):10 """Action submitted by the agent: a string containing the fixed Python code."""11 12 fixed_code: str = Field(13 default="", # Changed from ... to avoid null/zero errors14 description="The complete, corrected Python source code proposed by the agent.",15 )16 17 18class MicroSweGymObservation(BaseModel):19 """Observation returned by the environment after reset or step."""20 21 broken_code: str = Field(22 default="# No code provided", # Changed from ...23 description="The broken Python function the agent must repair.",24 )25 error_message: str = Field(26 default="",27 description="Compiler / runtime error from the last step, empty on reset.",28 )29 difficulty: Literal["easy", "medium", "hard"] = Field(30 default="easy", # Changed from ...31 description="Difficulty tier of the current task.",32 )33 task_id: int = Field(34 default=0, # Changed from ...35 description="Index of the active task (0, 1, or 2).",36 )