/// <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; }
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; }
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; }
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); } }