class_docstr: Utility class for conversation metadata.
  
  Metadata should be saved at ``<datapath>.metadata``.
class_docstr_tok: ["Utility","class","for","conversation","metadata",".","Metadata","should","be","saved","at","``","<","datapath",">",".metadata","``","."]
docstr: Dump conversation metadata to file.
docstr_tok: ["Dump","conversation","metadata","to","file","."]
code: def save_metadata(
      cls, datapath, opt, self_chat=False, speakers=None, **kwargs
  ):
      """
      Dump conversation metadata to file.
      """
      metadata = {}
      metadata["date"] = str(datetime.datetime.now())
      metadata["opt"] = opt
      metadata["self_chat"] = self_chat
      metadata["speakers"] = speakers
      metadata["version"] = cls.version()
  
      for k, v in kwargs.items():
          metadata[k] = v
  
      metadata_path = cls._get_path(datapath)
      logging.info(f"Writing metadata to file {metadata_path}")
      with PathManager.open(metadata_path, "w") as f:
          f.write(json.dumps(metadata))
  
imports: import datetime
  import json
  import os
  import itertools
  from parlai.utils.io import PathManager
  from parlai.core.metrics import dict_report
  from parlai.utils.misc import AttrDict
  import parlai.utils.logging
label_desc: Use image node_id 6 for calling the Metadata obj's underlying member method code with example usage: obj.save_metadata(cls, datapath, opt, _chat, speakers) without return types