예제 #1
0
        public DialogBot(ConversationState conversationState, UserState userState, T dialog, ILogger <DialogBot <T> > logger, LuisRecognizer recognizer, BotServices services, IConfiguration configuration, CalDialog calDialog)
        {
            ConversationState = conversationState;
            UserState         = userState;
            Dialog            = dialog;
            CalDialog         = calDialog;
            Logger            = logger;

            _configuration    = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _recognizer       = recognizer ?? throw new ArgumentNullException(nameof(recognizer));
            _services         = services ?? throw new ArgumentNullException(nameof(services));
            UserState         = userState ?? throw new ArgumentNullException(nameof(userState));
            ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));

            _userProfileStateAccessor = UserState.CreateProperty <UserProfileState>(nameof(UserProfileState));
            _mainDialogStateAccessor  = ConversationState.CreateProperty <DialogState>("mainDialogState");
            _calDialogStateAccessor   = ConversationState.CreateProperty <DialogState>("calDialogState");
            _leadDialogStateAccessor  = ConversationState.CreateProperty <DialogState>("leadDialogState");
            // Verify LUIS configuration.
            if (!_services.LuisServices.ContainsKey(LuisConfiguration))
            {
                throw new InvalidOperationException($"The bot configuration does not contain a service type of `luis` with the id `{LuisConfiguration}`.");
            }
        }
예제 #2
0
 public AuthBot(ConversationState conversationState, UserState userState, T dialog, ILogger <DialogBot <T> > logger, LuisRecognizer recognizer, BotServices services, IConfiguration configuration, CalDialog calDialog)
     : base(conversationState, userState, dialog, logger, recognizer, services, configuration, calDialog)
 {
 }