Slot list does not stay empty

I have a slot of type list containing options the user can choose from (displayed as buttons).

Each time the user picks an option:

  • an utterance is shown.
  • the option gets removed from the slot list
  • the remaining options are shown

This works. Also explained in a previous topic.

- rule: Show remaining options
  steps:
    - intent: show_remaining_options
    - action: action_remaining_options

- rule: After choosing an option, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - action: action_remaining_options

rasa shell

/show_remaining_options
a
b
c
-> a
b
c
-> b
c
-> c
<empty>
/show_remaining_options
<empty>

However if I want one of the options to not display the remaining options, I cannot empty the list. More precisely rasa shell --debug and log statements in the action server show that the slot list is empty, but as soon as I show the remaining options with /show_remaining_options the last options get refilled.

- rule: After choosing an option A, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_a
    - action: action_remaining_options
- rule: After choosing an option B, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_b
    - action: action_remaining_options
- rule: After choosing an option C, do not show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_c

rasa shell

/show_remaining_options
a
b
c
-> a
b
c
-> b
c
-> c
/show_remaining_options
c

Here is the code in a GitHub repo. It is a minimal working example straight from rasa init. head~1 has the working example, current commit has the problem described.

If I add a rule to also show the remaining options after c, I have the same problem:

- rule: After choosing an option A, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_a
    - action: action_remaining_options
- rule: After choosing an option B, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_b
    - action: action_remaining_options
- rule: After choosing an option C, show remaining options
  steps:
    - intent: choose_option
    - action: action_choose_option
    - slot_was_set:
      - option: utter_c
    - action: action_remaining_options

Hi, I wasn’t able to replicate this. I cloned your repository, trained the model, and ran rasa shell. Am I missing something? Or have I misunderstood the problem?

Your input ->  /show_remaining_options                                                                                                   
listing options [{'title': 'Option A', 'payload': '/choose_option{"option": "utter_a"}'}, {'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}, {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
? None  1: Option A (/choose_option{"option": "utter_a"})                                                                                
option utter_a
before deletion [{'title': 'Option A', 'payload': '/choose_option{"option": "utter_a"}'}, {'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}, {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
deleting {'title': 'Option A', 'payload': '/choose_option{"option": "utter_a"}'}
after deletion [{'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}, {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
listing options [{'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}, {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
Option A chosen
? None  1: Option B (/choose_option{"option": "utter_b"})                                                                                
option utter_b
before deletion [{'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}, {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
deleting {'title': 'Option B', 'payload': '/choose_option{"option": "utter_b"}'}
after deletion [{'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
listing options [{'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
Option B chosen
? None  1: Option C (/choose_option{"option": "utter_c"})                                                                                
option utter_c
before deletion [{'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}]
deleting {'title': 'Option C', 'payload': '/choose_option{"option": "utter_c"}'}
after deletion []
none
Option C chosen
Your input ->  /show_remaining_options 
Hey! How are you?
Your input -> 

Thanks for checking it out. It works now. No idea why :man_shrugging:

1 Like

Glad to hear it. Happy bot-building! :slight_smile: