我所試圖做的事:Alexa的意圖發送兩個請求,失敗
我有一個非常簡單的Alexa的技能來監聽命令字:
{
"intents": [{
"intent": "AffiliateEmpire",
"slots": [
{
"name": "affiliate_action",
"type": "AFFILIATE_ACTIONS"
},
{
"name": "date",
"type": AMAZON.DATE
}
}]
}
自定義插槽類型爲:
AFFILIATE_ACTIONS commissions | earnings | sales | summary
我的樣品話語是:
AffiliateEmpire for affiliate {affiliate_action}
AffiliateEmpire get {affiliate_action} for {date}
這與我的PHP服務器進行通信,我在那裏偵聽請求類型。
問題是什麼?
當我調用命令字,沒有任何意圖,它使一個「LaunchRequest」到我的服務器,並正確地返回card
和outputSpeech
如果我問的意圖,它使一個IntentRequest
到我的服務器,但然後還發送SessionEndedRequest
。
我處理IntentRequest
並把它的線沿線的一個JSON編碼的響應:
array(
'version' => '1.0',
'response' => array(
'outputSpeech' => array(
'type' => 'PlainText',
'text' => 'Some simple response'
)),
'shouldEndSession' => true,
'sessionAttributes' => array()
));
我的亞馬遜回聲從來沒有講Some simple response
而是給了我There was a problem communicating with the requested skill
我有一個非常類似的技術工作在此之前,但看不到我做錯了什麼。
我都試過了。
我使用PHP寫的每個原始請求的日誌文件,json_decoded要求我送回亞馬遜的響應。我也在使用測試工具,但是這給了我The remote endpoint could not be called, or the response it returned was invalid.
。我知道它可以調用我的端點,因爲我看到每次寫入的日誌文件。
爲什麼叫我的意圖,但然後結束會話造成的錯誤?