(msg: Any)
| 234 | |
| 235 | |
| 236 | def 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 | # --------------------------------------------------------------------------- # |
no test coverage detected