简体   繁体   English

Microsoft bot V4 Skill Bot 在 SendActivityAsync function 回复 Root bot 时响应 500(内部错误)

[英]Microsoft bot V4 Skill Bot responds with 500(Internal error) when replied to Root bot at SendActivityAsync function

I'm trying Master and Skill bot functionality by calling Microsoft Sample EchoSkillBot from Master Bot developed by me.我通过从我开发的 Master Bot 调用 Microsoft Sample EchoSkillBot 来尝试 Master 和 Skill bot 功能。 Call reached Skill bot from Master but while Skill bot replying to Master getting the exception "InternalServerError".来自 Master 的呼叫已到达 Skill bot,但在回复 Master 的 Skill bot 收到异常“InternalServerError”。 Additional note I'm using LUIS to route the conversations to respective Skill and QnA.附加说明我正在使用 LUIS 将对话路由到相应的技能和 QnA。

Code: (Exception thrown at this code)代码:(此代码抛出异常)

await turnContext.SendActivityAsync(
           MessageFactory.Text(messageText, 
                               messageText, 
                               InputHints.IgnoringInput), 
           cancellationToken);

Error:错误:

"{"type":"https://tools.ietf.org/html/rfc7231#section-6.6.1","title":"An error occured while processing your request.","status":500,"traceId":"XXXXX"}" "{"type":"https://tools.ietf.org/html/rfc7231#section-6.6.1","title":"处理您的请求时出错。","status":500," traceId":"XXXX"}"

"Operation returned an invalid status code 'InternalServerError'" “操作返回了无效的状态代码‘InternalServerError’”

I found the root cause for the exception.我找到了异常的根本原因。 In startup.cs I had used Bot framework adapter as IBotFrameworkHttpAdapter in one place and other place BotFrameworkHttpAdapter.在 startup.cs 中,我在一个地方使用了 Bot 框架适配器作为 IBotFrameworkHttpAdapter,而在另一个地方使用了 BotFrameworkHttpAdapter。 After fixing this Skill reply worked fine.修复此技能回复后,效果很好。

   // Create the Bot Framework Adapter with error handling enabled.
   //services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
     services.AddSingleton<BotFrameworkHttpAdapter, AdapterWithErrorHandler>();
     services.AddSingleton<BotAdapter>(sp => sp.GetService<BotFrameworkHttpAdapter>());  //Added for Skill bot

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM