docstr: Return specific info about the conversation, the context, acceptability, etc.
docstr_tok: ["Return","specific","info","about","the","conversation",",","the","context",",","acceptability",",","etc","."]
code: def get_final_chat_data(self) -> Dict[str, Any]:
      """
      Return specific info about the conversation, the context, acceptability, etc.
      """
  
      if self.check_acceptability:
          (
              human_messages,
              violation_types,
          ) = self._prepare_acceptability_checking()
          violations_string = self.acceptability_checker.check_messages(
              messages=human_messages,
              is_worker_0=False,
              violation_types=violation_types,
          )
      else:
          violations_string = None
  
      data = {
          "dialog": self.dialog,
          "workers": [get_mturk_id_from_mephisto_wrapper(self.agent)],
          "bad_workers": [],
          "acceptability_violations": (violations_string,),
          "hit_ids": [self.agent.mephisto_agent.task_run_id],
          "assignment_ids": [self.agent.mephisto_agent.assignment_id],
          "task_description": {
              "annotations_config": self.opt["annotations_config"],
              "model_nickname": self.bot.worker_id,
              "model_file": self.bot.model_agent.opt.get("model_file"),
              "model_opt": self.bot.model_agent.opt,
          },
      }
      # TODO: once the analysis scripts are fully switched over to DataBrowser, remove
      #  the 'workers' and 'assignment_ids' keys, which will now be duplicated in the
      #  returned Unit
      # TODO: 'bad_workers' is for compatibility. Before, it was only non-empty if a
      #  worker abandoned, returned, etc. a HIT, but now we don't even save chat
      #  data in that case. Remove this key once fully once on DataBrowser
      if self.check_acceptability:
          data["acceptability_violations"] = (violations_string,)
          # Make a tuple for compatibility with a human/human conversation in
          # which we check both sides for acceptability
  
      return data
  
imports: import time
  import os
  import json
  from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  from parlai.core.agents import create_agent_from_shared
  from parlai.core.message import Message
  from parlai.core.worlds import validate
  from parlai.crowdsourcing.utils.acceptability import AcceptabilityChecker
  from parlai.crowdsourcing.utils.worlds import CrowdOnboardWorld, CrowdTaskWorld
  from parlai.crowdsourcing.tasks.model_chat.bot_agent import TurkLikeAgent
  from parlai.crowdsourcing.tasks.model_chat.constants import ONBOARD_FAIL, ONBOARD_SUCCESS
  from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility
  from parlai.crowdsourcing.utils.mturk import get_mturk_id_from_mephisto_wrapper
  from typing import TYPE_CHECKING
label_desc: Use image node_id 8 for calling the BaseModelChatWorld obj's underlying member method code with example usage: obj.get_final_chat_data() and returns: data