簡體   English   中英

Amazon Alexa無法識別號碼槽

[英]Amazon Alexa isn't recognizing a number slot

可以說我的架構中有這個:

 {
  "slots": [
    {
      "name": "number",
      "type": "AMAZON.NUMBER"
    }
  ],
  "intent": "PriceMyProduct"
}

這些話語:

PriceMyProduct price of {number}
PriceMyProduct {number} price

在我的lambda函數中,我有這個意圖處理程序

'PriceMyProduct': function(){
        var itemNumber = this.event.request.slots.number.value;
         //DO STUFF
 }

問題是“ itemNumber”從不提取產品的編號,因此始終是未定義的。

我已經嘗試過執行“ 133202價格”或“ 133923價格”之類的操作,但是數字值從未被提取。 可能是什么問題呢?

嘗試將廣告位的名稱從“數字”更改為“ priceValue”。 像這樣:

{
  "slots": [
    {
      "name": "priceValue",
      "type": "AMAZON.NUMBER"
    }
  ],
  "intent": "PriceMyProduct"
}

然后像這樣更新話語:

PriceMyProduct price of {priceValue}
PriceMyProduct {priceValue} price

在lambda中使用新名稱:

'PriceMyProduct': function(){
    var itemNumber = this.event.request.slots.priceValue.value;
     //DO STUFF
 }

原因:數字似乎是保留名稱

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM