File size: 614 Bytes
b94ec37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

from pydantic import BaseModel, Field
from typing import List, Optional, Literal

class Observation(BaseModel):
    customer_query: str
    conversation_history: List[dict]
    ticket_status: Literal["open","pending","escalated","closed"]
    sentiment: Literal["negative","neutral","positive"]
    progress: float = Field(ge=0.0, le=1.0)

class Action(BaseModel):
    action_type: Literal["classify","respond","resolve","escalate"]
    category: Optional[Literal["account","billing","security","other"]] = None
    response_text: Optional[str] = None

class Reward(BaseModel):
    score: float
    feedback: str