alexa - 如何在自定义技能中处理来自用户的 'Yes'/'No' 响应?

标签 alexa alexa-skills-kit alexa-skill alexa-slot amazon-echo

我正在尝试构建 alexa 自定义技能。我正面临一个问题,我试图从用户那里获得是/否对技能向用户提出的问题的答复。

Alexa: Would you like to know the rules of the game?
User: <Can respond either Yes or No>

根据用户响应,我想执行特定操作。

这是我的 intent 架构:
{
    "intents": [
    {
        "intent": "AMAZON.StopIntent"
    },
    {
        "intent": "AMAZON.CancelIntent"
    },
    {
        "intent": "AMAZON.HelpIntent"
    },
    {
        "intent": "StartGame"
    },
    {
        "intent": "GetRules"
    }
  ]
}

以下是我的示例话语:
StartGame Begin the game
StartGame Start the game

GetRules What are the rules
GetRules Get the rules
GetRules Tell me the rules
GetRules Tell me the rules again

该技能向用户提出的问题如下:
Welcome to the game. Would you like me to tell you the rules?

每当我说"is"时,StartGame intent 就是被触发的。 (“否”也是如此)。 Alexa 总是选择 StartGame 的 intent 。调用“GetRules” intent 的最佳方式是什么。我希望用户只说是/否,而不是说“获取规则”。

如果这已经得到回答/需要更多信息,请告诉我。

最佳答案

您需要使用 AMAZON.YesIntent 和 AMAZON.NoIntent。

您可以在此处阅读有关它们的信息:。

标准内置 intent 。
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents

关于alexa - 如何在自定义技能中处理来自用户的 'Yes'/'No' 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42336790/

相关文章:

google-calendar-api - 如何从 Lambda AWS oAuth Google API?

ios - 来 self 的 iOS 应用程序的 Alexa 技能套件交互

node.js - Alexa 技能响应抱歉,我无法按照您的要求进行操作。请再试一遍

php - 如何在 alexa 中添加多个轨道以进行流式传输?

node.js - ( Alexa ) 是否可以在同一个 intent 处理程序中获得响应?

node.js - 如何在多轮中获取 AMAZON.QUERY 输入

node.js - 通过事件网关异步回答 Alexa 智能家居技能时,如何回答 AWS Lambda?

node.js - 在单个 Alexa 技能中使用多个语音?

amazon-web-services - 以编程方式配置架构和话语