コード例 #1
0
        public void TestAddingIntentExample()
        {
            string    intentName             = "TestAddingIntentExample";
            string    intentExample          = "Rotate object 30 degrees to the left";
            string    entityName             = "amount";
            string    entityDirection        = "direction";
            string    entityNameExample      = "30 degrees";
            string    entityDirectionExample = "left";
            LuisModel model = new LuisModel(luisAppID, ocpAcimSubscriptionKey);

            try
            {
                model.Modify()
                .AddIntent(intentName, new List <Entitylabel>()
                {
                    Entitylabel.Create(intentExample, entityName, entityNameExample),
                    Entitylabel.Create(intentExample, entityDirection, entityDirectionExample),
                })
                .Update();

                var intentNames = model.GetIntents().Keys;
                Assert.IsTrue(intentNames.Contains(intentName));
            }
            finally
            {
                model.DeleteIntent(intentName);
            }
        }
コード例 #2
0
        public void TestAddingIntent()
        {
            string    intentName = "TestAddingIntent";
            LuisModel model      = new LuisModel(luisAppID, ocpAcimSubscriptionKey);

            try
            {
                model.Modify()
                .AddIntent(intentName)
                .Update();

                var intentNames = model.GetIntents().Keys;
                Assert.IsTrue(intentNames.Contains(intentName));
            }
            finally
            {
                model.DeleteIntent(intentName);
            }
        }
コード例 #3
0
 public void TestGettingIntents()
 {
     LuisModel model       = new LuisModel(luisAppID, ocpAcimSubscriptionKey);
     var       intentNames = model.GetIntents().Keys;
 }