Is it possible to make a numbered menu based bot with rasa?( options 1,2,3)

I’m trying to make a menu based chatbot, wherein user just has to enter 1/2/3/4 numbers to choose from options instead of typing the full option name.

Most of the chatbots on whatsapp are number based menu bots.

Is this possible in Rasa? Any help is appreciated . Thanks

2 Likes

Did you find any solution for this ? @bamwani

Hi @bamwani and @salman01z! You can use a set of Rasa features to achieve that. See if the following helps you.

First you must create an intent that will receive the numbers/answers. Regex may help to identify it. Then, if you choose to display buttons, set this intent as payload for each option. On each story, use slots to branch the flow, like:

  • slot{“option” : “1”}
  • utter_option_1

Hope it helps!

2 Likes

Thanks @GeovanaRamos . I can’t use buttons but using regex and branching stories based upon slot values solves my problem

is it resolved, please let me know how it could be

hey Geovana , can we have a super simple code for this ? like choosing ‘1’ may show some text ‘abc’ and choosing ‘2’ show some text ‘xyz’

would be grateful

1 Like

hey Salman

how did you solve this ? , can you share for stories and domain & actions.py files etc

1 Like

Hey guys, how are you? Someone has solved the problem. How?

Thanks.

it’s like you can give custom value to the entity and you want to give different stories for each option

So you can achieve this

Hi! For example:

Menu

    1. Info Enterprise
    1. Request Turn
    1. List People

User: 1 -> Call Api - Info Enterprise

User 2 -> Sub menu of items 3

    1. Get turn
    1. Delete turn
    1. Update Turn

In each option list new options with apis delivery. And since it is for WhatApp, the best option is a menu with numbers.

my problem is that it does not recognize the numbers. So, I don’t know which option is selected by the user. Once selected, I do the option that says. That is, delete, update, etc.

Thanks

you use the ducking to extract the numbers @lcaraves

check out here

how do you do it

Can you help us with that please

I used a middleware where if I receive a single digit number, I add a “/” before it. So instead of message, It is now accepting as intent. which is working fine

Could you help me with an example since I am new?

Can you please help by giving example? Will it also work for freeflow conversion?

Hello everyone :slightly_smiling_face: This answer is probably a bit late but I’ve made a small example bot that I hope will help you solve this challenge :raised_hands: Let me know if it was useful to you. Link to the repository.

3 Likes

Hello everyone,

I know this is an old topic, but I took the opportunity to learn and improve my use of Rasa. Following some recommendations and the example given by @lcaraves , along with @Derguene 's repository, I created my own example.

I’d like to share the repository with you so you can take a look.

https://github.com/BartoGabriel/rasa-menu-sample

In essence, whenever I present a menu of options, I save the currently viewed menu in a slot (or None if there is no menu). Then, I detect user intentions for options (I chose to use a letter), and I have an action that detects the current menu and the user’s choice to determine how to proceed. I also perform some validations, such as ensuring that when an option arrives, there is actually a menu, or that the letters correspond to some of the options. Additionally, I allow the user to either type an option or state what they want directly. For example, if the user writes, “I want to schedule a new appointment,” the intent for a new appointment will be executed directly.

I hope this example helps you, and I would like to hear what more experienced people in Rasa think about my solution. I don’t have as much experience, and I’m not sure if I did it the right way.

1 Like