示例#1
0
 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();
 }
示例#2
0
 public Memory(ChatbotConfig cfg, ChatbotRuleConfig rules)
 {
     responses = RuleCompiler.CompileRules(rules.responseRules, cfg);
 }