ConsoleInputChannel no longer exist

So I know you have all already figured this out, but i will share this anyway. I have a python script which wraps common tasks like training running etc. Migrating from core 9 to core 11 caused me a small amount of work to get that going again. My custom “run” method for command line (in my script) in V9 looked like this:

def run(dbug=False):
if dbug:
    init_debug_logging()
from rasa_core.run import create_input_channel
agent = main("models/dialog",nlu_model="models/nlu/current",channel="cmdline")

agent = Agent.load("models/dialog", "models/nlu/current")
input_channel = create_input_channel("cmdline", None, None)
agent.handle_channel(input_channel)

return agent

Now (V11) it looks like this:

def run(dbug=False):
    if dbug:
        init_debug_logging()
    interpreter = NaturalLanguageInterpreter.create("models/nlu/current")
    from rasa_core.utils import EndpointConfig
    action_endpoint = EndpointConfig(url="http://localhost:5056/webhook")
    agent = Agent.load("models/dialog", interpreter=interpreter,action_endpoint=action_endpoint)
    rasa_core.run.serve_application(agent,channel='cmdline')
5 Likes