0

I am new to using Rasa and stack overflow as well. I am creating a restaurant search bot in Rasa but I am stuck with an issue in buttons.

utter_ask_budget:
- buttons:
    - payload: cheap
      title: Lesser than Rs. 300
    - payload: medium
      title: Rs. 300 to 700
    - payload: expensive
      title: More than 700
    text: what is your budget?

I created this response and it shows buttons when it asks for budget but issue is it also shows a text input field so that user can enter a custom value in that field. I don't want that to happen. I want to restrict the response to buttons only no text field. I checked on Rasa forum but I couldn't understand the answer.

So turned to stack overflow community.

I would appreciate any help with this issue

Thanks

developer101
  • 118
  • 7

2 Answers2

0

I guess when you refer to 'Text Field' you mean where the user typically types the message. I dont think you can disable that: the buttons allow to provide predefined options to the user, easy to use but he/she can decide to type a message instead.

If this the case you need to validate the message you receive is one of the expected values.

Beppe C
  • 11,256
  • 2
  • 19
  • 41
0

You can send your own custom elements by using “custom:” key in utter templates.

Here is my example:

utter_buy.confirm:
    - text: "Are you sure?"
      buttons:
        - title: "Yes"
          payload: "/affirm"
        - title: "No"
          payload: "/deny"
      custom:
        input_type: "disable"
        back_button: true
        exit_button: false

don’t forget to re-enable buttons on next bot message…

Harmandeep Singh Kalsi
  • 3,315
  • 2
  • 14
  • 26
  • For which frontend this is working, I am using rasa webchat by Botfront, I don't see the desired results. – Bharath Nov 17 '21 at 06:53