I want to integrate a live chat into an existing website that users can navigate with or without logging-in.
Optimally I want to manage two different scenarios:
user could chat with the assistant through the live chat, even if not (yet) logged for general info, etc.
But the basic requirement is that user must log in the website with his credentials (username/password) and afterward he can chat with the assistant backend as a logged-in user with a single user_id (say the username == his email). In that way the assistant can profile/personalize answers.
My question is about how to possibly simply configure the sender_id equal to the username with rasa-webchat.
The integration seems seamless in case of an “impersonal” chat , and as I well understood, in this case the sender_id is set with a random value. That’s ok for the case (1)
yes, the second mode (send and explicit intent setting a slot) confirm previous answer and seems to me a nice way to allow user to conversate with the bot, in two different roles:
as anonymous user (not “yet” logged user)
as logged user (after /my_init_intent{"username": "xy"})
“yet” because by example the livechat could be always available (for generic chat/FAQ/impersonal topics) but the chat could react to specific domains based on the specific username profile.
The drawback of this solution is that rasa webchat component sender_id is useless to identify user. That not necessarily bad, but also …
The first solution you suggests, could help in te scenario where RASA bot has many channels (connectors). In this case I probably need to manage an unique user_id (== sender_id) map explicitly.
By example, say we need to have 3 channels in parallel:
a live chat channel,
Telegram instant messaging channel,
an e-mail channel too.
Suppose also the bot has to push notifications to user (say on the Telegram/e-mail).
In this case I guess I have to manage a user_id gateway, that’s a dictionary mapping unique sender_id to the id of each channel. By example: