- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将我的机器人框架升级到 3.13.0.3,我的 LUIS 对话框停止工作。我的机器人启动了,但是当我写下关于意图的词时,机器人再次显示初始消息并停留在这个循环中。
我确实验证了应用程序 ID 和 key ,如果我从浏览器向 LUIS 发出请求,它工作正常,但从 bot 就好像没有发出请求。
我再次训练并发布了 LUIS 模型
在 visual studio 和 Azure 部署中,行为是相同的,当键入 LUIS 意图时,机器人会再次显示启动消息。 LUISIntent 在西类牙语中是“vacantes”或“registrar”
在升级之前,机器人工作正常并且 LUIS 对话框工作正常。
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using MP_BotMVP.SupportClasses;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using System.Collections.Generic;
using System.Configuration;
using System.Threading;
namespace MP_BotMVP.Dialogs
{
[Serializable]
public class RootDialog : LuisDialog<object>
{
public RootDialog() : base(new LuisService(new LuisModelAttribute(
ConfigurationManager.AppSettings["LuisAppId"],
ConfigurationManager.AppSettings["LuisAPIKey"],
domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
{
}
[LuisIntent("")]
[LuisIntent("None")]
public async Task None(IDialogContext context, LuisResult result)
{
string strUserName = "Usuario";
try
{
strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
}
catch { }
string message = string.Format(DialogText.No_Endiendo,strUserName);
await context.PostAsync(message);
context.Wait(this.MessageReceived);
}
public override Task StartAsync(IDialogContext context)
{
context.Wait(this.MessageReceivedAsync);
return Task.CompletedTask;
}
private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
{
await this.SendWelcomeMessage(context);
}
private async Task SendWelcomeMessage(IDialogContext context)
{
await context.PostAsync($"{DialogText.Saludo_Inicial}");
PromptDialog.Text(context, this.GetUserNameAfter, DialogText.Pedir_Nombre);
}
private async Task GetUserNameAfter(IDialogContext context, IAwaitable<object> result)
{
var userName = await result;
context.UserData.SetValue(DialogText.UserNameKey, userName);
await context.PostAsync(string.Format(DialogText.Bienvenido, userName.ToString()));
}
[LuisIntent("Saludo y Presentacion")]
public async Task Greetings(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
await this.SendWelcomeMessage(context);
}
[LuisIntent("Registrar CV")]
public async Task RecordCV(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
string strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
string strLink = System.Configuration.ConfigurationManager.AppSettings["MP_CV_Url"];
string strResponse = string.Format(DialogText.Registrar_CV, strUserName, strLink);
await context.PostAsync(strResponse);
await this.SendMayIHelp(context);
}
[LuisIntent("Buscar Vacantes")]
public Task SearchJob(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
string strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
string strResponse = string.Format(DialogText.Buscar_Vacante, strUserName);
PromptDialog.Text(context, this.SearchJobAfter, strResponse);
return Task.CompletedTask;
}
private async Task SearchJobAfter(IDialogContext context, IAwaitable<object> result)
{
var userCity = await result;
context.UserData.SetValue(DialogText.UserSelectedCityKey, userCity);
PromptDialog.Text(context, this.SearchJobAreaAfter, DialogText.Buscar_Area);
}
private async Task SearchJobAreaAfter(IDialogContext context, IAwaitable<object> result)
{
var userArea = await result;
context.UserData.SetValue(DialogText.UserSelectAreaKey, userArea);
string strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
string strUserCity = context.UserData.GetValue<string>(DialogText.UserSelectedCityKey);
string strUserArea = context.UserData.GetValue<string>(DialogText.UserSelectAreaKey);
string strLink = System.Configuration.ConfigurationManager.AppSettings["MP_CV_Url"];
string strResponse = string.Format(DialogText.Buscando_Vacante, strUserName, strUserCity, strUserArea);
await context.PostAsync(strResponse);
List<string> l_strOpps = SQLDB.Get_Opportunities(strUserCity, strUserArea);
if (l_strOpps.Count > 0)
{
await context.PostAsync(string.Format(DialogText.Si_Resultados, strUserName, l_strOpps.Count));
foreach (string str in l_strOpps)
{
await context.PostAsync(str);
}
await context.PostAsync(string.Format(DialogText.Vacantes_InfoExtra, strUserName, strLink));
await this.SendMayIHelp(context);
}
else
{
await context.PostAsync(DialogText.No_Resultados);
PromptDialog.Text(context, this.SearchJobAreaAfter, DialogText.No_Resultados_Nuevamente);
}
}
[LuisIntent("Ayuda Adicional")]
public async Task GetInfo(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
string strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
string strResponse = string.Format(DialogText.Ayuda_Adicional, strUserName);
await context.PostAsync(strResponse);
}
private async Task SendMayIHelp(IDialogContext context)
{
await context.PostAsync(DialogText.Mas_Ayuda);
}
[LuisIntent("Calificar")]
public Task GetFeedback(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
foreach (var ent in result.Entities)
{
if ((ent.Entity.ToLower() == "si") || (ent.Entity.ToLower() == "calificar"))
{
PromptDialog.Text(context, this.FeedbackAfter, DialogText.Calificar);
}
}
return Task.CompletedTask;
}
private async Task FeedbackAfter(IDialogContext context, IAwaitable<object> result)
{
var userFeedback = await result;
//TODO --> Grabar en la DB
string strUserName = context.UserData.GetValue<string>(DialogText.UserNameKey);
string strResponse = string.Format(DialogText.Despedida, strUserName);
await context.PostAsync(strResponse);
}
}
}
这是机器人模拟器的错误
{
"type": "message",
"timestamp": "2018-02-01T01:07:03.688Z",
"localTimestamp": "2018-01-31T20:07:03-05:00",
"serviceUrl": "http://localhost:32443",
"channelId": "emulator",
"from": {
"id": "8jbgkfm83h2a",
"name": "Bot"
},
"conversation": {
"id": "k9247mmn33ig"
},
"recipient": {
"id": "default-user"
},
"membersAdded": [],
"membersRemoved": [],
"locale": "en-US",
"text": "Exception: An error occurred while sending the request.",
"attachments": [
{
"contentType": "text/plain",
"content": " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Luis.LuisService.<Microsoft-Bot-Builder-Luis-ILuisService-QueryAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Luis.Extensions.<QueryAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.LuisDialog`1.<MessageReceived>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume`1.<Rest>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Frame`1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Fiber`1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__16.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.Microsoft.Bot.Builder.Internals.Fibers.IAwaiter<T>.GetResult()\r\n at Microsoft.Bot.Builder.Dialogs.Chain.LoopDialog`1.<ResumeAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume`1.<Rest>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Frame`1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Fiber`1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__16.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__23.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.ReactiveDialogTask.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.ScoringEventLoop`1.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.EventLoopDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.SetAmbientThreadCulture.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.QueueDrainingDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.SerializeByConversation.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext()"
}
],
"entities": [],
"replyToId": "6hj7g24i9bgf",
"id": "974a35c985dd"
}
错误文本的摘录(附件.content):
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Luis.LuisService.<Microsoft-Bot-Builder-Luis-ILuisService-QueryAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Luis.Extensions.<QueryAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.LuisDialog`1.<MessageReceived>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume`1.<Rest>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Frame`1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Fiber`1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.Microsoft.Bot.Builder.Internals.Fibers.IAwaiter<T>.GetResult()
at Microsoft.Bot.Builder.Dialogs.Chain.LoopDialog`1.<ResumeAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume`1.<Rest>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Wait`2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Frame`1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop<C>-PollAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Fiber`1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.ReactiveDialogTask.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.ScoringEventLoop`1.<Microsoft-Bot-Builder-Base-IEventLoop-PollAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.EventLoopDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.SetAmbientThreadCulture.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.QueueDrainingDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.SerializeByConversation.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext()
最佳答案
你的对话框实现有几个问题:
查看 LuisDialog
的定义在 GitHub :您将看到对 LUIS 的调用是在 MessageReceived
中进行的方法。或者使用 context.Wait(MessageReceived);
调用此方法它从未在您的对话框中使用,因为您正在覆盖 StartAsync(IDialogContext context)
.
因此,您永远不会调用 LUIS 并进入与意图匹配的方法。
要更正这一点,请添加 context.Wait(MessageReceived);
在您的欢迎过程之后,基本上在 GetUserNameAfter
结束时.
来自 documentation 的一件重要事情:
Ensure all dialog methods end with a plan to handle the next message.
All IDialog methods should complete with
IDialogStack.Call
,IDialogStack.Wait
, orIDialogStack.Done
. TheseIDialogStack
methodsare exposed through theIDialogContext
that is passed to every IDialogmethod. CallingIDialogStack.Forward
and using the system promptsthrough thePromptDialog
static methods will call one of these methodsin their implementation.
如果我们按照您的对话流程进行操作,您会遇到几个问题:
GetUserNameAfter
结束方法执行,您向用户发布消息,然后您不等待消息或结束对话
SendMayIHelp
结束方法执行,由多种方法调用(RecordCV
,SearchJobAreaAfter
,当计数 > 0,GetInfo
,...),您在其中向用户发布消息,然后您不等待消息或结束对话
在 SearchJob
& GetFeedback
, 你不应该 return Task.CompletedTask;
在开始 PromptDialog.Text
之后因为此提示将在其他地方恢复。添加async
到你的方法定义
FeedbackAfter
结束方法执行,您向用户发布消息,然后您不等待消息或结束对话
关于c# - Bot Framework 和 LUIS 发送请求时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48555436/
因此,我想创建一个 bot/incoming webhook 来读取群组中的所有消息并将其复制到电子表格中。我在这里要问的是,机器人或传入的 webhook 可以读取整个群组消息吗?在 google
我正在使用 Microsoft Bot Framework 开发一个机器人,在该机器人中,机器人将通过向用户发送一些图像来响应。我用 slack 和 skype 配置了它。 在 slack 中图像正在
我试图让我的机器人与用户开始对话,但我不知道应该从代码中的哪个位置发送消息。启动 convo 的文档在这里,但不是很有帮助:http://docs.botframework.com/connector
我正在创建 Telegram Bot 。我需要跟踪添加用户和添加用户的时间。我如何使用 Telegram API 来做到这一点? 最佳答案 在使用 Telegram API 的群组中,您可以调用 ne
我已经创建了几个 Telegram 机器人。它们适用于我的帐户,也适用于我测试过的其他几个帐户。 但我收到一些用户的报告,称机器人从不响应。 是否有一些用户设置会阻止帐户从机器人获取消息?或者任何其他
如果在一段时间内没有用户输入,我有一个关于取消提示或对话框的问题。 我需要一种方法来以某种方式在提示中超时。 Example: Bot prompts the user: "How old are y
我有一个用例,当我的机器人需要在一天中的特定时间向用户发送消息时。假设每天早上 6 点。 我正在使用预定的 azure Webjob 发送这些消息。消息将在 Slack 和 Skype 客户端中传递。
我是 Microsoft bot 的新手。我的公司有自己的通信应用程序,我想将我的机器人与通信应用程序连接起来,我的客户可以在我公司的通信应用程序上使用我的机器人。我读到它需要使用 Direct Li
我在 sdk V4 Bot 中实现了一个中间件来拦截 bot 和用户之间的每条消息并记录该自定义 mongo Db。我正在尝试为使用 SDK v4 构建的 Bot 实现类似的概念。看起来我可以使用以下
我对编程和学习还很陌生。我认为制作一个不和谐的机器人是一种很好的学习方式,我很享受,只是有点卡住了。所以我的机器人是私有(private)的,我们的不和谐服务器中有一个正在运行的笑话,每当用户发送“k
如何让机器人假装它正在输入消息? 当机器人假装输入时,聊天中会出现以下文本: 我使用 python aiogram框架,但对 native Telegram API 的建议也会有所帮助。 最佳答案 我
我有一个像这样的 Telegram Bot : 通过 webhook 获取更新 语言:C#(我也欢迎其他语言的回答) 我们有以下用户场景: 向机器人发送/MyPhoto a_parameter命令 向
我加入了一个 Telegram Bot ,但我不知道它的所有者。是否可以找到 Telegram Bot 的所有者? 最佳答案 根据 Telegram MTProto protocol 不可能看到 Te
我已经创建了一个电报机器人并按照文档中的描述设置了一个 webhook。出于测试目的,我已经设置了它,因此一旦您向机器人发送一条消息,它就会用相同的消息回复。 现在我遇到的问题是来自电报的更新非常缓慢
是否可以将位置从 Telegram 发送到 Bot,这是在 Bot Framework 中制作的? 我将我的位置从我的 Telegram 帐户发送到我的 Bot,但服务器没有收到它们(我没有收到回复)
我在 Telegram 上创建了一个组并创建了一个机器人并添加进来。 我正在尝试向我创建的组发送消息,错误如下所示 {"ok":false,"error_code":403,"description"
使用 Microsoft Bot Framework V3 我开始使用登录卡。 我从示例代码页做了一个简单的剪切并粘贴到我的代码中,假设它有效(编译): https://docs.botframewo
当用户刚刚打开聊天时,机器人如何向用户发送消息。 例子: 用户已经添加了 Telegram bot到他的联系人列表并开始对话 稍后,用户打开与该机器人的聊天窗口 机器人“看到”该用户已打开聊天窗口,但
将 XCode 更新到版本 11.4 (11E146) 后,我不再在机器人设置中看到存储库分支。但是我在 Source Controll Navigator 中看到了这些存储库分支。有谁知道我该如何解
我想将机器人的位置发送给用户,我在谷歌上搜索了很多,但我发现只有这种情况“将用户的位置发送给机器人”我想要相反的情况,意思是:“发送机器人的位置给用户”。这是我的想法:机器人的所有者是一个司机,他想与
我是一名优秀的程序员,十分优秀!