class_docstr: Class for observations and actions in ParlAI.
  
  Functions like a dict, but triggers a RuntimeError when calling __setitem__ for a
  key that already exists in the dict.
docstr: Prepare a Message for delivery to a client via json.
  
  Useful for chat-services, external libraries, and mephisto delivery.
  
  Works by stripping known unsafe fields from the message, and converting
  the object to a dict.
docstr_tok: ["Prepare","a","Message","for","delivery","to","a","client","via","json",".","Useful","for","chat-services",",","external","libraries",",","and","mephisto","delivery",".","Works","by","stripping","known","unsafe","fields","from","the","message",",","and","converting","the","object","to","a","dict","."]
code: def json_safe_payload(self) -> Dict[str, Any]:
      """
      Prepare a Message for delivery to a client via json.
  
      Useful for chat-services, external libraries, and mephisto delivery.
  
      Works by stripping known unsafe fields from the message, and converting
      the object to a dict.
      """
      return {k: v for k, v in self.items() if k not in UNSAFE_FIELDS}
  
file_path: ParlAI/parlai/core/message.py
imports: from __future__ import annotations
  from typing import Any, Dict
label_desc: Use image node_id 6 for calling the Message obj's underlying member method code with example usage: obj.json_safe_payload() and returns: unknown