code: def sanitize_message_for_prompt(text: Optional[str]) -> str:
      """Removes new lines from a string.
  
      Args:
          text: the text to sanitize
  
      Returns:
      A string with new lines removed.
      """
      return text.replace("\n", " ") if text else ""
  
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 2 for calling a global function with example usage: sanitize_message_for_prompt(text) and returns: unknown