docstr: If `include_speaker_in_context` is True, keep speaker ids in the text.
  
  If `add_speaker_to_context_end` is True, add speaker ids at the end of text, and
  remove speaker ids from the labels. If `include_speaker_in_context` is False,
  but `add_speaker_to_context_end` is True, add an empty sentence at the end of
  text and add the current speaker id to the list of speakers, to indicate the
  speaker for the empty sentence.
docstr_tok: ["If","`","include_speaker_in_context","`","is","True",",","keep","speaker","ids","in","the","text",".","If","`","add_speaker_to_context_end","`","is","True",",","add","speaker","ids","at","the","end","of","text",",","and","remove","speaker","ids","from","the","labels",".","If","`","include_speaker_in_context","`","is","False",",","but","`","add_speaker_to_context_end","`","is","True",",","add","an","empty","sentence","at","the","end","of","text","and","add","the","current","speaker","id","to","the","list","of","speakers",",","to","indicate","the","speaker","for","the","empty","sentence","."]
code: def _get_message_fields(self, text, speaker, speakers, prev_context):
      """
      If `include_speaker_in_context` is True, keep speaker ids in the text.
  
      If `add_speaker_to_context_end` is True, add speaker ids at the end of text, and
      remove speaker ids from the labels. If `include_speaker_in_context` is False,
      but `add_speaker_to_context_end` is True, add an empty sentence at the end of
      text and add the current speaker id to the list of speakers, to indicate the
      speaker for the empty sentence.
      """
      hasAddedSpeaker = False
      if self.include_speaker_in_context:
          if self.add_speaker_to_context_end:
              label = text
              text = (
                  prev_context
                  + f"{self.utterance_delimiter}{speaker}: "
              )
              # Save current spaker as the speaker for the empty utterance
              speakers.append(speaker)
              hasAddedSpeaker = True
          else:
              label = f"{speaker}: {text}"
              text = prev_context
      else:
          if self.add_speaker_to_context_end:
              label = text
              # The whitespace is left at the end to indicate an empty utterance
              text = prev_context + f"{self.utterance_delimiter} "
              # Save current spaker as the speaker for the empty utterance
              speakers.append(speaker)
              hasAddedSpeaker = True
          else:
              label = f"{speaker}: {text}"
              text = prev_context
  
      return text, label, speakers, hasAddedSpeaker
  
imports: from typing import Optional
  from parlai.core.opt import Opt
  from parlai.core.teachers import DialogTeacher
  from parlai.core.params import ParlaiParser
  from .build import build
  from collections import defaultdict
  import jsonlines
  from parlai.utils.data import DatatypeHelper
  import random
  import copy
  import os
label_desc: Use image node_id 4 for calling the DefaultTeacher obj's underlying member method code with example usage: obj._get_message_fields(text, speaker, speakers, prev_context) and returns: text,  label,  speakers,  hasAddedSpeaker