Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试制作一个可以捕获一个单词的插槽。我只希望整个指令只有一个单词,任何英文单词都会触发意图。我尝试使用 Amazon.LITERAL 但它可以捕获整个短语,这不是我想要的。有没有办法在 Alexa 中做到这一点?
目前没有办法限制槽中返回的单词数。
您可以以明确的方式提示用户您只需要一个单词,并且您的 lambda 代码可以验证槽中只提供了一个单词。
例如,让 Alexa 说“告诉我一个词……你可以说‘alexa,告诉你的技能名,这个词是幸运的’”。例如,您可能会在 LaunchRequest 期间这样说。
然后,您可以验证槽中只指定了一个单词,并根据需要重新提示。
答案的意图可能类似于“MyWordIntent 这个词是 {Word}”