亚马逊echo中国使用

by Lorrie Pearson

洛里·皮尔森(Lorrie Pearson)

我如何编程我的第一个Amazon Alexa技能并赢得了免费的Echo Dot (How I programmed my first Amazon Alexa Skill and won a free Echo Dot)

It’s been a year since I began learning to code. I became interested in coding because of my desire to work with others in the beauty, fashion and luxury lifestyle world. I wanted to create amazing websites with animated elements and other digital media.

自从我开始学习编码已经一年了。 由于对与美丽,时尚和奢侈生活方式世界中的其他人一起工作的渴望,我对编码产生了兴趣。 我想用动画元素和其他数字媒体创建出色的网站。

I started with an online course and a month later, I discovered freeCodeCamp. That’s when learning to code became more exciting and insightful.

我从一个在线课程开始,一个月后,我发现了freeCodeCamp。 那时,学习编码变得更加令人兴奋和深刻。

There is real-time communication with fellow coders ready to help you work through interactive challenges. They provide feedback and references for further learning. This helped my confidence grow and coding skills improve.

可以与其他编码人员进行实时通信,以帮助您应对交互式挑战。 他们提供反馈和参考,以供进一步学习。 这帮助我增强了信心,提高了编码技能。

In early June, a friend told me about an online webinar titled “Build Voice Enabled Experiences with Amazon Alexa.” The idea of the webinar increased my curiosity because at the time, I had only seen commercials, but had not used an Alexa enabled product. I signed up and was fascinated.

6月初,一个朋友告诉我一个在线研讨会,名为“使用Amazon Alexa构建启用语音的体验”。 网络研讨会的想法增加了我的好奇心,因为当时我只看过广告,但没有使用支持Alexa的产品。 我签约后着迷。

At the end of the webinar attendees received information about a promotion. If within 30 days you created a Skill and got it published, you were eligible to win a free Echo Dot. I didn’t know if I had enough knowledge to succeed, but I decided to give it a try to learn.

网络研讨会结束时,与会者收到了有关促销的信息。 如果您在30天内创建了一项技能并将其发布,则有资格赢得免费的Echo Dot。 我不知道我是否有足够的知识来成功,但是我决定尝试学习。

The thought of creating my first app was exciting. At that moment, my Alexa learning experience began.

创建我的第一个应用程序的想法令人兴奋。 那时,我的Alexa学习经历开始了。

什么是Alexa,它如何运作? (What is Alexa and how does it work?)

Alexa is a cloud-based voice service that powers millions of voice experiences in the home. Devices Alexa powers includes Amazon Echo, Echo Dot, Amazon Tap and Amazon Fire TV.

Alexa是基于云的语音服务,可为数百万个家庭语音体验提供支持。 Alexa的功能包括Amazon Echo,Echo Dot,Amazon Tap和Amazon Fire TV。

A Skill is a voice-driven application for Alexa.

技能是Alexa的语音驱动应用程序。

Alexa provides “Skills”, which allows users to interact with the devices. Skills can be created to do many things. They can answer questions, play trivia games, play music, set an alarms, tell jokes and more.

Alexa提供了“技能”,使用户可以与设备进行交互。 可以创造技能去做很多事情。 他们可以回答问题,玩琐事游戏,播放音乐,设置闹钟,讲笑话等等。

The Alexa Skills Kit (ASK) is a collection of tools, API’s, documentation, code samples and templates with links to GitHub. The ASK helps developers create Skills for Alexa enabled devices.

Alexa Skills Kit(ASK)是工具,API,文档,代码示例和模板的集合,并带有指向GitHub的链接。 ASK帮助开发人员为支持Alexa的设备创建技能。

An Alexa Skill has two main components: a Skill Service and a Skill Interface.

Alexa技能具有两个主要组件:技能服务和技能界面。

Your code is written in Node.js for the Skill Service which lives in the Cloud (Amazon AWS, Lambda, an HTTPS service). It receives instructions to determine the actions to take in response to the user requests from the Alexa enabled device.

您的代码是使用Node.js编写的,用于Cloud中的技能服务( Amazon AWS,Lambda和HTTPS服务)。 它从启用了Alexa的设备接收指令,以确定响应用户请求采取的措施。

The Skill Service implements event handlers that define how the Skill will behave. The event is triggered when the user speaks into an Alexa enabled device.

技能服务实现事件处理程序,这些事件处理程序定义技能的行为方式。 当用户对启用了Alexa的设备讲话时会触发该事件。

