插槽的resolutionsPerAuthority数组中是否有新的“动态”?

时间:2019-01-08 21:56:26

标签: alexa alexa-skills-kit alexa-skill alexa-slot

resolutionsPerAuthority数组中有一个名为dynamic的新对象,对此我几乎没有问题。

因为在我检查之前就像例子一样。

for (const slotName in currentIntent.slots) {
    const slot = currentIntent.slots[slotName];
    if (slot.confirmationStatus !== 'CONFIRMED'
        && slot.resolutions
        && slot.resolutions.resolutionsPerAuthority[0]) {
        if (slot.resolutions.resolutionsPerAuthority[0].status.code === 'ER_SUCCESS_NO_MATCH') {
            return responseBuilder
                .speak('I cant work with the ' + slot.name + ' slot. Please try again.')
                .reprompt('Please say something for ' + slot.name)
                .getResponse();
        }
    }
}

这是几个星期前。然后是一个示例数组。

{
    "name": "example",
    "value": "Hello",
    "resolutions": {
        "resolutionsPerAuthority": [
            {
                "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.00000000-0000-0000-0000-000000000000.example",
                "status": {
                    "code": "ER_SUCCESS_MATCH"
                },
                "values": [
                    {
                        "value": {
                            "name": "John",
                            "id": "john"
                        }
                    }
                ]
            }
        ]
    },
    "confirmationStatus": "NONE",
    "source": "USER"
}

现在几天以来,这个resolutionsPerAuthority数组由此扩展了。

{
    "authority": "amzn1.er-authority.echo-sdk.dynamic.amzn1.ask.skill.00000000-0000-0000-0000-000000000000.example",
    "status": {
        "code": "ER_SUCCESS_NO_MATCH"
    }
}

小的区别是.dynamic之后有一个echo-sdk。 而且这个dynamic不匹配。

由于我的逻辑,它有时会失败,有时不会。取决于它是否是数组中的第一个元素。

有人可以解释一下为什么我从今年或几天前现在有这个dynamic吗?

谢谢。

0 个答案:

没有答案