Forwarding messages to Slack and vice versa for human hand-off

Hi, one possible way to accomplish that would be the following:

So this means you

  • have one action action_human_handoff like you suggest above. In addition to what it does already, have it set a slot like handoff_active.
  • add a policy like described in the post I linked

And then for sending messages back and forth between the user and the human support, you could implement another custom action like action_talk_to_human which your policy always predicts while the handoff_active slot is set. The action action_talk_to_human could e.g. use the Slack API for sending messages to send the last message from the user as a reply to the thread that was started by action_human_handoff, use the Slack API for retrieving messages to get the answer that is sent by the human support, and then forward this answer to the user.

Once the hand-off is no longer required, the human support should send a specific message, e.g. /handback. The action action_talk_to_human needs to recognise this and unset the slot handoff_active.

Hope that helps, let me know if you have more questions.

6 Likes