forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BotServices.cs
45 lines (42 loc) · 2.1 KB
/
BotServices.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License
using System;
using System.Collections.Generic;
using Microsoft.ApplicationInsights;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.AI.Luis;
namespace Microsoft.BotBuilderSamples
{
/// <summary>
/// Represents references to external services.
///
/// For example, LUIS services are kept here as a singleton. This external service is configured
/// using the <see cref="BotConfiguration"/> class.
/// </summary>
/// <seealso cref="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.1"/>
/// <seealso cref="https://www.luis.ai/home"/>
/// <seealso cref="https://azure.microsoft.com/en-us/services/application-insights/"/>
public class BotServices
{
/// <summary>
/// Initializes a new instance of the <see cref="BotServices"/> class.
/// </summary>
/// <param name="client">An Application Insights <see cref="TelemetryClient"/> instance.</param>
/// <param name="luisServices">A dictionary of named <see cref="LuisRecognizer"/> instances for usage within the bot.</param>
public BotServices(Dictionary<string, TelemetryLuisRecognizer> luisServices)
{
LuisServices = luisServices ?? throw new ArgumentNullException(nameof(luisServices));
}
/// <summary>
/// Gets the set of LUIS Services used.
/// Given there can be multiple <see cref="LuisRecognizer"/> services used in a single bot,
/// LuisServices is represented as a dictionary. This is also modeled in the
/// ".bot" file since the elements are named.
/// </summary>
/// <remarks>The LUIS services collection should not be modified while the bot is running.</remarks>
/// <value>
/// A <see cref="LuisRecognizer"/> client instance created based on configuration in the .bot file.
/// </value>
public Dictionary<string, TelemetryLuisRecognizer> LuisServices { get; } = new Dictionary<string, TelemetryLuisRecognizer>();
}
}