【发布时间】:2017-06-17 19:57:04
【问题描述】:
我有以下 LUIS 意图实现 -
[LuisIntent("MyIntent")]
public async Task MyIntent(IDialogContext context, IAwaitable<IMessageActivity> res, LuisResult result)
{
var message = await res;
try
{
await context.PostAsync("I see that you have below options <br/> 1. Do first task <br/> 2. Do second task <br/> 3. Do third task ");
PromptDialog.Text(context, taskdoer, "You can ask me like - <br/>Do task 2<br/>or simply enter 2");
}
catch (Exception e)
{
await context.PostAsync("Error is <br/> " + e.ToString());
context.Wait(MessageReceived);
}
}
还有taskdoer的定义——
private async Task taskdoer(IDialogContext context, IAwaitable<string> result)
{
string strTaskNumber = await result;
if (strTaskNumber == "2")
{
await context.PostAsync("So, you have entered " + strTaskNumber);
await context.PostAsync("This is Task 2");
context.Wait(MessageReceived);
}
if (strTaskNumber == "3")
{
await context.PostAsync("So, you have entered " + strTaskNumber);
await context.PostAsync("This is Task 3");
context.Wait(MessageReceived);
}
}
我想要实现的是,在不使用新方法 - taskdoer 的情况下,我如何在 MyIntent 方法本身中实现 taskdoer 逻辑,但在 taskdoer 中使用用户提示输入? 是否可以在不使用 Microsoft bot 中的 PromptDialog 的情况下提示用户?
【问题讨论】:
标签: c# botframework azure-language-understanding