I have a problem with the buttons in rasa 2

so in my example I have a form and 4 slots, 3 of them are filled through buttons, I flowed the docs but there is a problem when I add the payload so I decided to remove it and it worked fine However , I have an utter_slots_values it is a recap on all the users answers unfortunately the problem appears while displaying this small recap I noticed the last letter of each value is missing

this how I used buttons :

responses: utter_greet:

  • text: “Hey! How are you?” buttons:
    • title: “great”

@Tobias_Wochinger can you help me plz ?

Thanks :slight_smile:

Some short note on your line breaks in your text using \n. There is a syntax in YAML for multiline strings: which makes this a bit more intuitive.

noticed the last letter of each value is missing

Lol, this is very weird. Could you try if the multiline thing fixes it? Otherwise I’m afraid it’s a bug.

Does this also appear if you speak to the bot via aother channel (e.g. REST? )

1 Like

I changed the line breaks unfortunately it didn’t fix the problem :confused: I did connect my assistant to rasa X but the buttons didn’t work I’m a little bit stuck in local mode the problem starts from the beginning as the screen shot shows can you give me any advice or a path to take in order to solve this please?

this is how I used buttons (was a little bit changed since I used rasa x but basically that) Thank you for helping :smiley:

the way it is mention in the docs (I followed the financial demo) it is like this

when I used the right way I get this

this why I eliminated the payload and I get the missing letter @Tobias_Wochinger tell me if you need more information plz and sorry for the late reply

What RASA version are you using?

@AminaDerouiche utter_ask_profiles:

  • text: c’est quoi votre profile buttons:
    • title: particulier payload: /bill
    • title: professionnel payload: /bill

utter_ask_marques:

  • text: “c’est quoir votre margue:\n”

Tip: make sure to create the intent of the bill and update in domain.yml file and even stories

For checking yml format : http://www.yamllint.com/ copy and paste and go

Hope it work.

1 Like

@nik202 I thank you for spending time looking into my problem and trying to help

really appreciate it.

Here is some feedback to your message :

  • the version of rasa is 2.5.0 and here is a screen shot for the rest as well

  • the “bill” intent is created and mentioned in the domain file ( when running rasa data validate everything is good)

in the stories and rules I’m not using the bill intent I’m using the bill_form

  • I checked the yaml format with the link that you send me and it looks good as well it’s valid (they gave me a nicer version yet the original one is valid)

  • for the solution that you proposed I tried it but once I run the rasa data validate I got this error

  • so I went to yaml format to checked and it is valid

so still don’t know what is the source of this problem, I’m here for any suggestion or advice on how I can solve this and Thank you again :slight_smile:

@AminaDerouiche Check Indentation

image

Train the model. Hope it works now?

Please share the Stories, Intent, Domain yaml files or if you have any action files.

1 Like

Hi @nik202 thank you for answering me, unfortunately it didn’t work it took /bill as the text :confused:

  1. data file

nlu.yml (3.4 KB)

rules.yml (806 Bytes)

stories.yml (540 Bytes)

  1. domain

domain.yml (3.0 KB)

  1. actions.py

actions.py (1.8 KB)

  1. config

config.yml (1.3 KB)

  1. credentials

credentials.yml (980 Bytes)

  1. endpoints

endpoints.yml (1.4 KB)

@AminaDerouiche can you share some scenarios, like steps with input? Input with expected output you are looking at?

What you especially looking at? Just a brief.

1 Like

I want to collect certain information so i know what the user is looking for so I start by greeting one the user will say I want to pay my bill “je veux payer ma facture” the form will be activated and certain questions will be answered

so an example of a discussion:

  • user: salut

  • bot: Bonjour, je suis un chatbot spécialisé en assurance\n comment puis je vous aider ?

  • user: je veux payer ma facture

  • bot : c’est quoi votre categorie (Use arrow keys)
    » 1: assurance

    2: sinistre Type out your own message…

  • user : (either pick or right down assurance or sinistre)

  • bot : c"est quoi votre marque:

