且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带有多选选项的聊天机器人

更新时间:2023-11-19 08:31:19

自适应卡与Azure Bot服务无关.至于是否支持自适应卡,这完全取决于前端,因为这就是自适应卡渲染器所在的位置.在聊天机器人的情况下,前端将是聊天平台,Bot Framework将其称为机器人通道".了解很多机器人行为是特定于渠道的,这一点很重要,因此您需要考虑所使用的渠道.支持自适应卡的两个主要Bot Framework渠道是Microsoft Teams和Bot Framework Web Chat.您可以在此处查看支持自适应卡的平台的正式列表: https://docs.microsoft.com/adaptive-cards/resources/partners

Adaptive Cards have little to do with the Azure Bot Service. When it comes to whether or not Adaptive Cards are supported, that is entirely determined by the front end because that's where an Adaptive Card renderer would be. In the case of chat bots the front end would be a chat platform, which the Bot Framework calls a bot "channel." It's important to understand that a lot of bot behavior is channel-specific, and so you need to consider what channel you're using. The two main Bot Framework channels that support Adaptive Cards are Microsoft Teams and Bot Framework Web Chat. You can see an official list of platforms that support Adaptive Cards here: https://docs.microsoft.com/adaptive-cards/resources/partners

如果您使用的通道不支持自适应卡,则可能存在其他一些特定于通道的功能,该功能允许用户选择多个选项,例如Slack的 FormFlow 库可能会有所帮助.如果您构建自己的对话框,那么没有理由它仍然不能使用按钮.您可以有一个用户单击其他按钮后单击的提交"按钮,尽管这可能需要一些更高级的bot开发技能.

If you're using a channel that doesn't support Adaptive Cards, there may be some other channel-specific feature that allows users to select multiple options, such as Slack's block kit. If there isn't, then you may have to design the bot to gather information through a dialog. This could be complicated, but the FormFlow library might help. If you build your own dialog then there's no reason it couldn't still use buttons. You could have a submit button that the user clicks after they've clicked the other buttons, though this might require some more advanced bot development skills.

如果您想了解有关自适应卡的更多信息,请查看我的博客文章: https://blog.botframework.com/2019/07/02/using-adaptive-cards-with-the-microsoft-bot-framework/

If you'd like to know more about Adaptive Cards, please have a look at my blog post: https://blog.botframework.com/2019/07/02/using-adaptive-cards-with-the-microsoft-bot-framework/