【问题标题】:Handling various message with IDialog使用 IDialog 处理各种消息
【发布时间】:2017-11-17 18:36:31
【问题描述】:

假设您有一个ContactUsDialogPizzaOrderDialog 和一个MyOrderDialog。用户发送一条消息,例如:“我的披萨订单还有多远” - 你怎么知道从哪个对话框开始?

    public async Task<HttpResponseMessage> Post([FromBody] Activity activity)
    {
        if (activity != null)
        {
            switch (activity.GetActivityType())
            {
                case ActivityTypes.Message:
                    await Conversation.SendAsync(activity, () => new ContactUsDialg());
                    await Conversation.SendAsync(activity, () => new PizzaOrderDialog());
                    await Conversation.SendAsync(activity, () => new MyOrderDialog());
                    break;
        }
        return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
    } 

【问题讨论】:

  • 你不能那样做。您需要决定哪一个是根对话框,根对话框中的根对话框根据需要重新路由到其他对话框。
  • 我是这么认为的...我可以使用 LUIS 来完成此任务吗?有什么例子吗?谢谢!

标签: c# botframework


【解决方案1】:

你不能以你想要的方式做到这一点。您需要决定哪一个将是根对话框并将消息重新路由到其他对话框。

一些可能对您有所帮助的示例:

是的,您可以使用 LUIS 作为根对话框,然后调用子对话框。一些可能也有帮助的帖子:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-04
    • 2017-08-01
    • 2015-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-04
    • 1970-01-01
    相关资源
    最近更新 更多