예제 #1
0
        protected virtual async Task DispatchToLuisActionActivityHandler(IDialogContext context, IAwaitable <IMessageActivity> item, string intentName, ILuisAction luisAction)
        {
            var actionHandlerByIntent = new Dictionary <string, LuisActionActivityHandler>(this.GetActionHandlersByIntent());

            if (!actionHandlerByIntent.TryGetValue(intentName, out LuisActionActivityHandler handler))
            {
                handler = actionHandlerByIntent[string.Empty];
            }

            if (handler != null)
            {
                await handler(context, item, await luisAction.FulfillAsync());
            }
            else
            {
                throw new Exception($"No default intent handler found.");
            }
        }
예제 #2
0
 protected virtual async Task <object> PerformActionFulfillment(IDialogContext context, IAwaitable <IMessageActivity> item, ILuisAction luisAction)
 {
     return(await luisAction.FulfillAsync());
 }