RL-IVR / models.py
hrajgarhia943's picture
Upload folder using huggingface_hub
7d80981 verified
raw
history blame contribute delete
901 Bytes
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)