Giter VIP home page Giter VIP logo

nodejs-echoapi-sample's Introduction

###Here's a simple guide on how to create a Node.js app hosted in Azure that will handle your Amazon Echo's API calls.


You will want to buy an Amazon Echo if you haven't already.

Here's a quick example video of what I did in the OpenSmartHub

  1. You will want to download and install Node.js if you haven't already.

  2. Create an Azure account if you haven't already and create a new web app.

  3. Using FTP, Git, or whichever method you would like, get the code into the location for your new azure web app.

  4. Join the Amazon Developer program for the Echo and create a new Echo app. (Note: In order to use this while in development on your Echo, the account needs to be the same one that the Echo is linked to)

  5. In your App information tab: 0. Fill out your "App Name". This will act as your official app name. 0. Fill out your "Spoken Name". You will want this to be short and simple to say in order to give it the easiest time to recognize. 0. Give your "App Version" which will need to match the info you hand back through the API. 0. Give your "App Endpoint" which will be your Azure webapp's URL + the api endpoint. (Example: "https://echotest.azurewebsites.net/api/echo")

  6. In your Interaction Model: 0. Fill out your "Intent Schema". The intent is the name of the function, slots are parameters, and the type when "literal" will give you back the speech-to-text recognized word. More info on this here.

     ```
     {
         "intents": [
             {
                 "intent": "TurnOn",
                 "slots": [
                     {
                         "name": "Device",
                         "type": "LITERAL"
                     }
                 ]
             },
             {
                 "intent": "TurnOff",
                 "slots": [
                     {
                         "name": "Device",
                         "type": "LITERAL"
                     }
                 ]
             }
         ]
     }
     ```
    
    1. Fill out your "Spoken Utterances". They should be tab separated between the intent and the sample phrases. Something interesting to note is that they suggest that you provide a sample for every number of literal device phrases from min to max. (In my case from 1-3 words, thus the repetitions.) It also does not like it when you have multiple of the same literals anywhere in the file.. More info on this here.

      TurnOn    turn on {living room switch|Device}
      TurnOn    turn on {spark one|Device}
      TurnOn    turn on {example|Device}
      TurnOff    turn off {living room two|Device}
      TurnOff    turn off {spark two|Device}
      TurnOff    turn off {coffee|Device}
      
    2. After this, set your app to be ready for testing and you are on your way!

  7. Call Alexa with your Spoken Name by saying "Alexa, open {YourSpokenAppNameHere}"

  8. Now you can say the commands that you've designated in both your Nodejs web app and your Amazon app declarations for your response!

If you want to make it your own, you will need to modify the Node.js back-end to respond according to the requests that you allow while also altering your intent schema and spoken utterances.

nodejs-echoapi-sample's People

Contributors

anthony-ngu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.