rasa_sdk/forms.py
def intent_is_desired(
        requested_slot_mapping: Dict[Text, Any], tracker: "Tracker"
    ) -> bool:
        """Check whether user intent matches intent conditions"""

        mapping_intents = requested_slot_mapping.get("intent", [])
        mapping_not_intents = requested_slot_mapping.get("not_intent", [])
        intent = tracker.latest_message.get("intent", {}).get("name")

        intent_not_excluded = not mapping_intents and intent not in mapping_not_intents

        return intent_not_excluded or intent in mapping_intents
Check whether user intent matches intent conditions
Check whether user intent matches intent conditions
Check whether user intent matches intent conditions
def intent_is_desired(
        requested_slot_mapping: Dict[Text, Any], tracker: "Tracker"
    ) -> bool:
        mapping_intents = requested_slot_mapping.get("intent", [])
        mapping_not_intents = requested_slot_mapping.get("not_intent", [])
        intent = tracker.latest_message.get("intent", {}).get("name")
        intent_not_excluded = not mapping_intents and intent not in mapping_not_intents
        return intent_not_excluded or intent in mapping_intents
def intent_is_desired ( requested_slot_mapping : Dict [ Text , Any ] , tracker : "Tracker" ) -> bool : mapping_intents = requested_slot_mapping . get ( "intent" , [ ] ) mapping_not_intents = requested_slot_mapping . get ( "not_intent" , [ ] ) intent = tracker . latest_message . get ( "intent" , { } ) . get ( "name" ) intent_not_excluded = not mapping_intents and intent not in mapping_not_intents return intent_not_excluded or intent in mapping_intents
Check whether user intent matches intent conditions
Check whether user intent matches intent conditions
"""Check whether user intent matches intent conditions"""
requested_slot_mapping
Dict[Text, Any]
tracker
"Tracker"