2017-07-20 75 views
1

我有一個QnA機器人,它應該適用於幾種意圖,我希望觸發它意爲無意,問候因爲我有一些獨特的答案,並且IT幫助,因爲這是QnA機器人的主要目的。我必須複製粘貼我的整個對話框,只是改變意圖名稱,或者我可以列出匹配方法的多個意圖?你可以在一個triggerAction中使用多個意圖嗎? [LUIS]

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 如果這是指它說:

{(RegExp|string)[]} 

無論是正則表達式或命名意圖的數組可以傳遞 給用戶話語在多種可能的方式相匹配。產生最高分數(最佳匹配)的規則 將用於得分 的目的。

回答

3

使用它的方式是:

.triggerAction({ 
    matches: [/greeting/i, /none/i, /^it help/i] 
)} 

.triggerAction({ matches: [ 
    /(roll|role|throw|shoot).*(dice|die|dye|bones)/i, 
    /new game/i 
]}); 
相關問題