Ejemplo n.º 1
0
        private async Task <DialogTurnResult> ShowWarningForUnsupportedCommand(WaterfallStepContext stepContext, HRManagement luisResult, CancellationToken cancellationToken)
        {
            var didntUnderstandMessageText = $"Sorry, I didn't get that. Please try asking in a different way (intent was {luisResult.TopIntent().intent})";
            var didntUnderstandMessage     = MessageFactory.Text(didntUnderstandMessageText, didntUnderstandMessageText, InputHints.IgnoringInput);
            await stepContext.Context.SendActivityAsync(didntUnderstandMessage, cancellationToken);

            return(await stepContext.ReplaceDialogAsync(InitialDialogId, "unpredictable error happens, please call the admin", cancellationToken));
        }
Ejemplo n.º 2
0
        // Shows a warning if the requested From or To cities are recognized as entities but they are not in the Airport entity list.
        // In some cases LUIS will recognize the From and To composite entities as a valid cities but the From and To Airport values
        // will be empty if those entity values can't be mapped to a canonical item in the Airport.
        private async Task <DialogTurnResult> ShowWarningForUnsupportedNames(WaterfallStepContext stepContext, HRManagement luisResult, CancellationToken cancellationToken)
        {
            var result       = string.Empty;
            var message      = new Activity();
            var fromEntities = luisResult.ToName;

            if (string.IsNullOrEmpty(fromEntities))
            {
                result  = "the name you entered is not valid.";
                message = MessageFactory.Text(result, result, InputHints.IgnoringInput);
                await stepContext.Context.SendActivityAsync(message, cancellationToken);

                return(await stepContext.ReplaceDialogAsync(InitialDialogId, "Lets start over, please enter your name", cancellationToken));
            }
            return(null);
        }