Adding Questions

Hi,

I am creating a chatbot which requires to ask the user some questions in order to assess them so, how do I implement this like I want to ask 10 questions in one by one manner.

Any help, resource or detailed explanation will be much appreciated.

Thanks!

1 Like

Will you have a different number of questions every time, or is the number of questions fixed?

You can use forms.

different number every time

Can I add a button instead of getting a text from user?

The way I do this is to have a non-featurized “Any” slot type that contains an index number pointing at the current question. After asking the user each question, I use actions to increment this index number by 1. I also have another slot containing the last index (which is different depending on your number of questions you have each time). When the two are equal, I run an action telling the user that my questions are over.

These slots are stored in the tracker and can be retrieved easily using rasa-sdk. In other words, I have my assistant remember what question we’re on and not move to the next one until the user answers the current one.

Thanks:)

No problem. Feel free to ask for help while implementing it.