コード例 #1
0
        public void AddSkills()
        {
            // Simple skill, no slots
            _skillManifests.Add(ManifestUtilities.CreateSkill(
                                    "testskill",
                                    "testskill",
                                    "https://testskill.tempuri.org/api/skill",
                                    "testSkill/testAction"));

            // Simple skill, with one slot (param1)
            var slots = new List <Slot>();

            slots.Add(new Slot("param1", new List <string>()
            {
                "string"
            }));
            _skillManifests.Add(ManifestUtilities.CreateSkill(
                                    "testskillwithslots",
                                    "testskillwithslots",
                                    "https://testskillwithslots.tempuri.org/api/skill",
                                    "testSkill/testActionWithSlots",
                                    slots));

            // Simple skill, with two actions and multiple slots
            var multiParamSlots = new List <Slot>();

            multiParamSlots.Add(new Slot("param1", new List <string>()
            {
                "string"
            }));
            multiParamSlots.Add(new Slot("param2", new List <string>()
            {
                "string"
            }));
            multiParamSlots.Add(new Slot("param3", new List <string>()
            {
                "string"
            }));

            var multiActionSkill = ManifestUtilities.CreateSkill(
                "testskillwithmultipleactionsandslots",
                "testskillwithmultipleactionsandslots",
                "https://testskillwithslots.tempuri.org/api/skill",
                "testSkill/testAction1",
                multiParamSlots);

            multiActionSkill.Actions.Add(ManifestUtilities.CreateAction("testSkill/testAction2", multiParamSlots));
            _skillManifests.Add(multiActionSkill);

            // Each Skill has a number of actions, these actions are added as their own SkillDialog enabling
            // the SkillDialog to know which action is invoked and identify the slots as appropriate.
            foreach (var skill in _skillManifests)
            {
                Dialogs.Add(new SkillDialogTest(skill, _mockServiceClientCredentials, _mockTelemetryClient, UserState, _mockSkillTransport));
            }
        }
        public void AddSkillManifest()
        {
            // Simple skill, no slots
            _skillManifest = ManifestUtilities.CreateSkill(
                "testSkill",
                "testSkill",
                "https://testskill.tempuri.org/api/skill",
                "testSkill/testAction");

            // Add the SkillDialog to the available dialogs passing the initialized FakeSkill
            Dialogs.Add(new SkillDialogTest(
                            _skillManifest,
                            _mockServiceClientCredentials,
                            _mockTelemetryClient,
                            UserState,
                            _mockSkillTransport));
        }