code: def nlg_request_format(
      utter_action: Text,
      tracker: DialogueStateTracker,
      output_channel: Text,
      **kwargs: Any,
  ) -> Dict[Text, Any]:
      """Create the json body for the NLG json body for the request."""
      tracker_state = tracker.current_state(EventVerbosity.ALL)
      response_id = kwargs.pop("response_id", None)
  
      return {
          "response": utter_action,
          "id": response_id,
          "arguments": kwargs,
          "tracker": tracker_state,
          "channel": {"name": output_channel},
      }
  
file_path: rasa/rasa/core/nlg/callback.py
imports: import json
  import logging
  from typing import List, Text, Any, Dict, Optional
  from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
  from rasa.core.nlg.generator import NaturalLanguageGenerator, ResponseVariationFilter
  from rasa.shared.core.trackers import DialogueStateTracker, EventVerbosity
  from rasa.shared.exceptions import RasaException
  from rasa.utils.endpoints import EndpointConfig
label_desc: Use image node_id 2 for calling a global function with example usage: nlg_request_format(utter_action, tracker, output_channel) and returns: dict