You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QnAMaker Middleware is sending output directly to the user. What if developer needs to format the result/use adaptive card etc..
Workaround to clone the Microsoft.Bot.Builder.Ai.QnAMaker class and store QnA response in bot state (which seems hacky) eg:
publicasyncTaskReceiveActivity(IBotContextcontext,MiddlewareSet.NextDelegatenext){if(context.Request.Type==ActivityTypes.Message){varmessageActivity=context.Request.AsMessageActivity();if(!string.IsNullOrEmpty(messageActivity.Text)){varresults=awaitthis.GetAnswers(messageActivity.Text.Trim()).ConfigureAwait(false);if(results.Any()){// Store results in state for handling by TemplateRenderer latercontext.State.Conversation["QnAResult"]=results;}}}awaitnext().ConfigureAwait(false);}
The text was updated successfully, but these errors were encountered:
So as a general rule, our goal is to make all of the built-in services usable both freestanding and as middleware. The JS SDK has the exact opposite problem that you can only use QnA Maker in freestanding mode right now. Please continue to file issues like this and we'll have all of these lose edges sewed up soon.
For now, I think this is "By Design". As we move soon to a model where there is significantly improved stateful interactions between Middleware components, we should come back and revisit this.
QnAMaker Middleware is sending output directly to the user. What if developer needs to format the result/use adaptive card etc..
Workaround to clone the Microsoft.Bot.Builder.Ai.QnAMaker class and store QnA response in bot state (which seems hacky) eg:
The text was updated successfully, but these errors were encountered: