Can we branch code with Forms in Rasa?

I wanted to know if it was possible to branch code with Forms?

For example if I have a restaurant booking bot and the coversation goes like:

Bot-> What would you like to eat today?
User-> Fish and Chips
Bot-> Would you like Tartar sauce with that?
User-> Yes
Bot-> Ok your order have been placed.

So I basically want the bot to inquire about Tartar sauce, in the case that the user wants fish and chips. However, I don’t want the bot to ask about tartar sauce when the user says some other food item like chicken.

Bot-> What would you like to eat today?
User-> Chicken Burger
Bot-> Ok your order has been placed.

Is such branch coding possible with Rasa?

Hi @BrookieHub - yes you can absolutely do this. You can check out the docs here for how to dynamically add slots to fill to a form.

1 Like