File size: 1,837 Bytes
0b6a889
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""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"