class_docstr: Natural language generator that generates messages based on responses.
  
  The responses can use variables to customize the utterances based on the
  state of the dialogue.
class_docstr_tok: ["Natural","language","generator","that","generates","messages","based","on","responses",".","The","responses","can","use","variables","to","customize","the","utterances","based","on","the","state","of","the","dialogue","."]
docstr: Select random response for the utter action from available ones.
  
  If channel-specific responses for the current output channel are given,
  only choose from channel-specific ones.
docstr_tok: ["Select","random","response","for","the","utter","action","from","available","ones",".","If","channel-specific","responses","for","the","current","output","channel","are","given",",","only","choose","from","channel-specific","ones","."]
code: def _random_response_for(
      self,
      utter_action: Text,
      output_channel: Text,
      filled_slots: Dict[Text, Any],
  ) -> Optional[Dict[Text, Any]]:
      """Select random response for the utter action from available ones.
  
      If channel-specific responses for the current output channel are given,
      only choose from channel-specific ones.
      """
      import numpy as np
  
      if utter_action in self.responses:
          response_filter = ResponseVariationFilter(self.responses)
          suitable_responses = (
              response_filter.responses_for_utter_action(
                  utter_action, output_channel, filled_slots
              )
          )
  
          if suitable_responses:
              selected_response = np.random.choice(suitable_responses)
              condition = selected_response.get(RESPONSE_CONDITION)
              if condition:
                  formatted_response_conditions = (
                      self._format_response_conditions(condition)
                  )
                  logger.debug(
                      "Selecting response variation with conditions:"
                      f"{formatted_response_conditions}"
                  )
              return selected_response
          else:
              return None
      else:
          return None
  
file_path: rasa/rasa/core/nlg/response.py
imports: import copy
  import logging
  from rasa.shared.core.trackers import DialogueStateTracker
  from typing import Text, Any, Dict, Optional, List
  from rasa.core.nlg import interpolator
  from rasa.core.nlg.generator import NaturalLanguageGenerator, ResponseVariationFilter
  from rasa.shared.constants import RESPONSE_CONDITION
label_desc: Use image node_id 2 for calling the TemplatedNaturalLanguageGenerator obj's underlying member method code with example usage: obj._random_response_for(utter_action, output_channel, filled_slots) and returns: None, selected_response, None