AMAZON ALEXA

ABHISHEK KUMAR
6 min readAug 23, 2018

--

Alexa, the voice service that powers Echo, provides capabilities, or skills, that enable customers to interact with devices in a more intuitive way using voice. Examples of these skills include the ability to play music, answer general questions, set an alarm or timer and more

Services required to work with Amazon alexa..

  1. AWS Lambda
  2. Registered on Amazon Alexa Developer Console .

How It Works:

Alexa is a cloud service. Activating Alexa works differently based on the type of Alexa-enabled product. For far-field Alexa-enabled devices like the Amazon Echo or Echo Dot, say the wake word to activate Alexa. For devices like Amazon Tap, activate Alexa by pressing the Talk or microphone button.

Amazon Alexa depends on :

Alexa Skills Kit : Alexa provides a set of built-in capabilities, referred to as skills. For example, Alexa’s abilities include playing music from multiple providers, answering questions, providing weather forecasts, and querying Wikipedia.

  1. The Alexa Skills Kit lets you teach Alexa new skills. Customers can access these new abilities by asking Alexa questions or making requests. You can build skills that provide users with many different types of abilities
  • Alexa Voice Service (AVS) : Use the Alexa Voice Service (AVS) to add intelligent voice control to any connected product that has a microphone and speaker. AVS is now available for the UK and Germany.

Creating Custom Skill In Alexa

  1. Create a personal AWS account
  2. Sign In To The Console of your AWS account.
  3. Click on the region drop-down next to your name on the top-right corner and select “US East (N. Virginia)” if you live in the US or “EU (Ireland)” if you live in the UK. These are the only two regions that support Alexa.
  4. Now click on Services on the top-left corner and go to Lambda under the Compute section

5. Click on the Get Started Now button to create a Lambda function..

6. Go to Configure triggers on the left menu.

7. Click on the image of the dotted outline and select Alexa Skills Kit

8. Hit Next.

9. Name the function “google” and select Node.js 4.3 for Runtime.

10. Under Lambda function code, select Upload a .ZIP file for Code entry type and upload the Archive.zip file. You can download it here. Unzip the downloaded file and the Archive.zip file will be located in the src folder.

11. Under Lamdba function handler and role, select Create new role from template(s) for Role and name the Role name “lambda_basic_execution” (or select Choose an existing role and lambda_basic_execution if the role already exists).

12. Under Advanced settings, change Timeout to 10 seconds.

13. This is what the completed page should look like. Hit Next and after that hit Create Function.

14. Copy the ARN code on the top-right corner. It should look something like “arn:aws:lambda:us-east-#:############:function:google“. We will need this later.

15. Now create a free Amazon Developer account here.

16. Under the Payments page, answer No for both questions.

17. Sign into your account here and go to the Alexa tab.

18. Click the Get Started button under Alexa Skills Kit.

19. Click Add a New Skill.

19. Set the Skill Type to Custom Interaction Model, select the correct language (US, UK, and German options available), name the Name and Invocation Name field “google“, and hit Next.

20. Copy and paste the code below into the Intent Schema box:

{ “intents”: [ { “intent”: “SearchIntent”, “slots”: [ { “name”: “search”, “type”: “SEARCH” } ] }, { “intent”: “AMAZON.StopIntent” } ] }

22. Enter SEARCH as the Enter Type and copy and paste the following text into the Enter Values box:

23. Now copy and paste the following code to the Sample Utterances box:

24. Press Next.

25. Select AWS Lambda ARN (Amazon Resource Name) for the Service Endpoint Type, select your geographical region, and paste your ARN code (from step 17) into the field.

27. Select No for the Account Linking question and hit Next.

28. Select AWS Lambda ARN (Amazon Resource Name) for the Service Endpoint Type, select your geographical region, and paste your ARN code (from step 17) into the field.

29. You will now be in the Test stage. You’re done!

30. In Enter Utterence type in the question you want to ask Google using Alexa and in Lambda Response it will return the result of your question.

31. This is the screenshot of all the custom skills including the Google skill which is defined in the use case

32. Output of the custom skill created in the text format and it can be also listened by clicking on the Listen

33. Reverb connects to Amazon Echo Services and works on macOS, in your browser or on your tablet or phone.

34. Install Amazon Alexa App on your phone and login in it using the same id used in signing up for Amazon Alexa Developer Console.

35. After installing it now download Reverb App on your phone and sign in with the same id used in the previous step.

36. In Setting , of Reverb App choose the language in which you created your custom skill. For example in our case it’s UK.

37. Go into Amazon Alexa App à Your Skills à Google(in our use case) and then Enable Skill so that it can be called through voice using Reverb App.

38. Open Reverb App and hold the microphone button on it and say “Ask Google,<Your Question>” and wait for the response.

--

--

ABHISHEK KUMAR

DevOps/Cloud | 2x AWS Certified | 1x Terraform Certified | 1x CKAD Certified | Gitlab