DCR: As a developer I would like to be able to pass LuisOptions to RecognizeAsync so I can override some settings based on the current user #5405
Labels
P1
Painful if we don't fix, won't block releasing
Issue
In many cases, we declare LuisRecognizer as a singleton in startup so we can reuse it. LuisRecognizer takes a LuisPredictionOptions parameter in the constructor and the developer can't change the values after the object has been created.
There are several properties in LuisOptions that a developer should be able to change when invoking RecognizeAsync:
I don't have concrete use cases but I think the following parameters can be also overridden per request:
Here is an example of the private implementation of RecognizeAsync where some of these options are being used:
Proposed change
I think the easiest solution is to add an override for RecognizeAsync that takes LuisPredictionOptions and overrides the values passed in the constructor with the new ones passed in the request. If the optional parameter is passed and a given property is set, the recognizer should use it, if not, it should use whatever was set in the object passed in the constructor (most properties in LuisPredictionOptions are nullable or have defaults defined so this should be doable)
Component Impact
Customer Impact
This is an addition to the current class, existing users shouldn't be impacted by this change.
Tracking Status
Dotnet SDK PR 1992
Javascript SDK JS Issue 964
Python SDK Python issue 206
[dcr]
The text was updated successfully, but these errors were encountered: