Buttons without text

Is it possible to define buttons without text? If I leave out - text: in my domain file like so:

      - title: "Yes"
        payload: '/affirm'
      - title: "No"
        payload: '/deny'

then rasa train gives the following error message:

I’ve also tried setting text: None but this produces a YAML error.

I don’t want to set - text: "" as I think this would produce an empty text message whereas I want no message at all.

If you’re wondering why I don’t want to define a message in my domain, it’s because I’m using the message for a dozen of these buttons, so instead of repeating this message a dozen times I am instead using a custom action to utter this message, then to select the proper button to display.

I tried adding the dash before buttons but that didn’t solve it.

Unfortunately, the yaml format is super sensitive to whitespaces. The example given should be

  - text: "Hey! How are you?"
    - title: "great"
      payload: "/mood_great"
    - title: "super sad"
      payload: "/mood_sad"

as here.

@j.mosig Thanks for your help; however my question is about how to display buttons without text. I copied and pasted exactly what you have into my domain, and deleted the third line (- text: ). This resulted in the same error as in my original post. I also tried adding a dash before it, which resulted in the error attached in my comment right above yours.

Oh, that text you mean! So you want to just display a button (with a button title) and not have the bot utter anything else. (Sorry, was a bit slow here :sweat_smile:) Then it should be

  - buttons:
    - title: "Yes"
      payload: "/affirm"
    - title: "No"
      payload: "/deny"

with a - before the buttons and exactly this indentation (any extra or missing space will break the file). But it seems that you have tried this… What is the output of rasa --version for you?

I am still getting the following error message:

Here is the output of rasa --version:

Indeed, in the lower terminal you can see that there is an incompatibility warning. However I’ve reinstalling rasa and it still gives me v2.1.3 so I’m not sure how I should fix this.

I was able to find a workaround to this issue. Instead of using responses/utterances to display buttons, I did it inside custom actions, like this:

    {"payload": '/affirm', "title": "Yes"},
    {"payload": '/deny', "title": "No"},

I think it’s possible that the reason I wasn’t able to define the buttons as utterances without text was the version incompatibility.

Hi @alexyuwen

Yes, that works, too. The YamlValidationException is still odd. The compatibility issue was a bug and should be fixed in the recent version (Rasa Version: 2.2.2, Rasa SDK Version: 2.2.0)