Spaces:
Sleeping
Sleeping
databoysu commited on
Commit Β·
1dfb089
1
Parent(s): 20ef9ad
TraceFix RL Deployed
Browse filesFiles changed (5)
1 unmodified line234556781 unmodified linetitle: TraceFix-RLemoji: π§βπ»colorFrom: bluecolorTo: cyancolorTo: indigosdk: dockerpinned: falseapp_port: 78604 unmodified lines567889101117 unmodified lines29303132333233343536373839404142434445464748495051525354553 unmodified lines5960616263646566676869707172734 unmodified linesfrom typing import Any, Dict, List, Literal, Optional
from openenv.core.env_server.types import Action, Observationfrom pydantic import BaseModel, Field, model_validatorfrom pydantic import BaseModel, Field, field_validator, model_validator
ActionType = Literal[17 unmodified lines ..., description="One of VIEW_CODE, RUN_TESTS, REPLACE_LINES, UNDO_EDIT, RESET_TO_ORIGINAL, SUBMIT.", ) start_line: Optional[int] = Field(default=None, ge=1) end_line: Optional[int] = Field(default=None, ge=1) start_line: Optional[int] = Field(default=None) end_line: Optional[int] = Field(default=None) new_code_block: Optional[str] = Field(default=None)
@field_validator("start_line", "end_line", mode="before") @classmethod def _coerce_optional_int(cls, value: Any) -> Optional[int]: if value is None: return None if isinstance(value, str): raw = value.strip() if raw == "": return None try: return int(raw) except ValueError: return None if isinstance(value, int): return value return None
@model_validator(mode="after") def validate_replace_fields(self) -> "CodeAction": if self.action_type == "REPLACE_LINES":3 unmodified lines raise ValueError("REPLACE_LINES requires end_line.") if self.new_code_block is None: raise ValueError("REPLACE_LINES requires new_code_block.") if self.start_line < 1 or self.end_line < 1: raise ValueError("REPLACE_LINES requires start_line and end_line >= 1.") if self.start_line > self.end_line: raise ValueError("REPLACE_LINES requires start_line <= end_line.") else: # Ignore extra form fields for non-edit actions (web UI often sends defaults). self.start_line = None self.end_line = None self.new_code_block = None return self
README.md+1-1
__pycache__/models.cpython-312.pyc
models.py+29-3
pre-val.sh
server/__pycache__/app.cpython-312.pyc