I'm quite a beginner to Alexa skill set. Trying to add a node.js skill to Alexa following few nuggets from the internet. I have created skill on amazon developer console and trying to create aws lambda function on aws console. Surprisingly, when I tried creating a lambda function, I could not find any blueprint matching to "Alexa" keyword.
Here are the steps -:
1.Got to aws.amazon.com and log in
2. Search for the Lambda service and go to it
3. Click on Create a function
4. Click on Blueprints
5. Search for “Alexa”
I did some research and it says, changing to North. Virginia region could help but no luck so far.
Any such leads would be really appreciated.
if you are unable to find "alexa-skills-kit-nodejs-factskill" under the section "Use a blueprint",
please look for it under the section "Browse serverless app repository",it doesnt matters whatever the location you choose.
Use cloudformation application templates instead. Though they are still outdated (like the blueprints out there). My advice is that you create an Alexa Hosted Skill instead
Related
I've written my first Azure Function and I've published it to azure. It said that the publish was successful and it created a new function app, but it's an empty one. I've done a bit of research into why my function wouldn't show up and I've seen that you might need to change the path to the zip deploy but I can't find where I need to change this and into what. Other solutions are always welcome! (I've published it directly from VS2017)
When I send a Postman Request to the url/api/function, it also doesn't work. It doesn't crash or anything, it just gives back nothing after a second.
I need this to work to create a custom connector for Power Automate that way I can use it in my Microsoft Flow.
So I am learning how to create alexa skills and I have create two sucessfully following the steps below but for some reason when I follow these steps now I am missing the node_modules folder and the package.json. This is causing the following error when I test my skill:
Unable to import module 'index': Error
The steps I am following are:
- go to the aws console select lambda
- select create new function
- blueprints -> select alexa-skill-kit-sdk-factskill -> configure
- select existing role -> lambda_basic_execution
- create function
It was my understanding that the alexa-skill-kit-sdk-factskill came with these dependencies. Is there a way to add them in manually if so how? I have tried to find a console but I don't see where that is in the lambda workspace.
Here is a screen shots of the project where it did add the folder and json file
Here is on of my current project
I have had this problem, but unfortunately, Lambda console doesn't give us console to install nodejs dependencies.
So, you have to actually deploy your lambda function. There are many ways to do that, but more popular are:
Node Lambda package (for node)
Create ZIP and deploy it in console (Not recommended because of size limitation)
AWS CLI
As you're learning the Alexa Skills, I would suggest you the way Amazon suggests devs to create and organise Alexa Skill and Lambda function.
Use ASK CLI
For creating new Alexa Skill.
This will create a directory, which will have:
Skill's intent Schema
Skill's lambda function
Plus, you can pass a template to create skill for a specific template. Here is list of templates created by Amazon devs.
For eg, command for creating Skill code, for a fact-template skill
ask new [--template [template-name] [--url <url>]]
[-n|--skill-name <name>]
[-p| --profile <profile>] [--lambda-name <lambda-name>]
Using ASK CLI, will give you the advantage of deploying your skill and lambda simultaneously.
I know ASK CLI is a lot to take in so quickly, but once you get the hang of it, it is a very useful tool for Alexa developers.
You can zip the whole directory content locally and upload the zip to
lambda. But yeah you can't edit the code in the console then.
Remember that your handler file name must be mentioned as it is in Handler section.
Like if your file name is app.js then app.handler.
Please direct me the right way. I'm stuck with some documentation issue. Going to code a small service with Google HOME for everyone to add a new phrase and make a POST request or answer with specific "TEXT" (like IFTTT run with WEBHOOKS) (fe: "Hey Google switch my kitchen light" -> service will send POST request to my own HTTP server). I know that IFTTT works but - I would to code the target service for tiny cases with fast response.
I tried to understand all Google Assistant layers - but still no luck and didn't find the clear path.
What I learned are:
1. connect to Google Account using OAuth 2
2. .... save the phrase and action for that in my DB - it's ok and simple way
3. ...??? how to send and to where? in (json?) a specific format
4. receive the answer from google home to understand the right case and make my action.... (for example: turn on\off the kitchen light)
It should be not so hard as I can image.... anyway Please help :).
Appreciate your time and answers and have a nice day!
To learn about extending the Google Assistant, you should look into the documentation for Actions on Google: https://developers.google.com/actions/extending-the-assistant
Although it also seems like you want to use it for Smart Home: https://developers.google.com/actions/smarthome/
You can run the Smart Home sample if you want to see how it works: https://github.com/actions-on-google/actionssdk-smart-home-nodejs
I've recently updated my serverless project, and I've found that many things have changed in the last few updates.
https://serverless.com/
I don't fully understand whats the correct way to have multiple lambda functions and api gateway endpoints related to the same project. With the old serverless I have every lambda and endpoint as a completely seperate function, this worked pretty well for me.
I can't seem to do this anymore, if I try my second lambda function overrides my first, presumably because my "service name" for both is the same. My service name is the same because I want both rest endpoints in the same API in API Gateway. Since serverless creates the API name based on the service name.
So then I tried to add both functions to the same "Service". this worked for the most part, except that now I need to include my custom role statement for all my functions into the same role (because this one role is now being linked to all my functions). Effectively giving more permissions to each individual function than it should have. The other issue is that all my handler files for the different functions are being put into each functions deployment bundle.
So basically, I'm not sure what is the correct approach to have multiple functions that relate to the same project but are separate in functionality. It used to make sense, now doesn't.
If anybody can give me some pointers please
Thanks
I understand your frustration. I had the same feeling until I looked deeper into the new version and formed a better understanding. One thing to note though, is the new version is not completely finished yet. So if something is completely missing, you can file an issue and have it prioritized before 1.0 is out.
You are supposed to define multiple functions under the same service under the functions: section of serverless.yml. To package these functions individually (exclude code for other functions) you will have to set individually: true under package: section. You can then use include and exclude options at the root level and at the function level as well. There's an upcoming change that will let you use glob syntax in your include and exclude options (example **/*-fn.js). You can find more about packaging here https://www.serverless.com/framework/docs/providers/aws/guide/deploying.
Not sure how to use different roles for different functions under the same service.. How did you do it with 0.5?
I was trying to find a solution for individual iam roles per function as well. I couldn't find a way to do it, but while I was looking through the documentation I found the line: "Support for separate IAM Roles per function is coming soon." on this page, so at least we know they are working on it.
The "IAM Roles Per Function" plugin for Serverless allows you to do exactly what it says on the tin: specify roles for each function. You can still use the provider-level roles as well:
By default, function level iamRoleStatements override the provider level definition. It is also possible to inherit the provider level definition by specifying the option iamRoleStatementsInherit: true
EDIT: You can also apply a predefined AWS role at both the provider and function level.
I was doing one of the tutorials (HelloWorld) to make a skill for the Echo and I followed the directions. When I tested the skill using the Service Simulator, I typed in
Alexa, tell Greeter to say hello
and that returned the following JSON response:
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Hello World!"
},
"card": {
"content": "Hello World!",
"title": "Greeter",
"type": "Simple"
},
"shouldEndSession": true
},
"sessionAttributes": {}
}
I think that is the correct output. However, when I tried testing the skill on my Echo, Alexa replies "Sorry, I didn't your question." I went on the history and Alexa interpreted my command as "alexa tell greeter to say hello." It seems that Alexa is not recognizing the skill?
I am using Amazon Lambda to execute the code, so I checked the logs and the code was not executed when I spoke the command to above.
I replaced the app_id in the javascript file to the one that corresponds to my skill. I have also put the amazon skills kit as a trigger.
I also tried the other tutorials (ChemistryFlashCards and HistoryBuff), and Alexa replies "I'm not sure what you meant by that."
Not sure what is happening! Any guidance is appreciated!!
For your Echo / Dot / Tap device to correctly invoke your custom skill, the Language of your Interaction Model needs to match the region your lambda resource is deployed in. I had this issue, as I deployed lambda in EU-West1 (Ireland) but the default alnguage for the Interaction model is English (US). In the interaction model I added a new language of English (UK) and copied over my intents and utterances, then deleted the English US language, and my Echo Dot now correctly invoked my custom skill intents
Your device language and the language you are using in developer account for creating custom skills should be same. If your device is registered in English India then you have to add English india language in your custom skill.
Check language on your alexa app settings -> Your Echo device -> Language
Have you enabled testing with your device for your skill?
Once you have this enabled, you can check if it is properly associated with your device by going to the Skills section of the Alexa app and hitting "Your Skills" to see the list of skills that your Echo recognizes. You should see your skill with a little green dev tag on it.
I was developing in default en-US language with North Virginia region (for Lambda function) but was based in India. I even tried using US address in Alexa app, but it didn't worked.
At the end I added all the english languages(en-IN, en-CA, en-GB, en-EU) and copied the model JSON file which was created for en-US. Build each one of them separately and fill the Description -> Skill Preview details for each of them. This worked.
Most of the time, you cannot open your skill because it is not the same language as your current language you set for your Amazon echo device. Then if that doesn't work, you might have not enabled testing for your skill.
Also if you want to quickly enable your skill if you haven't done so, say Alexa(or whatever your wake word is), enable
I use the 5 point check list below and it always works:
1. Under Alexa Language Settings, add all the languages like English-US and English-IN that your Echo devices are likely to be configured with.
2. Freshly build the interaction model and deploy again.
3. Tell Alexa to ignore the Alexa-hosted skill: Instead of its auto-generated lambda code, it should use the external custom lambda that you created.
4. Ensure that the service end point is correct: Under the AWS Lambda ARN, enter your custom lambda ARN for each and every region you will be invoking the skill.
5. In the Alexa simulator, select all the languages one by one in the drop down and test them individually.
One problem related to Language settings.
Correct the language settings in your Echo Device using https://alexa.amazon.in/ or alexa app. Make sure language enabled in skill and device are equal. For example, use English India.
Reenable the skill
Go to https://alexa.amazon.in/. Make sure device appears online. Disable the skill in Your Skill section. Enable it again.
This should solve the problem.