article by Grant Ronald, April 2019
(article updated for Oracle Digital Assistant)
One element to the success of your bot is the tone and voice your bots uses. Informal and “chatty” response may be a more engaging and better fit with your brand. In line with this approach, you would probably want to ensure your bot replies are not formulaic and predictable. In this article I demonstrate how you can easily randomize the responses from your bot.
There are many different ways you can achieve this functionality. To keep the implementation as simple as possible I’ve done so by defining a map with message types within the BotML. Each message type contains an array with the possible messages for that message type. A random message is retrieved using a simple pseudo random number generator (based on date/time) which picks one of your messages defined within one of the arrays.