How to set several slots in a Form Action using the same entity?

Hi Alex,

You’ll need to set the slots to auto_fill: false in your domain.yml file, e.g.:

  child_age:
    type: unfeaturized
    autofill: false

However, I believe the FormAction class by default tries to auto-fill slots based on entities and intents (depending on how you set up the slot_mappings method) without respecting the autofill:false clauses in the domain.yml. You can override this behavior by modifying the validate method to remove the call to extract_other_slots:

@overrides
    async def validate(
        self,
        dispatcher: "CollectingDispatcher",
        tracker: "Tracker",
        domain: Dict[Text, Any],
    ) -> List[EventType]:
        
        # slot_values = self.extract_other_slots(dispatcher, tracker, domain)
        
        slot_values = {}
        # extract requested slot
        slot_to_fill = tracker.get_slot(REQUESTED_SLOT)
        if slot_to_fill:
            slot_values.update(self.extract_requested_slot(dispatcher, tracker, domain))

        logger.debug(f"Validating extracted slots: {slot_values}")
        return await self.validate_slots(slot_values, dispatcher, tracker, domain)
1 Like