Exemple #1
0
        public FindArticlesDialog(
            BotSettings settings,
            BotServices services,
            ConversationState conversationState,
            UserState userState,
            AzureMapsService mapsService,
            IBotTelemetryClient telemetryClient)
            : base(nameof(FindArticlesDialog), settings, services, conversationState, userState, mapsService, telemetryClient)
        {
            TelemetryClient = telemetryClient;

            var newsKey = settings.BingNewsKey ?? throw new Exception("The BingNewsKey must be provided to use this dialog. Please provide this key in your Skill Configuration.");

            _client = new NewsClient(newsKey);

            var findArticles = new WaterfallStep[]
            {
                GetMarket,
                SetMarket,
                GetQuery,
                GetSite,
                ShowArticles,
            };

            AddDialog(new WaterfallDialog(nameof(FindArticlesDialog), findArticles));
            AddDialog(new TextPrompt(nameof(TextPrompt), MarketPromptValidatorAsync));
        }
Exemple #2
0
 public AzureMapsController(AzureMapsConfiguration azureMapsConfiguration,
                            PTI.Microservices.Library.Services.AzureMapsService azureMapsService
                            )
 {
     this.azureMapsConfiguration = azureMapsConfiguration;
     this.azureMapsService       = azureMapsService;
 }
        public NewsDialogBase(
            string dialogId,
            BotSettings settings,
            BotServices services,
            ConversationState conversationState,
            UserState userState,
            AzureMapsService mapsService,
            IBotTelemetryClient telemetryClient)
            : base(dialogId)
        {
            Services        = services;
            ConvAccessor    = conversationState.CreateProperty <NewsSkillState>(nameof(NewsSkillState));
            UserAccessor    = userState.CreateProperty <NewsSkillUserState>(nameof(NewsSkillUserState));
            TelemetryClient = telemetryClient;

            var mapsKey = settings.Properties["AzureMapsKey"] ?? throw new Exception("The AzureMapsKey must be provided to use this dialog. Please provide this key in your Skill Configuration.");

            _mapsService = mapsService;
            _mapsService.InitKeyAsync(mapsKey);
        }
Exemple #4
0
        public NewsDialogBase(
            string dialogId,
            IServiceProvider serviceProvider)
            : base(dialogId)
        {
            Settings        = serviceProvider.GetService <BotSettings>();
            Services        = serviceProvider.GetService <BotServices>();
            TemplateManager = serviceProvider.GetService <LocaleTemplateManager>();

            var conversationState = serviceProvider.GetService <ConversationState>();

            ConvAccessor = conversationState.CreateProperty <NewsSkillState>(nameof(NewsSkillState));
            var userState = serviceProvider.GetService <UserState>();

            UserAccessor = userState.CreateProperty <NewsSkillUserState>(nameof(NewsSkillUserState));

            var mapsKey = Settings.AzureMapsKey ?? throw new Exception("The AzureMapsKey must be provided to use this dialog. Please provide this key in your Skill Configuration.");

            _mapsService = serviceProvider.GetService <AzureMapsService>();
            _mapsService.InitKeyAsync(mapsKey);
        }
 /// <summary>
 /// Creates a new instance of <see cref="AzureMapsController"/>
 /// </summary>
 /// <param name="azureMapsService"></param>
 /// <param name="mapper"></param>
 public AzureMapsController(AzureMapsService azureMapsService, IMapper mapper)
 {
     this.AzureMapsService = azureMapsService;
     this.Mapper           = mapper;
 }