Run corresponding AWS Lambda function to get weather Natural Language Processing Generate response phrase “There’s a 50 percent chance of rain in New York tomorrow.”
needing a server running • Alexa commands are serverless AWS Lambda functions • Most Lambda functions are written in Node.js or Python • I prefer Python
to Alexa • Intent - The thing that happens (the function that runs) when Alexa hears an utterance • Slot (optional) - Variables/parameters for your intent
send to my intent? • Gronsky’s skill currently has no slots • If I was storing every month’s pancake into a database, I could ask for a specific month’s pancake Slots
open an Alexa skill, it sends a bunch of data in an “input” dictionary called event • Your Lambda function is taking that “input” dictionary, doing a bunch of stuff, and then sending back a dictionary with the response
the Lambda function starts if event[‘request’][‘type’] == ‘LaunchRequest’: Run the on_launch() generic event if event[‘request’][‘type’] == ‘IntentRequest’: Run the on_intent() generic event Main Handler
trying to run, and then run the code for that intent def on_intent(): if intent_name == ‘PancakeOfTheMonth’: return get_pancake_of_the_month() Determining the Intent
supposed to do • Pass the result to build_response() to actually make the response that Alexa will say • For Gronsky’s, I scrape their website for the pancake of the month Running the Intent
of the intent • You can also customize a nice visual “card” to show on the Echo Show or Alexa app • “The pancake of the month for April is carrot cake. To hear more information about Gronsky’s, say ‘Tell me about Gronsky’s’. Otherwise, say ‘Stop’ to quit.” Building the Response
To add third-party libraries, include them in a .zip file along with your Lambda function and upload to Lambda • pip install requests -t /path/to/folder Adding additional libraries
series of unique and coveted skillsets • As we learn new technologies and experiment with new things, think about ways to apply them in our local communities How can you, as a technologist, make a difference in your community?
make a difference in your community? • You’ll have a chance to practice your skills while helping local business owners • It’ll make you feel great! • This is what HackHunterdon is all about!
business owner, connect with technologists in your community? • Perform community outreach, engage with programs like HackHunterdon, and stay involved! • Your neighbors want to help you! • How can you incentivize them to do so?