Pause a Conversation in custom Action

I am at a point where i want a going conversation to be paused in a custom action, and take all the user inputs directly toward this custom action without getting it through NER. After a taking answers of a couple of questions from user i want to resume the conversation from that state again.

Anyway to achieve it or any findings ?

Thanks P.S Excuse my noobness.

1 Like

you can return a ConversationPaused() event to pause the conversation within a custom action. But i’m not sure how you would get user input from the user if you pause the conversation?

Yes, I am also facing the same issue for human agent handoff, returned ConversationPaused event from custom action and there is no way to send user input to human agent afterwards.

Is there any way to pause and resume conversation in custom action without returning from custom action run method?

Also if two users send request at the same time for custom action, the second user request didn’t reach to the custom action till first user request gets completed.

Please suggest how to handle human handoff with handling multiple user requests at a time.

This should work fine – you just have to forward the messages to the human agent now. The messages should get recorded, they just don’t get handled by Rasa Core

Hi,

But how to forward those messages to the human agent ? I can’t find anything for this part of the handoff.

Can you help me ?

Thanks

This depends on what you’re using for the human agent part, there’s not really a general solution there

Any proper solution on this problem ? Because its confusing that how can we develop an interaction between human agent and the user?

1 Like

I’m using the following for loop to get the history so far. After this I pause the tracker, which is giving me problems.

for event in tracker.events:
                if event.get("event") == "user":
                    logger.info("tracker.event[]: {} (User)".format(event.get("text"))) # DEBUG
                elif event.get("event") == "bot":
                    logger.info("tracker.event[]: {0}: {1} (Bot)".format(event.get("event"),event.get("text")))
                elif event.get("event") == "action":
                    logger.info("tracker.event[]: {0}: {1} (Action)".format(event.get("event"),event.get("text"))) 
                else:
                    logger.info("tracker.event[]: {0}: {1} (Other)".format(event.get("event"),event.get("text"))) 

Then I start a loop that keeps checking for new messages from the LiveChat API and in the tracker.events. But it seems the paused tracker isn’t accepting any message from the user anymore. On the console I get the following:

rasa_1 | 2019-10-29 14:24:50 DEBUG rasa.core.lock_store - Failed to acquire lock for conversation ID '85bebecfb21f42508d07e240fc0097ad'. Retrying...

Have you found a solution?

@akelad are they recorded in the tracker.events? I’m getting an error on the console (logs): Failed to acquire lock for conversation ID ...

@wim.de.webmaster no, when the ConversationPaused event is trackered, Rasa stops listening for user messages.

@akelad I found my mistake, I way connecting through websockets inside a custom action and trying to keep the websocket connection open while uttering templates etc. That doesn’t work very well… and I found that connection to a async webservice from the action server isn’t really a good solution.

1 Like

What solution did you find?

Well, I was taken of the project just after this… management didn’t want people doing innovation… so never got a change to fix my mistake… I have some ideas but no way currently to try them out.

You can do socket programming where your conversation get paused.

hey @sushilr007 can you elaborate how to do socket programing in rasa website chatbot

I’m stuck here for a long time please help to get out of this problem