Alexa 自定义技能将消息分成几部分

Alexa custom skill break message into parts

我有一个自定义技能,它支持像 Give me some information about <something> 这样的查询。回复是一个长文本(大约 5 个句子)。我想将此响应分解为多个 alexa 响应。如何才能做到这一点?

澄清我所说的多个部分的意思。目前是这样的。

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity. The mass of the neutrino is much smaller than that of the other known elementary particles.....

我想要的是,

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity.
Alexa: The mass of the neutrino is much smaller than that of the other known elementary particles.....

我看了Progressive Response but that involved much more complexities than required in this case I assume. Also, I looked at ssml,也没有这样的功能。

注意:我不想在演讲中停顿,这可以通过 break 标记来实现,而是两个实际的单独消息。这背后的动机是,我想在回复后问一个类似 "Do you need more information" 的问题,并且该问题不应与包含该信息的消息出现在同一消息中。

我目前正在使用 nodejs-sdkthis.emit 功能进行回复。

一个技能的响应只能包含一个输出语音和一个重新提示。 两者都可以是字符串或 SSML 字符串。 有关详细信息,请参阅 here。 您不能在一个回复中包含多个 Alexa 语音。 您也不能对用户的请求发送多个响应。用户与技能的交互是单个请求和单个响应的循环。

编辑: 如果您想通过询问来提供更多信息:"Do you want more information" 那么您实际上是在提示用户,这意味着您应该期待答案 "yes" 和 "no"。只有下一个用户输入,例如"yes"可以触发技能的新反应

我们只能从 lambda 向 alexa 发送一次响应。所以请尝试按照下面提到的方式设计您的代码。

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity. Do you need more information?
Me:  Yes
Alexa: The mass of the neutrino is much smaller than that of the other known elementary particles.....

作为响应的一部分,我们发送使用 A neutrino is a fermion that interacts only via the weak subatomic force and gravity 作为提示。 Do you need more information? 作为重新提示。 当用户说 Yes。在 Yes Intent 中编写代码以回答您剩余的语句 The mass of the neutrino is much smaller than that of the other known elementary particles.

希望对您有所帮助