Human-friendly summary for logging.
(self)
| 144 | return cls(type=MessageBlockType.TEXT, text=text) |
| 145 | |
| 146 | def describe(self) -> str: |
| 147 | """Human-friendly summary for logging.""" |
| 148 | if self.type is MessageBlockType.TEXT and self.text: |
| 149 | return self.text |
| 150 | if self.attachment: |
| 151 | name = self.attachment.name or self.attachment.attachment_id |
| 152 | return f"[{self.type.value} attachment: {name}]" |
| 153 | if self.text: |
| 154 | return self.text |
| 155 | if "text" in self.data: |
| 156 | return str(self.data["text"]) |
| 157 | return f"[{self.type.value} block]" |
| 158 | |
| 159 | def copy(self) -> "MessageBlock": |
| 160 | return MessageBlock( |
no outgoing calls
no test coverage detected