Beispiel #1
0
        public static async System.Threading.Tasks.Task <string> MessageHandler(string inputStr)
        {
            string response = String.Empty;

            // Convert input string to FaqLuis Model
            LuisObject faqLuis = await LuisService.ParseFaqInput(inputStr);

            if (faqLuis.topScoringIntent != null)
            {
                switch (faqLuis.topScoringIntent.intent)
                {
                case "FaqQuery":
                    response = await FaqService.FaqQueryProcessor(faqLuis.topScoringIntent);

                    break;

                case "Assistance":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Assistance);
                    break;

                case "DirectAddress":

                    response = await DirectAddressHandler(inputStr);

                    break;

                case "Farewell":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Farewells);
                    break;

                case "Politeness":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Emojis);
                    break;

                //- Could not place request
                default:
                    response = ResponseSet.GetRandomResponse(ResponseSet.Nones);
                    break;
                }
            }
            return(response);
        }