Cannot get rasa server response vi socketio

Hi guys, I’m trying to write a script to simulate client connection.

The code below can connect、send_message& disconnect properly.
I’m sure that server sended bot_uttered event, but client can’t recieve bot_uttered event from server.

Here is my code below, Thanks in advance

OS: Win 10 Rasa version: 2.8 Python version: 3.7 Rasa X, Rasa SDK: Not using

image

1 Like

Hi! I think you can use default socketio.py and customize the script You can get the code here: socketio.py

This widget use socket io. You can get the code here botfront / rasa-webchat

Thanks for your reply, I’m using the socketio.py in my rasa server.
But the question is I can’t recieve bot_uttered event from server.

I am resurrecting this thread because I have the same problem: No response from the Rasa server is making it thru to the chat interface. Help?

I am troubleshooting this by starting a new project as follows: 1) rasa init 2) Update credentials.yml to enable socketio channel 3) inserted rasa-chat snippet from the documentation; replacing the url with http://0.0.0.0:5005 4) rasa run --cors "*" --debug

On the client side, Chrome dev tools, I can see the outgoing users message:

42[“user_uttered”, {message: “hi”, session_id: “cda069755da04b2aa23cb4121b4d2c84”}]

On the server side, I can see that Rasa got the message:

2023-11-16 13:25:34 DEBUG rasa.core.processor - Starting a new session for conversation ID ‘cda069755da04b2aa23cb4121b4d2c84’. … 2023-11-16 13:25:35 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘utter_greet’

Here is a gist of the debug output: Rasa No Response Over Websocket · GitHub

======= Setup Details =================

Virtual environment:

  • rasa==3.6.13
  • rasa-sdk==3.6.2
  • python-engineio==4.8.0
  • python-socketio==5.10.0

credentials.yml

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: false

index.html

<div id="rasa-chat-widget" data-websocket-url="http://0.0.0.0:5005"></div>
<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>

I would check two things:

  • When Rasa starts with --debug logging, confirm that the socket endpoint is listed

  • Test network availablility of your endpoint using curl to make sure you get a response:

curl --location --globoff 'https://<url>/socket.io/?EIO=4&transport=polling&t=NHB_3lo'