Invoke Lex Intent without sample utterances or initial response - Amazon Connect Call flow

0

Hi,

 Can we invoke specific Lex Intent without prompting user for sample utterances or initial response? It means that can be pass the sample utterances or initial response from Amazon Connect Call flow without prompting for user?

Thanks, Selva

2 Answers
0

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.

AWS
answered a year ago
  • 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.

0

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

profile picture
dmacias
answered a year ago
  • 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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions