Multiple question in One action

Is there any way to implement multiple questions from a single action without using the Form, Slot, or Entities? Also, I just want to store the user response in a local variable of my action for further logical implementation.

If you want user input, you will need to have two actions, one asking the user for input and one processing that input. You can’t ask for and receive user input from inside one action. Forms make this easy by giving you actions that do just that; but if you want to do it without a form, and just take the users’ text input, via tracker.latest_message, you could. You’d still need two actions though.

May I ask why you have these restrictions?

@mloubser Thanks for you feedback. Suppose I’ve 4 classifications. Bus, Train, Plane and Ship. User have to choose one of them. I already store the value in a slot. I’ve separate list of questions for each categories. For example If user choose bus then I’ve a list BusQus = [Qus1, Qus2, Qus3] for this section and similar for other categories. And this list is not static. It’s generated through API. So far I implemented this. Now I want to throw this sort of qus to user serially and want to store the ans to another list so that I can make a dictionary of qus and ans. Also I don’t want any intent classification for users ans. whatever user reply it will just store the reply in a list and instead to any intent classification. Is there any suggestion except Form Action?

Based on what you’re describing, a form is definitely going to be the easiest way because you can just fill the slots from_text and accept all intents, so it won’t matter what the intent is. You can overwrite some of the form methods (probably request_next_slot for one) if you need to dynamically generate the required slots & their accompanying questions. I’m still not sure why you specifically wouldn’t want to use a form action (feel free to clarify), but what you need to think about is what your stories would look like with the dynamic set up you’re describing without a form. I don’t really see a way of doing this using typical stories & actions because you don’t know ahead of time what they’ll be.

1 Like

Hi! How did you solve it ? I have de same problem but in Rasa version 2.6 and there is no request_next_slot method in this rasa_sdk.

In 2.x you can customize how a slot is asked for with a custom action; you can customize the required slots with a form validation action that includes the required_slots method.

See the Migration Guide from 1.x to 2.x.

request_next_slot does still exist in rasa_sdk==2.6.0, but it FormAction as a whole is deprecated and will be removed in the future.