· 6 years ago · Jun 15, 2019, 04:06 PM
1var secretKey = Configuration.GetSection("botFileSecret")?.Value;
2var botFilePath = Configuration.GetSection("botFilePath")?.Value;
3
4var botConfig = BotConfiguration.Load(botFilePath ?? @".nlp-with-luis.bot", secretKey);
5services.AddSingleton(sp => botConfig ?? throw new InvalidOperationException($"The .bot config file could not be loaded. ({botConfig})"));
6
7var connectedServices = new BotServices(botConfig);
8services.AddSingleton(sp => connectedServices);