Often, bots offer the ability to purge a user's history and restart a brand new conversation. However, there seems to be no feature in the TOCK bot backend to facilitate this.
Existing implementations
- tock-react-kit has a button to erase the history on the frontend, but the backend keeps the whole conversation context
- tock-vue-kit has a similar button to erase the history on the frontend, which regenerates a tock_user_id
- other bots use a custom story implemented in code using integrated mode, which resets the conversation state serverside
Requirements
- the solution should reset the conversation context: current intent, current story, entity values, RAG history
- the solution should keep the user ID, in order to be compatible with all connectors as well as metadata like analytics and End User License Agreements
- the solution should be pluggable, so that third parties using integrated mode with custom state are able to handle their own data deletion
Proposed solution
The solution could come in the form of a builtin restart story, which pushes a new active Dialog to the UserTimeline, then calls a list of a new interface RestartListener loaded through ServiceLoader (similar to the way KeywordService works).
Often, bots offer the ability to purge a user's history and restart a brand new conversation. However, there seems to be no feature in the TOCK bot backend to facilitate this.
Existing implementations
Requirements
Proposed solution
The solution could come in the form of a builtin
restartstory, which pushes a new activeDialogto theUserTimeline, then calls a list of a new interfaceRestartListenerloaded throughServiceLoader(similar to the wayKeywordServiceworks).