docstr: Observe bot reply if and only if it passes.
docstr_tok: ["Observe","bot","reply","if","and","only","if","it","passes","."]
code: def observe(self, msg):
      """
      Observe bot reply if and only if it passes.
      """
      if self.self_offensive:
          # User was offensive, they must try again
          return
  
      # Now check if bot was offensive
      bot_offensive = self.check_offensive(msg.get("text", ""))
      if not bot_offensive:
          # View bot message
          print(
              display_messages(
                  [msg],
                  add_fields=self.opt.get("display_add_fields", ""),
                  prettify=self.opt.get("display_prettify", False),
                  verbose=self.opt.get("verbose", False),
              )
          )
          msg.force_set("bot_offensive", False)
      else:
          msg.force_set("bot_offensive", True)
          print(OFFENSIVE_BOT_REPLY)
  
file_path: ParlAI/parlai/agents/safe_local_human/safe_local_human.py
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.utils.misc import display_messages
  from parlai.utils.strings import colorize
  from parlai.agents.local_human.local_human import LocalHumanAgent
  from parlai.utils.safety import OffensiveStringMatcher, OffensiveLanguageClassifier
label_desc: Use image node_id 5 for calling the SafeLocalHumanAgent obj's underlying member method code with example usage: obj.observe(msg) without return types