Skip to content

jwang104-UCSC/UCSC-menu-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa Skill - Menu Reader

A simple AWS Lambda function that reads the menu of a dining hall from UCSC. NOTE: This readme was originally intended for the hello world example. It is no longer accurate after our modifications to the program, but should still provide useful information.

Concepts

This skill takes the hello world example and changes the response so that Alexa reads the text from a webpage instead.

Setup

To run this example skill you need to do two things. The first is to deploy the code in lambda, and the second is to configure the Alexa skill to use Lambda.

AWS Lambda Setup

  1. Go to the AWS Console and click on the Lambda link. Note: ensure you are in us-east or you wont be able to use Alexa with Lambda.
  2. Click on the Create Function button.
  3. Click Author from scratch.
  4. In Configure triggers, add Alexa Skill kit as trigger.
  5. Name the Lambda Function "Hello-World-Example-Skill".
  6. Select the runtime as Java 8.
  7. Build a jar file to upload it into the lambda function. There are two ways:
  • Using maven: go to the directory containing pom.xml, and run 'mvn assembly:assembly -DdescriptorId=jar-with-dependencies package'. This will generate a zip file named "helloworld-1.0-jar-with-dependencies.jar" in the target directory.
  • Using gradle: go to the directory containing build.gradle, and run 'gradle fatJar'. This will generate a zip file named "helloworld-fat-1.0.jar" in the build/libs directory.
  1. Select Code entry type as "Upload a .ZIP file" and then upload the jar file created in step 7 from the build directory to Lambda.
  2. Set the Handler as com.amazon.asksdk.helloworld.HelloWorldSpeechletRequestStreamHandler (this refers to the Lambda RequestStreamHandler file in the zip).
  3. Choose an existing role - lambda_basic_execution.
  4. Increase the Timeout to 30 seconds under Basic Settings.
  5. Leave the Advanced settings as the defaults.
  6. Click "Next" and review the settings then click "Create Function".
  7. Copy the ARN from the top right to be used later in the Alexa Skill Setup.

Alexa Skill Setup

  1. Go to the Alexa Console and click Add a New Skill.
  2. Set "HelloWorld" as the skill name and "greeter" as the invocation name, this is what is used to activate your skill. For example you would say: "Alexa, tell Greeter to say hello."
  3. Select the Lambda ARN for the skill Endpoint and paste the ARN copied from above. Click Next.
  4. Copy the contents of SpeechAssets.
    • If you are using the new Skill Builder, copy the Skill Builder from included SkillBuilder.json.
    • Otherwise, copy the Intent Schema from the included IntentSchema.json. Copy the Sample Utterances from the included SampleUtterances.txt. Click Next.
  5. Go back to the skill Information tab and copy the appId. Paste the appId into the HelloWorldSpeechletRequestStreamHandler.java file for the variable supportedApplicationIds, then update the lambda source zip file with this change and upload to lambda again, this step makes sure the lambda function only serves request from authorized source.
  6. You are now able to start testing your sample skill! You should be able to go to the Echo webpage and see your skill enabled.
  7. In order to test it, try to say some of the Sample Utterances from the Examples section below.
  8. Your skill is now saved and once you are finished testing you can continue to publish your skill.

Examples

One-shot model:

User: "Alexa, ask the dining hall what's on the menu."
Alexa: "Today's menu is ..."

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages