CoolFace
Apppublic

hackless123/gmail_sys

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
models.py28 linesDownload Raw Back to app
1from pydantic import BaseModel
2from enum import Enum
3from typing import List, Optional
4
5class ActionType(str, Enum):
6    MARK_PRIORITY = "mark_priority"
7    MARK_SPAM = "mark_spam"
8    AUTO_REPLY = "auto_reply"
9    ARCHIVE = "archive"
10
11class Action(BaseModel):
12    action_type: ActionType
13    email_id: str
14    reply_text: Optional[str] = None
15
16class Email(BaseModel):
17    id: str
18    sender: str
19    subject: str
20    body: str
21    # Making these optional prevents the validation error during observation
22    is_spam_truth: Optional[bool] = None 
23    is_priority_truth: Optional[bool] = None
24
25class Observation(BaseModel):
26    inbox: List[Email]
27    steps_taken: int
28    max_steps: int