How should a chatbot in rasa initiate the conversation without prompting the user to to start the chat?

For eg,

here the bot is asking for your input so instead of this i want to get the greeting option directly

How can this be implemented ?

Regards, Ajinkya H

This depends on your frontend. For example in rasa webchat, you can send an automatic intent when the user opens the widget. This, in turn, then triggers the bot to greet the user or whatever.

1 Like

How to send or create an automatic intent ?

can anyone send me a demo or a basic code so that i can understand it much more easily !

Look at the JS code with which you can setup Rasa webchat on your webpage:

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.8.js"></script>
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/get_started",
    interval: 1000, // 1000 ms between each message
    customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5500",
    socketPath: "/socket.io/",
    title: "Title",
    subtitle: "Subtitle",
    inputTextFieldHint: "Type a message...",
    connectingText: "Waiting for server...",
    hideWhenNotConnected: true,
    fullScreenMode: false,
    showFullScreenButton: false,
    profileAvatar: "http://to.avat.ar",
    openLauncherImage: 'myCustomOpenImage.png',
    closeLauncherImage: 'myCustomCloseImage.png',
    params: {
      images: {
        dims: {
          width: 300,
          height: 200,
        }
      },
      storage: "local"
    },
  })
</script>

The line initPayload: "/get_started" sends the get_started intent once the user opens the widget. You can then train your bot to react with a greeting or whatever to this intent.

2 Likes

Hello @tabularasa

How would a storyfile look like this way?

Because normally it is always starts

New Story

*intent

  - utter_example   or 
  - action_example 

Best regards

Tobias