Build a Skill for Amazon Alexa
Build a Skill for Amazon Alexa
Many developers are contributing to the Alexa platform to build “Alexa Skills” — this article teaches you how to make your own Alexa skills!
Join the DZone community and get the full member experience.Join For Free
Amazon's Alexa is one of the most popular Voice Assistants available. Many developers are contributing to the Alexa platform to build “Alexa Skills”. These skills help to expand Alexa's capabilities.
In return, Amazon is offering some perks to the developers to encourage them to build skills. https://developer.amazon.com/alexa-skills-kit/alexa-developer-skill-promotion-india
You can get an “Alexa T-shirt” and $100 free “AWS credit” every month for 12 months.
You may also like: Developing Alexa Skills With Spring Boot REST Services in Mind
Let’s get started and try to build a skill for Alexa. We will be calling it “NASA facts”. You can use these techniques to build skills of your own!
Create a Fact Skill First
Visit this link https://developer.amazon.com/alexa/console/ask/. You will see an “Alexa Developer Console” dashboard.
Click on the “Create Skill” button.
Enter the Skill name and language. Select the “Custom” model to add to your skill.
We have to do some modifications to our NASA facts.
Change the Facts Data
Got to the “Code” tab and open the “languageStrings.js“.
Change the FACTS list elements.
The facts are available from lines no. 21 to 25. Remove these facts and add your facts. Use Google to find out the facts. These are the facts I have added. Just copy and paste the below facts if you are trying the same tutorial.
“NASA, or the National Aeronautics and Space Administration, was created by President Dwight Eisenhower in 1958 in response to the Soviet Union’s launch of the first artificial satellite the previous year.”
“President John F. Kennedy gave NASA the goal of sending a man to the moon by the end of the 1960s. On July 20, 1969, the first men walked on the moon as part of the Apollo 11 mission.”
“Twelve men have walked on the moon, all during the Apollo missions.”
“In 1970, the Apollo 13 lunar landing was aborted after an oxygen tank exploded.”
“The space shuttle Enterprise was the first shuttle built for the reusable spacecraft fleet, though it was created for testing and never flew in space.”
“Enterprise was initially to be named Constitution, but fans of the TV show Star Trek ran a successful write-in campaign to change the name.”
“The space shuttle program has had more than 120 successful flights but also two disasters in which the shuttles and crews were lost (Challenger in 1986 and Columbia in 2003).”
“Within the next year and a half, the 51-year-old agency is slated to finish construction of the international space station and retire the three remaining shuttles — Atlantis, Discovery, and Endeavour.”
“Space shuttle Endeavour was built using spare parts from Discovery and Atlantis.”
“The next generation of spacecraft won’t be ready until 2015, so U.S. astronauts will travel with the Russians aboard their Soyuz spacecraft to visit the space station."
Edit the fact name and other strings in the file as required.
Click “Save” to save your changes.
Click on the “Deploy” button to deploy the changes.
Finally, edit the Invocation and GetNewFactIntent utterances. Just replace the space facts with “my amazing NASA facts” in the GetNewFactIntent.
Click the “Save model” and “Build Model”. Once it is built, you can test in the simulator.
P.S. please build first to test.
Enable the test. Type “ask my amazing NASA facts” in the textbox and hit enter.
You are done building your first Alexa Skill.
Build your logo and publish your skill on the Alexa Skills store.
This is a link for Indian developers.
Select your country on the same page.
Thank you for reading!
Opinions expressed by DZone contributors are their own.