在Virtual Assistant模板中使用Content Moderator会引发错误

时间:2019-10-03 18:10:04

标签: botframework

通过添加以下代码来打开内容主持人:

Use(new ContentModeratorMiddleware(settings.ContentModerator.Key, contentModeratorSettings.Value.Region)); to the defaultAdapter.cs.  

出现此错误:

at System.Text.Encoding.GetBytes(String s)
at Microsoft.Bot.Builder.Solutions.Middleware.ContentModeratorMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AutoSaveStateMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\AutoSaveStateMiddleware.cs:line 60
at Microsoft.Bot.Builder.Solutions.Middleware.EventDebuggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Solutions.Middleware.SetLocaleMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.ShowTypingMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\ShowTypingMiddleware.cs:line 71"

这发生在触发器之前:

protected override async Task OnEventAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))

0 个答案:

没有答案