简体   繁体   English

Amazon Alexa自定义插槽备忘录

[英]Amazon Alexa custom slot memo

I am creating an Alexa skill that needs to retrieve various things such as Date, File number, etc . 我正在创建一项Alexa技能,该技能需要检索各种内容,例如日期,文件编号等 I also need it to get the "Description" that a user says to it and be able to retain it. 我还需要它来获得用户对它说的“描述”并能够保留它。

For example: 例如:

"Alexa, description, patent drafting" “ Alexa,描述,专利起草”

so I would need Alexa to be able to retain the "Patent drafting" . 因此,我需要Alexa才能保留"Patent drafting" I am not to sure how I should go about this and any help would be much appreciated. 我不确定该如何处理,任何帮助将不胜感激。 Thanks! 谢谢!

You can use slots to get this piece of information for your skill. 您可以使用插槽获取此信息以提高您的技能。 You'll need slots like Date (use built-in AMAZON.Date as it's slot type), FileNumber (use AMAZON.Number ), and Description (this would be a custom slot, where you need to provide slot values explicitly). 您将需要诸如Date (使用内置AMAZON.Date作为其插槽类型), FileNumber (使用AMAZON.Number )和Description (这是一个自定义插槽,您需要在其中明确提供插槽值)之类的插槽。

Now you make all of the slots required in the build section of your Alexa skill builder. 现在,您完成了Alexa技能构建器的“构建”部分中所需的所有插槽。 And you also need to provide prompts (ie what Alexa will say to ask for the value of this slot) and utterances (ie what user will speak in response to those prompts). 而且,您还需要提供提示 (即Alexa会询问该插槽的值)和话语 (即用户将根据这些提示讲话)。 The utterances should have the slot variable. 这些话语应具有slot变量。 For example: "Note the date to {Date}" 例如: “记下日期为{Date}”

Once this is done, you'll need to have a look on Dialog.Delegate Directive. 完成此操作后,您需要查看Dialog.Delegate指令。 Your skill must return this Dialog, in order to retrieve the input data. 您的技能必须返回此对话框,以便检索输入数据。

This should not be a problem. 这应该不是问题。 But if you face any, comment below and I'll tell the step-by-step procedure and even the code to get this done. 但是,如果您有任何疑问,请在下面评论,然后我将告诉您逐步的过程,甚至是完成该过程的代码。

So for the description.. I can only get the values that I predefined within the utterances ? 因此,为了进行描述。.我只能在发声中获得我预定义的值? I would not be able to program Alexa to have it retrieve whatever I say? 我将无法对Alexa进行编程以使其检索到我所说的内容吗? Because there could be a large variety of things that could be said. 因为可能有各种各样的事情可以说。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM