Actions on google 在谷歌的行动中,图片并没有显示出丰富的反应
基本卡中没有显示丰富响应的图像 我已经提供了图像的url,但它没有显示图像Actions on google 在谷歌的行动中,图片并没有显示出丰富的反应,actions-on-google,dialogflow-es,Actions On Google,Dialogflow Es,基本卡中没有显示丰富响应的图像 我已经提供了图像的url,但它没有显示图像 @囚犯这是我的密码,如果我有任何错误,请告诉我 app.intent('totalResponses', (conv, { Location }) => { // extract the num parameter as a local string variable if (!conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT'
@囚犯这是我的密码,如果我有任何错误,请告诉我
app.intent('totalResponses', (conv, { Location }) => {
// extract the num parameter as a local string variable
if (!conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT')) {
conv.ask('Sorry, try this on a screen device or select the ' +
'phone surface in the simulator.');
return;
}
conv.ask('Hello World');
conv.ask(new BasicCard({
text: `Hello`, // Note the two spaces before '\n' required for
// a line break to be rendered in the card.
title: 'Title: this is a title',
image: new Image({
url: 'https://drive.google.com/file/d/13eEr2rYhSCEDKDwCLab29AqFMsKuOi4P/view',
alt: 'Image alternate text',
}),
}));
});
问题在于用于映像的驱动器URL。此URL用于直接从Google Drive加载图像时预览图像。它是一个HTML页面,而不是图像,因此如果您在网页或助手卡中使用它,它将不会显示 要获取需要使用的URL,您需要选择页面顶部的三个点,然后选择“嵌入项”。您不想使用整个嵌入代码,只想使用URL
按照以下步骤进行解决:
https://www.tutorialspoint.com/execute_bash_online.php
echo <paste your link> | cut -d '/' -f 6
您能否显示生成基本卡的代码或代码生成的JSON?如果我们没有一个最小的问题示例,就很难帮助您。我完全同意@capture所说的,没有您的代码,我们无法真正帮助您。否则,可能是JSON字段名称不正确,或者您的图像链接不是https。(而且,要清楚,请更新您的原始问题以包含图像。)仅供参考,如果您不知道,如果您在Firebase的免费层上托管您的操作,您可能无法连接到图像。@这是我的代码,如果我有任何错误,请告诉我,谢谢@Prisone,我从iframe元素(嵌入项内)找到的url也提供html页面,并且不在卡片中显示图像,然后我在新选项卡中打开图像(右键单击图像-->“在新选项卡中打开图像”),然后从那里获得正确的url,这对我来说很好:)
https://drive.google.com/uc?export=view&id=<paste the output unique key>