TL;DR
You cannot use a Staging slot by just editing the configuration of your bot.
But you can use staging with the Options of the Recognizer, so use another parameter to activate Staging use.
Details - Use of Staging vs Production in LUIS
Technically speaking, the difference between calls to Staging
versus Production
slots of a LUIS app can be seen in the URL called, where there is a
staging=true
field:
Staging: https://_AzureRegion_.api.cognitive.microsoft.com/luis/v2.0/apps/_AppId_?staging=true&verbose=true&timezoneOffset=60&subscription-key=_YourKey_&q=_YourQuery_
Prod: https://_AzureRegion_.api.cognitive.microsoft.com/luis/v2.0/apps/_AppId_?verbose=true&timezoneOffset=60&subscription-key=_YourKey_&q=_YourQuery_
Implementation in Bot Builder
You can see in the BotBuilder sources that staging
is never used in the configuration. But, in the class called LuisRecognizer
, you can pass options
where there is a staging
boolean, see here for .Net, here for js.
So in js in your case:
const luisApplication = {
applicationId: process.env.appId,
endpointKey: process.env.subscriptionKey,
azureRegion: process.env.region
}
const luisPredictionOptions = {
includeAllIntents: true,
log: true,
staging: **POINT TO A CONFIG VARIABLE FOR EXAMPLE**
}
const luisRecognizer = new LuisRecognizer(luisApplication, luisPredictionOptions, true);