How to get RASA to send session id along with response data through socketio channel

I am building a client script where multiple clients go through the same socket connection. A user sends a message and using the user id as session_id, I am sending the message to RASA to process.

A lot of users are going to be using this so there is a possibility that some users may be communicating with RASA through this script at the same time. The message is identified properly and matched to the right user and then sent and RASA properly identifies the conversation flow and sends a response back.

Now the problem is that when RASA sends back a message all I get is {‘text’: ‘(response to message)’}. Since a lot of users a texting at the same time due to some background process happening in the script it is hard for me to identify which user the response belongs to. Is there anyway for RASA to send back the session_id along with ‘text’ in the response so I can correctly identify which user the response has to go back to?

You can get the sender id with tracker.sender_id. The request and the response always have this sender id and you can use this to identify the user.

This is an response that is part of my flow from RASA

RESPONSE FROM RASA {‘text’: ‘1st of every Month’}

The values inside {} is the only data that I get from RASA as a response. There is no sender_id or session_id or any other data. I know over the RESTApi channel we get sender_id and other information back but this response is over SocketIO.

How can I make RASA send tracker.sender_id? I dont see any parameters I can configure in the credentials.yml file to be able to send any other information or any other way.

1 Like