File size: 1,045 Bytes
4b77608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from pydantic import BaseModel, Field
from typing import Dict, Any, Optional

class Email(BaseModel):
    id: str
    sender: str
    subject: str
    body: str
    is_urgent: bool = False
    is_spam: bool = False
    is_internal: bool = False

class Observation(BaseModel):
    emails_remaining: int
    current_email: Optional[Email] = Field(None, description="The current email to triage, or None if inbox is empty")
    time_elapsed: float = Field(0.0, description="Time elapsed in the episode")

class Action(BaseModel):
    action_type: int = Field(..., description="0: Ignore, 1: Reply, 2: Forward, 3: Archive, 4: Delete")

class Reward(BaseModel):
    step_reward: float = Field(..., description="Reward for the current step")
    total_reward: float = Field(..., description="Total accumulated reward")
    message: str = Field("", description="Reasoning or description for the reward given")

class EnvState(BaseModel):
    observation: Observation
    reward: Reward
    terminated: bool
    truncated: bool
    info: Dict[str, Any]