コード例 #1
0
        public async Task StartDialog(IDialogContext context, LuisResult result)
        {
            DiagnosticsUtil.TraceInformation($"MainLUISDialog- StartDialog");

            _context.Refresh(IntentType.StartDialog, result);
            var response = GetNextResponse();

            await SendResponse(context, response);
        }
コード例 #2
0
        public async Task Number(IDialogContext context, LuisResult result)
        {
            DiagnosticsUtil.TraceInformation($"SurveyLUISDialog- Number");
            _context.Refresh(IntentType.Number, result);
            _context.CheckAnswer(result);

            var response = GetNextResponse();

            await SendResponse(context, response);
        }
コード例 #3
0
        public override async Task StartAsync(IDialogContext context)
        {
            DiagnosticsUtil.TraceInformation($"SurveyLUISDialog- StartAsync");

            _context = new LUISDialogContext(context.Activity.From.Id);
            _context.Refresh(IntentType.StartDialog, null);
            _context.Questions = new List <Question>()
            {
                new Question()
                {
                    Id = 0, Subject = "Años", Text = "¿Cuántos años tienes", EntityType = EntityType.Age
                },
                new Question()
                {
                    Id = 1, Subject = "Lugar de estudios", Text = "¿Dónde estudias", EntityType = EntityType.Location
                },
                new Question()
                {
                    Id = 2, Subject = "Opinion", Text = "¿Te ha gustado la charla?", EntityType = EntityType.Opinion
                },
            };

            Response response = GetNextResponse();

            await SendResponse(context, response);
        }