/// <summary>
 /// Initializes a new instance of the <see cref="LuisStateFlowEngine" /> class.
 /// </summary>
 /// <param name="appId">The application identifier.</param>
 /// <param name="appKey">The application key.</param>
 /// <param name="initialState">The initial state.</param>
 /// <param name="luisConfiguration">The luis configuration.</param>
 /// <param name="behaviorExecutor">The behavior executor.</param>
 /// <param name="context">The context.</param>
 public LuisStateFlowEngine(string appId, string appKey, T initialState,
                            LuisFlowConfiguration <T> luisConfiguration,
                            IBehaviorExecutor <T> behaviorExecutor,
                            Dictionary <string, object> context)
 {
     this.appId         = appId;
     this.appKey        = appKey;
     this.StateMachine  = new FiniteStateMachine <T, string, LanguageUnderstandingResult>(initialState, luisConfiguration.Transitions);
     this.stateBehavior = behaviorExecutor;
     this.context       = context;
 }
Ejemplo n.º 2
0
 public DiscordService(
     ILogger <DiscordService> logger,
     IOptions <DiscordOptions> options,
     IBehaviorExecutor behaviorExecutor,
     IPlatformDatabase database,
     ServiceContext serviceContext
     )
     : base(logger, options, behaviorExecutor, database, serviceContext)
 {
     _logger  = logger;
     _options = options.Value;
 }
Ejemplo n.º 3
0
        public TelegramService(
            ILogger <TelegramService> logger,
            IOptions <TelegramOptions> options,
            IBehaviorExecutor behaviorExecutor,
            IPlatformDatabase database,
            ServiceContext serviceContext
            )
            : base(logger, options, behaviorExecutor, database, serviceContext)
        {
            _logger  = logger;
            _options = options.Value;
            _botId   = serviceContext.BotId;

            _client                 = new TelegramBotClient(_options.Token);
            _client.OnMessage      += OnMessageAsync;
            _client.OnReceiveError += OnReceiveError;
        }
Ejemplo n.º 4
0
        protected IngoingServiceBase(
            ILogger <IngoingServiceBase> logger,
            IOptions <TransportOptions> options,
            IBehaviorExecutor behaviorExecutor,
            IPlatformDatabase database,
            ServiceContext serviceContext
            )
        {
            _logger           = logger;
            _options          = options.Value;
            _behaviorExecutor = behaviorExecutor;
            _serviceContext   = serviceContext;

            using (database)
            {
                _behaviorExecutor.Initialize(_serviceContext.ScriptId, database);
            }
        }