MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / has_exportable_structured_content

Function has_exportable_structured_content

src/utils/export_renderer.py:305–326  ·  view source on GitHub ↗
(content: Any)

Source from the content-addressed store, hash-verified

303
304
305def 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
329def should_export_structured_message(msg: Any, msg_type: str) -> bool:

Callers 1

Calls 5

is_internal_textFunction · 0.85
is_text_blockFunction · 0.85
_btextFunction · 0.85
_is_objFunction · 0.85
_btypeFunction · 0.85

Tested by

no test coverage detected