How to get welcome messages in AWS Lex (lambda in Python)?
Asked Answered
H

2

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.

Horary answered 27/1, 2018 at 14:24 Comment(0)
Q
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.

Quincyquindecagon answered 27/1, 2018 at 16:15 Comment(3)
i am confused with 5th point do i need to make my own lambda or i need to select prebuilt one ?Eula
@RonakShethia you can pick a prebuilt or your own lambda function. I recommend creating an own lambda function to customize your welcome message.Quincyquindecagon
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.Gilliam
I
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.

Indomitability answered 29/1, 2018 at 5:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.