Spaces:
Sleeping
Sleeping
| """Typed Pydantic models for the FinePrint OpenEnv environment.""" | |
| from pydantic import BaseModel, Field | |
| from typing import Optional, Dict, Any, List | |
| class Action(BaseModel): | |
| """Agent action for the FinePrint policy compliance environment.""" | |
| command: str = Field( | |
| ..., | |
| description=( | |
| "Command to execute. One of: view_policies, view_workflow, " | |
| "check_compliance, request_verification, quote_policy, " | |
| "respond_to_user, take_action, escalate, abort_workflow, " | |
| "clarify, submit" | |
| ), | |
| ) | |
| args: Dict[str, Any] = Field(default_factory=dict, description="Command arguments") | |
| metadata: Dict[str, Any] = Field(default_factory=dict) | |
| class Observation(BaseModel): | |
| """Environment observation returned to the agent after each step.""" | |
| output: str = Field(default="", description="Command output or feedback text") | |
| task_description: str = Field(default="", description="Current task description") | |
| workflow_names: List[str] = Field(default_factory=list, description="Available workflow names") | |
| available_commands: List[str] = Field( | |
| default_factory=lambda: [ | |
| "view_policies", "view_workflow", "check_compliance", | |
| "request_verification", "quote_policy", "respond_to_user", | |
| "take_action", "escalate", "abort_workflow", "clarify", "submit", | |
| ], | |
| ) | |
| done: bool = False | |
| reward: Optional[float] = None | |
| metadata: Dict[str, Any] = Field(default_factory=dict) | |
| class State(BaseModel): | |
| """Episode state tracking.""" | |
| episode_id: Optional[str] = None | |
| step_count: int = Field(default=0, ge=0) | |
| task_id: str = "" | |
| max_steps: int = 30 | |
| current_workflow: str = "" | |
| active_version: str = "" | |
| agent_version: str = "" | |
| class Config: | |
| extra = "allow" | |