| 18 | OPTIMIZATION_STEP = "optimization_step" |
| 19 | |
| 20 | class ChatEvent(BaseModel): |
| 21 | id: str = Field(..., description="The unique identifier for the event.") |
| 22 | step_number: int = Field(..., description="The step number of the event.") |
| 23 | event_type: EventType = Field(..., description="The type of the event.") |
| 24 | timestamp: datetime = Field(default_factory=datetime.now, description="The timestamp of the event.") |
| 25 | data: Dict[str, Any] = Field(default_factory=dict, description="The data of the event.") |
| 26 | agent_name: Optional[str] = Field(None, description="The name of the agent that generated the event.") |
| 27 | session_id: Optional[str] = Field(None, description="The session ID of the event.") |
| 28 | task_id: Optional[str] = Field(None, description="The task ID of the event.") |
| 29 | |
| 30 | def __str__(self): |
| 31 | string = dedent(f"""<chat_event> |
| 32 | ID: {self.id} |
| 33 | Step Number: {self.step_number} |
| 34 | Event Type: {self.event_type} |
| 35 | Timestamp: {self.timestamp} |
| 36 | Agent Name: {self.agent_name} |
| 37 | Session ID: {self.session_id} |
| 38 | Task ID: {self.task_id} |
| 39 | Data: {json.dumps(self.data)} |
| 40 | </chat_event>""") |
| 41 | return string |
| 42 | |
| 43 | def __repr__(self): |
| 44 | return self.__str__() |
| 45 | |
| 46 | class Importance(Enum): |
| 47 | HIGH = "high" |
no outgoing calls
no test coverage detected