if anyone can help me?
Hi, have you checked Your Own Website guide? First thing I’d look into is whether your backend handles all of the events. Most importantly the “user_uttered” event.
You need something like this:
import socketio
from aiohttp import web
# Web app routing
app = web.Application()
app.add_routes([ .. ])
# Websocket through SocketIO with support for regular HTTP endpoints
sio = socketio.AsyncServer(async_mode='aiohttp', cors_allowed_origins='*')
sio.attach(app)
@sio.on('session_request')
async def on_session_request(sid, data):
if data is None:
data = {}
if 'session_id' not in data or data['session_id'] is None:
data['session_id'] = uuid.uuid4().hex
await sio.emit('session_confirm', data['session_id'])
@sio.on('user_uttered')
async def on_user_uttered(sid, message):
user_message = message.get('message', '')
...
await sio.emit('bot_uttered', json, room=sid)
Feel free to browse my project: