code: def tracker_as_readable_transcript(
      tracker: DialogueStateTracker,
      human_prefix: str = USER,
      ai_prefix: str = AI,
      max_turns: Optional[int] = 20,
  ) -> str:
      """Creates a readable dialogue from a tracker.
  
      Args:
          tracker: the tracker to convert
          human_prefix: the prefix to use for human utterances
          ai_prefix: the prefix to use for ai utterances
          max_turns: the maximum number of turns to include in the transcript
  
      Example:
          >>> tracker = Tracker(
          ...     sender_id="test",
          ...     slots=[],
          ...     events=[
          ...         UserUttered("hello"),
          ...         BotUttered("hi"),
          ...     ],
          ... )
          >>> tracker_as_readable_transcript(tracker)
          USER: hello
          AI: hi
  
      Returns:
      A string representing the transcript of the tracker
      """
      transcript = []
  
      for event in tracker.events:
          if isinstance(event, UserUttered):
              transcript.append(
                  f"{human_prefix}: {sanitize_message_for_prompt(event.text)}"
              )
          elif isinstance(event, BotUttered):
              transcript.append(
                  f"{ai_prefix}: {sanitize_message_for_prompt(event.text)}"
              )
  
      if max_turns:
          transcript = transcript[-max_turns:]
      return "\n".join(transcript)
  
imports: from typing import Optional
  import structlog
  from rasa.shared.core.events import BotUttered, UserUttered
  from rasa.shared.core.trackers import DialogueStateTracker
label_desc: Use image node_id 1 for calling a global function with example usage: tracker_as_readable_transcript(tracker, human_prefix, ai_prefix, max_turns) and returns: str