How to ask "any" response

I have a survey bot that asks users a series of questions, sometimes after retrieving information from actions.py. What is the best way to allow RASA to accept any text response during a happy path?

For instance, here’s how a flow may go.

Bot: What hotel is your favorite? User: Mine is the mariott Bot: (checks actions and database)
Bot: are you talking about the Mariott at center st in new york? User: Yes Bot: what is your opinion of this hotel? User: Bot: it sounds like you thought:

How do i prime RASA in a sequence of questions to take any text response and then move on to the next question or phrase?

thanks and let me know if i can make this question more clear!

@travelmail26 Generally, if you are collecting information from a user, you will want to use a form. In the example you provide, it seems like you would likely want slots for hotel and opinion. Since you emphasised being able to “take any text response”, I will also point out that you can use tracker.latest_message['text'] to grab the entire user input

Hi, @travelmail26! If you are using Forms to obtain this information, you can define it in slot_mappings method:

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
        return {
            "slot_name": [self.from_text(intent=None)],
        }

which takes the whole text of user’s answer and stores in that slot. I hope I understand your question well.

1 Like