Then you configure the Skill Interface with the Skill Developer Portal. The interface processes the users’ words to trigger the events that the Skill Service handles. In this area you determine what to call your Skill so the user can invoke it by name. This also is where you define the Skill interaction model. This is so it knows how to listen to users’ spoken words and respond with the information intended.

然后,您可以使用Skill Developer Portal配置Skill Interface。 该界面处理用户的单词以触发技能服务处理的事件。 在此区域中,您可以确定调用技能的方式,以便用户可以按名称调用它。 这也是定义技能交互模型的地方。 这样一来,它便知道如何听用户说的话并以所需的信息进行响应。

It’s the interaction of the two components that make the Skill work.

正是两个组件的相互作用才使这项技能发挥作用。

The Amazon Team provided links to three Skill Templates. These templates are great to help you get started and to learn how Alexa interacts and responds.

亚马逊团队提供了指向三个技能模板的链接。 这些模板非常有助于您入门并了解Alexa如何进行交互和响应。

  • Fact Skill template

    事实技能模板

    to create something like a “fact” or “joke” of the day.

    创造类似一天的“事实”或“笑话”之类的东西。

  • Decision Tree template

    决策树模板

    to create simple adventure games and quizzes

    创建简单的冒险游戏和测验

  • How To template

    如何模板

    to create skills like recipes content with similar step by step processes.

    通过类似的逐步过程来创建食谱内容之类的技能。

Plus many more intermediate and advanced templates available .

加上更多可用的中级和高级模板。

I now have three published skills, Makeup Facts, Fashion Facts and Girls Can Code . I work as a freelance makeup artist and fashion stylist and decided to start with what I know best.

我现在拥有三个已发布的技能: 化妆事实 , 时尚事实和女孩可以编码 。 我是一名自由化妆师和时尚设计师,因此决定从我最了解的地方开始。

To create these “Fact Skills” I reviewed the topic and information on creating a Skill. Then I created my list of facts that would be integrated into the Fact Skill Template. All Skills were accepted and published within a couple of days.

为了创建这些“基本技能”,我回顾了有关创建技能的主题和信息。 然后,我创建了事实列表,这些事实将被整合到事实技能模板中。 几天之内就接受并发布了所有技能。

我如何创建我的第一个技能 (How I created my first Skill)

Go to Amazon Developer Portal sign in, click Alexa at top of the screen.

转到Amazon Developer Portal登录,单击屏幕顶部的Alexa。

On the Alexa page, choose the “Get Started” for the Alexa Skills Kit.

在Alexa页面上,为Alexa技能套件选择“入门”。

On the next page..select “Add New Skill.”

在下一页上。选择“添加新技能”。

Then fill out the Information page.

然后填写信息页面。

Skill Type: Custom

技能类型: 自定义

Language: English

语言: 英语

Name: Makeup Facts

名称: 化妆事实

Invocation Name: (what your user will need to say to start the Skill) Makeup Facts

调用名称:(您的用户将需要说些什么来启动此技能) 化妆事实

Click next to go to Interaction Model page. This is where you create intents or what users will ask Alexa to do. Then create utterances or possible ways the user will ask Alexa about the Skill you’ve created. I found this GitHub repository to be helpful. The Samples include: give me a fact, tell me a fact.

单击下一步转到“ 交互模型”页面。 这是您创建意图或用户将要求Alexa做什么的地方。 然后创建语音或用户可能会询问Alexa有关您创建的技能的可能方式。 我发现此GitHub存储库很有帮助。 样本包括:给我一个事实,告诉我一个事实。

My Intents in the Interactive Model for Makeup Facts

我在化妆事实 互动模型中的 意图

{ “intents”: [ { “intent”: “GetNewFactIntent” }, { “intent”: “AMAZON.HelpIntent” }, { “intent”: “AMAZON.StopIntent” }, { “intent”: “AMAZON.CancelIntent” } ] }

My Utterances in the Interactive Model for Makeup Facts.

我在互动模式 话语 化妆事实。

GetNewFactIntent a factGetNewFactIntent tell me a factGetNewFactIntent tell me a makeup factGetNewFactIntent give me a factGetNewFactIntent give me a makeup factGetNewFactIntent tell me triviaGetNewFactIntent give me triviaGetNewFactIntent give me some informationGetNewFactIntent tell me somethingGetNewFactIntent give me something

