Restart conversation through Tracker HTTP API

I would like to restart the state of a conversation whenever someone opens our mobile app (slots and dialog state). My plan was make a call to the tracker, to restart it whenever the app opens. POST /conversations/<sender_id>/tracker/events

{
   "event": "restart"
}

The problem with this approach is, it doesn’t put the bot in a listening state. So the first utterance from the user is ignored. It doesn’t register anything until the user utters/types the phrase a second time.

It looks like RASA’s Restarted() function does a reset, then a followup action ACTION_LISTEN

 def apply_to(self, tracker):
        from rasa_core.actions.action import ACTION_LISTEN_NAME
        tracker._reset()
        tracker.trigger_followup_action(ACTION_LISTEN_NAME)

Do I need to do something similar in order to get the same results when performing this action through the Tracker REST API?

I’m thinking of using the following payload: PUT /conversations/<sender_id>/tracker/events

[{
    "event": "restart"
},	
{
    "event": "followup",
    "name": "action_listen"
}
]

My main concern is RASA docs advise agains using PUT in production. Any reason that doing this is unsafe? Or is there a better way to restart the conversation through the Tracker API?

From the docs:

This endpoint should not be used to modify trackers in a production setup, but rather for creating training data.

1 Like

Well if you are going to restart the conversation and don’t care about the tracked events before. I think you will be safe with the put. Not sure but I think the reason why they don’t recommend using it in a production is because you might forget some events or put them in incorrect order and this might affect the prediction. But if you are going to begin fresh from zero. I think you should be safe.

This is still an issue with rasa 2.7