webchat and rasa, handling multiple users on a nodejs backend

Viewed 173

I've setup a dockerized rasa installation to communicate to using a non dockerized react (mongo node express) frontend. I'm using the botfront webchat component as the chat component and I can send and receive messages correctly from rasa.

What I don't understand is how to make it so that different users (in the nodejs backend) can have different chats (in the rasa backend).

I've setup a custom connector for rasa and webchat using socketio which is setup to create a new sessionId at every connection event. This seems to work correctly as in the browser console I do see the following upon consecutive refresh:

connect:d01c6e80aa2647a186f087a4d1849ef9
session_confirm:d01c6e80aa2647a186f087a4d1849ef9 session_id:e50e1e9c87eb48c989d3d98022a0e8c3
connect:c6fc7aff5f0448a89ee54642561fe34c 
session_confirm:c6fc7aff5f0448a89ee54642561fe34c session_id:2811d41ff0c44d398927d019b3d604f9

I assume the two session_ids being different means that the chat should appear empty, however the previous interactions are still visible.

Moreover, session_persistance is set to false in the credentials.yml file but this doesn't seem to have any influence

 MySocketIO.WebchatInput:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: false

And also in the widget itself I am setting the storage to session and not local:

<Widget
      initPayload={"/get_started"}
      socketUrl={"http://localhost:5005"}
      socketPath={`/socket.io`}
      customData={{"language": "en", 'ciccio':123}} // arbitrary custom data. Stay minimal as this will be added to the socket
      params={{'storage':'session'}}
      title={"Title"}
    />

I need to send the mongodb user._id of the specific user using the chat to the rasa custom actions and that is currently working through the customData, however I still cannot find out how to keep sessions of different users separate from each other.

0 Answers
Related