Spaces:
Sleeping
Sleeping
Upload models.py with huggingface_hub
Browse files
models.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Pydantic v2 models for the Scheduling Optimisation Environment."""
|
| 2 |
+
|
| 3 |
+
from pydantic import BaseModel, Field
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class Observation(BaseModel):
|
| 7 |
+
"""What the agent sees at each step."""
|
| 8 |
+
|
| 9 |
+
schedule_instance: str = Field(
|
| 10 |
+
description="JSON-encoded scheduling problem instance to evaluate"
|
| 11 |
+
)
|
| 12 |
+
task_id: str = Field(description="Current task identifier")
|
| 13 |
+
context: str = Field(description="Instructions or hints for the current step")
|
| 14 |
+
step_number: int = Field(ge=0, description="Current step in the episode")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class Action(BaseModel):
|
| 18 |
+
"""What the agent submits as a response."""
|
| 19 |
+
|
| 20 |
+
response: str = Field(
|
| 21 |
+
description=(
|
| 22 |
+
"Agent's answer: 'feasible'/'infeasible', a violation category, "
|
| 23 |
+
"or a JSON repair schedule"
|
| 24 |
+
)
|
| 25 |
+
)
|
| 26 |
+
task_id: str = Field(description="Task identifier this action is for")
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class Reward(BaseModel):
|
| 30 |
+
"""Grading result returned to the agent."""
|
| 31 |
+
|
| 32 |
+
score: float = Field(ge=0.0, le=1.0, description="Reward score in [0.0, 1.0]")
|
| 33 |
+
feedback: str = Field(default="", description="Human-readable grading feedback")
|