class_docstr: Filters response variations based on the channel, action and condition.
class_docstr_tok: ["Filters","response","variations","based","on","the","channel",",","action","and","condition","."]
docstr: Checks if the conditional response variation matches the filled slots.
docstr_tok: ["Checks","if","the","conditional","response","variation","matches","the","filled","slots","."]
code: def _matches_filled_slots(
      filled_slots: Dict[Text, Any], response: Dict[Text, Any]
  ) -> bool:
      """Checks if the conditional response variation matches the filled slots."""
      constraints = response.get(RESPONSE_CONDITION, [])
      for constraint in constraints:
          name = constraint["name"]
          value = constraint["value"]
          filled_slots_value = filled_slots.get(name)
          if isinstance(filled_slots_value, str) and isinstance(
              value, str
          ):
              if filled_slots_value.casefold() != value.casefold():
                  return False
          # slot values can be of different data types
          # such as int, float, bool, etc. hence, this check
          # executes when slot values are not strings
          elif filled_slots_value != value:
              return False
  
      return True
  
file_path: rasa/rasa/core/nlg/generator.py
imports: import logging
  from typing import List, Optional, Union, Text, Any, Dict
  import rasa.shared.utils.common
  import rasa.shared.utils.io
  from rasa.shared.constants import CHANNEL, RESPONSE_CONDITION
  from rasa.shared.core.domain import Domain
  from rasa.utils.endpoints import EndpointConfig
  from rasa.shared.core.trackers import DialogueStateTracker
label_desc: Use image node_id 2 for calling the ResponseVariationFilter obj's underlying member method code with example usage: obj._matches_filled_slots(filled_slots, response) and returns: True, False, False