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

Function extract_message_content

src/utils/export_renderer.py:236–247  ·  view source on GitHub ↗
(msg: Any)

Source from the content-addressed store, hash-verified

234
235
236def extract_message_content(msg: Any) -> Any:
237 if isinstance(msg, Mapping):
238 nested = msg.get("message")
239 if isinstance(nested, Mapping):
240 return nested.get("content")
241 if "content" in msg:
242 return msg["content"]
243 return None
244 nested = getattr(msg, "message", None)
245 if isinstance(nested, Mapping):
246 return nested.get("content")
247 return getattr(msg, "content", None)
248
249
250# --------------------------------------------------------------------------- #

Callers 6

_message_textFunction · 0.90
extract_first_promptFunction · 0.90
render_messages_to_jsonFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected