请求构建多层对话机器人的代码建议



我的公司希望一个azure bot对一系列的"是"one_answers"否"的答案,并带有三层对话路径。我正在使用 Visual Studio Community 2019 用于编辑代码和 bot框架模拟器(v4(来测试bot。

这是指向问题和答案图像以及对话流程的链接:

https://cdn1.imggmi.com/uploads/2019/5/5/21/738797C22A777756A01FDDF6786F26EB39B-39B-FULL.PNG。

我不确定如何将多层对话链接在一起。我只能在下面的URL上构造一个带有一层对话的机器人:

https://cdn1.imggmi.com/uploads/2019/5/5/21/99019E881D62F56CE449397CA97CA9F191-

我尝试使用"建议的bot"模板,但似乎需要进行重大返工以使我们的可交付能力成为可能。

https://github.com/microsoft/botbuilder-samples/tree/master/samples/csharp_dotnetcore/08.suggested-actions

仅供参考,这是第一层对话的代码的示例:

private static string ProcessInput(string text)
{
    const string FirstSequenceResponseYes = "Sure, can you explain the issue? " + 
        "Do you see error message such as 'Power BI Access Tokens Not Allocated?'";
    const string FirstSequenceResponseNo = "Thanks, user. " +
        "It's good to interact with you. Have a great day!";
    switch (text)
    {
        case "yes":
        {
            return $"{FirstSequenceResponseYes}";
        }
        case "no":
        {
            return $"{FirstSequenceResponseNo}";
        }
        default:
        {
            return "Please select one of the suggested action choices.";
        }
    }
}

编写代码以使此可交付能力成为可能的最佳方法是什么?有人可以提供与我们要实现的目标直接相关的URL和资源吗?

我不确定我完全理解您的问题,正如评论所说的。

但是,对于机器人的导航层,我鼓励您阅读此文档。

使用Bot-Community解决方案,您可以创建一个具有多个级别的复杂对话框。

最后,为了创建一个仅接收"是又有答案的对话框",我建议使用确认支持。

相关内容

最新更新