(self)
| 160 | self.timestamp = time.time() |
| 161 | |
| 162 | def to_dict(self) -> dict: |
| 163 | return { |
| 164 | "role": self.role, |
| 165 | "blocks": [b.to_dict() for b in self.blocks], |
| 166 | "uuid": self.uuid, |
| 167 | "parent_uuid": self.parent_uuid, |
| 168 | "timestamp": self.timestamp, |
| 169 | } |
| 170 | |
| 171 | @staticmethod |
| 172 | def from_dict(data: dict) -> "ConversationMessage": |