-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Why?
The LLM prompt currently performs two distinct tasks in a single request:
- Action Classification: Determine if email needs action (YES/NO)
- Label choice: Select relevant labels from user's labels
=> violates the single responsibility principle
Problems identified :
- Two separate task sections with different instructions
- Action is a boolean, labels are IDs
What?
Refactor LlmMailBackendClassifierListener to treat needs-action as a system label rather than a separate classification task.
The goal is to have a single, generic action in the prompt that reads the provided labels (both system and user labels) and then performs the classification.
Before:
OUTPUT: YES,labelA,labelB
After:
OUTPUT: Needs-action,labelA,labelB
How?
- Update LlmOutput parsing logic:
Keep onlyList<String>labels: Parse output as comma-separated label IDs only - Change flags' setting logic: No special handling for "action" field
- Update userPrompt in
build_user_prompt()to include the system labels in addition to user context labels - Simplify system prompt: Single task: "Select relevant labels"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels