In this step, you will learn how to export the Lex configuration file into a JSON file and use the same file for Alexa skill development.
Go to AWS Lex Console
Click on the Left Arrow on the top left corner
Select your bot and click on Action
Click on Export
Choose the bot version and platform as
Alexa Skills Kit(ASK). Click on Export, save the file
Unzip the downloaded file and you will get the .json file. This will be used for Alexa Skill later. You can also export it as Lex format. The exported file can be used to replicate the same bot in another account.
Note: You could use json formatter to convert the file to standard indented json if the file’s original indents is not perfect
Go to the Alexa Developer Console
If you don’t already have an account, you will be able to create a new one for free. Note it’s not the same account for amazon.com. Sign in with your developer account
From the Alexa Skills Console select the Create Skill button near the top-right of the
list of your Alexa Skills.
Input Skill Name,
Personal Banker. This is the name that will be shown in the
Alexa Skills Store, and the name your users will refer to. Also change the locale if so
desired. Click Next to continue
Select the Custom button to add it to your skill, and select the Create Skill button at the top right.
You can choose to build the Interaction Model for your skill by adding intents, slots and etc. manually which we have already done in Lex. So we are going to re-use our Lex intents, slots. Choose Start from scratch, click Choose
On the left hand navigation panel, select the JSON Editor tab under Interaction Model. In the textfield provided, replace code line 5 to 23 with the code in the zip file exported from Lex. Follow the instruction below.
Select code line 5 to 23, delete it.
Open the .json file you export from Lex in Visual Studio or any other text edit file.
Select the highlighted part below. Copy it.
Paste it back to the Alexa console after line 4.
Input a invocation name
personal banker as shown below.
If you encounter an “Missing Intent” error message, please add the following code into intent.
If you find it is hard to follow, replace the entire code in the textfield provided with alexa-developer-console-personal-banker.json. Then you can skip subsequent jump to step 7: Create an Alexa Lambda function.
Click on Save Model and then Build Model. You should notice that Intents and Slot Types will auto populate based on the JSON Interaction Model that you have now applied to your skill
If your interaction model builds successfully, proceed to the next step. If not, you should see an error. Try to resolve the errors.
In our next step of this lab, we will be creating our Lambda function in the AWS developer console, but keep this browser tab open, because we will be returning here.