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년 전
관련 콘텐츠
- 질문됨 4달 전
- AWS 공식업데이트됨 7달 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 일 년 전