Example #1
0
def run_hello_world(serve_forever=True):
    default_domain = TemplateDomain.load("examples/default_domain.yml")
    agent = Agent(default_domain,
                  policies=[SimplePolicy()],
                  interpreter=HelloInterpreter(),
                  tracker_store=InMemoryTrackerStore(default_domain))

    if serve_forever:
        # Attach the commandline input to the controller to handle all
        # incoming messages from that channel
        agent.handle_channel(ConsoleInputChannel())

    return agent
    def run_online_training(self,
                            ensemble,
                            domain,
                            interpreter=None,
                            input_channel=None):
        from conversationinsights.agent import Agent
        if interpreter is None:
            interpreter = RegexInterpreter()

        bot = Agent(domain,
                    ensemble,
                    featurizer=self.featurizer,
                    interpreter=interpreter)
        bot.toggle_memoization(False)

        bot.handle_channel(
            input_channel if input_channel else ConsoleInputChannel())