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

Appendix B

Debugging

Trying to figure out why your code isn't working can be a very frustrating process and there can be loads of different sources of the issues. Throughout this book, we have three main sources of problems: Lambdas, Alexa Skill setup, and Lex setup.

Debugging Alexa Skills

If your skill hasn't worked, then there are a few things that you need to check:

  • You're using the correct utterances
  • Your model has been saved and built
  • Your endpoint is set correctly
  • You've added Alexa as a trigger for your Lambda
  • Your Lambda is working properly

Check the utterances

If Alexa is replying with "Sorry, I don't know that one," make sure that you are saying or typing the correct phrase. It should be "Alexa, tell your skill invocation your intent utterance," so it might be, "Alexa, tell my skill hello" or "Alexa, ask car helper what car I should get." Check that you've correctly set your skill invocation and intent utterances...

Debugging Lex chatbots

As with Alexa skills, there are a few different places that can cause errors in your chatbot. Here are a few things you need to check:

  • You are using the correct utterances
  • Your intent has a text response or is triggering the correct Lambda
  • Your intent has been saved and the chatbot built and deployed
  • Your connected platform is properly configured (Facebook, Slack, API)
  • Your Lambdas are working

Check your utterances

If Lex is saying that it couldn't understand what you said, then it couldn't match your utterance to an intent. There are two ways this can happen: you don't have any sample utterances close enough to the utterance you used, or there are two sample utterances on different...

Debugging Lambdas

If you have found that the problem is not with your Alexa skill or Lex chatbot, there might be a problem with your Lambda. Before you start changing things in your code, it is often a good idea to create a test in the Lambda console. This should represent the request that is being sent by Alexa or Lex. Use this test to see whether it is your Lambda that is at fault or it works as expected.

If your test is unsuccessful, look in the logs for the error messages. This can often point you to the root of the problem.

Here are some things to check when trying to debug a Lambda:

  • Your Lambda has all of the required packages installed
  • Your permissions are correct
  • All of your variables are correctly defined
  • Your Lambda code is correct
  • Everything your Lambda calls is working
...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Chatbot Development with Alexa Skills and Amazon Lex
Published in: Sep 2018Publisher: PacktISBN-13: 9781788993487
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

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