How to repeat last response of bot in dialogflow

前端 未结 2 1993
清酒与你
清酒与你 2021-01-24 02:47

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

相关标签:
2条回答
  • 2021-01-24 03:12

    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.)

    0 讨论(0)
  • 2021-01-24 03:22

    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.

    0 讨论(0)
提交回复
热议问题