File size: 781 Bytes
d51679d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from pydantic import BaseModel, Field
from typing import Optional, Dict, List, Literal

class Action(BaseModel):
    tool: Literal["READ_FILE", "WRITE_FILE", "RUN_LINTER", "RUN_TESTS", "SUBMIT"] = Field(
        ..., description="The tool to use."
    )
    filepath: Optional[str] = Field(None, description="The file to read or write.")
    content: Optional[str] = Field(None, description="The full resolved content to save (if WRITE_FILE).")

class Observation(BaseModel):
    current_status: str
    tool_output: str
    files_with_markers: List[str]
    available_files: List[str]

class Reward(BaseModel):
    score: float = Field(..., ge=0.0, le=1.0)
    feedback: str

class State(BaseModel):
    task_id: str
    files: Dict[str, str]
    step_count: int
    is_done: bool