I am new to dialogflow.I want to know there is any way on dialogflowto repeat last response of bot ,if I tell "repeat". I have lot of follow-up intent so for each intents not possible to make a follow-up intent Repeat.
-
1) Make an output context called 'session_var' for your Default Welcome Intent 2) Do Not use that output context as input context for anything 3) – Anshuman Kumar May 29 '21 at 10:15
2 Answers
Libraries like multivocal store the last response and provide a handler for a "repeat" intent that will play the response again.
So all you need to do is use the library and create an Intent such as this with "multivocal.repeat" set as the action and the webhook fulfillment enabled, and it will handle repeats for you:
If you look at the JSON that gets generated as part of each reply, you'll see that it creates a short-lived context with what was just sent. (Here's just a small part of the JSON that illustrates this.)
{
"name": "projects/vodo/agent/sessions/A...w/contexts/multivocal_repeat",
"lifespanCount": 1,
"parameters": {
"Ssml": "I'm sorry, I don't know about an attribute named Alpha. What would you like to do now?",
"Text": "I'm sorry, I don't know about an attribute named Alpha. What would you like to do now?"
}
}
],
"payload": {
"google": {
"richResponse": {
"items": [
{
"simpleResponse": {
"ssml": "<speak>I'm sorry, I don't know about an attribute named Alpha. What would you like to do now?</speak>",
"displayText": "I'm sorry, I don't know about an attribute named Alpha. What would you like to do now?"
}
}
]
},
(Note that I'm the lead maintainer for multivocal, as discussed in the comments below.)

- 49,922
- 7
- 53
- 105
-
Amazing stats, just wondering should you not mention that you are author of the lib? I should make more ads for my own libs too^^ – rekire Mar 14 '19 at 16:30
-
1"Amazing" stats... one user? {: I don't hide that I'm the author, but its not like I get anything from it. It's open source, so can serve as an example of how to do it that concurs with your answer, or as a more out of the box solution. – Prisoner Mar 14 '19 at 18:31
-
The part with the amazing stats is just the fact that you have the "actions-on-google" badge in gold, I hardly got some rep for the related tags. Good work so far :-) Regarding mentioning the *ownership*, I was just thinking that I could make *my* open source projects also more visible. – rekire Mar 14 '19 at 18:40
-
1I don't go out *trying* to advertise multivocal - I answer questions about other libraries as well. But it made sense in this case. (And hopefully more sense with the example.) You have plenty of rep and gold of your own. {: Nothing to sneeze at. – Prisoner Mar 14 '19 at 19:15
There is no out of the box solution. We didn't implement it yet, but we decided that we would just store the latest output in the context and give it out again when the user asks to repeat it. For that you would need to use a webhook which sets the context as required.

- 47,260
- 30
- 167
- 264