Default welcome message - Rasa Open Source - Rasa Community Forum
Default welcome message
post by Ajinkz on Jan 7, 2019
how set default welcome message for Bot ?
post by huberrom on Jan 7, 2019
It’ll depend on the chat you are using. For my project, we have the control over the chat, so we are going to send a /welcome message/intent so the bot will respond with the welcome intent without interaction from the user.
But there is not standard way to do this, it depends on your chat platform.
post by Quresh_Abrar on Feb 25, 2019
@huberrom can you please elaborate on how to perform this task. Thanks in advance
post by huberrom on Feb 25, 2019
Well, I have an intent which is name “bienvenue” (welcome in french), with the following story :
## story_bienvenue
* bienvenue
- action_bienvenue
When the chat open, it sends this to the bot :
{ "message" : "/bienvenue"}
(if you don’t use the last version of rasa core, it would be query instead of message)
post by rasalearner on Jun 9, 2019
Can you share more details here, I am still struggling with it, thanks
post by prashant_kamble on Jun 9, 2019
Hi @rasalearner if you are using mrbot-ai/ rasa-webchat then in that case I can help you up to some extent.
Below are the steps I followed to display a welcome message when the bot loads:
Create
utter_welcome_messageutterance in your domain file. And give whatever initial message you want to display.Also add one intent with the name of your choice in your domain file. In my case, I have ‘hello’ as intent. Also don’t forget to include this
utter_welcome_messagein your action’s list i.e in the domain file.Add simple story in your story file for the specified intent and call action as
utter_welcome_message.In your HTML file put
initPayloadvalue with the intent that you have created, for e.g in my case it is
initPayload: "/hello",
If it helps let me know pal! 😊
post by rasalearner on Aug 2, 2019
Hey Prashant,
Thanks for your reply. We are using rocket.chat. Do you know how to use payload there?
post by prashant_kamble on Aug 3, 2019
Hi Nitin,
I have not used rocket chat yet. But can you show me what you are up to or what have you done?
post by rasalearner on Aug 3, 2019
So what I am asking is how to trigger initPayload: "/hello", in rocket.chat client so that the default welcome message appears there. Currently, I am only asking the user to chat first and then the welcome message appears. In this case, sometimes the user doesn’t do proper greeting as expected hence trigger doesn’t work. So we want the welcome message first to force some default happy paths.
post by Saurbh060 on Jan 14, 2020
hii @prashant_kamble, which HTML file are you talking about ?
post by prashant_kamble on Jan 15, 2020
Hi @Saurbh060, HTML means I am talking about the JavaScript file from which we are calling the rasa core webhook API.
post by Saurbh060 on Jan 15, 2020
ohh thanks
post by prashant_kamble on Jan 15, 2020
Yup ! 😊
post by tiziano on Jan 21, 2020
can you please give more details on how to send the HTTP request? How can I know who to send the request to?
post by Shank on Feb 27, 2020
If you have started both the rasa servers on your localhost, that is the action server and the rasa server, then they are by default running on ports 5055 and 5005 respectively. You can do a POST request to the URL localhost:5005/webhooks/rest/webhook. Keep in mind for this to work, you need to be using the REST channel as the medium for communication.
Hope that helps.
post by sibbsnb on Apr 3, 2020
thanks
post by Superbatman on Apr 17, 2020
Thanks, It helped me.
post by pranay_raj on Apr 21, 2020
hey @prashant_kamble I did use your steps but my bot isn't sending anything at start. I included this code in my HTML page and followed your 4 steps, but the bot waits for me to initiate conversation.
<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
// Or you can replace latest with a specific version
<script>
WebChat.default.init({
selector: "#webchat",
initPayload: "/hello",
customData: {"language": "en"}, // arbitrary custom data. Stay minimal as this will be added to the socket
socketUrl: "http://localhost:5005",
socketPath: "/socket.io/",
title: "Title",
subtitle: "Subtitle",
})
</script>
post by prashant_kamble on Apr 22, 2020
Hi @pranay_raj,
Have you created the corresponding intent like I have mentioned i.e /hello intent??
post by pranay_raj on Apr 22, 2020
@prashant_kamble yes I have created an intent 'hello 'and followed all 4 steps of yours. Does it need to be ‘/hello’ ?
post by pranay_raj on Apr 22, 2020
@prashant_kamble I even tried intent as ‘/hello’ , while training it says no stories present. and if I use ‘hello’ as intent then it does not initiate the conversation.
post by prashant_kamble on Apr 22, 2020
Hi @pranay_raj,
You will also need to have a story. Did you check on that??
post by pranay_raj on Apr 22, 2020
@prashant_kamble Yes this is in story:
## startup story
- hello
- utter_welcome_message
this is my domain:
templates:
utter_welcome_message :
- text: “Hey…this is welcome message!!”
actions:
- utter_welcome_message
intents:
- hello
post by pranay_raj on Apr 22, 2020
@prashant_kamble Prashant, Am I missing something in my domain or story???
post by prashant_kamble on Apr 22, 2020
Hi @pranay_raj,
Here is my LinkedIn id https://www.linkedin.com/in/prashant-kamble-a45b36a8. I am writing it because I didn’t get your request. feel free to contact! 😊
post by nik202 on May 3, 2020
Any code or example how to add the welcome message or greet message by bot-like "Hello, I am a bot, how can I help you today?" at the first instant of the chat window open or the sequence of messages one after another.
Bot: Hello.
Bot: Welcome to the website.
Bot: I am your chatbot assistant!
Then user reply
User: Hey there!! Please Help, Guys!
post by narasingh on Jun 24, 2020
hi @pranay_raj … do you got a solution for this? if yes please tell me . how to get welcome message from bot when it opens?
post by narasingh on Jun 25, 2020
hi @Shank. can you give an example for this ?
post by faiza_conte on Sep 2, 2020
Hello prashant …I saw ur LinkedIn here I also have the same issue and am trying to connect you.@Faiza Abdella please accept it show me a little bit about it
post by samvatsar on Jan 12, 2021
You can send “/session_start” to the rasa backend server when a user invokes the chat icon and customize the welcome message by creating a custom action like:
class ActionSessionStart(Action):
"""
This action is used at the start of conversation.
"""
def name(self) -> Text:
"""This is the name to be mentioned in domain.yml and stories.md files for this action."""
return "action_session_start"
async def run(
self,
dispatcher: CollectingDispatcher,
tracker,
domain: Dict[Text, Any],
) -> List[EventType]:
"""This run function will be executed when "action_session_start" is triggered."""
events = [SessionStarted()]
dispatcher.utter_message(
text="Hi! How can I help you?")
events.append(ActionExecuted("action_listen"))
return events
post by alludaddy on Jun 3, 2021
Sir, do you know how to display a default welcome message?
post by nik202 on Jun 12, 2021
If you using shell use this Default welcome message - #32 by samvatsar or if you are using some front end like rasa web chat see this GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront
<script>!(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/rasa-webchat@1.x.x/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
window.WebChat.default(
{
customData: { language: "en" },
initPayload: "/hello", ** utterance or welcome message
socketUrl: "https://bf-botfront.development.agents.botfront.cloud",
// add other props here
},
null
);
}),
t.insertBefore(e, t.firstChild);
})();
</script>
post by iKraft on Jun 21, 2024
Hello, I am not able to see the initial welcome message with this code.
post by iKraft on Jun 21, 2024
Reply