Rasa conditions ( Couldn’t create message error )

I added a condition to my response and whenever I invoke it I get the following error :

ERROR rasa.core.actions.action - Couldn’t create message for response ‘utter_select_inquiry’.

Here is my code, you can just ignore the Arabic text since it was valid and works when I remove the condition

*domain :

  utter_select_inquiry:
  - condition:
    - type: slot
      name: type_inquiry
      value: true
    text: "هل ترغبين بالاستعلام عن معلومات عضو هيئة تدريس ؟"
    buttons:
    - title: "نعم"
      payload:  معلومات عضو هيئة تدريس 
    - title: "استفسار اخر"
      payload:  استفسار اخر

*rules:

- rule: ask user to submit an inquiry
  steps:
  - intent: select_inquiry
  - slot_was_set:
    - type_inquiry: true
  - action: utter_select_inquiry  

*stories :

- story: inquire
  steps:
  - intent: select_inquiry
  - slot_was_set:
    - type_inquiry: true
  - action: utter_select_inquiry

please let me know if you have any ideas on how to resolve this…

It looks like a formatting issue: I believe the payload should be on a new line & indented (no leading characters).

1 Like

Please properly format your code on the forum by placing three backticks around it

```
like this
```

I have done it for you but please do it yourself in the future


That said, are you sure the type_inquiry slot is set to true? You can make sure with rasa shell --debug or Rasa X.

@rana2378 can you please share the rasa --version for the reference?

@rana2378

My main concern is payload how you are defining the syntax for that, if its generic syntax then you need to mention the intent for the payload as shown in the doc: https://rasa.com/docs/rasa/responses/#buttons

Demo code for the English language:

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

I don’t know about your native language but I am suggesting as per the generic thumb rule, I can be totally wrong.

@rana2378 further please see the indentation of your code please ref this doc link: Responses

Demo code:

responses:
  utter_greet:
    - condition:
        - type: slot
          name: logged_in
          value: true
      text: "Hey, {name}. Nice to see you again! How are you?"

I hope this will help you and good luck!

1 Like