/// <summary> /// Initializes a new instance of the <see cref="NlpDispatchBot"/> class. /// </summary> /// <param name="services">Services configured from the ".bot" file.</param> public SysforeAIBotBot(IOptionsSnapshot <AppSettings> appSettings, IOptionsSnapshot <DialogFlow> dialogFlow, SysforeAIBotAccessors accessors) { _accessors = accessors ?? throw new System.ArgumentNullException(nameof(accessors)); _appSettings = appSettings.Value; _dialogFlow = dialogFlow.Value; _services = BotServiceHelper.InitBotServices(_appSettings); }
public MainVM() { botHelper = new BotServiceHelper(); SendCommand = new Command(SendActivity); Messages = new ObservableCollection <ChatMessage>(); botHelper.MessageReceived += BotHelper_MessageReceived; }
public ChatVM() { botHelper = new BotServiceHelper(); SendCommand = new Command <string>(SendMessage, SendCanExecute); Messages = new ObservableCollection <ChatMessage>(); botHelper.MessageReceived += BotHelper_MessageReceived; }
private async Task Init() { SendCommand = new Command(async() => await Send()); Messages = new ObservableCollection <ChatMessage>(); _botServiceHelper = new BotServiceHelper(); await _botServiceHelper.CreateConversation(); _botServiceHelper.MessageRecieved += _botServiceHelper_MessageRecieved; }