File size: 901 Bytes
7d80981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pydantic import BaseModel, Field
from typing import Optional, Dict, Any

class CustomerAction(BaseModel):
    action_type: str = Field(..., description="Must be 'speak', 'tool_call', or 'end_call'")
    content: str = Field(..., description="The spoken text or the name of the tool")
    tool_args: Dict[str, Any] = Field(default_factory=dict, description="Arguments for the tool")

class CustomerObservation(BaseModel):
    customer_reply: Optional[str] = Field(None, description="What the customer said")
    tool_response: Optional[str] = Field(None, description="Result of the tool call")
    conversation_history: str = Field(..., description="Full transcript of the episode")
    
    done: bool = Field(False, description="Whether the episode has ended")
    reward: float = Field(0.0, description="Reward received for this step")
    metadata: Dict[str, Any] = Field(default_factory=dict)