Now it’s time to set up Lambda. Go to https://aws.amazon.com/ and sign into the console. Then go to services-Lambda.

现在是时候设置Lambda了。 转到https://aws.amazon.com/并登录到控制台。 然后转到services-Lambda

On the top right of your page, make sure your AWS Region is N. Virginia.

在页面右上角,确保您的AWS区域N. Virginia

Then click the blue button to create a Lamda function.

然后单击蓝色按钮以创建Lamda函数。

Choose the blueprint that looks like this:

选择如下所示的蓝图:

Configure your trigger. Make sure you choose Alexa Skills Kit in the drop down menu.

配置触发器。 确保在下拉菜单中选择Alexa技能套件

Configure your function. Make sure your function name is written in camelBack. You can leave the description blank, but you are building this in Node.js.

配置您的功能。 确保您的函数名称写在camelBack中。 您可以将描述保留为空白,但是要在Node.js中进行构建。

Add your updated code.

添加您的更新代码。

There is an AlexaSkill.js file written with specific event handlers. It specifies output, prompt and speech. There is also an Index.js file that you customize to meet the needs of your Skill.

有一个用特定事件处理程序编写的AlexaSkill.js文件。 它指定输出,提示和语音。 您还可以自定义一个Index.js文件来满足您的技能需求。

Girls Can Code (index.js)
‘use strict’;var Alexa = require(‘alexa-sdk’);
var APP_ID = “amzn1.ask.skill.1f2c85a9-b1b6–49a8-b94d-8a795d545d98”;
var SKILL_NAME = “Girls Can Code”;var GET_FACT_MESSAGE = “Here’s your fact: “;var HELP_MESSAGE = “You can say tell me a code fact, or, you can say exit… What can I help you with?”;var HELP_REPROMPT = “What can I help you with?”;var STOP_MESSAGE = “Goodbye!”;
var data = [ “Coding is awesome.”, “You can create tools that will change the world.”, “Coding is creative.”, “Coding is like solving a puzzle.”, “Coding work can be done remotely”, “Learning code is empowering.”, “Technology and coding help create the future.”, “Girls who can code have the edge”, “Anyone can code. You’ll discover something new.”, “Coding promotes critical thinking”, “Women make great coders”, “Girls who code are role models for all women.”, “Girls who code know that technology is not just for boys.”, “Jobs in tech are in demand.”, “Coding is the language of the 21st century”, “Girls who code help close the gender gap.”, “Coding can be done anywhere, anytime”, “Working in tech can be a very lucrative career choice”, “Coding is not just about building robots and website, you learn to create things that don’t exist”, “A girl who codes could create the next new social media app”, “A girl with tech skills can change the ways businesses communicate”, “Girls who code love to learn.”];
exports.handler = function(event, context, callback) { var alexa = Alexa.handler(event, context); alexa.APP_ID = APP_ID; alexa.registerHandlers(handlers); alexa.execute();};
var handlers = { ‘LaunchRequest’: function () { this.emit(‘GetNewFactIntent’); }, ‘GetNewFactIntent’: function () { var factArr = data; var factIndex = Math.floor(Math.random() * factArr.length); var randomFact = factArr[factIndex]; var speechOutput = GET_FACT_MESSAGE + randomFact; this.emit(‘:tellWithCard’, speechOutput, SKILL_NAME, randomFact) }, ‘AMAZON.HelpIntent’: function () { var speechOutput = HELP_MESSAGE; var reprompt = HELP_REPROMPT; this.emit(‘:ask’, speechOutput, reprompt); }, ‘AMAZON.CancelIntent’: function () { this.emit(‘:tell’, STOP_MESSAGE); }, ‘AMAZON.StopIntent’: function () { this.emit(‘:tell’, STOP_MESSAGE); }};

Create a compressed file with the above two files and upload the zipfile into Lambda.

使用上述两个文件创建一个压缩文件,然后将zipfile上传到Lambda。

Skip the Advanced settings.

跳过高级设置。

Copy the ARN # in the top right hand corner of your screen.

将ARN#复制到屏幕的右上角。

Go back to the Amazon Developer page. Select your skill and click on the Configuration tab located in the left sidebar menu.

返回到Amazon Developer页面。 选择您的技能,然后单击左侧边栏菜单中的“ 配置”选项卡。

Select the AWS Lambda option. Check the North America box. Paste the arn# that you copied from your Lambda dashboard.

选择AWS Lambda选项。 选中北美框。 粘贴您从Lambda仪表板复制的arn#

