亚马逊 Alexa - 一个意图启用话语

Amazon Alexa - One intent enable utterances

在 Amazon Alexa 中有没有办法让一个意图初始化一组话语?

我问是因为除了时间和地点之外,我还需要识别汽车的型号。为 cars/places 添加插槽似乎很荒谬,因为可能有 8000 多种可能性。

例如:

valetService.prototype.launch = fucntion(intent, session, response){
  if(intent.slots['vehicleType'] === 'car'){
    response.ask('Which vehicle?', *activate utterance*);
  }
};

如果这不可能,我可以创建一系列函数来处理每条必要的信息,然后每次都将目标函数更改为单个单词意图吗?

您不需要按照您的问题所针对的进行操作。您试图避免的——不定义自定义插槽类型——实际上是您问题的答案。

您可以根据需要使用 Custom Slot Type。我同意列出所有可能的选项是荒谬的,但这就是要点:你不必!

您所要做的就是定义一个自定义插槽类型,或许可以添加一些值,因为我不确定您是否可以离开并完成。 Alexa 会将插槽的值发送给您的技能,即使它不在列表中也是如此。用亚马逊的话来说:

Note that a custom slot type is not the equivalent of an enumeration. Values outside the list may still be returned if recognized by the spoken language understanding system. Although input to a custom slot type is weighted towards the values in the list, it is not constrained to just the items on the list. Your code still needs to include validation and error checking when using slot values. See the “Handling Possible Input Errors” section of Handling Requests Sent by Alexa.

你可以找到所有关于它的信息here