ItsMe1501/MetaHackathon
0
1from openenv.core.env_server.types import Action, Observation2from pydantic import BaseModel, Field3from typing import List, Optional, Literal4 5class Email(BaseModel):6 id: str7 sender: str8 subject: str9 body: str10 11class EmailSummary(BaseModel):12 id: str13 sender: str14 subject: str15 status: Literal['inbox', 'archived', 'deleted', 'flagged', 'replied', 'forwarded']16 17class EmailTriageAction(Action):18 """Action for the Email Triage environment."""19 command: Literal['read', 'reply', 'forward', 'archive', 'delete', 'flag', 'done'] = Field(20 ..., description="Action to perform: read, reply, forward, archive, delete, flag, or done."21 )22 email_id: Optional[str] = Field(None, description="ID of the email to act upon. Required except for 'done'.")23 target: Optional[str] = Field(None, description="Target email address for 'forward', or content for 'reply'.")24 25class EmailTriageObservation(Observation):26 """Observation from the Email Triage environment."""27 inbox_summary: List[EmailSummary] = Field(..., description="Summary of all emails in the current task")28 current_email: Optional[Email] = Field(None, description="Detailed view of the read email, if 'read' was called")29 feedback: str = Field(..., description="Result or feedback of the last action")30 