Rasa core and Mrbot webchat not getting connected

Bot is working using the code given in the docs (SocketIOinput) and the Mrbot is also working fine. But the bot neither receive the user input nor reply. Please help me as I need to show this for UAT. The webchat parameters are:

WebChat.default.init({ selector: “#webchat”, initPayload: “/get_started”, socketUrl: “http://localhost:5004/”, socketPath: “/core”, title:“DEV Test” })

And the SocketIO setup runs using the following code:

nlu_interpreter = RasaNLUInterpreter(’./models/nlu/default/afl_ppf2’) agent = Agent.load(’./models/dialogue’, interpreter = nlu_interpreter)

input_channel = SocketIOInput( # event name for messages sent from the user user_message_evt=“user_uttered”, # event name for messages sent from the bot bot_message_evt=“bot_uttered”, # socket.io namespace to use for the messages namespace=None )

# set serve_forever=False if you want to keep the server running

s = agent.handle_channels([input_channel], 5004, serve_forever=True)

The bot server log show the following msgs: - - [2018-10-08 12:49:23] “GET /core/?EIO=3&transport=polling&t=MPIYtVF HTTP/1.1” 404 342 0.000000

Pls help me to fix this issue.

Now it started working automatically. I dont know how it started working fine. Sorry for the disturbance, just ignore this question.

Can you explain how would you connect your rasa bot to the web-chat

Run this code explained in the rasa core docs:

And then run the mrbot webchat. It will connect automatically. You dont need to do anything.

can you send your socket python code for example

My socket.io python code is below

from rasa_core.channels.socketio import SocketIOInput
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.utils import EndpointConfig

nlu_interpreter = RasaNLUInterpreter(’./models/nlu/default/weathernlu’)
action_endpoint = EndpointConfig(url=“http://localhost:5055/webhook”)
agent = Agent.load(’./models/dialogue’, interpreter = nlu_interpreter, action_endpoint = action_endpoint)

input_channel = SocketIOInput(





s = agent.handle_channels([input_channel], 5002, serve_forever=False)

—is there any correction in it?

Same code

How to run the mrbot webchat

@Seenivasan Did you get websocket to work via upgraded WS protocol, or is it continous long polling? I.e. endless loop of GET/POSTs? We got long polling to work, but it seems the server can’t negotiate the upgrade to ws protocol and stays in long polling?