Trigger Alexa Skill From AWS Lambda

寵の児 提交于 2019-12-11 15:59:26

问题


I have gone through some of the documentation of AWS Lambda, I see we can attach a trigger(Alexa Skill Kit) to lambda function and lambda function will be triggered once the skill gets invoked. (Someone Calls Alexa and Lambda gets triggered)

But i want vice-versa of this, like I should be able to invoke a skill set from AWS Lambda function, like i write a AWS lambda function and should be able to make a call to invoke that Alexa skill which i have published. (Lambda gets triggered from my Application and that invokes a Skill Set).


回答1:


Technically you can not invoke a 'Alexa Skill' from anywhere but from an Alex device. i.e. you can not cause your skill to start sending voice prompts to customers. The Alexa flow is always the other way around : customer asks something to Alexa, your skill is invoked and Alexa delivers the voice response to customer.

You can send Alexa notifications to customers that authorized it. For example your skill can inform an order is ready or being delivered without being triggered by a customer question. See Alexa Proactive Events API documentation to check how to implement this : https://developer.amazon.com/blogs/alexa/post/7822f3ee-1735-4eaa-9aa6-5b8e39953c07/proactiveeventsapi-launch-announcement

That being said, as your Alexa skill is implemented by an AWS Lambda function, you can write code to invoke that function outside of the Alexa context. This would allow another app to invoke the same code as your Alexa Skill, but you won't be able to send a voice message by to your customers by doing so, as the invocation will be out of any Alexa session.

To trigger a Lambda function, you have multiple options. You can use the Invoke API programmatically or through the AWS command line. You can also expose your Lambda function through an API Gateway (REST) or AppSync (GraphQL)



来源:https://stackoverflow.com/questions/56785023/trigger-alexa-skill-from-aws-lambda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!