无法显示Amazon lex chatbot的多个响应卡

编程入门 行业动态 更新时间:2024-10-11 15:15:01
本文介绍了无法显示Amazon lex chatbot的多个响应卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在使用Amazon lex创建聊天机器人,并希望能够一次发布多个响应卡.聊天机器人提出的问题将是您当前有一个集成的Shield Plan吗?"然后是多个响应卡,其中将显示来自不同品牌的计划列表.但是,如果用户没有计划,则响应卡上会有一个名为否"的选项.

I am currently using Amazon lex to create a chatbot and want to be able to post multiple response cards at once. The question asked by the chatbot will be "Do you have an integrated Shield Plan currently?" and followed will be multiple response cards where it will show a list of plans from different brands. But if the user does not have a plan, there will be an option called "No" on the response card.

但是,如果我发布聊天机器人,让我们在Slack上说,甚至不会显示任何响应卡.我该如何解决这个问题?

But if I publish the chatbot let's say on Slack, not even one response card is shown. How do I fix this problem?

推荐答案

您尚未指定卡片图片网址,这就是为什么没有卡片的原因.我刚刚进行了测试,如果我们使用控制台进行设置,没有图像卡URL的ResponseCard将不会显示在Facebook或Slack上.

You have not specified the Card Image URL, this is why there is no card. I have just now tested it, without Image Card URL ResponseCard will not be shown on Facebook or Slack if we are setting it using console.

但是,如果您要在Lambda功能中设置响应卡,那么我们可以选择不显示图像.您可以在 DialogCodeHook 中检查插槽是否已满,并相应地显示 ResponseCard .

However if you are setting Response Cards in Lambda function, then we can choose not to have an image. You can check that slot is filled or not in the DialogCodeHook and display the ResponseCard accordingly.

下面是显示没有图像的ResponseCard的示例代码:

Below is sample code to display ResponseCard without an image:

{ 'dialogAction': { 'type': 'Close', 'fulfillmentState': 'Fulfilled', 'message': { 'contentType': 'PlainText', 'content': message }, 'responseCard': { 'version': '0', 'contentType': 'application/vnd.amazonaws.card.generic', 'genericAttachments': [ { 'title': 'title1', 'subTitle': 'subtitle', "buttons":[ { "text":"button 1", "value":"value 1" }, { "text":"button 2", "value":"value 2" }, { "text":"button 3", "value":"value 3" } ] } } } }

希望有帮助.

更多推荐

无法显示Amazon lex chatbot的多个响应卡

本文发布于:2023-11-28 05:58:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641206.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   Amazon   lex   chatbot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!