So I’ve managed to connect a custom front-end for my chatbot.
The UI has javascript code which calls Rasa X API to authenticate the user and send and receive messages from the bot. So far, so good.
The Rasa X server where the Rasa X API is hosted is running locally on my computer on port 5002, and my actions.py script server is running locally on my computer on port 5055. Again, so far, so good…
However, when I re-start my browser to chat with my chatbot again, the slots are not reset from the previous chat, which obviously makes some parts of my stories get skipped when I chat again.
How do I reset my conversation everytime I refresh the page? Can this be done programmatically using Rasa X API? I haven’t been able to do so yet…
Also, how would this extend to having multiple users chatting to the chatbot at once? Since the tracker.db file is saved server-side, how can I have one server (local on port 5002 for now) for multiple users chatting to my chatbot at the same time? Because as it stands, if multiple users connect to the same server, I could fill the single set of tracker slots saved on that one server by messaging the chatbot from multiple clients.
Hi @alihejaziu multiple users chatting to the bot is possible out of the box. If you’re using the REST channel you just need to make sure you’re assigning each user a unique user_id. If you do that for each new session (so including you refreshing), then having a new session every time you refresh is possible as well. The socket.io channel has configurable session persistence out of the box as well, so that may be another option
Hi @akelad. Thank you so much for your response. If possible, could you please tell me how to “assign each user a unique user_id”. I’m struggling to find out how using the documentation.
that’s something you have to handle in your frontend. You then hit the rest api by sending the sender id you generated, along with the messages they send
can you show us the url on how you are passing the data to rasa from your front end(mostly it will be in js), for my custom widget for time being , i am generating random numbers and assigned it as user id to rasa.