AWS Machine Learning Blog

Export your Amazon Lex bot schema to the Alexa Skills Kit

You can now export your Amazon Lex chatbot schema into the Alexa Skills Kit to simplify the process of creating an Alexa skill.

Amazon Lex now provides the ability to export your Amazon Lex chatbot definition as a JSON file that can be added to the Alexa Skills Kit (ASK). Once you add the bot schema file into ASK, you can build an Alexa skill with it, for use on the Amazon Echo, Amazon Dot, Amazon Look, Amazon Tap, Amazon Echo Show and 3rd party Alexa enabled devices. The JSON configuration file contains the structure of your Amazon Lex chatbot, including the intent schema with utterances, slots, prompts and slot-types. The export functionality simplifies the process of creating an Alexa skill from an Amazon Lex chatbot.

To create an Alexa skill, you can use your Amazon Lex bot definition file from within the ASK portal, using the following steps.

From the Amazon Lex console

  1. Once you have created, built, and published your bot, navigate back to the page containing the list of bots which you have currently developed.
  2. Using the radio buttons, select the bot you would like to export. The Actions tab will become enabled at the top of the page once a bot is selected.
  3. From the Actions tab, select Export from the drop-down menu items, and following the modal dialogs, select Alexa Skills Kit as your Platform, and choose your version.
  4. Click Create. A zip file will be generating containing your JSON file of your bot schema.

Your Amazon Lex bot schema is now ready to be used in an Amazon Alexa skill!

From the Amazon Alexa Developer Portal

  1. Log in to the Alexa developer portal and navigate to the Interaction Model tab, to Launch the Alexa Skill Builder (currently in Beta).
  2. From the Skill Builder, paste the unzipped bot schema file into the Code Editor of your Alexa skill. (You can also drag-drop the JSON file.)
  3. Create a custom back-end for your skill in AWS Lambda.
  4. Connect the Lambda Function to your Interaction Model.
  5. From there, you can select “Build Model” from the top menu and complete any other updates to your skill information, interaction model, or configuration. Then Submit your skill for publication!

For more information on exporting your chatbot schema from Amazon Lex to simplify skill creation through the Alexa Skills Kit, visit the Amazon Lex documentation and FAQs page for more details. For more information about creating an Alexa skill, see the Alexa Skills Kit.