Test your Skill. If necessary, update it so that it works properly. This GitHub Repository gives you the sample code for creating a Fact Skill. Check it, clone it and update it to write your own.

测试您的技能。 如有必要,请对其进行更新以使其正常运行。 该GitHub存储库为您提供了创建事实技能的示例代码。 检查它,克隆它并更新它以编写自己的。

You can test your code in the Developer Console, in the Lambda functions, on your Echo and at Echoism.io.

您可以在开发人员控制台,Lambda函数,Echo和Echoism.io上测试代码。

Enter your Publishing and Privacy information.

输入您的发布和隐私信息。

Congrats..you’re ready to submit for certification.

恭喜。您已准备好提交认证。

It takes a few days to hear back from the Amazon Developer Team. If your Skill is approved, then everything works and all of the information is compliant. Your Skill will be certified and published and available for others to use.

几天后才能收到Amazon开发团队的回音。 如果您的技能获得批准,则一切正常,并且所有信息均符合要求。 您的技能将得到认证和发布,并可供其他人使用。

If not, you will receive feedback and suggestions on what you need to to to resolve any issues so you can re-submit.

如果没有,您将收到解决任何问题所需的反馈和建议,以便重新提交。

我学到的是 (What I learned)

  • It’s helpful to have some familiarity with JavaScript and Node.js.熟悉JavaScript和Node.js很有帮助。
  • You will need an AWS (Amazon Web Services) account and an Amazon Developer Account to complete and submit Skills.您将需要一个AWS(Amazon Web Services)帐户和一个Amazon Developer帐户来完成和提交技能。
  • Review the words you cannot use that will conflict with how Alexa responds.查看您无法使用的词,这些词会与Alexa的响应方式冲突。
  • Listen to the preview of your Skill. It’s extremely helpful to know your information flows.聆听您的技能预览。 了解您的信息流非常有帮助。
  • It’s very different creating something that is voice activated by an end user as compared to reading on a screen.与在屏幕上阅读相比,创建由最终用户语音激活的东西是非常不同的。
  • Pretend you are the end user when writing your Skill. It helped me understand how the user would ask Alexa for information.编写技能时,假装您是最终用户。 它帮助我了解了用户如何向Alexa询问信息。
  • If your Skill is not accepted review the feedback from the Alexa Skills Team. They provide great information that will help you get your skill certification ready.如果您的技能未被接受,请查看Alexa技能团队的反馈。 他们提供了重要的信息,可帮助您准备好技能证书。
  • If you provide improvements to one of your existing Skills, the improved Skill has to go through the same process.如果您对现有技能之一进行了改进,则改进后的技能必须经过相同的过程。
  • You need an icon or image for your Skill to upload with submission.您需要一个图标或图像以供您的技能上载并提交。
  • Once your skill is accepted and certified, it is live on Amazon.一旦您的技能被接受和认证,它就会在Amazon上发布。

I am currently working on two Skills. One uses the “Decision Tree template” and the other uses the “How To template”. These are a little more complex to build, but I’m confident will have them published soon.

我目前正在研究两项技能。 一种使用“决策树模板”,另一种使用“操作方法模板”。 这些构建起来要复杂一些,但是我相信它们会很快发布。

I also have my free Echo Dot. Interacting with this device has given me ideas for developing more Skills.

我也有免费的回声点。 与该设备互动为我提供了开发更多技能的想法。

翻译自: https://www.freecodecamp.org/news/how-to-use-your-tech-skill-to-create-alexa-skills-a3e9f210a952/

亚马逊echo中国使用

