Bot Framework Emulator 是否使用 Direct-Line-API 通过 Bot Connector 进行通信?

Does the Bot Framework Emulator uses Direct-Line-API to communicate over the Bot Connector?

我是 Microsoft Bot Framework 的新手,我想问一下我对通用架构的理解是否正确。

我偶然发现了以下架构 picture 假设我使用 Microsoft 提供的模板构建了一个简单的 Echo-Bot,现在我正在使用 Bot Framework Emulator 在本地测试我的 Bot。

我目前的理解是,当我与 Bot Framework Emulator 交互时,Emulator 使用 Direct-Line-API 与 Bot Connector 通信,Bot Connector 与我的本地 Bot Web API.或者我可以将 Bot Framework Emulator 视为 Skype、Facebook 等渠道吗?

简答:是。

长答案:Emulator uses WebChat, which uses Directline-JS。因此,当您使用 Emulator 时,您就是在使用 WebChat 频道。

但是,Emulator 刚刚将 Bot Inspector 添加到最新版本中。这使您可以附加到其他渠道(如 Skype 或 Facebook)上的对话,并通过模拟器实时查看对话。有关设置说明,请参阅上面的 link,但其要点是:

  1. 将检查器中间件添加到您的机器人
  2. 使用 ngrok 或 Azure Service Bus Relay 将 Bot Inspector 连接到您的托管机器人
  3. 在频道中开始与您的机器人聊天,然后输入 Bot Inspector 给您的代码 (/INSPECT attach <UUID>)
  4. 您的对话随后会附加到模拟器,您可以在该频道中查看您的机器人与用户(您)之间的所有流量

注意:Bot Inspector 是超级新的。还有一些问题需要解决,说明也有点稀疏,但除此之外效果很好。您可以在此处查看已经具有 Inspector 中间件代码的示例:

注意:Bot Inspector 模式不同于 Inspector Pane