连接Bot框架模拟器与停靠机器人

发布于 2025-01-24 16:51:09 字数 1831 浏览 4 评论 0 原文

我很难理解将机器人框架模拟器连接到在本地码头容器中运行的机器人的过程。

我在机器人框架作曲家的帮助下创建了一个(nodejs)机器人。我可以使用bot框架模拟器成功启动机器人,并成功地连接到它:

  1. 验证bot frame emulator中的chatbot connect

接下来,我将应用程序放入一个应用程序Docker Container,暴露了端口3978,并再次在本地开始。我可以成功验证,容器正在运行

  1. 验证在cli上验证运行docker容器

我还可以验证,bot应用程序在容器中运行,并且可以通过调用端点 localhost:3978/api/messages 在我的浏览器中访问。

对我来说,该机器人似乎在Docker容器中运行,因为有一个陈述,即路由不存在(可以理解,因为未实现获取API/消息)

  1. 验证docker容器中的bot是否在docker

容器中运行然后,我在bot框架模拟器中创建了一个新的端点配置:

  1. 添加端点配置到dockerized chatbot

现在出现问题:如果我打开端点连接,i i,i收到500个错误(连接拒绝)。

  1. 验证bot框架模拟器输出

有人有想法吗?

有什么区别:

  • 使用“ npm Run dev”启动机器人(= bot可在http:// localhost:3978/api/messages),并
  • 使用Docker容器启动机器人(= bot,请访问http://可用Localhost:3978/API/消息)

我在GitHub上发现以下问题,但这无济于事: https://github.com/microsoft/botframework-botframework-emulator-emulator-emulator-emulator/sissues/sissues/356

看来,这里的用户比我较远,因为我的设置在连接时间已经失败了,在GitHub问题中,用户在已经连接的机器人的情况下遇到了“发送”消息的问题。

在此先感谢您的任何指导!

I've trouble to understand the process to connect the Bot Framework Emulator to a bot, that runs within a local Docker container.

I created a (NodeJS) bot with the help of the Bot Framework Composer. I can start the bot with the IDE and connect to it via the Bot Framework Emulator successfully:

  1. Start chatbot via Bot Framework Composer
  2. Verify chatbot connect in Bot Framework Emulator

Next, I put the application into a Docker Container, exposed the port 3978 and started it locally again. I can successfully verify, that the container is running

  1. Verify running Docker Container on CLI

I can additionally verify, that the bot application is running in the container and that is accessible by calling the endpoint localhost:3978/api/messages in my browser.

For me it seems, that the bot is running in the Docker container, because there is a statement, that a route does not exist (understandable, because GET api/messages is not implemented)

  1. Verify if bot is running within the Docker container

I then created a new endpoint configuration in Bot Framework Emulator to connect to my locally deployed bot in the Docker container:

  1. Add endpoint configuration to dockerized chatbot

Now the issue appears: If I open the endpoint connection, I receive a 500 error (connection refused).

  1. Verify Bot Framework emulator output

Does someone have an idea, what's actually going on here?

What's the difference between:

  • starting the bot with "npm run dev" (= bot is available at http://localhost:3978/api/messages) and
  • starting the bot with a Docker container (= bot is available at http://localhost:3978/api/messages)

I found following issue on GitHub, but this didn't help:
https://github.com/microsoft/BotFramework-Emulator/issues/356

It seems that the user here was one step further than me, because my setup already fails during connection time and in the GitHub issue the user had issues "sending" messages to a already connected bot.

Thanks in advance for any guidance here!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

趁微风不噪 2025-01-31 16:51:09

这是一个古老的问题,但是我也有同样的问题。如果可以帮助某人,这就是我修复它的方法:

在您的 docker-compose.yml config,您需要将运行机器人在容器内运行的端口曝光到本地主机,以便bot框架模拟器可以与之交谈

ports:
      - "3978:3978"

,然后您还需要让您的机器人查看Localhost上的内容,以响应Bot Framework仿真器。以下行允许您连接到 http(s):// localhosthost上运行的事物:(port)通过调用 http(s)://host.docker.internal:(端口)从您的容器内部。 请参阅

extra_hosts:
      - "host.docker.internal:host-gateway"

文档设置:

  • 旁路
  • 地址的

本地

  • tick URL: http:// localhost:3978/api/messages
  • 留下所有其他空白
  • 连接

This is an old question, but I had the same problem. Here is how I fixed it if that can help someone:

In your docker-compose.yml config, you need to expose the port running your bot inside your container to your localhost, so that the Bot Framework Emulator can talk to it

ports:
      - "3978:3978"

Then you also need to let your bot see what's running on localhost, to respond to the Bot Framework Emulator. The following line lets you connect to things running on your http(s)://localhosthost:(port) by calling http(s)://host.docker.internal:(port) from within your container. See documentation

extra_hosts:
      - "host.docker.internal:host-gateway"

Finally, in your Bot Framework Emulator settings:

  • Tick Bypass ngrok for local addresses
  • Set localhost override to host.docker.internal
  • Save

You should then be able to connect to Open Bot

  • Bot URL: http://localhost:3978/api/messages
  • Leave everything else blank
  • Connect
别念他 2025-01-31 16:51:09

什么帮助我。

docker构成设置

端口:

  • '3334:80'extra_hosts

  • “ localhost:host-gateway:待测试”

用于测试我使用bot框架模拟器

What help me.

Docker Compose settings

ports:

  • '3334:80'

extra_hosts:

  • "localhost:host-gateway"

For test I use Bot Framework Emulator

记忆で 2025-01-31 16:51:09

为@yannickv答案提供投票。我只是在此处发布一个真实示例:

  1. 创建您的bot项目
  2. 构建容器映像,然后推到某些容器注册表
  3. 创建Docker-compose.yaml

服务:
Botservice:
图像: /echobot
端口:
- “ 8080:8080”
extra_host:
- “ host.docker.internal:host-gateway”#这个值是重要的

  1. 启动docker组成
  2. 更新bot仿真器配置

然后您可以在本地调试

Upvote for @yannickv answer. I just post a real example here:

  1. Create your Bot project
  2. Build container image and push to some container registry
  3. Create docker-compose.yaml

services:
BotService:
image: /echobot
ports:
- "8080:8080"
extra_hosts:
- "host.docker.internal:host-gateway" # this value is important

  1. start docker compose up
  2. update Bot Emulator config
    enter image description here

Then you can debug locally

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文