By using AWS re:Post, you agree to the Terms of Use

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

0

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?)

1 Answer
0

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. https://docs.aws.amazon.com/lexv2/latest/dg/conversation-logs-s3.html. The audio data gets stored in a customer specified S3 bucket, which can later be accessed using a Lambda function.

answered 5 months ago
  • 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?

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