public new void Initialize() { var builder = new ContainerBuilder(); ConversationState = new ConversationState(new MemoryStorage()); DialogState = ConversationState.CreateProperty <DialogState>(nameof(DialogState)); UserState = new UserState(new MemoryStorage()); TelemetryClient = new NullBotTelemetryClient(); SkillConfigurations = new Dictionary <string, SkillConfigurationBase>(); // Add the LUIS model fakes used by the Skill Services = new MockSkillConfiguration(); Services.LocaleConfigurations.Add("en", new LocaleConfiguration() { Locale = "en-us", LuisServices = new Dictionary <string, ITelemetryLuisRecognizer> { { "general", GeneralTestUtil.CreateRecognizer() }, { "FakeSkill", FakeSkillTestUtil.CreateRecognizer() } } }); Services.LocaleConfigurations.Add("es", new LocaleConfiguration() { Locale = "es-mx", LuisServices = new Dictionary <string, ITelemetryLuisRecognizer> { { "general", GeneralTestUtil.CreateRecognizer() }, { "FakeSkill", FakeSkillTestUtil.CreateRecognizer() } } }); // Dummy Authentication connection for Auth testing Services.AuthenticationConnections = new Dictionary <string, string> { { "DummyAuth", "DummyAuthConnection" } }; builder.RegisterInstance(new BotStateSet(UserState, ConversationState)); Container = builder.Build(); BotResponseBuilder = new BotResponseBuilder(); BotResponseBuilder.AddFormatter(new TextBotResponseFormatter()); Dialogs = new DialogSet(DialogState); // Manually mange the conversation metadata when we need finer grained control ConversationReference = new ConversationReference { ChannelId = "test", ServiceUrl = "https://test.com", }; ConversationReference.User = new ChannelAccount("user1", "User1"); ConversationReference.Bot = new ChannelAccount("bot", "Bot"); ConversationReference.Conversation = new ConversationAccount(false, "convo1", "Conversation1"); }
public virtual void Initialize() { this.Configuration = new BuildConfig().Configuration; var builder = new ContainerBuilder(); builder.RegisterInstance <IConfiguration>(this.Configuration); this.Container = builder.Build(); this.BotResponseBuilder = new BotResponseBuilder(); this.BotResponseBuilder.AddFormatter(new TextBotResponseFormatter()); }
private static BotResponseBuilder BotResponseBuilder() { var responseBuilder = new BotResponseBuilder(); return(responseBuilder); }
public static Activity CreateAdaptiveCardReply <T>(this Activity activity, BotResponse response, string cardPath, T cardDataAdapter, BotResponseBuilder responseBuilder = null, StringDictionary tokens = null, Activity replyToUse = null) where T : CardDataBase { var reply = replyToUse ?? activity.CreateReply(); if (responseBuilder == null) { responseBuilder = BotResponseBuilder(); } responseBuilder.BuildAdaptiveCardReply(reply, response, cardPath, cardDataAdapter, tokens); return(reply); }
public static Activity CreateAdaptiveCardGroupReply <T>(this Activity activity, BotResponse response, string cardPath, string attachmentLayout, List <T> cardDataAdapters, BotResponseBuilder responseBuilder = null, StringDictionary tokens = null) where T : CardDataBase { var reply = activity.CreateReply(); if (responseBuilder == null) { responseBuilder = BotResponseBuilder(); } responseBuilder.BuildAdaptiveCardGroupReply(reply, response, cardPath, attachmentLayout, cardDataAdapters, tokens); return(reply); }
public static Activity CreateReply(this Activity activity, BotResponse response, BotResponseBuilder responseBuilder = null, StringDictionary tokens = null) { var reply = activity.CreateReply(); if (responseBuilder == null) { responseBuilder = BotResponseBuilder(); } responseBuilder.BuildMessageReply(reply, response, tokens); return(reply); }