public QnABot(IConfiguration configuration, ILogger <QnABot> logger, IHttpClientFactory httpClientFactory, ConversationState conversationState, UserState userState, IBotServices botServices) { _configuration = configuration; _logger = logger; _httpClientFactory = httpClientFactory; BotServices = (BotServices)botServices; if (botServices.QnAMakerService == null) { _logger.LogError("Cannot use QNAMakerService"); System.Environment.Exit(-1); } ConversationState = conversationState; UserState = userState; //active learning // QnA Maker dialog options QnaMakerOptions = new QnAMakerOptions { Top = 3, ScoreThreshold = 0.03F, }; _dialogs = new DialogSet(ConversationState.CreateProperty <DialogState>(nameof(DialogState))); _dialogHelper = new DialogHelper(botServices); _dialogs.Add(_dialogHelper.QnAMakerActiveLearningDialog); }
public MainDialog(IConfiguration configuration, IStatePropertyAccessor <AuthenticatedUser> AuthenticatedUserAccessor, IBotServices botServices, Intents intents) : base(nameof(MainDialog), configuration["ConnectionName"]) { Configuration = configuration; _AuthenticatedUserAccessor = AuthenticatedUserAccessor; _botServices = botServices; Intents = intents; AddDialog(new OAuthPrompt( nameof(OAuthPrompt), new OAuthPromptSettings { ConnectionName = ConnectionName, Text = "Before we start, I would need from you to verify your account.", Title = "Verify Account", Timeout = 300000, // User has 5 minutes to login (1000 * 60 * 5) })); //AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt))); AddAllPossibleDialogs(); AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { PromptStepAsync, LoginStepAsync, StartProcessingIntents, EndProcessingIntents })); // The initial child Dialog to run. InitialDialogId = nameof(WaterfallDialog); }
public MainDialog(IBotServices botServices, TechnicalAssistanceDialog technicalAssistance, OrderProductDialog orderProduct, AskUserInfoDialog infoDialog, ConversationState conversationState, ConfirmOrderDialog confirmOrderDialog, AddProductInfoDialog addProductInfoDialog, UserValidationDialog userValidationDialog, IConfiguration configuration, UserController userController, NotifyController notifyController, IPrestashopApi prestashopApi) : base(nameof(MainDialog)) { AddDialog(new TextPrompt(nameof(TextPrompt))); AddDialog(orderProduct); AddDialog(technicalAssistance); AddDialog(infoDialog); AddDialog(confirmOrderDialog); AddDialog(addProductInfoDialog); AddDialog(userValidationDialog); AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { WelcomeStepAsync, InitialStepAsync, DispatchStepAsync, FinalStepAsync, })); InitialDialogId = nameof(WaterfallDialog); BotServices = botServices; UserController = userController; NotifyController = notifyController; PrestashopApi = prestashopApi; _conversationAccessor = conversationState.CreateProperty <ConversationData>(nameof(ConversationData)); Configuration = configuration; }
//private const string Message = "Humm... Searching...😊"; public QnADialog(IConfiguration configuration, IBotServices services) : base(nameof(QnADialog)) { //var waterfallSteps = new WaterfallStep[] //{ // //QuestionsStepAsync, // CallGenerateAnswerAsync, // IntroStepAsync, // QuestionConfirmStepAsync, // //SummaryStepAsync, // //DisplayQnAResult, //}; //AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallSteps)); AddDialog(new TextPrompt(nameof(TextPrompt))); AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt))); AddDialog(new NumberPrompt <int>(nameof(NumberPrompt <int>))); AddDialog(new ChoicePrompt(nameof(ChoicePrompt))); AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { CallGenerateAnswerAsync, //IntroStepAsync, //QuestionConfirmStepAsync, })); // The initial child Dialog to run. _services = services ?? throw new ArgumentNullException(nameof(services)); InitialDialogId = nameof(WaterfallDialog); //Step = nameof(CallGenerateAnswerAsync); }
//private const string InfoMessage = "Here's what I can do to help ... 😊 "; // Dependency injection uses this constructor to instantiate MainDialog public MainDialog(ILogger <MainDialog> logger, IConfiguration configuration, IBotServices service, LuisRecongnizer luisRecognizer) : base(nameof(MainDialog)) { Logger = logger; Configuration = configuration; Service = service; _luisRecognizer = luisRecognizer; AddDialog(new TextPrompt(nameof(TextPrompt))); AddDialog(new ChoicePrompt(nameof(ChoicePrompt))); AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt))); AddDialog(new AddDialog(configuration)); AddDialog(new QnADialog(configuration, service)); //AddDialog(new QnAMakerBaseDialog(configuration, service)); AddDialog(new LuisDialog(configuration, luisRecognizer)); AddDialog(new SmartDialog(configuration, service)); AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { //IntroStepAsync, IntroStepAsync, ActStepAsync, //LuisStepAsync, // FinalStepAsync, // FinalStepAsync, })); // The initial child Dialog to run. InitialDialogId = nameof(WaterfallDialog); }
public QnABot(ConversationState conversationState, UserState userState, T dialog, IBotServices botServices, ILogger <QnABot <T> > logger) { ConversationState = conversationState; UserState = userState; Dialog = dialog; _botServices = botServices; }
// Dependency injection uses this constructor to instantiate MainDialog public MainBastardDialog(BastardRecognizer luisRecognizer, ILogger <MainBastardDialog> logger, IBotServices botBervices, IServiceScopeFactory scopeFactory, DIBastardBrain brain, IMemoryCache memoryCache) : base(nameof(MainBastardDialog)) { _luisRecognizer = luisRecognizer; _botServices = botBervices; _brain = brain; Logger = logger; _cache = memoryCache; AddDialog(new TextPrompt(nameof(TextPrompt))); AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { ShowConditions, CheckAccepted, IntroStepAsync, ActStepAsync, ShowQnAInsultAndGetAnother, GoRoundAgain })); AddDialog(new NewInsultQnADialog(brain)); AddDialog(new ChoicePrompt(nameof(ChoicePrompt))); // The initial child Dialog to run. InitialDialogId = nameof(WaterfallDialog); }
public DispatchBot(IBotServices botServices, ILogger <DispatchBot> logger, ConversationState conversationState, UserState userState) { _logger = logger; _botServices = botServices; _conversationState = conversationState; _userState = userState; }
public LuisRootDialog(UserState userState, ITableStore tableStore, IBotServices botServices) : base(nameof(LuisRootDialog)) { _luisRootDialogStateAccessor = userState.CreateProperty <LuisRootDialogState>(nameof(LuisRootDialogState)); _tableStore = tableStore; // Add child dialogs AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[] { GetLuisResultAsync, GetEntitiesAsync, EstablishMandatoryCategoriesAsync, PromptCpuCategoryAsync, HandleCpuCategoryAsync, PromptColourCategoryAsync, HandleColourCategoryAsync, PromptConnectivityCategoryAsync, HandleConnectivityCategoryAsync, PromptMemoryCategoryAsync, HandleMemoryCategoryAsync, PromptProductCategoryAsync, HandleProductCategoryAsync, PromptProductFamilyCategoryAsync, HandleProductFamilyCategoryAsync, PromptStorageCategoryAsync, HandleStorageCategoryAsync, ShowLinkAsync, FinalStepAsync, })); AddDialog(new TextPrompt(nameof(TextPrompt))); // The initial child Dialog to run. InitialDialogId = nameof(WaterfallDialog); AddDialog(new ShowLinkDialog(nameof(ShowLinkDialog), botServices)); }
public VisionAlarmBot(IBotServices botServices, ILogger <VisionAlarmBot> logger, ConcurrentDictionary <string, ConversationReference> conversationReferences, IConfiguration configuration, IHttpClientFactory clientFactory) { _logger = logger; _botServices = botServices; _conversationReferences = conversationReferences; _configuration = configuration; _clientFactory = clientFactory; }
public DispatchWeatherBot(ConversationState conversationState, UserState userState, IConfiguration configuration, IBotServices botServices, ILogger <DispatchWeatherBot> logger) { _conversationState = conversationState; _userState = userState; _configuration = configuration; _logger = logger; _botServices = botServices; }
public Mediator(DatabaseOperator databaseOperator, IBotServices telegramOperator, MessageHandler messageHandler) { this.databaseOperator = databaseOperator; this.telegramOperator = telegramOperator; this.telegramOperator.AddMediator(this); this.messageHandler = messageHandler; this.messageHandler.AddMediator(this); }
public DialogBot(ConversationState conversationState, UserState userState, T dialog, ILogger <DialogBot <T> > logger, IBotServices botServices) { ConversationState = conversationState; UserState = userState; Dialog = dialog; Logger = logger; _botServices = botServices; }
public QnABot(ConversationState conversationState, UserState userState, T dialog, IBotServices services, IConfiguration configuration) { ConversationState = conversationState; UserState = userState; Dialog = dialog; _services = services; //_config = configuration; }
public DialogBot(ConversationState conversationState, UserState userState, T dialog, ILogger <DialogBot <T> > logger, IBotServices botServices) { this.conversationState = conversationState; this.userState = userState; this.dialog = dialog; this.logger = logger; this.botServices = botServices; }
public QnAMakerBaseDialog(IConfiguration configuration, IBotServices services) : base() { this._services = services; _defaultNoAnswer = configuration.GetValue <string>("DefaultNoAnswer"); _defaultCardTitle = configuration.GetValue <string>("DefaultCardTitle"); _defaultCardNoMatchText = configuration.GetValue <string>("DefaultCardNoMatchText"); _defaultCardNoMatchResponse = configuration.GetValue <string>("DefaultCardNoMatchResponse"); }
public ChatBot(IBotServices botServices, ConversationState conversationState, UserState userState, T dialog, ILogger <ChatBot <T> > logger) { ConversationState = conversationState; UserState = userState; Dialog = dialog; Logger = logger; this.botServices = botServices; }
public DispatchBot(IBotServices botServices, ILogger <DispatchBot> logger, UserState userState, MicrosoftTranslator translator) { _logger = logger; _botServices = botServices; _userState = userState ?? throw new NullReferenceException(nameof(userState)); _translator = translator ?? throw new ArgumentNullException(nameof(translator)); _languagePreference = userState.CreateProperty <string>("LanguagePreference"); }
/// <summary> /// Initializes a new instance of the <see cref="QnAMakerBaseDialog"/> class. /// Dialog helper to generate dialogs. /// </summary> /// <param name="services">Bot Services.</param> public QnAMakerBaseDialog(IBotServices services, IConfiguration configuration) : base() { this._services = services; if (!string.IsNullOrWhiteSpace(configuration["DefaultAnswer"])) { this.DefaultAnswer = configuration["DefaultAnswer"]; } }
public RandomSetCardPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public DispatchBot(IBotServices botServices, ConversationState conversationState, UserState userState, UserProfileDialog userProfileDialog, ILogger <DispatchBot> logger) { _logger = logger; _botServices = botServices; _userProfileDialog = userProfileDialog; _conversationState = conversationState; _userState = userState; }
public ImgHiresCommand( IBotServices services, BotConfig config ) : base( services, config) { }
public CoinFlipPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public CardPricePlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public GetSetPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public RulingPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public ScryFallImgPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
/// <summary> /// Dialog helper to generate dialogs /// </summary> /// <param name="services">Bot Services</param> public DialogHelper(IBotServices services) { QnAMakerActiveLearningDialog = new WaterfallDialog(ActiveLearningDialogName) .AddStep(CallGenerateAnswer) .AddStep(FilterLowVariationScoreList) .AddStep(CallTrain) .AddStep(DisplayQnAResult); _services = services; }
public TappedOutComboDecksPlugin( IBotServices services, BotConfig config ) : base( services, config) { }
public TappedOutLatestTop8Plugin( IBotServices services, BotConfig config ) : base( services, config) { }
public KarmaModule(IBotServices botServices) { _botServices = botServices; }
public GuidesModule(IBotServices botServices) { _botServices = botServices; }
public RadioModule(IBotServices botServices) { _botServices = botServices; }
public BotModule(IBotServices botServices) { _botServices = botServices; }
public ToolsModule(IBotServices botServices) { _botServices = botServices; }
public StatsModule(IBotServices botServices) { _botServices = botServices; }
public DefenceModule(IBotServices botServices) { _botServices = botServices; }
public NewsModule(IBotServices botServices) { _botServices = botServices; }
public Bot(DiscordClient client, CommandService commandService, IBotServices botServices) { _client = client; _commandService = commandService; _botServices = botServices; }
public AdminModule(IBotServices botServices) { _botServices = botServices; }