Exemple #1
0
            public async Task DepositHandler(IDialogContext context, LuisResult result)
            {
                var utteranceEntities = new Dictionary <string, dynamic>
                {
                    { "Account", "" },
                    { "TransactionAmount", 0d },
                };

                luisBankModel = new LUISBankModel();

                foreach (var entityRecommendation in result.Entities)
                {
                    if (luisBankModel.entities.Contains(entityRecommendation.Type))
                    {
                        utteranceEntities[entityRecommendation.Type] = entityRecommendation.Entity;
                    }
                }
                await context.PostAsync("Got it!");

                await context.PostAsync($"I'll go ahead and deposit ${utteranceEntities["TransactionAmount"]} into your {utteranceEntities["Account"]}.");

                // confirmation to select the propse intent no, yes
                // ..
                context.Wait(MessageReceived);
            }
Exemple #2
0
            public async Task WithdrawHandler(IDialogContext context, LuisResult result)
            {
                var utteranceEntities = new Dictionary <string, dynamic>
                {
                    { "Account", "" },
                    { "TransactionAmount", 0d },
                };

                luisBankModel = new LUISBankModel();

                foreach (var entityRecommendation in result.Entities)
                {
                    if (luisBankModel.entities.Contains(entityRecommendation.Type))
                    {
                        utteranceEntities[entityRecommendation.Type] = entityRecommendation.Entity;
                    }
                }

                await context.PostAsync("Sure thing!");

                await context.PostAsync($"I'll go ahead and withdraw ${utteranceEntities["TransactionAmount"]} from your {utteranceEntities["Account"]}.");

                context.Wait(MessageReceived);
            }