Slot setting

Hello,

I have been working on my chatbot and have found the problem that my slot ‘selected_dimensions’ is not being set in one of my actions when I have the return value:

return [SlotSet('selected_dimensions', selected_dimensions), SlotSet('campo', None), SlotSet('campo_valor', None)]

However, this bug doesn’t occur when I use rasa interactive. It occurs however when I use rasa shell or rasa run with Telegram.

I have tested my bot many times and found that the slot is indeed not being set because it’s causing problems in following actions. But like I said, this problem doesn’t occur when I use rasa interactive.

Can anyone give me a tip on how I can fix this issue? Is there a bug in SlotSet possibly?

Best regards, Robyn

Hi Robyn,

SlotSet is heavily used so I think a bug is not likely. What version of Rasa are you using? Can you do a print of the selected_dimensions and the channel name just before the return.

Greg

1 Like

Hi Greg,

I am using Rasa 1.10.7 and Python 3.7.6.

I have looked a little bit more into the problem and have found that the slot is being set, but its value is not staying when I run the next action.

Here is the output of the results of tracker.get_slot(‘selected_dimensions’) from the custom action “action_confirm_valor” after SlotSet was run with the current value of selected_dimensions being {‘Ano’: ‘2010’, ‘Filial’: ‘Rio de Janeiro’}, and the output of tracker.get_slot(‘selected_dimensions’) in the action “action_get_vendas” which is run after it.

SlotSet('selected_dimensions', selected_dimensions)
selected dimensions at the end of action 'action_confirm_valor'
tracker.get_slot('selected_dimensions'): {'Ano': '2010', 'Filial': 'Rio de Janeiro'}

selected_dimensions in next action 'action_get_vendas'
tracker.get_slot('selected_dimensions'): {'Ano': '2010', 'Filial': 'Sao Paulo'}

For example, here is a part of a story:

 - action_confirm valor
 - slot{"selected_dimensions":{"Ano": "2010", "Filial": "Rio de Janeiro"}}
 - slot{"campo": null}
 - slot{"campo_valor": null}
* vendas 
 - action_get_vendas

Here are screenshots of the two actions

Here is a screenshot of a part of a conversation on Telegram where the value of the slot was not saved to use for the next action “action_get_vendas”.

Captura de Tela (84)_LI

Every time I run this sequence of intents and actions in rasa shell or on Telegram, I get the same result of the slot not changing, but when I use rasa interactive it changes.

I hope that helps to explain the problem a little bit better.

Thanks in advance for the help!

Best regards, Robyn

I found that the slots were being “unset” somehow because of the fallback policy that was being used. I removed the FallbackPolicy from config.yml and my code worked fine after that.