Hi everyone, I’m trying to implement a welcome message with socket io implementation in my own website. I saw some topics but I get my code running with expected result. I wan’t to get a message from rasa bot when the user open the site and the bot, how can I do that?
I’m using the official rasa script that s
<div id="rasa-chat-widget" data-websocket-url="https://your-rasa-url-here/"></div>
<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>
Some extra code of my implementation my script
<div id="rasa-chat-widget" data-initial-payload="/get_started" data-websocket-url="https://your-rasa-url-here/"></div>
<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>
my domain.yml
utter_welcome_message:
- text: Ciao
intents:
- get_started
my story
- story: welcome message
steps:
- intent: get_started
- action: utter_welcome_message
Can you show us what is happening when you open the bot? It would be helpful if you can upload some logs.
Hi, thanks for your time. When I open the bot nothing happens, it just show blank chat
what about the logs in rasa? do you see the intent getting triggered?
how can I see if it was called? i have no log in the console
What command you are using to run rasa. You can use rasa run -m models --enable-api --cors "*" --debug
can see what’s happening with the flow. you just need to add --debug
to your command.
In fact you can save the logs into a file if you run rasa run -m models --enable-api --cors "*" --debug --log-file out.log
I’m using socket io in my own website, so I just have the widget in my page and I run the bot with rasa run actions & rasa run -m models --enable-api --cors “*” in the terminal
oh nice, let me try
Opening the bot it shows just 2021-11-17 11:37:40 DEBUG rasa.core.channels.socketio - User XXX connected to socketIO endpoint. 2021-11-17 11:37:40 DEBUG rasa.core.channels.socketio - User XXX connected to socketIO endpoint.
Let me also try with this widget. Meanwhile, you can use botfront rasa-webchat
<script>
(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src = "https://cdn.jsdelivr.net/npm/rasa-webchat@1.0.1/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
window.WebChat.default({
initPayload: '/get_started',
socketUrl: "http://127.0.0.1:5005/",
title: 'Title',
subtitle: 'An AI Assistant',
protocol: 'socketio',
customData: {
language: "en"
},
params: {
storage: "session"
},
// add other props here
});
}),
t.insertBefore(e, t.firstChild);
})();
WebChat.show();
</script>
I’m trying not to change widget and use the suggested by rasa official website to have a clean intallation. I also use jwt and I prefere not to change widget
Understood, as per the logs data-initial-payload
is not hitting the rasa. will check and if I find any will get back to you
Thank you a lot
@ayoubelma What basically you mean by not to change the widget and suggested by rasa? Is that you developed your on frontend or you are using third party widget for rendering on website?
I’m using the script
<div id="rasa-chat-widget" data-websocket-url="https://your-rasa-url-here/"></div>
<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script>
that is indicated in the rasa official site Your Own Website I need to use this and not third implementation
@ayoubelma Right! Then you must be aware that some of the features are much depends on the frontend.
Can you confirm, what all features are your able to see in rasa official Webchat. like button, image, hyperlink, card carousal etc etc
Are you aware or the Rasa Webchat for the integration?
Please mention @ and alias of the person whom you are responsing please.
@nik202 At the moment I’m simply using a white html page with the script, I tried few weeks ago to show imgs and buttons and worked, I’m using jwt and it also works well. What do you mean with aware or the Rasa Webchat for the integration?