问题
I have a QnA bot that should work for a couple of intents and I want to trigger it for None intent, Greeting because I have some unique responses, and IT help because that's the main purpose of the QnA bot. Do I have to copy paste my entire dialog and just change the intent name or can I list multiple intents for the matches method?
bot.dialog('QnABotRequest', function (session, args) {
//Code
}).triggerAction({
matches: 'Greeting' | 'None' | 'IT Help' //Maybe something like this ?
});
https://docs.botframework.com/en-us/node/builder/chat-reference/modules/_botbuilder_d_.html#matchtype Where this is defined it says:
{(RegExp|string)[]}
An array of either regular expressions or named intents can be passed to match the users utterance in a number of possible ways. The rule generating the highest score (best match) will be used for scoring purposes.
回答1:
The way to use it is:
.triggerAction({
matches: [/greeting/i, /none/i, /^it help/i]
)}
or
.triggerAction({ matches: [
/(roll|role|throw|shoot).*(dice|die|dye|bones)/i,
/new game/i
]});
回答2:
If you are using azure, then you can try the following
bot.dialog('QnABotRequest', function (session, args) {
//Code
}).triggerAction({
matches: ['Greeting', 'None', 'IT Help'],
})
来源:https://stackoverflow.com/questions/45223553/can-you-use-multiple-intents-in-one-triggeraction-luis