I’ve developed a chatbot with rasa stack and Iwould like to integrate the it with Live Chat. I want to accomplish two major features.
Add a button named “Chat with a Live Agent” - when the user clicks on this button he/she should be redirected to a live agent from Live Chat.
Redirect to a live agent from live chat when the bot fails to answer.
I am unable to find documentations or examples pertaining to this. It will be a lot helpful for me to move my chatbot to live environment if you could provide me with an idea on how to approach this.
Thank you for the reply. To be more clear on my question, I would like to know about hand-off to a human agent by integrating Rasa chatbot with Live Chat. Can I switch from bot to human agent using rasa in terms of Live Chat api. If it is possible can you let me know how it could be done?
your frontend can route messages to a different backend when the bot sends some specific message
you can use custom actions to forward messages to a human
This second way is what @himanshus97 already suggested. You would want to implement a custom action that hands over to a human agent and use that as fallback action. If you add a button “Chat with a Live Agent”, have this button trigger the same custom action.
I’m able to post messages to Live Chat System (FreshChat) using the second method.
Now the live agent system needs to push responses back to rasa instance (and forward it to user). The live agent system supports webhooks and it can push messages (including sender_id) to rasa it.
I added a webhook HTTP API to the rasa server (rasa/server.py). I am able to receive messages from the live agent system. Also, I’m able to reproduce the tracker obejct and Input_channel object.
I managed to make this work for the Input Channels who are providing get_output_channel() fn. But issue is, for the Socketio Input channel, get_output_channel() only returns CollectingDisptacher object. So, I’m not able to push messages to the socket channel.
How can i approch this case ? I’m stuck here since past 2 days. Any help is appreciated
PS: If this is something in your roadmap, once the issues are sorted out, I’d love to create a pull request to support live chat handover
Cool that you solved it for some channels already! To make it work for the SocketIO channel, too, maybe you could implement a get_output_channel() function for the class SocketIOInput in rasa/core/channels/socketio. If you do this, feel free to create a pull request, then we can include it in a release so everyone can benefit from it.
About your PS: Thanks for the offer! I will bring this up in our next planning meeting.
@chkoss. We are looking at same. Could you elaborate a bit more on how we put on the bot ‘on rails’ to always send messages to this custom action when in ‘talking with agent’ mode. @himanshus97 I didn’t follow the fallback policy as the bot may still classify the intent, we just it to send all inputs to the action when the switch/slot is on. Similiar to how the FormPolicy takes over the normal predictive next action until.
Also which Rasa version has this socket.io fix has been implemented in?
https://github.com/RasaHQ/rasa/pull/5578
Status says merged, but not closed.
@alfredfrancis Did you manage to finish this end to end? Any suggestions on the above?
thanks
Hi, the custom action shouldn’t handle all the messages in talking with agent mode. Rather, you should have a client UI which can switch to a different backend, and the job of the custom action would be to prompt this switch and pause the conversation in Rasa. See this reply for further explanation.