AttributeError: 'str' object has no attribute 'event_broker' (JupyterLab)

I am building a chatbot using JupyterLab. I try to run the chat(model_path.model, endpoints) to chat but I got this error. I don’t seem to find a solution – especially since not many people are using Jupyter notebook to build a chatbot.