如何在对话框中重复机器人的最后响应 [英] How to repeat last response of bot in dialogflow

查看:68
本文介绍了如何在对话框中重复机器人的最后响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是dialogflow的新手。我想知道,如果我告诉 repeat,dialogflow上有任何方法可以重复机器人的最后响应。
我有很多跟进意图,因此对于每个意图都不可能做出跟进意图。

解决方案



在每个回复的一部分生成的JSON中,您会看到它使用刚刚发送的内容创建了一个短暂的上下文。 (这里只是JSON的一小部分,对此进行了说明。)

  {
name: projects / vodo / agent / sessions / A ... w / contexts / multivocal_repeat,
lifespanCount:1,1,
parameters:{
Ssml:很抱歉,我不知道一个名为Alpha的属性。您现在想做什么?,
文本:对不起,我不知道一个名为Alpha的属性。您想要什么?现在要做?
}
}
],
有效载荷:{
google:{
richResponse:{
items :[[
{
simpleResponse:{
ssml:< speak>很抱歉,我不知道名为Alpha的属性。您想要什么< / speak>,
displayText:对不起,我不知道一个名为Alpha的属性。您现在想做什么?
}
}
]
},

(请注意,我是多声乐的首席维护者,如下面的评论所述。)


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.

解决方案

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

这篇关于如何在对话框中重复机器人的最后响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