I currently have a Lex bot that requires a Lambda function on my AWS account. I want to turn this existing bot into an Alexa Skill but can't migrate it easily.
What I've done so far:
- Publish a version of the Lex Bot and export as an ASK
- Import the JSON file into the Alexa Developer Console JSON Editor
- Followed this tutorial to give both my Alexa Skill and Lambda function access to each other
I've checked in the CloudWatch Logs and the Alexa Skill seems to be calling my function properly, however, it won't fulfill the intent. When it reaches the end of the dialog for an intent, the Amazon Skill only says:
You just triggered [IntentName]
I understand that the JSON format is different for Alexa and Lex and the return formats are as follows:
// Alexa return
return handlerInput.responseBuilder
.speak(speakOutput)
.reprompt(speakOutput)
.getResponse();
// AWS Lex return
return {
sessionAttributes: attributes,
dialogAction: {
type: 'Close',
fulfillmentState: fulfillStatus,
message: {
contentType: "PlainText",
content: messageContent,
}
}
};
Is there any simple way to convert my existing Lambda function to work with an Alexa Skill without needing to rewrite the entire thing?