如何从 mvc web 应用程序连接到 Microsoft bot 框架
how to connect to Microsoft bot framework from mvc web application
我创建了一个简单的 mvc 网络应用程序,以 JSON 格式发送消息。
我应该在连接机器人的应用程序中输入哪个 URL?
以及该机器人如何接收消息并发回响应?
截至目前,我正在使用 Microsoft 的机器人模拟器,我的机器人应用程序运行良好。
我需要在 Azure 上发布我的机器人应用程序吗???
which URL should i enter in my app that connects the bot?
使用 WebChat 控件 可能是让您的机器人上网的最简单方法。默认情况下,您可以在任何网页的 iframe 中使用以下 url(在 dev.botframework.com 中创建、发布和配置您的机器人之后):
<iframe src="https://webchat.botframework.com/embed/YOUR_BOT_ID?s=YOUR_SECRET_HERE"></iframe>
注意:您应该调用 https://webchat.botframework.com/api/tokens with your secret, and get back a server to server token, replacing s with t, so you don't expose your bot's secret. This is all explained here: https://docs.botframework.com/en-us/support/embed-chat-control2/
and how does that bot receive message and send back the response?
消息以json 格式发送和接收。网上有很多文档和示例。像这样:https://docs.botframework.com/en-us/csharp/builder/sdkreference/routing.html 关于 发送和接收活动
As of now I am using bot emulator by Microsoft and my bot app working
fine.
DO i need to publish my bot app on azure???
您的机器人需要在某处发布。 Azure 是目前托管机器人的最佳场所,因为 Microsoft 致力于该框架及其未来。
还有 安全方面和复杂性 ,由 Dan Driscoll 在这里解释 https://github.com/Microsoft/BotBuilder/issues/1006#issuecomment-244087904:
Bots are just web services. If you unhook security and talk directly
to the bot's activity endpoint, you can operate your bot locally on
your machine. It may be simpler to just open your own API on the bot's
service because emulating what we do in the channels is actually a
fair amount of work. (It's by no means impossible -- this is exactly
what we do in the emulator -- but there is a fair amount of complexity
there.)
If you want to stay within the Bot Framework universe, the bot's
endpoint does need to be accessible by the Bot Framework services,
i.e. on the internet. If you're publishing on the internet, you will
probably want to secure your endpoint, and the Bot Framework security
model by design does not allow just anyone to call a bot -- our
libraries only allow in authentic Bot Framework services.
我创建了一个简单的 mvc 网络应用程序,以 JSON 格式发送消息。
我应该在连接机器人的应用程序中输入哪个 URL?
以及该机器人如何接收消息并发回响应?
截至目前,我正在使用 Microsoft 的机器人模拟器,我的机器人应用程序运行良好。
我需要在 Azure 上发布我的机器人应用程序吗???
which URL should i enter in my app that connects the bot?
使用 WebChat 控件 可能是让您的机器人上网的最简单方法。默认情况下,您可以在任何网页的 iframe 中使用以下 url(在 dev.botframework.com 中创建、发布和配置您的机器人之后):
<iframe src="https://webchat.botframework.com/embed/YOUR_BOT_ID?s=YOUR_SECRET_HERE"></iframe>
注意:您应该调用 https://webchat.botframework.com/api/tokens with your secret, and get back a server to server token, replacing s with t, so you don't expose your bot's secret. This is all explained here: https://docs.botframework.com/en-us/support/embed-chat-control2/
and how does that bot receive message and send back the response?
消息以json 格式发送和接收。网上有很多文档和示例。像这样:https://docs.botframework.com/en-us/csharp/builder/sdkreference/routing.html 关于 发送和接收活动
As of now I am using bot emulator by Microsoft and my bot app working fine.
DO i need to publish my bot app on azure???
您的机器人需要在某处发布。 Azure 是目前托管机器人的最佳场所,因为 Microsoft 致力于该框架及其未来。
还有 安全方面和复杂性 ,由 Dan Driscoll 在这里解释 https://github.com/Microsoft/BotBuilder/issues/1006#issuecomment-244087904:
Bots are just web services. If you unhook security and talk directly to the bot's activity endpoint, you can operate your bot locally on your machine. It may be simpler to just open your own API on the bot's service because emulating what we do in the channels is actually a fair amount of work. (It's by no means impossible -- this is exactly what we do in the emulator -- but there is a fair amount of complexity there.)
If you want to stay within the Bot Framework universe, the bot's endpoint does need to be accessible by the Bot Framework services, i.e. on the internet. If you're publishing on the internet, you will probably want to secure your endpoint, and the Bot Framework security model by design does not allow just anyone to call a bot -- our libraries only allow in authentic Bot Framework services.