Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions lex-web-ui/src/lib/lex/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,34 @@ export default class {
}

async startNewSession() {
let command;
if (this.isV2Bot) {
command = new PutSessionCommandV2({
botAliasId: this.botV2AliasId,
botId: this.botV2Id,
localeId: this.botV2LocaleId,
sessionId: this.userId,
sessionState: {
let command, res;
try {
if (this.isV2Bot) {
command = new PutSessionCommandV2({
botAliasId: this.botV2AliasId,
botId: this.botV2Id,
localeId: this.botV2LocaleId,
sessionId: this.userId,
sessionState: {
dialogAction: {
type: 'ElicitIntent',
},
},
});
const res = await this.lexRuntimeV2Client.send(command);
return res;
} else {
command = new PutSessionCommandV1({
botAlias: this.botAlias,
botName: this.botName,
userId: this.userId,
dialogAction: {
type: 'ElicitIntent',
},
},
});
} else {
command = new PutSessionCommandV1({
botAlias: this.botAlias,
botName: this.botName,
userId: this.userId,
dialogAction: {
type: 'ElicitIntent',
},
});
}

try {
const res = await this.lexRuntimeClient.send(command);
return res;
});
const res = await this.lexRuntimeClient.send(command);
return res;
}
} catch(err) {
console.log(err)
}
Expand Down