Python API for NLU interpreter and Agent

I have just migrated my project over to the latest version of Rasa (previous version used was mid 2018), however it seems to have broken some of the old code.

Previously I was creating an instance of RasaNLUInterpreter with interpreter = RasaNLUInterpreter(interpreter_path),

and an Agent using agent = Agent.load("bots/responder/models/dialogue/responder_model.tar.gz", interpreter=interpreter)

I then obtained results from the Interpreter usinginterpreterOutput = interpreter.parse(msg), which gives me the intent with interpreterOutput['intent']['name']

However, now I get this error: TypeError: 'coroutine' object is not subscriptable

Is there documentation for the Python API for the latest version of Rasa? I can’t seem to find it anywhere.

Does agent.handle_text(text_message=msg, sender_id=interactionID) still work?

Figured it out. The new version of Rasa uses async functions, so we have to use asyncio event loops like so:

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
interpreterOutput = loop.run_until_complete(interpreter.parse(msg))

And similarly with agent.handle_text