Spaces:
Sleeping
Sleeping
Commit ·
546dac1
1
Parent(s): 33dbeed
Update models.py (#14)
Browse files- Update models.py (abda8799ab189bfc10663219a2c24ccfa6a9b6b3)
Co-authored-by: tarun saroya <Tarun-sar0ya@users.noreply.huggingface.co>
models.py
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Models for the API Triage Agent environment.
|
| 2 |
+
|
| 3 |
+
Defines the Action, Observation, and State data structures
|
| 4 |
+
used by the OpenEnv client-server interface.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from pydantic import BaseModel
|
| 8 |
+
from typing import List
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class Action(BaseModel):
|
| 12 |
+
"""An action that the agent can take in the environment."""
|
| 13 |
+
action_name: str
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class Observation(BaseModel):
|
| 17 |
+
"""What the agent observes at each step."""
|
| 18 |
+
step: int
|
| 19 |
+
max_steps: int
|
| 20 |
+
incident_summary: str
|
| 21 |
+
logs: List[str]
|
| 22 |
+
response_code: int
|
| 23 |
+
fix_applied: bool
|
| 24 |
+
is_resolved: bool
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class State(BaseModel):
|
| 28 |
+
"""Internal episode state tracking."""
|
| 29 |
+
episode_id: str = ""
|
| 30 |
+
step_count: int = 0
|
| 31 |
+
is_done: bool = False
|