Skip to content

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.

// init
const recognizeUtterance = yield* AWS.LexV2.RecognizeUtterance(alias);
// runtime — response fields are gzip+base64; decode before use
const reply = yield* recognizeUtterance({
localeId: "en_US",
sessionId: "user-123",
requestContentType: "text/plain; charset=utf-8",
inputStream: new TextEncoder().encode("hello"),
});