Exemple #1
0
        public DemoSkill(DemoSkillServices services, DemoSkillAccessors accessors)
        {
            _accessors = accessors;
            _dialogs   = new DialogSet(accessors.ConversationDialogState);
            _responder = new DemoSkillResponses();
            _services  = services;

            RegisterDialogs();
        }
Exemple #2
0
        // Skill Mode Constructor
        public DemoSkill(BotState botState, string stateName = null, Dictionary <string, string> configuration = null)
        {
            // Flag that can be used for Skill specific behaviour (if needed)
            _skillMode = true;

            // Create the properties and populate the Accessors. It's OK to call it DialogState as Skill mode creates an isolated area for this Skill so it doesn't conflict with Parent or other skills
            _accessors = new DemoSkillAccessors
            {
                DemoSkillState          = botState.CreateProperty <DemoSkillState>(stateName ?? nameof(DemoSkillState)),
                ConversationDialogState = botState.CreateProperty <DialogState>("DialogState"),
            };

            if (configuration != null)
            {
                // If LUIS configuration data is passed then this Skill needs to have LUIS available for use internally
                string luisAppId;
                string luisSubscriptionKey;
                string luisEndpoint;

                configuration.TryGetValue("LuisAppId", out luisAppId);
                configuration.TryGetValue("LuisSubscriptionKey", out luisSubscriptionKey);
                configuration.TryGetValue("LuisEndpoint", out luisEndpoint);

                ////if (!string.IsNullOrEmpty(luisAppId) && !string.IsNullOrEmpty(luisSubscriptionKey) && !string.IsNullOrEmpty(luisEndpoint))
                ////{
                ////    LuisApplication luisApplication = new LuisApplication(luisAppId, luisSubscriptionKey, luisEndpoint);

                ////    _services = new DemoSkillServices();
                ////    _services.LuisRecognizer = new Microsoft.Bot.Builder.AI.Luis.LuisRecognizer(luisApplication);
                ////}
            }

            _dialogs   = new DialogSet(_accessors.ConversationDialogState);
            _responder = new DemoSkillResponses();

            RegisterDialogs();
        }