2017-06-21 150 views
0

我編寫了一個LUIS機器人,它將一些消息轉發給啓用主動學習的Qna製造商對話框。 當一個問題返回單個答案時,它完美地工作,但當它檢測到多個答案時,它不會發送任何消息,而是執行我的簡歷功能。LUIS對話框+ Qna Maker主動學習對話框問題

如果我像使用根對話框一樣使用我的QnaMaker,這將起作用。

你能幫我嗎?

感謝

這裏我前進的FUNC:

[LuisIntent("None")] 
    [LuisIntent("")] 
    public async Task None(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result) 
    { 
     //Récupération du message 
     var messageToForward = await activity; 
     var cts = new CancellationTokenSource(); 
     var faq = new QnADialogWithOverrides(); 
     //Transfert du message une fois réponse retournée => AfterFAQDialog 
     await context.Forward(faq, AfterFAQDialog, messageToForward, CancellationToken.None); 
    } 

    private async Task AfterFAQDialog(IDialogContext context, IAwaitable<object> result) 
    { 
     context.Wait(MessageReceived); 
    } 

我QNA BOT:

[Serializable] 
    [QnAMaker("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxx", "I don't understand this right now!", 0.50, 5)] 
    public class QnADialogWithOverrides : QnAMakerDialog 
    { 
    } 

結果:

What I have

What I want

+1

除非您顯示更多的代碼,否則將無法爲您提供幫助。將代碼添加到QnADialogWithOverrides請 –

+0

您QnADialogWithOverrides爲空。這可以嗎? –

+1

是的,我只是使用Overrides功能進行調試。主動學習不需要覆蓋功能來工作。 –

回答

0

看來this conditionQnAMakerDialog沒有被滿足,所以對話框is ending via the default message path

奇怪的是,條件表明你沒有答案,但根據你的截圖,似乎可能並非如此。

我會嘗試覆蓋RespondFromQnAMakerResultAsync以查看發生了什麼,因爲該方法負責顯示結果(默認情況下,行爲僅顯示第一個答案,如here所示)。

您甚至可以使用hereQnADialogWithOverrides代碼。

+0

我覆蓋了'RespondFromQnAMakerResultAsync',這個函數不會在用戶提問多個答案時執行。所以,我重覆'QnAFeedbackStepAsync'和我有一個異常未捕獲:'System.MissingMethodException:未找到方法:無效Microsoft.Bot.Builder.Dialogs.PromptOptions1..ctor(System.String,System.String,System.String, System.Collections.Generic.IReadOnlyList1 ,Int32,' –

+0

對,這是由於這個問題https://github.com/Microsoft/BotBuilder-CognitiveServices/issues/28。 –

+0

順便說一句,是否確定它返回多個答案? –