gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 20:23:09 25 4
gpt4 key购买 nike

我正在尝试构建 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com