public override void ProvideResources(DiContainer diContainer) { diContainer.GetImplementation().Bind <ChatbotConfig>().ToMethod(x => ChatbotConfig.Load()).InSingletonScope(); diContainer.GetImplementation().Bind <ChatbotRuleConfig>().ToMethod(x => ChatbotRuleConfig.Load(x.Kernel.Get <ChatbotConfig>())).InSingletonScope(); diContainer.GetImplementation().Bind <Memory>().ToSelf().InSingletonScope(); diContainer.GetImplementation().Bind <ConversationHandler>().ToSelf().InSingletonScope(); diContainer.GetImplementation().Bind <PlaceholderHandler>().ToSelf().InSingletonScope(); }
public Memory(ChatbotConfig cfg, ChatbotRuleConfig rules) { responses = RuleCompiler.CompileRules(rules.responseRules, cfg); }