Turn off auto-fill for slots when FormAction is active

Hello everyone!

Is it possible to turn off the auto-fill behavior of rasa when the FormAction is active?

Explanation:

When the form is active, I’m asking the user an open question and filling my slot slot_A with whatever the user said (using self.from_text() mapping here), but the nlu is extracting some entities from this user input (which is fine) and filling the slots with same name as the entities. Now this auto-fill behavior is causing problem because it is filling one of the required slots, hence the form is not asking for that slot, also the validation is failing because it got auto-filled. So the slot got filled with invalid data silently.

I don’t want to use auto_fill: False in domain.yml because when the form is not active, I want this slot to be auto-filled from user input (because I have further custom actions which have the code to validate this slot.)

Any idea how to overcome this situation?

Also, do you think it could be implemented in rasa as a feature to be able to turn the auto-fill behaviour on and off if the FormAction is active?

Thanks.

hi @saurabh-m523 … I was wondering what if i have 3 parameters that needs to be captured in forms and all three are free text. So, I want to capture the text entered by the user for the 3 parameters and set it as 3 slots. can you help me with this.

Hi @Anna!

Yeah sure you can do that. You’ll need custom slot mapping in your form action, something like this:

    def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
        """A dictionary to map required slots to
            - an extracted entity
            - intent: value pairs
            - a whole message
        or a list of them, where a first match will be picked."""

        return {
            "cuisine": self.from_text(),
            "num_people": self.from_text(),
            "outdoor_seating": self.from_text()
        }

Hope it helps! :slightly_smiling_face:

1 Like

thanks:)

@saurabh-m523…hello did u find the solution for it ?