我尝试了一切方法来获取 this示例工作(特别是轮播部分)。每次我尝试使用 Google 上的操作中的列表或建议或轮播时,它都会在 Google 模拟器中显示此错误: error from actions on google simulator
这是我的heroku webhook 中的意图代码(它是示例中的复制粘贴)
function prova(agent){
let conv = agent.conv();
const imageUrl = 'https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png';
const imageUrl2 = 'https://lh3.googleusercontent.com/Nu3a6F80WfixUqf_ec_vgXy_c0-0r4VLJRXjVFF_X_CIilEu8B9fT35qyTEj_PEsKw';
const linkUrl = 'https://assistant.google.com/';
conv.ask(new Carousel({
title: 'Google Assistant',
items: {
'WorksWithGoogleAssistantItemKey': {
title: 'Works With the Google Assistant',
description: 'If you see this logo, you know it will work with the Google Assistant.',
image: {
url: imageUrl,
accessibilityText: 'Works With the Google Assistant logo',
},
},
'GoogleHomeItemKey': {
title: 'Google Home',
description: 'Google Home is a powerful speaker and voice Assistant.',
image: {
url: imageUrl2,
accessibilityText: 'Google Home'
},
},
},
}));
agent.add(conv);
}
所以,这是我的依赖项:
谁已经解决了这个问题?我没有找到任何关于此的信息...
提前谢谢您!
最佳答案
在您的实现中,您错过了原始示例中的一行。您需要在轮播之前有一个 SimpleResponse
。所以你需要一行诸如
conv.ask('Please choose an item:');
位于新轮播
的conv.ask()
之前的行。
关于node.js - 使用 actions-on-google Carousel 或 List 与dialogflow 的 WebhookClient 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51301849/