Rasa stack with socket.io internl server error


(Swagat123) #1


My objective is to create a web chat with rasa stack. I trained nlu and dialogue with below command

   python -m rasa_core.train -d domain.yml -s stories.md --debug -o models/dialogue
   python -m rasa_nlu.train -c nlu_config.yml --fixed_model_name nlu --data nlu.md -o models --project current --verbose  

i have aws server ec2 instance.

then i used the rasa webchat widget

	<div id="webchat">
		<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
		        selector: "#webchat",
		        initPayload: "/get_started",
		        interval: 1000, // 1000 ms between each message
		        customData: {"sender": "userl"}, // arbitrary custom data. Stay minimal as this will be added to the socket
		        socketUrl: "http://<remote server ip>:8082/",
		        title: "Connect",
		        subtitle: "The bot which connects people",
		        profileAvatar: "https://rasa.com/assets/img/demo/rasa_avatar.png",
		        showCloseButton: true,
		        fullScreenMode: false

the n rasa core socket code is

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/current')
action_endpoint = EndpointConfig(url="http://<remote server ip>:5055/webhook")
agent = Agent.load('models/dialogue', interpreter = nlu_interpreter, action_endpoint = action_endpoint)

input_channel = SocketIOInput(




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

when i try to run in local system http::8082 i got internal server error

and error message was

Thu Dec 6 07:00:36 2018 {‘REMOTE_PORT’: ‘33100’, ‘HTTP_HOST’: ‘8082’, ‘REMOTE_ADDR’: ‘’, (hidden keys: 24)} failed with TypeError - - [2018-12-06 07:00:36] “GET / HTTP/1.1” 500 161 0.000364

i have no other code only this index.html which has web chat code and rasa socket code. do i have to add any other code. i have no knowledge in UI.

My objective is to use a webchat wither rest or http or socket.

I appreciate your help.

Regards Swagat