Created
October 30, 2019 06:46
-
-
Save arafattehsin/72ae355cc247d2fb7690deb21453248e to your computer and use it in GitHub Desktop.
Class to read configuration and assigning them to the respective language models and knowledge sources such as LUIS, QnA and Virtual Agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BotServices : IBotServices | |
{ | |
public BotServices(IConfiguration configuration) | |
{ | |
// Read the setting for cognitive services (LUIS, QnA) from the appsettings.json | |
// If includeApiResults is set to true, the full response from the LUIS api (LuisResult) | |
// will be made available in the properties collection of the RecognizerResult | |
VABotDispatch = new LuisRecognizer(new LuisApplication( | |
configuration["LuisAppId"], | |
configuration["LuisAPIKey"], | |
$"https://{configuration["LuisAPIHostName"]}.api.cognitive.microsoft.com"), | |
new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true }, | |
includeApiResults: true); | |
VABotService = new VABotService(new VABotEndpoint( | |
configuration["VABotId"], | |
configuration["VABotTenantId"], | |
configuration["VABotTokenEndpoint"]), | |
configuration["VABotName"] | |
); | |
} | |
public LuisRecognizer VABotDispatch { get; private set; } | |
public VABotService VABotService { get; private set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment