Reader small image

You're reading from  Hands-On Chatbot Development with Alexa Skills and Amazon Lex

Product typeBook
Published inSep 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781788993487
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Sam Williams
Sam Williams
author image
Sam Williams

Sam Williams qualified with an aerospace engineering master's degree, then became a self-taught software developer while holding down his first job. While traveling, he started to write articles about the tech he was learning about and accrued an audience of readers on Medium and freeCodeCamp.Currently, Sam works as a lead chatbot developer for the SmartAgent team at MissionLabs, building custom systems for large retailers. His role ensures that he is working with the newest chatbot technologies and is constantly pushing their capabilities.
Read more about Sam Williams

Right arrow

Creating a Lambda to handle the request

To handle the intents inside our new Alexa Skill, we need to create a Lambda function. This will contain all of the logic we need to understand the intent and send a reply to the user.

To create a Lambda, we can use any of the methods described in Chapter 2, Getting Started with AWS and Amazon CLI, but we're going to be using our local development setup. Navigate to your base Lambda folder and create a new folder called hello-alexa-skill. Inside that folder, we need to create a new index.js file and open it to create our function.

To start, we need to require in the alexa-sdk, which makes creating the logic for Alexa a lot easier:

const Alexa = require('alexa-sdk');

Because we are requiring it, we also need to make sure that we have it installed. In the command-line interface, navigate into your hello-alexa-skill folder and...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Chatbot Development with Alexa Skills and Amazon Lex
Published in: Sep 2018Publisher: PacktISBN-13: 9781788993487

Author (1)

author image
Sam Williams

Sam Williams qualified with an aerospace engineering master's degree, then became a self-taught software developer while holding down his first job. While traveling, he started to write articles about the tech he was learning about and accrued an audience of readers on Medium and freeCodeCamp.Currently, Sam works as a lead chatbot developer for the SmartAgent team at MissionLabs, building custom systems for large retailers. His role ensures that he is working with the newest chatbot technologies and is constantly pushing their capabilities.
Read more about Sam Williams