Remove previous message

Hi,

I am running the open source sever and having conversations with it through the HTTP API. My question is: Is it possible to remove a previously sent message and restore the conversation to the state before the unwanted message? I see this. But 1), does modifying the tracker allow me to do this, and 2) I see that this method is not to be used in production.

Any help is appreciated!

Hi @nmvl. In general, the endpoint you are referring to would allow you to remove a previously sent message and restore the conversation. It’s not designed to be used in production since it can be used to modify important states of the conversation and break the assistant in a middle of the conversation.

How do you see this functionality working? Would you like to enable the users delete the messages sent to the assistant in the middle of the conversation? Or is it something else that you are after?

Hey @Juste, thanks for the quick reply. My use case is a bit tricky, but the general idea is that I would send a message to the server, but then based on some other input I get from the application, I would like to unsend that message. In my application, the user does not communicate directly with the rasa bot.

Could you expand a little more on how the conversation could be broken using this endpoint?

Hey @nmvl. I think instead replacing all events you should use the endpoint for adding events where you can advise your bot to revert the last user message by passing a userutterancereverted event.

Thanks @Butusov, to get it to work I had to pass an array of events:

[
    {
        "event": "rewind"
    },
    {
        "event": "action",
        "name": "action_listen"
    }
    
]

The rewind event to undo the previous user message, and the listen event to get the bot to properly respond to future messages.

OK @nmvl. I had the thing with the listen event in mind but was not sure at last. Thx for clarification. Glad that it works.

@Butusov There was one issue that I ran into with this method. I posted here: Rewind event sometimes rewinds too far with active form

Have you encountered this?

@nmvl. Unfortunately not. Looks to be an edge case thing. Hope one from rasa team can help with that.