aws-samples / amazon-sumerian-hosts

Amazon Sumerian Hosts (Hosts) is an experimental open source project that aims to make it easy to create interactive animated 3D characters for Babylon.js, three.js, and other web 3D frameworks. It leverages AWS services including Amazon Polly (text-to-speech) and Amazon Lex (chatbot).
MIT No Attribution
187 stars 82 forks source link

LexRuntimeV2 recognizeUtterance Response #167

Closed sckhg1367 closed 1 year ago

sckhg1367 commented 1 year ago

I use the recognizeUtterance function of LexRuntimeV2. But put the inputTranscript of Response into Base64 decoder and display "not a Base64 encoded string". I want to get the 'text of inputTranscript'(chinese). Please let me know if I did something wrong, thank you.

The execution screen is as follows:

image image image image image
Krxtopher commented 1 year ago

I maintain a separate repository (personal) that contains the Amazon Sumerian Host Babylon demos. As luck would have it, I just added a new "Lex v2" demo to that repository a few days ago. You can use that demo as a starting point for your Lex v2 Hosts application, or you can just look the src/extras/LexV2Feature.js file for reference on how I'm decoding the Lex v2 response object. Look for the decodeResponse(lexResponse) and decodeAndUnzipJsonString(encodedString) functions in particular.

If that unblocks you, let us know so we can close this ticket. Thanks!

sckhg1367 commented 1 year ago

@Krxtopher It's working, thank you~