In the Watson Dialog there is an option to generate multiple responses randomly. Allowing it to feel less robotic.
In the new Actions skills they do not have this option. Is there a way to reproduce it?
Updates:
SpEL is no longer supported in responses. So the sample code below will only work if assigned to a variable, then that variable is used in the response.
Actions now has the ability to create multiple responses.
If you have simple one line responses then the following code snippet will work in a response.
<? {
0: "Message 1",
1: "Message 2",
2: "Message 3"
}[new java.util.Random().nextInt(3)]
?>
The 3
in nextInt(3)
must be the total number of random responses.
If you have more detailed responses to give then you can assign a context variable a value of java.util.Random().nextInt(3)
(again changing 3 to total responses). Then use that as a conditional in the steps.