rasa_sdk/forms.py
def entity_is_desired(
        self,
        other_slot_mapping: Dict[Text, Any],
        other_slot: Text,
        entity_type_of_slot_to_fill: Optional[Text],
        tracker: "Tracker",
    ) -> bool:
        """Check whether the other slot should be filled by an entity in the input or
        not.
        Args:
            other_slot_mapping: Slot mapping.
            other_slot: The other slot to be filled.
            entity_type_of_slot_to_fill: Entity type of slot to fill.
            tracker: The tracker.
        Returns:
            True, if other slot should be filled, false otherwise.
        """

        # slot name is equal to the entity type
        entity_type = other_slot_mapping.get("entity")
        other_slot_equals_entity = other_slot == entity_type

        # use the custom slot mapping 'from_entity' defined by the user to check
        # whether we can fill a slot with an entity
        other_slot_fulfils_entity_mapping = False
        if (
            entity_type is not None
            and (
                other_slot_mapping.get("role") is not None
                or other_slot_mapping.get("group") is not None
            )
            and entity_type_of_slot_to_fill == other_slot_mapping.get("entity")
        ):
            matching_values = self.get_entity_value(
                entity_type,
                tracker,
                other_slot_mapping.get("role"),
                other_slot_mapping.get("group"),
            )
            other_slot_fulfils_entity_mapping = matching_values is not None

        return other_slot_equals_entity or other_slot_fulfils_entity_mapping
Check whether the other slot should be filled by an entity in the input or
        not.
        Args:
            other_slot_mapping: Slot mapping.
            other_slot: The other slot to be filled.
            entity_type_of_slot_to_fill: Entity type of slot to fill.
            tracker: The tracker.
        Returns:
            True, if other slot should be filled, false otherwise.
        
Check whether the other slot should be filled by an entity in the input or
not.
Check whether the other slot should be filled by an entity in the input or not .
def entity_is_desired(
        self,
        other_slot_mapping: Dict[Text, Any],
        other_slot: Text,
        entity_type_of_slot_to_fill: Optional[Text],
        tracker: "Tracker",
    ) -> bool:
        entity_type = other_slot_mapping.get("entity")
        other_slot_equals_entity = other_slot == entity_type
        other_slot_fulfils_entity_mapping = False
        if (
            entity_type is not None
            and (
                other_slot_mapping.get("role") is not None
                or other_slot_mapping.get("group") is not None
            )
            and entity_type_of_slot_to_fill == other_slot_mapping.get("entity")
        ):
            matching_values = self.get_entity_value(
                entity_type,
                tracker,
                other_slot_mapping.get("role"),
                other_slot_mapping.get("group"),
            )
            other_slot_fulfils_entity_mapping = matching_values is not None
        return other_slot_equals_entity or other_slot_fulfils_entity_mapping
def entity_is_desired ( self , other_slot_mapping : Dict [ Text , Any ] , other_slot : Text , entity_type_of_slot_to_fill : Optional [ Text ] , tracker : "Tracker" , ) -> bool : entity_type = other_slot_mapping . get ( "entity" ) other_slot_equals_entity = other_slot == entity_type other_slot_fulfils_entity_mapping = False if ( entity_type is not None and ( other_slot_mapping . get ( "role" ) is not None or other_slot_mapping . get ( "group" ) is not None ) and entity_type_of_slot_to_fill == other_slot_mapping . get ( "entity" ) ) : matching_values = self . get_entity_value ( entity_type , tracker , other_slot_mapping . get ( "role" ) , other_slot_mapping . get ( "group" ) , ) other_slot_fulfils_entity_mapping = matching_values is not None return other_slot_equals_entity or other_slot_fulfils_entity_mapping
Check whether the other slot should be filled by an entity in the input or
not.
Check whether the other slot should be filled by an entity in the input or not .
"""Check whether the other slot should be filled by an entity in the input or
        not.
        Args:
            other_slot_mapping: Slot mapping.
            other_slot: The other slot to be filled.
            entity_type_of_slot_to_fill: Entity type of slot to fill.
            tracker: The tracker.
        Returns:
            True, if other slot should be filled, false otherwise.
        """ # slot name is equal to the entity type # use the custom slot mapping 'from_entity' defined by the user to check # whether we can fill a slot with an entity
True, if other slot should be filled, false otherwise.
True if other slot should be filled false otherwise .
self
other_slot_mapping
Dict[Text, Any]
None
other_slot
Text
The other slot to be filled.
The other slot to be filled .
entity_type_of_slot_to_fill
Optional[Text]
Entity type of slot to fill.
Entity type of slot to fill .
tracker
"Tracker"
None