2017-07-19 4 views
0

Ich versuche, mehrere LUIS-Dialoge basierend auf Absicht auszulösen. Aber das Problem, mit dem ich konfrontiert bin, ist, sobald der Child-Dialog ausgelöst wird, löst es automatisch die Callback-Methode im übergeordneten LUIS-Dialog aus.LUIS multiple IDialog

Ich habe diese post von SO verfolgt, die das gleiche Problem erwähnt, aber bin nicht in der Lage, den gleichen Erfolg zu replizieren.

Hier ist mein Code-Schnipsel Referenz

[LuisIntent("ClaimStatus")] 
public async Task ClaimStatus(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result) 
{ 
     string message = ""; 
     message = "Sure, but first I would need to verify you."; 
     await context.PostAsync(message); 
     await context.Forward(new VerificationDialog(), VerificationDialogCompleted, context.Activity, CancellationToken.None); 
} 

private Task VerificationDialogCompleted(IDialogContext context, IAwaitable<object> result) 
{ 
    //var res = await result; 
    context.PostAsync("ProductsDialogCompleted" + result); 
    context.Wait(MessageReceived); 
    return Task.CompletedTask; 
} 

in dem Code Kind Dialog

override public async Task StartAsync(IDialogContext context) 
{ 
     await context.PostAsync("Would you please tell me your Customer ID?"); 
     context.Wait(MessageReceived); 
} 

[LuisIntent("None")] 
private async Task None(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result) 
{ 
    context.Done(true); 
} 

EDIT1: Ich habe auch einen GitHub repo, die den Dialog in SO-Stacks von demselben Autor zeigt aber immer noch Der LUIS-Dialogfeldstapel funktioniert nicht wie erwartet.

+0

Welche Version von BotBuilder verwenden u? –

+0

@EzequielJadib Microsoft.Bot.Builder v3.8.5 – user6083088

+0

@EzequielJadibI hier sind die Nachricht Controller, root & Kind luis Dialog als gist https://gist.github.com/PrasenjitGiri/eae50a3cccb7914bcf4eabda16e62309 – user6083088

Antwort

0

Das Problem, das Sie sehen, liegt daran, dass Sie context.Forward() verwenden, das im Grunde einen Dialog initiiert und die Nachricht übergibt (ohne Benutzereingabe).

Wenn Sie das vermeiden möchten, müssen Sie nur context.Call() verwenden, das den Dialog initiiert, aber auf eine Nachricht vom Benutzer wartet.

können Sie überprüfen diese mehr wissen: Calling Forms from Dialogs