AWS LEX

0

Hi all,
I have a requirement. While I am serving an intent in LEX, if I type utterence of other matching intent, LEX is calling the latter intent. Instead I need to ask for confirmation like ' Do you quit existing service {intentName}?'

How this can be achieved?

Devaki
質問済み 4年前343ビュー
1回答
1

Hi Devaki,

The behaviour you are expecting can be achieved by responding with ConfirmIntent dialogAction from your Initialization and validation code hook Lambda.
One of the ways to achieve this is by checking if the previous intent is completed, by looking at the fulfillmentState of the first intent in the list of recentIntentSummaryView in the event received by lambda.
If the fulfillmentState on this intent is not of these: Fulfilled, Failed or ReadyForFulfillment. It means that the intent was not completed and user tried to switch intents.

At this point, you can respond back with ConfirmIntent to confirm if your customer really want to switch the intents.
Here is an pseudo code showing how this can be achieved:

previousIntent = event[“recentIntentSummaryView”][0]
 
if previousIntent[“fulfillmentState”] != “Fulfilled” && previousIntent[“fulfillmentState”] == “Failed” && previousIntent[“fulfillmentState”] == “ReadyForFulfillment” {
                // previous intent is not completed, user is trying to switch intents mid conversation
}
回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