Skip to content

Latest commit

History

History
executable file
·
144 lines (103 loc) · 6.06 KB

README.md

File metadata and controls

executable file
·
144 lines (103 loc) · 6.06 KB

Alexa Skill Note Taker

AnAWS Lambdafunction of an Alexa skill for taking notes. It saves your notes in DynamoDB, so your notes can be read out or deleted later. The Alexa responses used Speech Synthesis Markup Language (SSML) for richer audio effect.

This Alexa skill is now live. You can enable ithereorhere.

However, to get it to work with yourMagic MirrorModule -Note Taker,you have to use your own DynamoDB, so you still have to create your own Lambda function & Alexa skill by following the instructionsbelow.

One-shot Examples

User: "Alexa, ask Note Taker to take my note lunch with Linda at Maru tomorrow"
Alexa: "Dun dun dun. I have taken a new note. Your third note is lunch with Linda at Maru tomorrow"
User: "Alexa, ask Note Taker to read my notes"
Alexa: "As you wish. You have the following notes:......"
User: "Alexa, ask Note Taker to read note number three"
Alexa: "Aha! Your third note is lunch with Linda at Maru tomorrow"
User: "Alexa, ask Note Taker to delete note number three"
Alexa: "Good riddance. Your third note, lunch with Linda at Maru tomorrow is deleted"
User: "Alexa, ask Note Taker to delete my notes"
Alexa: "Yay! All of your notes are deleted."

List of commands

Say Hello

  • hello
  • hi
  • how are you

Take Note

  • take my note {asymmetric cryptography uses public and private keys to encrypt and decrypt data}
  • take a note {dinner with Linda at six tomorrow at Hao}
  • take note {interactive orange juice}

Read all notes

  • read all my notes
  • read all notes
  • read my notes
  • read notes

Read a note

Note: readIndex has to be a cardinal number, not an ordinal number

  • read my note number {readIndex}
  • read note number {readIndex}
  • read number {readIndex}
  • read note {readIndex}
  • what's my note number {readIndex}
  • what's note number {readIndex}

Delete all notes

  • delete all my notes
  • delete all notes
  • delete my notes
  • delete all

Delete a note

Note: deleteIndex has to be a cardinal number, not an ordinal number

  • delete note number {deleteIndex}
  • delete my note number {deleteIndex}
  • delete number {deleteIndex}
  • delete note {deleteIndex}

Get Alexa User ID

Note: This is only for the use of theMagic Mirror Module Note Taker.Your user ID will be displayed on your Alexa companion mobile app or on theAlexa website

  • what's my database user ID
  • what's my user ID
  • what's my user identifier
  • what's my identifier
  • my user ID
  • my identifier

Dependencies

On your terminal, navigate to the src folder, and enternpm installto install dependencies.

Setup

To run this skill you need to do two things:

  1. deploy the code in Lambda
  2. configure the Alexa skill to use Lambda

AWS Lambda Setup

  1. Go to the AWS Console and click on theLambdalink. Note: ensure you are inus-eastor you won't be able to use Alexa with Lambda.
  2. Click on theCreate a Lambda FunctionorGet Started Nowbutton.
  3. ChooseBlank Blueprint
  4. Choose triggerAlexa Skills Kit,click "Next"
  5. Name the Lambda Function, select the runtime asNode.js
  6. Go to your localsrcdirectory, select all files and then create a zip file, make sure the zip file does not contain the src directory itself, otherwise Lambda function will not work.
  7. Go back to the AWS Lambda console, selectCode entry typeas "Upload a.ZIP file" and then upload the.zip file to the Lambda
  8. Keep the Handler as index.handler (this refers to the main js file in the zip)
  9. Create a new role for full access of DynamoDB:
    1. Go to theIAMservice from the AWS Console
    2. Click on Roles, thenCreate New Role
    3. Call this Rolelambda-dynamo-full-access-role
    4. SelectAWS Lambdaas the Role Type
    5. Select policiesAmazonDynamoDBFullAccessandCloudWatchFullAccess(for debug)
    6. ClickNext,thenCreate Role
  10. Go back to the Lambda console,Choose an existing role
  11. Chooselambda-dynamo-full-access-role
  12. Leave the Advanced settings as the defaults
  13. Click "Next" and review the settings then click "Create Function"
  14. Copy theARNfrom the top right to be used later in the Alexa Skill Setup

Alexa Skill Setup

  1. Go to theAlexa Consoleand clickAdd a New Skill.
  2. Set "Mirror Mirror On The Wall" as the skill name and "on the wall" as the invocation name, this is what is used to activate your skill. For example you would say: "Alexa, on the wall, say hello". If you customized the wake word as "Mirror mirror", you can say "Mirror mirror on the wall, find Snow White".
  3. Select theLambda ARNfor the skill Endpoint and paste the ARN copied from above. Click Next.
  4. Copy theIntent Schemafrom the included IntentSchema.json in the speechAssets folder.
  5. Copy theSample Utterancesfrom the included SampleUtterances.txt. Click Next.
  6. Go back to the skill Information tab and copy the appId. Paste the appId into the index.js file for the variableAPP_ID,then update the Lambda source zip file with this change andupload to Lambdaagain, this step makes sure the Lambda function only serves request from authorized source.
  7. You are now able to start testing your Alexa skill! You should be able to go to theEcho webpageand see your skill enabled.
  8. In order to test it, try to say some of the Sample Utterances from theList of commandssection above.