LuisDialog returns error after BotAddedToConversation to any message
See original GitHub issueHi after I successfully have my response from BotAddedToConversation message I have the following error displayed as a response in my simulator;
{
"message": "An error has occurred.",
"exceptionMessage": "invalid need: expected Wait, have Done",
"exceptionType": "Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedException",
"stackTrace": " at Microsoft.Bot.Builder.Internals.Fibers.Wait`1.ValidateNeed(Need need)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Wait`1.Microsoft.Bot.Builder.Internals.Fibers.IWait.Post[D](D item)\r\n at Microsoft.Bot.Builder.Internals.Fibers.Extensions.Post[T](IFiber fiber, T item)\r\n at Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IUserToBot-SendAsync>d__20.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.Conversation.<SendAsync>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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at MyApp.MessagesController.<Post>d__0.MoveNext() in C:\\dev\\projects\\other\\msusur\\jupi-bot\\Jupi.App\\Controllers\\MessagesController.cs:line 28\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 System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.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 System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.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 System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>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 System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>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 System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
here is my luis dialog. What might go wrong?
[LuisModel("my model id", "subscription key")]
[Serializable]
public class MyQueryDialog : LuisDialog
{
[LuisIntent("LoadLinks")]
public async Task ProcessLinkRequest(IDialogContext context, LuisResult result)
{
var entities = new List<EntityRecommendation>(result.Entities);
if (entities.Count == 0)
{
await context.PostAsync("Thank you!");
}
context.Wait(MessageReceived);
}
}
Here is how I handle the messages
public async Task<Message> Post([FromBody]Message message)
{
if (message.Type == "Message")
{
return await Conversation.SendAsync(message, () => new MyQueryDialog(BuildForm));
}
return HandleSystemMessage(message);
}
private static IForm<QueryModel> BuildForm()
{
var builder = new FormBuilder<QueryModel>();
return builder.AddRemainingFields().Build();
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
LuisDialog returns error after BotAddedToConversation to any ...
Hi after I successfully have my response from BotAddedToConversation message I have the following error displayed as a response in my ...
Read more >LuisDialog returns an InvalidIntentHandlerException every time
When I replaced every reference of LuisServiceResult to LuisResult, the error went away and my intent methods came into play.
Read more >Messages in bot conversations - Teams | Microsoft Learn
Learn how to send receive a message, suggested actions, notification, attachments, images, Adaptive Card and status error code responses.
Read more >botframework-sdk from microsoft - Giter VIP
When the SandwichOrder Form is completed I'd like to store the order. I didn't find any code in the sample where I could...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s the ID that shows up the LUIS query url - the website will provide it to you.
Thank you!