- Newest
- Most votes
- Most comments
Hi Selva,
You can. You would need to use Lambda to "warm" your Lex bot. In this scenario, your Lambda would act as the entity initiating the conversation with Lex. Assuming you are using Lex V2, use Lambda to call the "RecognizeUtterance" API. You will need to pass obvious parameters (botId, botAliasId, localeId, etc), along with a sessionId and the inputStream. The inputStream must match an utterance that is configured on the intent you want to start the conversation with. The sessionId will be used to keep the conversation context for the end-user Lex is interacting with.
Happy to assist further if needed.
When using this with Amazon Connect, Lex sessionId is Amazon Connect's ContactID which you can get in Contact Flow $.ContactId
Hi Aurelien, Thanks for details. We are using Lex V2. But in V2, Lambda can be invoked inside the intent. It means that Do we need to call Lambda before calling Get user Input in AC call flow? In this case, how can we find out sessionId for Lex? I will appreciate your feedback. Thanks, Selva
To make sure I understand the contact flow: Lambda to the RecognizeUtterance end point with parameter botId, botAlias, sessionId = contactId, inputStream=utterance. Then if successful go to a Get Customer Input node to send the call to Lex?
That is correct. The output of the RecognizeUtterance API call is to be used into a Get Customer Input.
I don't see a way. You could use conditional branching (assuming v2), but you need that initial utterance to start the whole process to be able to branch. What are you trying to accomplish? Are you looking to have a single bot instead of a bunch of different smaller bots?
david
Thanks David. We want to use single bot with multiple intents and want to call the Lex bot multiple times in same call flow.
In order to give better customer experience, we want to pass utterance from call flow / Lambda.
Thanks, Selva
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
If I understand your question correctly you're attempting to set some state without prompting the user first?
If so you could use the PutSession API to set the conversation state: https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PutSession.html