How to use Rasa 1 with python

For setting up rasa 0.14.4 with python we used this tutorial:

But it’s seems no longer valid with Rasa X also because it creates a .tar.gz file instead of using the models/dialog and models/current folders

interpreter = RasaNLUInterpreter(‘models/current/nlu’)
agent = Agent.load(‘models/dialogue’, interpreter=interpreter)
responses = agent.handle_message(a)

So how should we change the Agent to work with the Rasa 1.0.1?

1 Like

same, we need to know

I posted the issue yesterday and I think the devs will work on the docs. Missing Python API guide in Rasa 1.0 docs · Issue #3609 · RasaHQ/rasa · GitHub

For your specific question, my solution is:

agent = Agent.load(unpacked_model_path=dir_model) # contains both nlu and core models
loop = asyncio.get_event_loop()
lst_dict_reply = loop.run_until_complete(agent.handle_text(text_message=input_message))