File size: 764 Bytes
1b64cba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from app.actions import Action


class BaselinePolicy:
    def act(self, observation):
        if not observation.emails:
            return None

        email = observation.emails[0]
        text = (email.subject + " " + email.body).lower()

        # Heuristic rules
        if "meet" in text:
            return Action(
                type="classify",
                target_id=email.id,
                payload={"label": "meeting_request"}
            )

        elif "report" in text or "update" in text:
            return Action(
                type="classify",
                target_id=email.id,
                payload={"label": "task_request"}
            )

        return Action(
            type="archive",
            target_id=email.id
        )