Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProactiveBot"/> class.
        /// </summary>
        /// <param name="jobState">The state provider that is independent of user or conversation.</param>
        /// <param name="endpointService">The <see cref="EndpointService"/> portion of the <see cref="BotConfiguration"/>.</param>
        /// <seealso cref="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1#windows-eventlog-provider"/>
        public ProactiveBot(JobState jobState, EndpointService endpointService)
        {
            _jobState = jobState ?? throw new ArgumentNullException(nameof(jobState));
            _jobLogPropertyAccessor = _jobState.CreateProperty <JobLog>(nameof(JobLog));

            // Validate AppId.
            // Note: For local testing, .bot AppId is empty for the Bot Framework Emulator.
            AppId = string.IsNullOrWhiteSpace(endpointService.AppId) ? "1" : endpointService.AppId;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FHL.Hack.SmartAssistantBot"/> class.
        /// </summary>
        /// <param name="botServices">Bot services.</param>
        /// <param name="conversationState">Bot conversation state.</param>
        /// <param name="userState">Bot user state.</param>
        public Bot(BotServices botServices, ConversationState conversationState, UserState userState, IBotTelemetryClient telemetryClient, JobState jobState, EndpointService endpointService)
        {
            _conversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
            _userState         = userState ?? throw new ArgumentNullException(nameof(userState));
            _services          = botServices ?? throw new ArgumentNullException(nameof(botServices));
            _telemetryClient   = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));

            _dialogs = new DialogSet(_conversationState.CreateProperty <DialogState>(nameof(FHL.Hack.SmartAssistantBot)));
            _dialogs.Add(new MainDialog(_services, _conversationState, _userState, _telemetryClient));

            _jobState = jobState ?? throw new ArgumentNullException(nameof(jobState));
            _jobLogPropertyAccessor = _jobState.CreateProperty <JobLog>(nameof(JobLog));

            AppId = string.IsNullOrWhiteSpace(endpointService.AppId) ? AppId : endpointService.AppId;
        }
Esempio n. 3
0
 public JobService(JobState jobState)
 {
     _jobState = jobState ?? throw new ArgumentNullException(nameof(jobState));
     _jobLogPropertyAccessor = _jobState.CreateProperty <JobLog>(nameof(JobLog));
 }