【发布时间】:2017-11-28 17:28:42
【问题描述】:
我在 Microsoft Bot Framework 上编写了一个机器人。我使用了 LUIS 语言模型。 下面是我的一段代码:
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));
bot.dialog('/', intents);
intents.matches('GoogleHome', [
function (session, args) {
if(builder.EntityRecognizer.findEntity(args.entities, 'cookingtips'))
{
quickReply(session, args)
}
if(builder.EntityRecognizer.findEntity(args.entities, 'wakingtips'))
{
//My rest of the code
}
}])
这是我的快速回复的代码
function quickreply(session, args){
var msg = new builder.Message(session)
.text("Let me know the date and time you are comfortable with..")
.suggestedActions(
builder.SuggestedActions.create(
session,[
builder.CardAction.imBack(session, "CookingTips", "CookingTips"),
builder.CardAction.imBack(session, "WalkingTips", "WalkingTips")
]
)
);
builder.Prompts.choice(session, msg, ["CookingTips", "WalkingTips"]), function(session,results) {
console.log(results);
session.send('So I understand you want a cooking tip ' + results + ' right now');
session.endDialog();
}}
我能够得到快速回复,点击后什么也没有发生。我在控制台中看到以下内容:
.BotBuilder:prompt-choice - Prompt.returning([object Object])
.BotBuilder:prompt-choice - Session.endDialogWithResult()
/ - Session.endDialogWithResult()
相反,我希望将此消息发送到我的 LUIS,或者至少显示回调函数中所写的确认消息。我该怎么做?
【问题讨论】:
标签: javascript node.js botframework chatbot azure-language-understanding