How to implement "Restart conversation from here" in webchat just like in bot emulator?

Viewed 549

I am looking to implement a functionality which is same as that of "Restart conversation from here" in WebChat. I did not found anything relevant which addresses my requirement.

2 Answers

I had a similar requirement which I needed to implement. I implemented it like this:

  1. Get the token of the conversation and saved it inside the state
  2. Pass the token to the WebChat component
  3. User clicks "Restart Conversation button" -> Set the token to null
  4. React then would take care of it, as it would restart the token fetching process and start a new conversation.

Restarting a conversation using a conversationId usually restarts from the start unless you specify a watermark. In your case you would need to store the watermark with each save point in the conversation.

Related