【发布时间】:2017-10-30 23:24:46
【问题描述】:
我想做的事:
我有一个非常简单的 Alexa Skill 可以监听命令词:
{
"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()
));
我的 Amazon Echo 从不说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.。我知道它可以调用我的端点,因为我每次看到写入的日志文件。
为什么它调用了我的意图,然后通过结束会话导致错误?
【问题讨论】:
标签: alexa-skill