Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom welcome message #2023

Closed
aourednik opened this issue Apr 4, 2018 · 6 comments
Closed

Custom welcome message #2023

aourednik opened this issue Apr 4, 2018 · 6 comments

Comments

@aourednik
Copy link

Rasa Core version: 0.8.5

Python version: 3.6

Operating system (windows, osx, ...): Ubuntu 16

Issue: Users often request the bot to utter something on startup, instead of being presented with an empty input. rasa-core actually provides a welcome message but it is hard-coded in console.py: "Bot loaded. Type a message and press enter: "
Would it be possible to make this message configurable?
The solution I've found is overwriting the method, but that is a lot of code to change just one element in the method:

...
from rasa_core.channels.console import * 
class MyConsoleInputChannel(ConsoleInputChannel): 
    def _record_messages(self, on_message, max_message_limit=None):
        utils.print_color("Hallo, ich bin ein ChatBot.",utils.bcolors.OKBLUE)
        num_messages = 0
        while max_message_limit is None or num_messages < max_message_limit:
            text = input().strip()
            if six.PY2:
                # in python 2 input doesn't return unicode values
                text = text.decode("utf-8")
            if text == INTENT_MESSAGE_PREFIX + 'stop':
                return
            on_message(UserMessage(text, ConsoleOutputChannel(),
                                self.sender_id))
        num_messages += 1
...
@akelad
Copy link
Contributor

akelad commented Apr 5, 2018

This is just for the command line though, this doesn't happen when it's deployed on a channel somewhere.
You can easily have the bot say something the first time a user talks to it on a deployed channel though. e.g. if it's on Telegram, you have to start the first conversation by pressing "/start" or something similar. So you can add a story like this:

* start
    - utter_greet

@aourednik
Copy link
Author

Many thanks for your answer. I was wondering if my workoaround would work for other channels.
This seems to be a challenge for most chatbot frameworks (the MS bot framework has trouble with producing a welcome message, too). Yet our users say they are disoriented by an empty input in the messenger-like GUI frontend. Would you have an advice for making a story like this work?:

## a story example
    - bot_utter_greet
* start
    - utter_what_can_i_do_for_you

i.e. the bot would utter something defined in the domain as soon as the channel is opened

@tmbo
Copy link
Member

tmbo commented Jun 15, 2018

Usually this should be configured in the input / output channel. Nevertheless, I see the point for being able to configure an initial message of the bot when it picks up a conversation. I don't see this being integrated soon though.

The way to do it atm.: when you open a chat, send a message to the bot eg /init which is treated as the first message from the user and the bot can normally respond to it. To the user it will seem as the bot started the conversation. FB let's you easily do that.

@tmbo tmbo closed this as completed Jun 15, 2018
@tmbo tmbo transferred this issue from RasaHQ/rasa_core Mar 21, 2019
@njain51
Copy link

njain51 commented Jun 9, 2019

How to do it with rocket.chat

@cyrilthank
Copy link

Many thanks for your answer. I was wondering if my workoaround would work for other channels.
This seems to be a challenge for most chatbot frameworks (the MS bot framework has trouble with producing a welcome message, too). Yet our users say they are disoriented by an empty input in the messenger-like GUI frontend. Would you have an advice for making a story like this work?:

## a story example
    - bot_utter_greet
* start
    - utter_what_can_i_do_for_you

i.e. the bot would utter something defined in the domain as soon as the channel is opened

does this work on rasa-x ui?

@cryoff
Copy link

cryoff commented Dec 20, 2021

I know this is closed but I am still interested: is it possible to make a bot to send a greeting message on a startup when using rasa shell?
(same question raised here: https://forum.rasa.com/t/custom-welcome-message/12729/4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants