取消息第一个非空文本 block。源码: compact.rs:281-288
(msg: Message)
| 160 | |
| 161 | |
| 162 | def _first_text(msg: Message) -> Optional[str]: |
| 163 | """取消息第一个非空文本 block。源码: compact.rs:281-288""" |
| 164 | for block in msg.content: |
| 165 | if isinstance(block, TextContentBlock) and block.text.strip(): |
| 166 | return block.text |
| 167 | return None |
| 168 | |
| 169 | |
| 170 | # ============================================================ |
no outgoing calls
no test coverage detected