RocketChat/Apps.Rasa

Customer handover happens only once

Closed this issue · 10 comments

bmwas commented

Hello,

I'm experiencing a rather confusing behavior with the bot-human agent handover process. If the customer is new - let's say customer 1, the bot is able to perform a successful handover to a department and everything works fine. However, let's assume the first chat from customer 1 is closed and even deleted from rocketchat but the same customer initiates another chat from either same browser or same phone number (assuming it's sms), the bot-human agent handover fails with an error (see below). However, let's assume customer 2 who has never made contact tries to ask for a human ...this action is successful - which indicates that it fails once the customer's information is added onto the contact list. Any suggestions what might be going wrong here? I would like to have customers get multiple bot-human agent handover regardless of whether they are registered in the contact list or not.

Thanks you!

morethanonce

[
"Error occurred while processing the request. Details:- Error: Error! Invalid request. User is already present in the specified department"
]

I have attached a screenshot from the APP logs

bmwas commented

I'm sorry this issue seems related to my earlier issue posted here #13 ...I would like to add that I've also tried with rest and callback methods and I receive the same error.

I have attached a screenshot from the APP logs

Do you have to setup anything for the handoff to agent apart from rasa.app settings?

bmwas commented

@bshowket Yes - I have a custom action within rasa that hands over the customer to a live agent based on a pre-specified intent (e.g. can i talk to the manager).

@bshowket Yes - I have a custom action within rasa that hands over the customer to a live agent based on a pre-specified intent (e.g. can i talk to the manager).

i have intent to hand over , but i am not sure what that action would look like, do mind to share your action snippets with me please?

for the above issue, i saw same behavior, only way i can use it for test if you use GDPR rule , and forget the data...

image

Error! Invalid request. User is already present in the specified department

@bmwas Regarding this error, it is supposed to be thrown when the targetHandover department is the same as the department in which the visitor is currently present. Could you please verify if this is the case or not?

bmwas commented

@murtaza98 Yes that's right. I only have one department at the moment and the assumption is that I will have visitors that might drift on and off as they interact with the bot on multiple instances spread out in days/months.

I would like to forward them to live agents based specific triggers/events. It looks like the current setup assumes that the visitor interacts with the bot only once?

It also seems like once the live agent closes the chat - the visitor still remains in the department ... Are you aware of a way to remove a visitor from the contact center or switch their departments?

I appreciate your response

@bmwas I'd like to suggest an alternate approach for dealing with departments. This is the approach I had in mind while developing this app.

Create a department with only bots and another department with only live agents. Whenever you want to transfer the chat from bot to live agent, you simply have to specify the target department as the department with live agents.

I think if you follow the above approach, the issue you're facing will be solved.

Let me know if there are any concerns:)

bmwas commented

@murtaza98 Thank you. I will definitely try this. I appreciate :)

bmwas commented

For this particular use case - where a visitor can be forwarded to an agent multiple times ( assumes they interact with the bot regularly) - I decided to use the main rocket chat api endpoint /api/v1/livechat/room.forward - where the bot forward to the next available agent. This works well for now.