(content: Any)
| 303 | |
| 304 | |
| 305 | def has_exportable_structured_content(content: Any) -> bool: |
| 306 | if content is None: |
| 307 | return False |
| 308 | if isinstance(content, str): |
| 309 | return len(content.strip()) > 0 and not is_internal_text(content) |
| 310 | if not isinstance(content, list): |
| 311 | return True |
| 312 | for block in content: |
| 313 | if is_text_block(block): |
| 314 | text = _btext(block) |
| 315 | if len(text.strip()) > 0 and not is_internal_text(text): |
| 316 | return True |
| 317 | continue |
| 318 | if not _is_obj(block): |
| 319 | if block is not None: |
| 320 | return True |
| 321 | continue |
| 322 | block_type = _btype(block) |
| 323 | if block_type in ("thinking", "redacted_thinking"): |
| 324 | continue |
| 325 | return True |
| 326 | return False |
| 327 | |
| 328 | |
| 329 | def should_export_structured_message(msg: Any, msg_type: str) -> bool: |
no test coverage detected