BotFramework Composer,在调用时出现404错误

2024-10-02 18:25:09 发布

您现在位置:Python中文网/ 问答频道 /正文

复制步骤:

步骤1:

选择Echo bot template,使用composer(mac上的1.0.0版安装表单DMG)创建一个bot

步骤2:

从当前回购中克隆回显技能样本: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/python/80.skills-simple-bot-to-bot

步骤3:

在本地运行该技能

步骤4:

连接到技能:

enter image description here

图中的端点是端口3980,但在最后一次尝试中,主bot是由编写器在当前bot上提供服务的。关键是我将回调URL设置为运行主bot的URL

步骤5:

在回显响应后,向未知意图对话框添加技能: enter image description here

错误:

我在技术方面消除了一个错误。在调试该技能之后,我发现问题出在回调上,回调将404错误返回给发送活动时的技能

uring handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/victorvasiliev/PycharmProjects/BotBuilder-Samples/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/adapter_with_error_handler.py", line 71, in _send_eoc_to_parent
    await turn_context.send_activity(end_of_conversation)
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py", line 170, in send_activity
    result = await self.send_activities([activity_or_text])
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py", line 217, in send_activities
    return await self._emit(self._on_send_activities, output, logic())
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py", line 295, in _emit
    return await logic
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/turn_context.py", line 212, in logic
    responses = await self.adapter.send_activities(self, output)
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_framework_adapter.py", line 686, in send_activities
    raise error
  File "/usr/local/lib/python3.7/site-packages/botbuilder/core/bot_framework_adapter.py", line 672, in send_activities
    activity.conversation.id, activity.reply_to_id, activity
  File "/usr/local/lib/python3.7/site-packages/botframework/connector/aio/operations_async/_conversations_operations_async.py", line 533, in reply_to_activity
    raise models.ErrorResponseException(self._deserialize, response)
botbuilder.schema._models_py3.ErrorResponseException: Operation returned an invalid status code 'Not Found'

有人面临过同样的问题吗


Tags: inpysendlibpackagesusrlocal技能
1条回答
网友
1楼 · 发布于 2024-10-02 18:25:09

您可以在documentation中看到,您的技能宿主端点需要以api/skills结束,而不仅仅是api

Select Skills from the Composer menu. In the Skills page, if your skill is remote, enter <ngrok address>/api/skills in the Skill Host Endpoint field. If your skill is local, you should enter localhost:port/api/skills in the Skill Host Endpoint field.

技能主机端点用作发送给技能的活动中的服务URL,这意味着它将是技能调用的任何对话API方法的基础URI。如果你的技能试图向一个不存在的URL发送请求,那么你应该得到404。Composer bot将把请求路由到以api/skills开头的路由,所以这就是您应该放在服务URL中的内容

相关问题 更多 >