Exemple #1
0
        public ModuleDialog(ConversationRecognizer luisRecognizer, ILogger <ModuleDialog> logger, LecturerDialog lecturerDialog, ExtracurricularDialog extracurricularDialog, EndConversationDialog endConversationDialog, CampusDialog campusDialog)
            : base(nameof(ModuleDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(lecturerDialog);
            AddDialog(extracurricularDialog);
            AddDialog(endConversationDialog);

            AddDialog(campusDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                NumberModulesStepAsync,
                FavModuleAsync,
                ExamorCaFavAsync,
                OpinionFavAsync,
                LeastFavModuleAsync,
                ExamorCaLeastAsync,
                OpinionLeastAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #2
0
        public DialogBot(ConversationRecognizer luisRecognizer, ConversationState conversationState, UserState userState, T dialog, ILogger <DialogBot <T> > logger)
        {
            _luisRecognizer = luisRecognizer;

            ConversationState = conversationState;
            UserState         = userState;
            Dialog            = dialog;
            Logger            = logger;
        }
Exemple #3
0
        public EndConversationDialog(ConversationRecognizer luisRecognizer, ILogger <EndConversationDialog> logger)
            : base(nameof(EndConversationDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                ThankTask,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #4
0
        public CoronaDialog(ConversationRecognizer luisRecognizer, ILogger <CoronaDialog> logger)
            : base(nameof(CoronaDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                ExplanationStepAsync,
                FinalStepAsync,
            }));
            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
        // Begin End Conversation Dialog-Flow
        public EndConversationDialog(ConversationRecognizer luisRecognizer, ILogger <EndConversationDialog> logger, MainDialog mainDialog)
            : base(nameof(EndConversationDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(mainDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                EndStepAsync,
            }));
            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #6
0
        // Initialise the dialog

        public UserProfileDialog(ConversationRecognizer luisRecognizer, ILogger <UserProfileDialog> logger, EndConversationDialog endConversationDialog, ModuleDialog moduleDialog)
            : base(nameof(UserProfileDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(endConversationDialog);
            AddDialog(moduleDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                GetNameAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #7
0
        public UserProfileDialog(ConversationRecognizer luisRecognizer, ElectionDialog electionDialog, ILogger <UserProfileDialog> logger)
            : base(nameof(UserProfileDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(electionDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                GetNameAsync,       // Name input
                GetUserIDAsync,     // UserID input
                FinalStepAsync,     // Move to next dialog
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #8
0
        public CampusDialog(ConversationRecognizer luisRecognizer, ILogger <CampusDialog> logger, CoronaDialog coronaDialog)
            : base(nameof(CampusDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(coronaDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                FacStepAsync,
                CoronaStepAsync,
                CoronaResponseStepAsync,
                CoronaMoveStepAsync,
            }));
            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #9
0
        // Extracurricular Dialog Class
        public ExtracurricularDialog(ConversationRecognizer luisRecognizer, ILogger <ExtracurricularDialog> logger, CampusDialog campusDialog)
            : base(nameof(ExtracurricularDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(campusDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                GetInfoAsync,
                MoveConvoAsync,
                CampusAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #10
0
        public PartyDialog(ConversationRecognizer luisRecognizer, EndConversationDialog endConversationDialog, ILogger <PartyDialog> logger)
            : base(nameof(PartyDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(endConversationDialog);
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskParty,               // Ask for user input
                ElaboratePartyAsync,    // Make a remark on input
                ContinueStepAsync,      // Continue to next dialog
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #11
0
        public ConstituencyDialog(ConversationRecognizer luisRecognizer, IssuesDialog issuesDialog, ILogger <ConstituencyDialog> logger)
            : base(nameof(ConstituencyDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(issuesDialog);
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskConstituency,            // Ask users where they vote
                RemarkOnLocationAsync,      // Make a remark on location
                AgreeStepAsync,             // Agree with user opinion and continue
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #12
0
        public IssuesDialog(ConversationRecognizer luisRecognizer, PartyDialog partyDialog, ILogger <IssuesDialog> logger)
            : base(nameof(IssuesDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(partyDialog);
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskIssues,              //Ask user about societal issues
                ElaborateIssuesAsync,   //Bot responds intelligently
                ContinueStepAsync,      //continues to next dialog
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #13
0
        public LecturerDialog(ConversationRecognizer luisRecognizer, ILogger <LecturerDialog> logger, MainDialog mainDialog, EndConversationDialog endConversationDialog, ExtracurricularDialog extracurricularDialog)
            : base(nameof(LecturerDialog))

        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(endConversationDialog);
            AddDialog(extracurricularDialog);
            AddDialog(mainDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                GetInfoAsync,
                GetAnswerAsync,
            }));
            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #14
0
        public ElectionDialog(ConversationRecognizer luisRecognizer, ILogger <ElectionDialog> logger, ConstituencyDialog constituencyDialog
                              )
            : base(nameof(ElectionDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(constituencyDialog);
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,     // Bot asks if the user voted in the Election
                AskVotedAsync,      // Stores result and comments on answer (Yes/No)
                FillerStepAsync,    // Conversation chit-chat filler
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #15
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainDialog(UserState userState, ConversationRecognizer luisRecognizer, ElectionDialog electionDialog, UserProfileDialog userProfileDialog, ILogger <MainDialog> logger)
            : base(nameof(MainDialog))
        {
            _luisRecognizer = luisRecognizer;
            _userState      = userState;
            Logger          = logger;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(userProfileDialog);
            AddDialog(electionDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                ActStepAsync,
                FinalStepAsync,
                EndStepAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #16
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainDialog(ConversationRecognizer luisRecognizer, ExtracurricularDialog extracurricularDialog, CampusDialog campusDialog, ILogger <MainDialog> logger)
            : base(nameof(MainDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(new TextPrompt(nameof(TextPrompt)));


            AddDialog(campusDialog);
            AddDialog(extracurricularDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                NameStepAsync,
                ActStepAsync,
                FinalStepAsync,
            }));

            // The initial child Dialog to run
            InitialDialogId = nameof(WaterfallDialog);
        }