Variations to a Message
# 👀feature-requests
s
Would be great if the bot could send a variation of a same message. For example: If the bot is suppossed to say: Hi!, My name is Richard and i'm your assistant; It would be incredible to have an ai variation generator or a manual one where you could set different type of messages related to the original such as: Hello! I'm Richard, your Ai Assistant or Hi! Im Richard and today i'm gonna be your assistant. These variations would be sent randomly.
c
yess VoiceFlow has a great function for that suggesting 5 variations (or more).
b
hey! that could be simply done using an Execute Card.
shorter version! 1. Pick an execute card, and add your variations (in below code)
Copy code
workflow.welcomeMessage = _.sample([
  "Hello! I'm Richard, your AI Assistant",
  "Hi! I'm Richard, your AI Assistant",
  "Welcome! I'm Richard, your AI Assistant",
  "Greetings! I'm Richard, here to assist you.",
  "Jumping in to assist! Hello, I'm Richard.",
])
2. display the variations with
@Workflow.welcomeMessage
c
thanks for sharing, Ill actually implement this 💡I do have to add that in VoiceFlow the AI makes suggestion automatically without the need to ask GPT and put it into code.
h
I saved my different questions inside a variable called "workflow.randomQuestion" Then used a execute card to chose one at random: const randomQuestionSelected = _.sample(workflow.randomQuestion) workflow.randomQuestionSelected = randomQuestionSelected Then output the value workflow.randomQuestionSelected in a Capture card. Same result, slightly different flow.
c
👏 yes this works great for now
39 Views