RecognizeUtterance
Source:
src/AWS/LexV2/RecognizeUtterance.ts
Runtime binding for lex:RecognizeUtterance — send user text or audio to
an Amazon Lex V2 bot alias. Unlike RecognizeText, the response’s
messages/sessionState/interpretations come back gzip-compressed and
base64-encoded, and an audioStream reply is available for voice bots.
Conversing with a Bot
Section titled “Conversing with a Bot”// initconst recognizeUtterance = yield* AWS.LexV2.RecognizeUtterance(alias);
// runtime — response fields are gzip+base64; decode before useconst reply = yield* recognizeUtterance({ localeId: "en_US", sessionId: "user-123", requestContentType: "text/plain; charset=utf-8", inputStream: new TextEncoder().encode("hello"),});