marqueA

marqueB

marqueC

  • user : marqueA

  • bot :? c’est quoi votre profile (Use arrow keys)
    » 1: (particulier)

    2: (professionnel)

    Type out your own message…

  • user : (either pick or right down)

  • bot : c’est quoi votre produit (Use arrow keys)
    » 1: (maladie)

    2: (habitation)

    3: (climatique)

    4: (automobile)

    Type out your own message…

  • user : (either pick or right down)

  • bot :

Merci, vos réponses ont été enregistrées ! Votre recap :

final answer is a recap on every information the user entered with a fake link (as if it s his best solution to what he is looking for)

@nik202 if you need more explanation plz let me know and again thank you for your help

@AminaDerouiche did you need this type of buttons?

Bot: Bonjour, je suis un chatbot spécialisé en assurance comment puis je vous aider ?

User: je veux payer ma facture

Bot: image

User: Select either assurance or sinistre

User: assurance (Selected)

Bot: image

Till now its correct?

That what you expecting as the Bot output?

Yes or No?

Sorry: I do not know French :stuck_out_tongue: , but trying to help you as much as I can :slight_smile:

1 Like

Why do you have both buttons with same payload? both have /bill as payload. Syntax is fine here otherwise it won’t compile when you do rasa train

Below is an example for reference

  utter_greet:
  - text: Hey there 👋! I can help you with employee onboarding information related to following
  utter_greet_options:
  - text: Select one from below
    buttons:
      - title: "Forms"
        payload: '/main_forms'
      - title: "Personal Documents"
        payload: '/main_personal_docs'
      - title: "Official Documents"
        payload: '/main_official_docs'
      - title: "PI Report"
        payload: '/main_pi_report'
      - title: "Contractors"
        payload: '/main_contract_faqs'
      - title: "Medical Certificate"
        payload: '/main_medical_faqs'

You can even fill Entities with button payloads, check this official Wellness bot example

  utter_ask_health_form_stress:
  - text: Is your stress level low, medium or high 🧘🏼?
    buttons:
    - title: "Low"
      payload: '/inform{{"stress": "low"}}'
    - title: "Medium"
      payload: '/inform{{"stress": "medium"}}'
    - title: "High"
      payload: '/inform{{"stress": "high"}}'

Notice the two {{ }} brackets thats for python to prevent interpreting it for string interpolation. payload should be a Json like this → {“entity”: “value”}

1 Like

@nik202 yes exactly

1 Like

Added more example check answer again :slight_smile:

1 Like

@kmanadkat in the docs the payload is an intent , the option that the buttons offers are both from the same intent

categories is an entity that is linked to the intent bill

Yeah definitely, payload is intent, you are right. But lets circle back to original question. Buttons should work with syntax you have. Assuming you did rasa train and then rasa shell (also just to be safe, delete old models folder & re train & test)

The point of having two buttons is to have it call 2 different intents or fill different entities with same intent. you cannot have same payload (intent) & expect it to run differently :sweat_smile:? Am I missing something?

Cool, your actions in the domain need to be sorted and even stories. I have updated your file now. Just you need to pass payload as you have passed like /bill and you always need different payloads for marqueA, marqueB and marqueC with “utter”. It will take a lot of time for me to check the complete code. But I have updated the code, I am sure you will be able fixed the issue.

Tip: Go, step by step on outputs and one scenario at a time and /bill will not use two times, it will confuse the model. Try to delete the old models. If you believe your code is 100% correct.

Do let me know if it works for you or any other help :slight_smile:

I have only updated domain.yml file. domain.yml (3.2 KB)

2 Likes

I’m using buttons to fill entities

@nik202 I will have a look and let you

thank you so much for your help :smiley:

1 Like

No worries @AminaDerouiche , I have sorted your button problem only, for buttons payload to fill entities do check the rasa website. :slight_smile: Have a great day!

1 Like