刚到家用电脑,是时候玩我在Build上学到的东西了!
以下代码是我对Cortana技能的默认回复。出于某种原因,她说“抱歉。我不知道你的意思。”两次。她没有说卡片图片的替代文字。那么......为什么她说两次呢?我怎么能说服她一次呢?
[LuisIntent("None")]
private async Task None(IDialogContext context, LuisResult result)
{
var reply = context.MakeMessage();
reply.Speak = "Sorry. I don't know what you mean.";
reply.InputHint = InputHints.IgnoringInput;
var card = new HeroCard
{
Images =
new List<CardImage>()
{
new CardImage("http://i.imgur.com/PiowyjZ.jpg", "Sorry, I didn't catch what you meant.")
}
};
reply.Attachments.Add(card.ToAttachment());
// return our reply to the user
await context.PostAsync(reply);
context.Wait(MessageReceived);
}
编辑:她没有在Android上对我这么做,在尝试了第二台PC后,它也没有发生在那里。我猜这台PC上的Cortana存在问题。