question

Miles Milosevich avatar image
Miles Milosevich asked

Passing intent as a variable into lambda?

Hi, I am fairly new here. Is it possible to pass everything after the invocation as a variable/input into a lambda? e.g. "Alexa, tell to "? I have very little coding knowledge, so I am trying to eventually pass this phrase to Tasker or EventGhost by having the lambda send an autoremote link containing the prementioned variable in the message. I considered using IFTTT instead, but this didn't have the flexibility I need. Thanks for the help
alexa skills kitvoice-user interface
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
You need to read up on how Alexa skills work. There are intents (which are kind of like functions) and slots (which are kind of like arguments to functions). That's it. That's what you get. Alexa is [b]not[/b] a generic speech to text service. At no point will you ever get "what the user said". Their computation pipeline never resolves that. It goes straight from sound to Intent + Slots.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Miles Milosevich avatar image
Miles Milosevich answered
Thank you for your response. Please, then, help me understand how something similar was done here: https://forums.developer.amazon.com/forums/thread.jspa?messageID=23962嶚
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Remember I said that slots are like arguments to a function? Well an argument has a value. Slots have values which is what Alexa decided was the words that fall into that slot. This is generally determined by your utterance file. Alexa can make some calculated guesses, but it isn't always the best at that. In Matt's example, he has an utterance defined like this: TextIntent Send the message {Here's a short message|Message} You can activate the skill with this by saying, say, "Alexa, tell My Wonderful Skill to Send the message Here's a short message" What your skill will receive is Intent=TextItnent, Message=Here's a short message. You can try to activate the skill by saying "Alexa, tell My Wonderful Skill to Send the message buy low, sell high". If you are lucky you will get Intent=TextIntent, Message=buy low sell high. The further what you say deviates from the utterances you provide, the less likely Alexa is to match it.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Miles Milosevich avatar image
Miles Milosevich answered
edit: Referring to Monty617's reply in the above link ( https://github.com/monty617/AtoIFTTT)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Miles Milosevich avatar image
Miles Milosevich answered
Ah. Thank you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Monty is using a different approach. He's defined several utterances like this: [code] PerformAction {one | Action} PerformAction {one two | Action} PerformAction {one two three | Action} PerformAction {one two three four | Action} [/code] A number of people have tried this approach to just get generic Speech To Text out of Alexa and do all the parsing themselves. I've never seen more than limited success with it (from personal experience and testing/reviewing the skills that have been published using it). It relies entirely on Alexa's greatest weakness (generic STT) and ignores Alexa's greatest strength (pattern recognition). If you want to do a "hey, isn't this swell" demo, sure, go ahead. Write the skill, do twelve to fourteen takes to get the perfect recognition, and post it to YouTube. If you want to do a serious skill for widespread consumption, I do not recommend it.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.