我试图将 Luis 与 botframework 集成。从我所看到的(p/s. 仍然是新的),Luis 根据用户的文本输入处理响应。因此,当我尝试使用自适应卡片提交按钮操作时,我可以设置值但不能设置文本值。即使我在提交按钮上使用 dataJson,它仍然会产生空错误。我仍然对如何解决这个问题感到困惑。代码如下:
LuisIntent("Greet.Welcome")]
public async Task QueryGPN(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult luisResult)
{
AdaptiveCard gpnCard = new AdaptiveCard();
gpnCard.Body.Add(new TextBlock()
{
Text = "GPN Lookup Form",
Size = TextSize.Large,
Weight = TextWeight.Bolder
});
TextInput gpnInput = new TextInput()
{
Id = "GPN",
IsMultiline = false
};
gpnCard.Body.Add(gpnInput);
gpnCard.Actions.Add(new SubmitAction()
{
Title = "Submit"
});
Attachment gpnCardAttachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = gpnCard
};
IMessageActivity gpnFormMessage = context.MakeMessage();
gpnFormMessage.Attachments = new List<Attachment>();
gpnFormMessage.Attachments.Add(gpnCardAttachment);
await context.PostAsync(gpnFormMessage);
context.Wait(this.MessageReceived);
}
[LuisIntent("Curse")]
public async Task Cursing(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult luisResult)
{
Console.WriteLine("Curse");
await context.PostAsync($"Curse");
context.Wait(this.MessageReceived);
}
情况是我将在文本输入中输入诅咒,并且我期望机器人将重定向到“Curse”LuisIntent。
高级 TQVM。