Is there a way to grab a user's voice utterance from an Amazon Lex V2 bot using Lambda calls?


I am building an Amazon Lex V2 bot, and I would like to send the user's voice utterances from the Lex V2 bot to a third party application.

I have looked through the documentation for Lex V2, and it appears that the API RecognizeUtterance only sends back a text transcription of the user's audio utterance. I also looked at AudioInputEvent, but it looks like that if for sending audio into Lex, and not retrieving it.

Is there a datatype where a user's utterance is saved into session in the Lex V2 bot, and if so, is there an API to access it using a Lambda call in either Java or Python (using Boto3?)

質問済み 2年前1414ビュー

Lex does not support returning voice utterances in API response. It only returns transcripts of the input audio.

For data analysis on voice utterances, you can enable Lex conversation logs to access user's voice utterances for data analysis. The audio data gets stored in a customer specified S3 bucket, which can later be accessed using a Lambda function.

回答済み 2年前
  • swapandeepataws, would it be possible in the future for the Lex team to please return the S3 URL from the Lex bot CloudWatch logs to the response sent to Lambda via Lex codehook on each turn?

    You can see in Lex logging output to CloudWatch (if turned on for conversation logs in Lex bot alias settings), those logs from Lex show the S3 utterance path. But that’s not passed from Lex to the Lambda codehook as info that we could use to “tie together” the utterance text transcript from the response JSON to its associated utterance S3 URL recording.

    We know how to find the utterances in S3, but without the URL that ties to the text, we can’t “match them up” effectively in our custom app (they aren’t necessarily recorded in order to the bucket—they can be written “out of order”). We’d like to show the text utterance, and also hyperlink it to the associated S3 URL for the utterance it was related to. That way, the user could click on an utterance result in our custom app, and play the actual recording that was captured. Would be a great feature.

    Is anything like that possible today? Or could a feature request be added to Lex to please pass on that S3 URL to the JSON response for use so we could leverage it?


Alternatively, these use cases can currently be achieved using real-time media streaming from Amazon Connect.

This allows you to capture the audio to / from the customer is real-time and consume it using Amazon Kinesis Video Streams.

回答済み 1ヶ月前

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