Dialogflow Webhook UpdatePermissions 自定义提示

Dialogflow Webhook UpdatePermissions custom prompt

我目前正在尝试在我的 dialogflow webhook 中实现推送通知提示。如果我按照 google 文档 (https://developers.google.com/actions/assistant/updates/notifications)

中描述的方式实现它,它可以正常工作并为用户设置推送通知
conv.ask(new UpdatePermission({
            intent: 'send_notification'
        }));

当用户激活这部分代码时,系统会提示他们

Is it okay if I send push notifications for my_updates_intent?

这条消息没有问题,但是,我希望至少在它前面加上一条我自己的消息,以便我可以根据上下文显示此提示,具体取决于用户在对话流中的位置。例如:

Your email has been set. We can set up notifications to keep you informed. Is it okay if I send push notifications for my_updates_intent?

No problem, we wont send you an email. If you are interested, we can set up notifications to keep you informed. Is it okay if I send push notifications for my_updates_intent?

使用 Permission 构造函数,UpdatePermission 继承,我可以设置一个允许我这样做的上下文。

conv.ask(new Permission({
    context: "So we can give you directions",
    permissions: ['DEVICE_PRECISE_LOCATION'],
});

哪个会回应:

So we can give you directions, I'll just need to get your street address from Google. Is that ok?

该消息的前半部分是我写的,后半部分来自 Google,具体取决于我请求的权限类型。

从逻辑上讲,我假设也许我可以通过使用基础 Permission 构造函数并将 permissions 设置为 来解决这个问题更新

conv.ask(new Permission({
    context: 'Your email has been set. We can set up notifications to keep you informed',
    permissions: ['UPDATE'],
    updatePermissionValueSpec: {
        arguments: undefined,
        intent: 'send_notification'
    }
}));

但是,这与 UpdatePermission 构造函数的响应完全相同,并且完全忽略了我的上下文。我无法找到解决此问题的任何文档或在线资源。有可能吗?还是我遗漏了一些明显的东西?

在联系 google 支持的操作后,我了解到目前无法自定义 UpdatePermission 消息。

来自支持团队:

Unfortunately, altering this message is not possible for updates and push notifications. I'm adding this to our system as a feedback.

希望这对面临类似问题的其他人有所帮助。