rasa_sdk/forms.py
def extract_other_slots(
        self,
        dispatcher: "CollectingDispatcher",
        tracker: "Tracker",
        domain: "DomainDict",
    ) -> Dict[Text, Any]:
        """Extract the values of the other slots
        if they are set by corresponding entities from the user input
        else return None
        """
        slot_to_fill = tracker.get_slot(REQUESTED_SLOT)

        entity_type_of_slot_to_fill = self._get_entity_type_of_slot_to_fill(
            slot_to_fill
        )

        slot_values = {}
        for slot in self.required_slots(tracker):
            # look for other slots
            if slot != slot_to_fill:
                # list is used to cover the case of list slot type
                other_slot_mappings = self.get_mappings_for_slot(slot)

                for other_slot_mapping in other_slot_mappings:
                    # check whether the slot should be filled by an entity in the input
                    should_fill_entity_slot = (
                        other_slot_mapping["type"] == "from_entity"
                        and self.intent_is_desired(other_slot_mapping, tracker)
                        and self.entity_is_desired(
                            other_slot_mapping,
                            slot,
                            entity_type_of_slot_to_fill,
                            tracker,
                        )
                    )
                    # check whether the slot should be
                    # filled from trigger intent mapping
                    should_fill_trigger_slot = (
                        tracker.active_loop.get("name") != self.name()
                        and other_slot_mapping["type"] == "from_trigger_intent"
                        and self.intent_is_desired(other_slot_mapping, tracker)
                    )
                    if should_fill_entity_slot:
                        value = self.get_entity_value(
                            other_slot_mapping["entity"],
                            tracker,
                            other_slot_mapping.get("role"),
                            other_slot_mapping.get("group"),
                        )
                    elif should_fill_trigger_slot:
                        value = other_slot_mapping.get("value")
                    else:
                        value = None

                    if value is not None:
                        logger.debug(f"Extracted '{value}' for extra slot '{slot}'.")
                        slot_values[slot] = value
                        # this slot is done, check  next
                        break

        return slot_values
Extract the values of the other slots
        if they are set by corresponding entities from the user input
        else return None
        
Extract the values of the other slots
if they are set by corresponding entities from the user input
else return None
Extract the values of the other slots if they are set by corresponding entities from the user input else return None
def extract_other_slots(
        self,
        dispatcher: "CollectingDispatcher",
        tracker: "Tracker",
        domain: "DomainDict",
    ) -> Dict[Text, Any]:
        slot_to_fill = tracker.get_slot(REQUESTED_SLOT)
        entity_type_of_slot_to_fill = self._get_entity_type_of_slot_to_fill(
            slot_to_fill
        )
        slot_values = {}
        for slot in self.required_slots(tracker):
            if slot != slot_to_fill:
                other_slot_mappings = self.get_mappings_for_slot(slot)
                for other_slot_mapping in other_slot_mappings:
                    should_fill_entity_slot = (
                        other_slot_mapping["type"] == "from_entity"
                        and self.intent_is_desired(other_slot_mapping, tracker)
                        and self.entity_is_desired(
                            other_slot_mapping,
                            slot,
                            entity_type_of_slot_to_fill,
                            tracker,
                        )
                    )
                    should_fill_trigger_slot = (
                        tracker.active_loop.get("name") != self.name()
                        and other_slot_mapping["type"] == "from_trigger_intent"
                        and self.intent_is_desired(other_slot_mapping, tracker)
                    )
                    if should_fill_entity_slot:
                        value = self.get_entity_value(
                            other_slot_mapping["entity"],
                            tracker,
                            other_slot_mapping.get("role"),
                            other_slot_mapping.get("group"),
                        )
                    elif should_fill_trigger_slot:
                        value = other_slot_mapping.get("value")
                    else:
                        value = None
                    if value is not None:
                        logger.debug(f"Extracted '{value}' for extra slot '{slot}'.")
                        slot_values[slot] = value
                        break
        return slot_values
def extract_other_slots ( self , dispatcher : "CollectingDispatcher" , tracker : "Tracker" , domain : "DomainDict" , ) -> Dict [ Text , Any ] : slot_to_fill = tracker . get_slot ( REQUESTED_SLOT ) entity_type_of_slot_to_fill = self . _get_entity_type_of_slot_to_fill ( slot_to_fill ) slot_values = { } for slot in self . required_slots ( tracker ) : if slot != slot_to_fill : other_slot_mappings = self . get_mappings_for_slot ( slot ) for other_slot_mapping in other_slot_mappings : should_fill_entity_slot = ( other_slot_mapping [ "type" ] == "from_entity" and self . intent_is_desired ( other_slot_mapping , tracker ) and self . entity_is_desired ( other_slot_mapping , slot , entity_type_of_slot_to_fill , tracker , ) ) should_fill_trigger_slot = ( tracker . active_loop . get ( "name" ) != self . name ( ) and other_slot_mapping [ "type" ] == "from_trigger_intent" and self . intent_is_desired ( other_slot_mapping , tracker ) ) if should_fill_entity_slot : value = self . get_entity_value ( other_slot_mapping [ "entity" ] , tracker , other_slot_mapping . get ( "role" ) , other_slot_mapping . get ( "group" ) , ) elif should_fill_trigger_slot : value = other_slot_mapping . get ( "value" ) else : value = None if value is not None : logger . debug ( f"Extracted '{value}' for extra slot '{slot}'." ) slot_values [ slot ] = value break return slot_values
Extract the values of the other slots
if they are set by corresponding entities from the user input
else return None
Extract the values of the other slots if they are set by corresponding entities from the user input else return None
"""Extract the values of the other slots
        if they are set by corresponding entities from the user input
        else return None
        """ # look for other slots # list is used to cover the case of list slot type # check whether the slot should be filled by an entity in the input # check whether the slot should be # filled from trigger intent mapping # this slot is done, check  next
self
dispatcher
"CollectingDispatcher"
tracker
"Tracker"
domain
"DomainDict"