From cd3141fcf25d1973000454af84616eed73878094 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 11 Apr 2018 12:54:34 +0300 Subject: [PATCH] Include LUIS app id --- app/Http/Controllers/BotController.php | 4 ++-- config/ninja.php | 6 ++++++ docs/configure.rst | 5 +---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/BotController.php b/app/Http/Controllers/BotController.php index 5d3ddb47077e..0d28f03d7cf6 100644 --- a/app/Http/Controllers/BotController.php +++ b/app/Http/Controllers/BotController.php @@ -158,8 +158,8 @@ class BotController extends Controller private function parseMessage($message) { - $appId = env('MSBOT_LUIS_APP_ID'); - $subKey = env('MSBOT_LUIS_SUBSCRIPTION_KEY'); + $appId = config('ninja.voice_commands.app_id'); + $subKey = config('ninja.voice_commands.subscription_key'); $message = rawurlencode($message); $url = sprintf('%s/%s?subscription-key=%s&verbose=true&q=%s', MSBOT_LUIS_URL, $appId, $subKey, $message); diff --git a/config/ninja.php b/config/ninja.php index a7ca1c793652..213dc4952f80 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -30,4 +30,10 @@ return [ 'google_maps_enabled' => env('GOOGLE_MAPS_ENABLED', true), 'google_maps_api_key' => env('GOOGLE_MAPS_API_KEY', ''), + // Voice commands + 'voice_commands' => [ + 'app_id' => env('MSBOT_LUIS_APP_ID', 'ea1cda29-5994-47c4-8c25-2b58ae7ae7a8'), + 'subscription_key' => env('MSBOT_LUIS_SUBSCRIPTION_KEY'), + ], + ]; diff --git a/docs/configure.rst b/docs/configure.rst index 95c783773959..f61f45ebf9e9 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -117,14 +117,11 @@ You can disable the feature by adding ``GOOGLE_MAPS_ENABLED=false`` to the .env Voice Commands """""""""""""" -Supporting voice commands requires creating a `LUIS.ai `_ app, once the app is created you can import this `model file `_. - -You'll also need to set the following values in the .env file. +Supporting voice commands requires creating a `LUIS.ai subscription key `_, then set the following values in the .env file. .. code-block:: shell SPEECH_ENABLED=true - MSBOT_LUIS_APP_ID=... MSBOT_LUIS_SUBSCRIPTION_KEY=... Lock Invoices