Rasa human handoff, messages sent while ConversationPaused aren't ignored

Hi, I’m attempting to build a bot that has the ability to handoff conversations to human agents mid conversation as alluded to here:

The problem I’m running into is that the messages from the participant that took place during the participant <> human agent conversation (while the conversation was paused) are still being read in after the conversation is resumed. Is there a way to ignore messages that are sent while the conversation is paused?

Perhaps this is due to me using the cmdline interface for the bot and stdin is still being processed while if interface was Slack or some other connection, it would be safely ignored while conversation is paused?

I’m making use of the ConversationPaused and ConversationResumed events, where I pause the conversation if the action to talk to a human agent is triggered. And then listen on an external API where messages are posted to by the human agents, polling this API and getting the messages into the conversation. Once the human agent sends an ‘/unpause’ message, I trigger the ConversationResumed event, and hand the conversation back to the chatbot. Here’s the code to do that: rasa-handoff/actions.py at master · moaazsidat/rasa-handoff · GitHub

Any help would be much appreciated. cc @akelad @tmbo

3 Likes

Moaaz, we built a human agent interface for callcenters: expertflow.com/chat . We want the bot to continuously stay involved in the conversation, so that he will suggest the best answers to the human agent, and auto-respond if the confidence level is sufficiently high.

1 Like

Hi @moaazsidat sorry we overlooked your post. So you mean Core tries to predict the next step based on everything the user has said between the ConversationPaused and ConversationResumed events? Hmm, not sure that’s how that should be, we’ll take a look into what’s going on there

@moaazsidat Did you get your code worked for human handoff? Could you help me how you solved it? I tried like your code only, but it gives the error of tracker.update as Attribute Error: tracker doesn’t have the attribute “update”.

2 Likes

Hi, I am trying to implement human-handoff feature in a Bot I’m building too and I’m facing some errors while using the above mentioned piece of code. Is there some inbuilt feature in Rasa that allows us to do so? @moaazsidat How were you testing your human handoff feature, like how where you conecting to the Human Agent’s email account to fetch his messages and vice versa.

cc: @akelad @tmbo

1 Like

@moaazsidat Hi, I am trying to implement human-handoff feature in a Bot. I’m facing some problem while using the above mentioned piece of code. How were you testing your human handoff feature, like how where you conecting to the Human. I mean from where human can reply message to bot.

Rasa shell: handoff01

api.py: handoff02

handoff04

How human can interact with bot through api.py? @akelad

1 Like

action class:

api.py:

It seems you have connected from bot to api.py now you have create front end for human agent too and that will be connected to api.py so it will look like this (Chatbot > api.py > Human agent). Tip - You can use webhook for that.

did you solve?

No I haven’t tried but you can achieve that. my req has been changed so I quit.

Hello. I have the same problem, will it be fixed?

@Nicanor could you describe your problem please?

I want to test human hand off in rasa chatbot.can you share me a tutorial or step ?

Hi everyone from Rasa!

I’m also facing similar concerns.

Assumptions

To expound on this concern, here are the pre-requisites that I did:

  1. Created a Rasa action server
  2. Execute pass_thread_control through facebook's Graph API
class ActionFacebookHandover(Action):
    def run(self, dispatcher, tracker, domain):
        ### some logic here
        return requests.post(
            "https://graph.facebook.com/v2.6/me/pass_thread_control",
            params=url_query_params,
            json=json_data
        )
  1. Serve facebook webhook endpoint through Rasa
  2. If it’s important, I’m only doing all this within a development state with a facebook app that I created

Problem

All features for responses and intent classification are working great. The issue now happens, as described by original problem above, that:

  1. the thread control is passed or handover is passed to live agent
  2. the secondary receiver, message inbox, or agent talks to the facebook user – take note of the conversation between the user and the agent on this step
  3. the agent marks the conversation as done and will pass the control back to Rasa
  4. ALL messages between agent and user will now be processed by Rasa as if their user input for the bot

Maybe this could help solve the problem. I’m not sure if this is a facebook problem; but would be great to know your thoughts on how to alleviate the problem. Thank you!

Edit: I haven’t tried looking into events like ConversationPaused() or ConversationResumed() but I will look it up if this helps.

1 Like

As with the problem mentioned above, I’m getting the same issue with regards to pausing the conversation when the conversation is handed over because this means I cannot execute ConversationResumed.

you can hit this tracker endpoint to resume a conversation

Thanks for this! Works great!

Can someone provide good documentation for human handover using telegram.

Did this work for you sir?

Is there any way to implement human handoff using Socket programming? Currently, my user can only send a message when there is any key that triggers human handoff. But I want to establish a permanent connection between the rasa chat interface and the admin interface keeping the bot silent.

Please don’t share that financial and help desk demo it is not worth it, I want human handoff, not bot handoff.