From b4c37c378fa3ae119bb1d5688236efb9e8eacce3 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 22 Sep 2020 15:31:59 +0800 Subject: [PATCH 1/5] ci: add php 7.3 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d25d651..188d6dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: - 5.6 + - 7.3 install: - composer self-update - composer install --no-interaction From f85d741800fb379060d8a9d3d79334abb16c5b4c Mon Sep 17 00:00:00 2001 From: goodjun Date: Tue, 22 Sep 2020 15:36:32 +0800 Subject: [PATCH 2/5] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 188d6dc..2d911f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: - 5.6 + - 7.0 - 7.3 install: - composer self-update From c3cc39aacdf6545d0e5947cfc10c21cbec63c363 Mon Sep 17 00:00:00 2001 From: goodjun Date: Tue, 22 Sep 2020 02:12:02 -0700 Subject: [PATCH 3/5] feat: add train feature --- src/LUIS/LuisAppClient.php | 22 ++++++++++++++++++++++ tests/LUIS/Tests/FeatureTest.php | 11 +++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/LUIS/LuisAppClient.php b/src/LUIS/LuisAppClient.php index 941ec9a..eb9f775 100644 --- a/src/LUIS/LuisAppClient.php +++ b/src/LUIS/LuisAppClient.php @@ -169,4 +169,26 @@ public function deleteUtterance($utteranceId) { return $this->request('DELETE', 'apps/' . $this->appId . '/versions/' . $this->versionId . '/examples/' . $utteranceId); } + + /** + * Get version training status + * + * @return mixed + * @throws Exception + */ + public function trainingStatus() + { + return $this->request('GET', 'apps/' . $this->appId . '/versions/' . $this->versionId . '/train'); + } + + /** + * Train application version + * + * @return mixed + * @throws Exception + */ + public function train() + { + return $this->request('POST', 'apps/' . $this->appId . '/versions/' . $this->versionId . '/train'); + } } diff --git a/tests/LUIS/Tests/FeatureTest.php b/tests/LUIS/Tests/FeatureTest.php index 37cdd0d..6c670cc 100644 --- a/tests/LUIS/Tests/FeatureTest.php +++ b/tests/LUIS/Tests/FeatureTest.php @@ -107,4 +107,15 @@ public function testCreateDeleteUtterance() $this->luisClient->app($this->appId)->deleteEntity($entityId); $this->luisClient->app($this->appId)->deleteIntent($intentId); } + + public function testTrainApp() + { + $response = $this->luisClient->app($this->appId)->version('0.1')->train(); + $this->assertNotNull($response); + + sleep(3); + + $response = $this->luisClient->app($this->appId)->version('0.1')->trainingStatus(); + $this->assertNotNull($response); + } } From 668b5af53ecdbedcdb1ca1d3f6b28b43faaa780a Mon Sep 17 00:00:00 2001 From: goodjun Date: Tue, 22 Sep 2020 02:25:04 -0700 Subject: [PATCH 4/5] ci: update .travis.yml --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d911f4..d25d651 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: php php: - 5.6 - - 7.0 - - 7.3 install: - composer self-update - composer install --no-interaction From a07e583605b9c0bb8d20ef4e784fe5e3c1b1b94b Mon Sep 17 00:00:00 2001 From: goodjun Date: Tue, 22 Sep 2020 02:47:12 -0700 Subject: [PATCH 5/5] feat: update namespace --- composer.json | 2 +- src/LUIS/LuisAbstract.php | 2 +- src/LUIS/LuisAppClient.php | 4 ++-- src/LUIS/LuisClient.php | 4 ++-- src/LUIS/Models/App.php | 2 +- src/LUIS/Models/Entity.php | 2 +- src/LUIS/Models/Intent.php | 2 +- src/LUIS/Models/ModelAbstract.php | 2 +- src/LUIS/Models/Utterance.php | 2 +- tests/LUIS/Tests/FeatureTest.php | 12 ++++++++---- 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index a3d5c0a..ebf7eeb 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,6 @@ }, "minimum-stability": "stable", "autoload": { - "psr-4": {"LUIS\\": "src/LUIS"} + "psr-4": {"Goodjun\\LUIS\\": "src/LUIS"} } } diff --git a/src/LUIS/LuisAbstract.php b/src/LUIS/LuisAbstract.php index d5c3f0b..d3b74d5 100644 --- a/src/LUIS/LuisAbstract.php +++ b/src/LUIS/LuisAbstract.php @@ -1,6 +1,6 @@ luisClient = new LuisClient($primaryKey, $location); $this->appId = $appId; }