Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BotServices"/> class.
        /// <param name="botConfiguration">A dictionary of named <see cref="BotConfiguration"/> instances for usage within the bot.</param>
        /// </summary>
        public BotServices(IOptions <LuisConfig> config)
        {
            LuisConfig = config.Value;

            foreach (var luisApplication in LuisConfig.LuisApplications)
            {
                var app        = new LuisApplication(luisApplication.AppId, LuisConfig.ApiKey, LuisConfig.Hostname);
                var recognizer = new LuisRecognizer(app);
                LuisServices.Add(luisApplication.Name, recognizer);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LuisRecognizerOptionsV2"/> class.
 /// </summary>
 /// <param name="application">The LUIS application to use to recognize text.</param>
 public LuisRecognizerOptionsV2(LuisApplication application)
     : base(application)
 {
 }
Beispiel #3
0
 public LuisRecognizer(LuisApplication application, IBotTelemetryClient telemetryClient, bool logPersonalInformation, LuisPredictionOptions predictionOptions = null, bool includeApiResults = false, HttpClientHandler clientHandler = null)
     : this(BuildLuisRecognizerOptionsV2(application, predictionOptions, includeApiResults), clientHandler)
 {
 }
Beispiel #4
0
        public LuisRecognizer(LuisApplication application, LuisPredictionOptions predictionOptions = null, bool includeApiResults = false, HttpClientHandler clientHandler = null)
#pragma warning disable CS0618 // Type or member is obsolete
            : this(application, telemetryClient : null, logPersonalInformation : false, predictionOptions : predictionOptions, includeApiResults : includeApiResults, clientHandler : clientHandler)
#pragma warning restore CS0618 // Type or member is obsolete
        {
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LuisRecognizer"/> class.
 /// </summary>
 /// <param name="application">The LUIS application to use to recognize text.</param>
 /// <param name="predictionOptions">(Optional) The LUIS prediction options to use.</param>
 /// <param name="includeApiResults">(Optional) TRUE to include raw LUIS API response.</param>
 /// <param name="clientHandler">(Optional) Custom handler for LUIS API calls to allow mocking.</param>
 public LuisRecognizer(LuisApplication application, LuisPredictionOptions predictionOptions = null, bool includeApiResults = false, HttpClientHandler clientHandler = null)
     : this(application, telemetryClient : null, logPersonalInformation : false, predictionOptions : predictionOptions, includeApiResults : includeApiResults, clientHandler : clientHandler)
 {
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LuisRecognizerOptions"/> class.
 /// </summary>
 /// <param name="application">An instance of <see cref="LuisApplication"/>.</param>
 protected LuisRecognizerOptions(LuisApplication application)
 {
     Application = application ?? throw new ArgumentNullException(nameof(application));
 }