You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor AI rule selection to include rule names and improve instruction formatting. Update response structure to use rule names instead of numbers for better clarity.
constsystem=`You are an AI assistant that helps people manage their emails.
27
25
28
26
<instructions>
29
-
IMPORTANT: Follow these instructions carefully when selecting a rule:
30
-
31
-
<priority>
32
-
1. Match the email to a SPECIFIC user-defined rule that addresses the email's exact content or purpose.
33
-
2. If the email doesn't match any specific rule but the user has a catch-all rule (like "emails that don't match other criteria"), use that catch-all rule.
34
-
3. Only use rule #${specialRuleNumber} (system fallback) if no user-defined rule can reasonably apply.
35
-
</priority>
36
-
37
-
<guidelines>
38
-
- If a rule says to exclude certain types of emails, DO NOT select that rule for those excluded emails.
39
-
- When multiple rules match, choose the more specific one that best matches the email's content.
40
-
- Rules about requiring replies should be prioritized when the email clearly needs a response.
41
-
- Rule #${specialRuleNumber} should ONLY be selected when there is absolutely no user-defined rule that could apply.
42
-
</guidelines>
27
+
IMPORTANT: Follow these instructions carefully when selecting a rule:
28
+
29
+
<priority>
30
+
1. Match the email to a SPECIFIC user-defined rule that addresses the email's exact content or purpose.
31
+
2. If the email doesn't match any specific rule but the user has a catch-all rule (like "emails that don't match other criteria"), use that catch-all rule.
32
+
3. Only use rule system fallback if no user-defined rule can reasonably apply.
33
+
</priority>
34
+
35
+
<guidelines>
36
+
- If a rule says to exclude certain types of emails, DO NOT select that rule for those excluded emails.
37
+
- When multiple rules match, choose the more specific one that best matches the email's content.
38
+
- Rules about requiring replies should be prioritized when the email clearly needs a response.
39
+
- The system fallback rule should ONLY be selected when there is absolutely no user-defined rule that could apply.
0 commit comments