Alexa WorkShop – High low Sample Project @ Bangalore

Yesterday(June 16th, 2018) I got an opportunity to Participate in the Alexa introduction workshop organized by Amazon.

Here I’m sharing my experience and Short tour to quickly set up the sample Alexa project(high low game).

  • Setup your amazon developer access Amazon Developer Account & AWS Account  Complete the verification steps for enabling an Amazon verified account, including payment details, profile info, and phone verification as applicable.
  • InSide AWS Account you have to create one developer user.  you have to use the created developer account for the subsequent login.

Sample Project – High Low Scanner

Here I’m walking you through step by step creating the High-Low Scanner Application in Alexa(Mini Project)

Step1: Login to Alexa then click on Your Alexa Console –> Skills

ax_1.jpg

Step2: Create new skill, click on create new skill and name it as high low scanner first app and change the default language to English(IN), then click on Next Button

ax_2

ax_3.jpg

Step3: Select Custom and click on Create Skill Button , Because we are going to use node js custom development.ax_4.jpg

Step4: the next screen is the Alexa developer console screen, here you can build, simulate test

ax_5.jpg

Step5:  login to AWS Account  by using your developer account. Then select the default region to  US East (N. Virginia)

ax_6ax_7

Step6: Click on Services –> Lambda , then click on Create Function

ax_8-e1529248966656.jpgax_9.jpg

Step7: Click on ServerLess Application Repository. then type facts and then press enter then click on alexa-skills-kit-nodejs-factskill

ax_10

note: alexa-skills-kit-nodejs-factskill is the sample template created by Amazon developer team,  by default it’s installed node.js. It helps to create the new node.js project easily. otherwise, if you are starting with the blank template,, you need to take care of installing node.js and other default configurations

Step8: in the next page, scroll down and enter the application name as Alexa-HighLow-Game then click on Deploy.

ax_11

Step9: once deployed you can able to see the three Green Checkmarks , then click on alexaskillskitnodejsfactskill then you can able to see

ax_12.jpg

Next Page Configuration and Monitoring Screen.

ax_13.jpg

Configuration and Monitoring Screen.: scroll down –> Function Code

ax_14.jpg

Index.js

Click on Index.js –> it holds the source code for sample project. till the previous step we did the basic setup for the Alexa app.

Now its time to Attach the sourcecode of High low game to our created project.

Open the following URL :

highlow

Then Open lamba/custom and then copy the entire content from index.js

attaching the index.js here

ax_15

Copy the entire content and go back to Function Code and then replace the index.js content and then click on Save

ax_16.jpg

Step10: Go back to Alexa Console , then open high-low scanner app , then click on JSON Editor

ax_21.jpg

then go to the following github url and copy the raw value.

https://github.com/alexa/skill-sample-nodejs-highlowgame/blob/master/models/en-GB.json

then come back to the JSONEditor and paste the data, then Click on Save Model , then click on Build Model.

ax_22.jpg

to verify the build, check the below intents & Slot types are created.

ax_23.jpg

Step10: its time to update EndPoints. Go to the lambda Console and copy the arn Urlax_24.jpg

Come back to the Alexa Console and then click on EndPoints and then select AWS Lambda ARN,  then paste the copied ARN Url , and then Save End Points

ax_25.jpg

 

Step10: In our sample project, we are using Session storage and during the session end event we are capturing the session data inside the table, Amazon has dynamodb its basically NoSql Db, for first 25 gb lines is free in our  free account.

So i’m giving the read-write access for my Lamba

  • open https://console.aws.amazon.com, then click on services and then Type IAM and click
  • roles and then click on the role name assigned to your project.
    • you can check the role name in the lamba console and then check the execution role –> existing role
    • find the same role name in the list from the IAM–> Roles
  • click on Attach Policy, then type dynamodb, select –> AmazonDynamoDBFullAccess then click on Attach Policyax_17ax_18ax_19.jpg
  • To verify the access go back to your lambda console ,Then you can see the lot of apps added to the Lamba section.

ax_20.jpg

Its Show Time :

giphy

game Rule: Alexa will store the random number and save it in session, we have to guess the number by telling, alexa will validate the request and provide the response.

  • Open Alexa Console, select the High low game and then click on Test Tab and then enable the test

ax_26.jpg

  • Type high low game then you can able to see the result as like below

ax_27.jpg

  • Then Typed Yes and then started playing the game by providing the different types of inputs, see the screenshot below. then ended the game. i started from fifty to 1, My bad the number is 1 😦

ax_28

in the next post, I will explain the below code details, these are the key coding used in the high-low game

  • Session Storage – Set and retrieval
  • Database Table Creation
  • Table Data –  Set and retrieval

Thanks for reading, Happy coding. !!!!!!!!!!!!!!!!!!!

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