File size: 1,059 Bytes
dab441f | 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 31 32 33 34 35 36 37 38 39 40 41 42 | """Task definitions shared by the Supermail environment."""
from __future__ import annotations
from dataclasses import dataclass, field
BENCHMARK_NAME = "supermail"
PRIORITY_OPTIONS = ("urgent", "normal", "spam")
CATEGORY_OPTIONS = ("billing", "delivery", "technical", "general")
ACTION_OPTIONS = ("respond_immediately", "assign_to_team", "ignore")
FIELD_OPTIONS = {
"priority": list(PRIORITY_OPTIONS),
"category": list(CATEGORY_OPTIONS),
"action": list(ACTION_OPTIONS),
}
@dataclass(frozen=True)
class TaskDefinition:
"""Single deterministic support triage task."""
task_id: str
difficulty: str
objective: str
email: str
context: dict[str, str]
expected: dict[str, str]
field_weights: dict[str, float]
max_attempts: int = 4
benchmark: str = BENCHMARK_NAME
guidance: str = field(
default=(
"Read the email and submit only the labels required for this task."
)
)
@property
def required_fields(self) -> list[str]:
return list(self.expected.keys())
|