简体   繁体   English

如何在 Power Virtual Agents 中使用自适应卡?

[英]How to use adaptive cards in Power Virtual Agents?

I want to use adaptive card in PVA (chat bot).我想在 PVA(聊天机器人)中使用自适应卡。 Tried to create a PVA flow and added an adaptive card.尝试创建 PVA 流程并添加了自适应卡。 If I use the flow in "microsoft team" then there is no issue but if I try to use it in PVA,it doesnot work.如果我在“microsoft team”中使用流程,那么没有问题,但如果我尝试在 PVA 中使用它,它就不起作用。

在此处输入图像描述

Is there a way to include adaptive cards in PVA flow where we don't have "team id" and "channel id".有没有办法在我们没有“团队 ID”和“频道 ID”的 PVA 流程中包含自适应卡。 Flow structure is created as below:流结构创建如下:

在此处输入图像描述

In order to send an Adaptive Card to the user in Power Virtual Agents, you will need to extend the bot using Bot Framework Composer.为了在 Power Virtual Agents 中向用户发送自适应卡,您需要使用 Bot Framework Composer 扩展机器人。 Inside Composer, it's possible to respond to the user with an adaptive card .在 Composer 内部,可以使用自适应卡片响应用户

To achieve this, you will have to return the data that is the input to the adaptive card in Power Automate to Power Virtual Agents.为此,您必须将作为 Power Automate 中自适应卡的输入的数据返回给 Power Virtual Agents。 The return value should be a string, and it will get JSON Serialized.返回值应该是一个字符串,它会得到 JSON 序列化。 Inside Composer, you can JSON deserialize the string using the json function.在 Composer 中,您可以 JSON 使用json function 反序列化字符串。 As long as the variable inside of Power Virtual Agents is a bot-scoped variable, you can pass the data:只要 Power Virtual Agents 内部的变量是机器人范围的变量,您就可以传递数据:

Power Automate 的输出

全局变量

Json 解析函数

Here is Microsoft's documentation on Bot Framework Composer integration with Power Virtual Agents .这是 Microsoft 关于Bot Framework Composer 与 Power Virtual Agents 集成的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM