Exemple #1
0
        public VSLiveBot(VSLiveBotAccessors accessors, BotServices services)
        {
            _accessors = accessors ?? throw new System.ArgumentNullException(nameof(accessors));

            _dialogs = new DialogSet(accessors.ConversationDialogState);

            var userInforDialog = new UserInfoDialog(_accessors);

            // Add named dialogs to the DialogSet. These names are saved in the dialog state.
            _dialogs.Add(new WaterfallDialog("UserInfo", userInforDialog.Steps()));
            _dialogs.Add(new TextPrompt("name"));
            _dialogs.Add(new TextPrompt("adoId"));

            var createNewDialog = new CreateNewDialog(_accessors);

            // Add named dialogs to the DialogSet. These names are saved in the dialog state.
            _dialogs.Add(new WaterfallDialog("CreateNew", createNewDialog.Steps()));
            _dialogs.Add(new TextPrompt("description"));
            _dialogs.Add(new ConfirmPrompt("assignSelf"));

            _services = services ?? throw new System.ArgumentNullException(nameof(services));
            if (!_services.LuisServices.ContainsKey(LuisKey))
            {
                throw new System.ArgumentException($"Invalid configuration....");
            }
        }