Skip to content

Commit

Permalink
Fix "TypeError: AWS.LexRuntimeV2 is not a constructor" when using Lex…
Browse files Browse the repository at this point in the history
… V2 based Elicit Response Bots. Fix "Cannot read property 'buttons' of undefined" when no buttons specified in response card. Bug fix - protect against TypeError exception while processing fallback intent case for an invalid response provided to a LexV2 Response Bot.
  • Loading branch information
Bob Potterveld committed Jul 8, 2021
1 parent 83a88da commit 80bef08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.7.2]
- Bug fix "TypeError: AWS.LexRuntimeV2 is not a constructor" when using Lex V2 based Elicit Response Bots.
- Bug fix "Cannot read property 'buttons' of undefined" when no buttons specified in response card.
- Bug fix Protect against TypeError exception while processing fallback intent case for an invalid response provided to a LexV2 Response Bot.
## [4.7.1]
- Amazon Elasticsearch version 7.10 is now utilized.
- Encrypted Elasticsearch (production) instance types now use m6g.large.elasticsearch for improved price/performance/memory.
Expand Down
2 changes: 1 addition & 1 deletion lambda/fulfillment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DST=../../build/lambda/$(NAME).zip
RESOURCES := $(shell find . | grep -v node_modules | grep -v test )

$(DST): $(RESOURCES)
echo "Building $(NAME)"; npm install -production && zip -r -q $(DST) .
echo "Building $(NAME)"; rm $(DST); npm install -production && zip -r -q $(DST) .
3 changes: 2 additions & 1 deletion lambda/fulfillment/lib/middleware/lexRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function lexV1ClientRequester(params) {
});
}
function lexV2ClientRequester(params) {
console.log(`aws sdk version is ${AWS.VERSION}`);
const lexV2Client = new AWS.LexRuntimeV2();
return new Promise(function(resolve, reject) {
lexV2Client.recognizeText(params, function(err, data) {
Expand Down Expand Up @@ -319,4 +320,4 @@ async function processResponse(req, res, hook, msg) {
return resp;
}

exports.elicitResponse=processResponse;
exports.elicitResponse=processResponse;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-ai-qna-bot",
"version": "4.7.1",
"version": "4.7.2",
"engines": {
"node": ">=12.16.1",
"npm": ">=7.8.0"
Expand Down

0 comments on commit 80bef08

Please sign in to comment.