5

I am using Aws Lex for constructing chatbots. I had a scenario where I need to have welcome message initially without user input so that I can give a direction to the user in my chatbot.

halfer
  • 19,824
  • 17
  • 99
  • 186
Akhil Gudimetla
  • 342
  • 3
  • 11

2 Answers2

7

You need to work that scenario using API call to start a context with your user.

You can follow these steps:

  • You need to create an Intent called AutoWelcomeMessage.
  • Create a Slot type with only one value i.e: HelloMe.
  • Create an Utterances HelloMessage.
  • Create a Slot as follow: Required, name: answer, Slot Type: HelloMe, Prompt: 'AutoWelcomePrompt'.
  • Pick Amazon Lambda for your Fulfillment that will send a response to your user. I.e:

Hello user, may I help? (Here the user will enter another Intent and your Bot will respond).

Now, start a conversation with your User, just call via API your Lex Bot and send an intention with Intent AutoWelcomeMessage, that call starts a context with your Lex Bot and the fulfillment will execute your Lambda.

Ele
  • 33,468
  • 7
  • 37
  • 75
  • i am confused with 5th point do i need to make my own lambda or i need to select prebuilt one ? – Ronak Shetiya Aug 01 '18 at 13:14
  • @RonakShethia you can pick a prebuilt or your own lambda function. I recommend creating an own lambda function to customize your welcome message. – Ele Aug 01 '18 at 13:29
  • Hello, Ele, how can i write my lambda function? On dispatch we compare the intent "if (intentName === 'AutoWelcomeMessage')'". It means, we need to get IntentName before showing it as initial message. – Jacobys527 Sep 03 '18 at 15:41
1

If you are using your own website or an app for integrating the chatbot, then you can send some unique welcome text from that website/app when it loads for the first time i.e on load method to the amazon lex. And in amazon lex you can create a welcome intent and put exact same text as utterance.

This way, when the website/app loads, it will send text to amazon lex and lex can fire the welcome intent and reply to it.

sid8491
  • 6,622
  • 6
  • 38
  • 64