亚马逊echo中国使用_我如何编程我的第一个Amazon Alexa技能并赢得了免费的Echo Dot...相关推荐

  1. 寻找亚马逊测评师邮箱_关于亚马逊测评一些普及

    背景 亚马逊公司(Amazon,简称亚马逊:NASDAQ:AMZN),是全球最大的一家网络电子商务公司,亚马逊成立于1995年,致力于成为全球最"以客户为中心"的公司.目前已成为全 ...

  2. 解析亚马逊退出中国市场后,沉默下注印度市场的品牌策略

    • 引言 • 一代电商"枭雄"亚马逊是否能够吸取其在中国市场的惨痛教训,重新制定本土化市场战略,选择重兵押注"宝藏之地"印度市场的亚马逊是否还会重蹈中国市场的覆 ...

  3. 阿里秒杀亚马逊?中国技术又一次让世界叹服!

    2017年1月19日,国际奥委会正式宣布: 阿里巴巴成为奥林匹克"顶级赞助商",阿里巴巴旗下公司阿里云将为奥运会提供一流的云计算和人工智能技术.合作期限直至2028年! 一同竞举的 ...

  4. 寻找亚马逊测评师邮箱_亚马逊站外精准引流推广实操(超级干货

    亚马逊站外精准引流推广实操(44页的PPT)想要完整清晰版本的朋友,可以分享公众号文章到朋友圈,直接扫码领取 1.亚马逊站外精准引流推广实操 分享超级大卖家内部流出来的美国站6000个测评师,6万个独 ...

  5. 寻找亚马逊测评师邮箱_美国及欧盟亚马逊产品外观专利查询步骤实操教程(已验证)...

    亚马逊产品外观专利防不胜防:美国及欧盟外观专利查询步骤实操教程(已验证) 欧洲 https://www.tmdn.org/tmdsview-web/dsview-logo-white.15c95da2 ...

  6. 亚马逊数据库数据传输费用_见解:亚马逊希望获得有关您的身体形状和眼球运动的数据

    亚马逊数据库数据传输费用 Amazon's Anticipatory Package Shipping in its Fulfillment Centres has packed and ready ...

  7. 亚马逊服务器 购买 流程_亚马逊环如何使我们对购买的每种产品都抱有偏执

    亚马逊服务器 购买 流程 重点 (Top highlight) 非品牌 (Off Brand) A little over four years ago, my wife and I moved in ...

  8. Qtum量子链与亚马逊AWS中国云服务达成合作

    全球最大的云上技术服务平台亚马逊网络服务(AWS)中国区正式宣布与Qtum量子链合作 昨日,AWS中国区域业务开发主管Simon Wang证实了这一合作关系,并在电子邮箱中向外国媒体CoinDesk说 ...

  9. 亚马逊云和谷歌云_云产品免费套餐-Amazon vs Google

    亚马逊云和谷歌云 作为开发人员,您是服务提供商的重要资源. 没有开发人员,服务提供商将无法根据规模进行节省. 拥有开发人员还意味着某人在您的服务之上拥有杀手idea的机会,创造更多价值的机会更高. 开 ...

最新文章

  1. Github的Tom大鸟:我是如何拒绝微软30w的诱惑,专注于Github事业
  2. [Flash开发笔记] 如何在as2.0中使用自定义类事件
  3. RocketMQ实战--大数据平台技术栈06
  4. 随笔(很晚很晚,瞎写一通)
  5. vijos p1143(三取方格数)(100)
  6. uoj#351. 新年的叶子(概率期望)
  7. SQLserver数据库反编译生成Hibernate实体类和映射文件
  8. Android串口通信apk源码
  9. 【MIT领导力课程笔记】前Nokia 总裁Ollila——打造移动未来
  10. php 继承性,php面向对象全攻略 (七) 继承性_php基础
  11. ip地址怎么设置才有效_房产遗嘱怎么写才有效?需要公证吗?
  12. 无法启动mysql server问题:“1067”进程意外终止
  13. 小程序tabBar不显示?
  14. 如何制作移动端静态网页
  15. 怎么设置锤子手机显示无服务器,锤子手机远程协助怎么使用 锤子手机远程协助使用教程【详解】...
  16. 江西应用技术职业学院计算机协会,江西应用技术职业学院47个学生社团陆续召开动员大会...
  17. 「Computer keyboard」- 在键盘中,手指的摆放位置 @20210331
  18. 微信小程序 宠物社区源码
  19. 牛客入门编程—金字塔图案
  20. 弦振动 matlab,弦振动规律及MATLAB数据处理

热门文章

  1. Zabbix+分布式数据库TiDB实现分布式数据库监控
  2. 电力电子转战数字IC20220727day57——寄存器模型(续)
  3. linux c socket编程学习(1)(一些基本概念及基本的函数使用)
  4. 数据采集有什么难点?
  5. STM32和ST-LINK V2的连接与调试
  6. python turtle 小乌龟 编辑动画(24)
  7. “解密”华为机器视觉军团:华为向上,产业向前
  8. 科济管线|热烈庆祝苏州方德门达新药研发公司同种异体CAR-T临床取得重大突破
  9. 《嵌入式 – GD32开发实战指南》第14章 内部温度传感器
  10. 对话京东安全首席架构师:电商平台构建安全防护体系关键点