I have just started experimenting RASA about 2 weeks ago and I am enjoying it. However, I would like to ask for some advice on Forms. I am trying to build a bot that will ask the user a set of same questions repeatedly until the user indicates that he/she does not want to continue anymore (for example, a bus arrival bot where the user can keep checking for the bus until it arrives). I will also need to make an API call in between each question.
After some research, I believe that I could achieve my goal using forms (with action_ask). The idea is since forms only end after all required slots are filled, I can create a slot to capture if the user wants to stop the form or to continue. The proposed flow is: start form → utter_ask → action_ask(call API) → ask if the user wants to repeat the form.
However, after following this link [Forms] and adding the action_ask in the domain, the form does not execute this action. Therefore I would like to check if I am missing any steps or there is anything that I misunderstood about forms.
Yup my action server is running and I am able to invoke the other actions in actions.py.
I edited my bot to a bus service bot, with form name choose_bus_form and the action I wanted to invoke is ‘action_ask_bus_service’ (“bus_service” is a required slot). The logic of the action is similar to the code shared in my first post.
Yup. This is my endpoint.yml. I can run other customs actions in the same actions.py file
This is my config.yml if it helps
This is part of my domain.yml (The slots required are bus_stop and bus_service)
Definition of form
This is my current stories.yml
I have tried to run action_ask_bus_serivce and it works perfectly, but what I want to achieve is that the form will execute this action automatically when requesting for bus_service slot
Ah, ok, I think you may be getting some funky outputs because of how your form is defined. In Rasa 2.x, you no longer need to have the form in your actions.py. if you only want your form to get slots (which it looks like is what this form is doing?), you can define it like this in your domain file:
Hi, I wasn’t aware of the change in rasa forms in Rasa 2.x., thanks for pointing this out! However, I am really confused on how to convert my current form into Rasa 2.x as I spent quite a lot of effort reading tutorials and guide on Forms for Rasa 1.x. I will be very grateful if you can link me to some guides for forms written in Rasa 2.x. My form currently does validation, calls API for every slot filled by form and set another slot using the value returned by the API.