When we reset slot during train rasa_core chatbot

Hi everyone, I’m newbie, I just start to study about rasa chatbot about there weeks. I have a question that I don’t know when I will reset slots for reasonable. So, my issue described as follow example: ex: When a person name A, he give name to bot then name_slot = ‘A’. But at some second later a person name B say hello to the bot then the bot will say “Hello A” instead of ‘ask name of B and say Hello B’ :(. Hope some one can give me some advice to fix this problem. Thank all.

Hello @hau.08tth,

I’m not sure if i understand your problem correctly, but in the case of different users talking to the bot, there will be different sender_id for each of them. Rasa server will handle conversations depends on this sender_id, which means different sender_id = different conversation.

So person A’s conversation has nothing to do with person B’s conversation, since they have different sender_id.

Currently how do you send messages to the bot ? Do you have your own custom chat UI or are you using premade one ?

Hello @fuih, thank you about your answer. I already thought about sender_id but it just return ((tracker.current_state())[“sender_id”] = “default” for any user. My bot are now run on facebook, you can find it with name “Bigdata-msg” but it’s built to chat with Vietnamese language. I don’t know can you typing Vietnamese language :).

I haven’t integrated Rasa with facebook yet so i don’t know about this, but if that’s truly is the problem, then you simply need to find a way for facebook to send different sender_id for different user. You shouldn’t manually handle this, because you can’t. Imagine if you have 100 people talking to your bot at the same time, the bot will treat those 100 people as 1 person, which is absolutely a disaster. They will share all the slots, all the information, conversations mix together, etc,… I’m sure there is some type of configuration so different user will have different sender_id for the facebook channel, let’s wait for the devs or someone with experience with facebook channel to answer the question.

OK, thank you very much. I also try to integrated this bot with telegram but it also get same issue. So, I think that issue come from my config during training bot but now I don’t know how to fix. Hope someone with experience with rasa_core training can help. Thank you @fuih

Hi fuih, I solved this issue by save information with user_id as key to file if you want to run on test local. Someone advice that you can save user information to Redis or a database for faster. I have tested save info to file and it work well. Thank about your reply.

Glad that you find a solution, @hau.08tth.

But i’m having trouble following you, are you creating custom sender_id for each user and save them to a file ? Does the facebook channel allow you to send custom id for each user ? I thought it’s always ‘default’ for any user. How do you interfere with the facebook connector and make it send the id in the file ?

Sorry if i’m being a little bit clueless, i have never tried integrating Rasa with facebook, might try it in the future though haha :smiley:

Hi fuih, Sory for late answer. As you know, you cannot get sender_id in actions.py because it just give you “default”. So, to get sender_id you should save sender_id from app.py or main.py and and slot for each sender_id can be saved in custom actions. I see that, rasa app will process one by one mess from users therefore you just mapping sender_id and slots of them by index. Hope this can help for you :slight_smile:

1 Like