raunakratan/priority-mind-lite
0
1from __future__ import annotations2 3from typing import Any, Literal, Optional4 5from pydantic import BaseModel, ConfigDict, Field6 7 8class Observation(BaseModel):9 """Environment observation returned to the acting agent."""10 11 model_config = ConfigDict(extra="forbid")12 13 ticket_text: str = Field(..., description="Customer message content")14 sentiment: float = Field(..., ge=-1.0, le=1.0, description="Customer sentiment from -1 to 1")15 category: Optional[Literal["billing", "technical", "general", "complaint"]] = None16 priority: Optional[Literal["low", "medium", "high", "urgent"]] = None17 attempts: int = Field(default=0, ge=0)18 resolved: bool = Field(default=False)19 20 21class Action(BaseModel):22 """Action chosen by the agent."""23 24 model_config = ConfigDict(extra="forbid")25 26 action_type: Literal["categorize", "prioritize", "respond", "escalate", "resolve"]27 content: Optional[str] = Field(default=None, description="Content for categorize or respond actions")28 priority: Optional[Literal["low", "medium", "high", "urgent"]] = Field(29 default=None, description="Priority level for prioritize action"30 )31 32 33class Reward(BaseModel):34 """Normalized reward with interpretable partial signals."""35 36 model_config = ConfigDict(extra="forbid")37 38 score: float = Field(..., ge=0.0, le=1.0, description="Normalized reward score between 0 and 1")39 reasoning: str = Field(default="", description="Human-readable explanation for the reward")40 partial_signals: dict[str, Any] = Field(41 default_factory=dict,42 description="Additional reward signals like empathy, efficiency, strategy",43 )44 