Similarly, I had code to start interactive training from my script. This broke in V11 because of ConsoleInputChannel. So my V9 Version was:
agent = Agent("domain.yml", policies=[KerasPolicy()])
stories_file = "data\stories.md"
stories_data = agent.load_data(stories_file)
output_path = "models\dialog"
if online:
import rasa_core.run
if nlu:
agent.interpreter = RasaNLUInterpreter("models/nlu/current")
else:
agent.interpreter = RegexInterpreter()
agent.train_online(
stories_data,
input_channel=ConsoleInputChannel(),
epochs=100,
model_path=output_path)
And my V11 Version now looks like:
from rasa_core.train import online
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)
online.serve_agent(agent)
Actually the same as the run code, but with online.serve_agent() instead of rasa_core.run.serve_application()