Hi, I am working to develop an application for Alexa in Java. I'm developing a skill where the user tells alexa a number (a weight in grams), she manipulates the number to give it in cups, and then she returns the gram and cup measurements. I have coded the input as AMAZON.NUMBER and am then using parseInt to extract the integer, which I am manipulating and returning. I was having a lot of problems getting parseInt to return something that wasn't NaN. Yesterday, I changed the code a little bit and it worked, and I got back the correct number and answers. I saved the code, tested it on my amazon echo later, and it still worked. About an hour after that, I tested it on my echo again and got a NaN error. I tried a few more times and still got NaN. I checked my Alexa app to make sure I was saying the exact same phrase, and I was. I went back to test on the developer site and I was getting the error there as well-- even though I hadn't been getting it a few hours prior. There was no change in the code in the meantime. Please advise me on what to do. You can view my code here
https://github.com/hsw28/alexa/tree/master/metriccooking but I think it may be the result of a problem external to me since the ouput changed with no change in the code or the inquiry. Thanks, Hannah Message was edited by: Hsw
I am. My day job is in Cambridge, just opposite the Galleria. I started looking at Echo stuff last summer. Since then I've written a book, lots of blog entries, more forum entries than is healthy, and have four skills published, and four more in certification hell. If you filter your skill list by "TsaTsaTzu" you should see them. Starlands and TweetPoll are the more serious ones. Knock Knock and Demotivate Me are trivial "fortune cookie" type skills.
I'm going to ask around today and see if the auditoriums in my work place can be used for external meetings sponsored by employees. Then, maybe, we can do a Boston thing.
No problem! I note from your profile you are at MIT. You should consider joining the Boston Meet Up group for Alexa developers. It's been dead for a while but looks like it is starting up again. (
http://www.meetup.com/Boston-Amazon-Echo-Developer-Meetup) There should be enough of us in the area to have a reasonable and productive get-together.
This came up in another thread recently. You need to check what value is being passed back in the slot. Alexa may still call your intent even if it does not recognize all the values for all the slots. In the other person's case it was returning "?" in the slot value, which would throw an exception for parseInt().
Alexa isn't perfect at voice recognition. It's going to get it right some times, and wrong other times. This would also explain the indeterminacy of the error.
I'd put a try-catch around the code and if it fails to parse, return something like "I didn't understand that. Please try again."