Chitchat or rules not working after a slot was set

Hi, I have a problem with chitchat and rules after a slot was set. I am using rasa 2.8.14 and I had the problem also with previous versions and also with rasa 3.0.

More detailed description of the problem: I want to create a chatbot which gives the user information about the address and requirements depends on the the1 vehicle_type. And also chitchat should be possible. So when I start a conversation chitchat is working fine. There is no problem.

When I start with a question for the requirementse.g. and the slot was set to bike, the answer is correct. But when I asking after that chichat the bot ignores the chitchat and gaves a wrong answer (no utter_chitchat). I used the debug mode, and the nlu detects the intent correct in all cases, but the core ignores the rules.

I am confused because at rasa docs there was the following informations. And on my point of view it contradicts.

Now, your assistant should be able to respond correctly and consistently to FAQs or chitchat, even if these interjections happen while your assistant is helping the user with another task.

If I use influence_conversation: false for the vehicle_type chitchat is working fine every time, but than I didn’t get the right answer depending on the entity/slot value.

Details from rules and the domain file, I also used stories

# rules
version: "2.0"
rules:
- rule: always_greet_nameless
  condition:
  - slot_was_set:
    - user_name: null
  steps:
  - intent: phrase_greeting
  - action: utter_phrase_greeting

- rule: always_greet_withname
  condition:
  - slot_was_set:
    - user_name: true
  steps:
  - intent: phrase_greeting
  - action: utter_phrase_greeting_name

- rule: respond_to_chitchat
  steps:
  - intent: chitchat
  - action: utter_chitchat

# domain
intents:
- address
- requirements
- phrase_greeting
- chitchat

entities:
- user_name
- vehicle_type 

slots:
  user_name:
    type: text
  vehicle_type :
    type: categorical
    #influence_conversation: false
    initial_value: car
    values:
    - car
    - bike
    - scooter

responses:
  utter_requirements_car:
  - text: You need xxx.
  utter_requirements_bike:
  - text: You need yyy.
  utter_requirements_scooter:
  - text: You need zzz.
  utter_address_car:
  - text: The address is xxx.
  utter_address_bike:
  - text: The address is yyy.
  utter_addresss_scooter:
  - text: The address is zzz.
  utter_phrase_greeting:
  - text: Hello.
  utter_phrase_greeting_name:
  - text: Hello {user_name}
  utter_chitchat/how_are_you:
  - text: I am fine. 
  utter_chitchat/bot:
  - text: I am a bot.

Leave influence_conversation: false and use a form to hande the requirements intent.

1 Like

Hi, I solved it on another way. I added the chitchat to the stories. I wrote some stories where chitchat is inside. But I’m a bit confused, that it works on that way, because on rasa docs there are no informations about adding chichat to the stories.

influence_conversation: false of slot1 helped for the case with a rule and condition

  • rule: rule 1 condition:
    • slot_was_set: slot1

is it also relevant in the case of steps within a rule? steps: - or: - intent: inform_measurement entities: - slot1: 1

Hi there Julia! I’m having the same problem with my rules after a slot was set. Did you understand why this is happening? Checking the debug logs, it seems that there is no rule to apply (I didn’t figure out why it don’t find the right rule only after the slot was set).

For me, the solution was to duplicate rules by adding a condition statement with the two options of the boolean slot:

- rule: rule greet 1
  condition:
  - slot_was_set:
    - my_bool_slot: true
  steps:
  - intent: greet
  - action: utter_greet

- rule: rule greet 2
  condition:
  - slot_was_set:
    - my_bool_slot: false
  steps:
  - intent: greet
  - action: utter_greet

Adding the rules to the stories works fine too. I would like to understand why this is happening though.

I’m using rasa 2.8 and the default policies pipeline.

Thanks!

1 Like

Hi Andrés, thanks for your answer. Interesting to hear that others have these problems too. Unfortunately I don’t understand why this happend. I saw the same in the debug logs, and it was very confusing.

Thanks for our solution :slight_smile: hopefully we can help some other people with this issue.

I also found another solution. For my use case it was possible to use conditional responses like descriped in https://rasa.com/blog/conditional-response-variations/

1 Like

Hi Andrés, How does your intent list in the domain.yml look like?

Like this:

intents:
- chitchat
- faq

or like that:

intents:
- chitchat:
    is_retrieval_intent: true
- faq:
    is_retrieval_intent: true

I never saw it with is_retrieval_intent: true. I took a look in the domain file after I did some interactive learning and saw it. I could not found it in the documentation. But maybe this could also solve the probleme. I did not try it because I use the conditional responses at the moment.

Hi Julia,

I’ve tried the is_retrieval_intent configuration, but it didn’t solve the problem. I get the following error when testing the affected intents:

ERROR    rasa.core.actions.action  - Couldn't create message for response 'utter_None'.

Maybe is something you already know, but I noticed that the rules only fail if the slot is set in a custom action. I mean that you can create a slot, with an initial value, and use that slot to influence the conversation without problems. Once the slot is set in a custom action, the response predictions starts to fail.

Thanks for your reply!