microsoft / botframework-components

The repository for components built by Microsoft for the Azure Bot Framework.
https://aka.ms/botdocs
MIT License
113 stars 82 forks source link

[MCS-DE-GO] LUIS Prediction Parameters #1161

Open goergenj opened 3 years ago

goergenj commented 3 years ago

From the Logs we can see that the Composer-integrated Bot runtime set two query parameters with every LUIS Prediction call:

https://.cognitiveservices.azure.com:443//luis/prediction/v3.0/apps//slots/production/predict?verbose=False&log=True&show-all-intents=False

I could not find how to set these parameters in the Bot settings within Composer.

Please provide guidance on how this can be configured with Composer.

@joaollq @goergenj @garypretty

goergenj commented 3 years ago

See also: https://github.com/microsoft/BotFramework-Composer/issues/3317

peterinnesmsft commented 3 years ago

Hi @goergenj,

I've taken a look at the above. The query parameters verbose, log, and show-all-intents are controlled by the optional predictionOptions object specified on the LUIS adaptive recognizer JSON. You can find the schema definition for the options here: https://github.com/microsoft/botbuilder-dotnet/blob/ee4f5f074302af9c24d498025c45a6ae809ef1eb/libraries/Microsoft.Bot.Builder.AI.LUIS/Schemas/Microsoft.LuisRecognizer.schema#L83-L114

The mapping of the properties is as follows:

includeInstanceData (default: false) -> verbose log (default: true) -> log includeAllIntents (default: false) -> show-all-intents

It should be possible to manually update the recognizer JSON in your bot project to override these as necessary. Since they use adaptive expressions, you could also bind these to set values in your appsettings.json.

That said, this obviously requires updating the recognizer JSON files manually, which is not ideal for users looking to do this directly through Composer. @garypretty @cwhitten can you provide guidance on whether it is possible to set these recognizer options through Composer directly for adaptive dialogs?

GitHub
microsoft/botbuilder-dotnet
Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET. - microsoft/botbui...
goergenj commented 3 years ago

@peterinnesmsft Thanks for the information.

@garypretty @cwhitten Is it possible to add the "preditionoptions" into the appsettings of the Bot in Composer:

"luis": { "name": "Botname", "defaultLanguage": "de-de", "authoringEndpoint": "https://xx-authoring.cognitiveservices.azure.com/", "endpoint": "https://xx.cognitiveservices.azure.com/", "authoringRegion": "westeurope", "environment": "local", "authoringKey": "xxx", "endpointKey": "xxx" "predictionOptions": { "properties": { "includeAllIntents": true, "log": true, "slot": "production" } } },

@joaollq

tracyboehrer commented 3 years ago

So the recognizer JSON could be changed to use expressions to point to appsettings. Then the default appsettings in the adaptive generator would include them. What would the appropriate defaults be?

@benbrown The default appsettings could be changed immediately. The recognizer JSON could be changed as able later?

goergenj commented 3 years ago

@cwhitten @tracyboehrer @benbrown @garypretty Could we setup an alignment call next week to discuss how this can be implemented? We need this urgently in our customer project and will eventually write a customization. If we sync on this quickly maybe we can join forces and push this back via a pull request or you can provide the updated version.

cwhitten commented 3 years ago

The following comment expresses a gap in the SDK to enable and support this: https://github.com/microsoft/botframework-components/issues/1015#issuecomment-831736740

After this is fixed, yes Composer can author to the format.

goergenj commented 3 years ago

@cwhitten FYI, for our customer implementation we implemented this as a wrapper to the SDK to enable the "log" and "staging" slot settings. If it bridges the time for fixing it in the SDK, we can provide a pull-request for this if needed. Doing it properly in the SDK would be the better solution however.

@joaollq