Spaces:
Sleeping
Sleeping
File size: 1,816 Bytes
9682da5 | 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # models.py β Typed models for PipelineEnv
from openenv.core.env_server import Action, Observation, State
from pydantic import BaseModel, Field
from typing import List, Optional
from enum import Enum
# βββ ACTION ββββββββββββββββββββββββββββββββββββββββββ
class RepairAction(str, Enum):
fix_test = "fix_test"
set_env_var = "set_env_var"
fix_docker_config = "fix_docker_config"
fix_yaml_config = "fix_yaml_config"
retry_stage = "retry_stage"
rollback_commit = "rollback_commit"
add_dependency = "add_dependency"
no_op = "no_op"
class PipelineAction(Action):
action: RepairAction
target: Optional[str] = Field(None, description="Stage or component to act on")
value: Optional[str] = Field(None, description="Value for set_env_var or add_dependency")
# βββ OBSERVATION βββββββββββββββββββββββββββββββββββββ
class PipelineStage(BaseModel):
name: str
status: str
error: Optional[str] = None
runtime: float = 0.0
class PipelineObservation(Observation):
pipeline_name: str
stages: List[dict]
failing_count: int
health_score: float
error_messages: List[str]
available_actions: List[str]
task_description: str
step_number: int
max_steps: int
# βββ STATE βββββββββββββββββββββββββββββββββββββββββββ
class PipelineState(State):
task_id: str
episode_id: str
step_count: int
health_score: float
scenario_name: str
is_done: bool |