【问题标题】:Alexa custom skill break message into partsAlexa自定义技能中断消息分成几部分
【发布时间】:2018-08-01 21:01:05
【问题描述】:

我有一个自定义技能,它支持像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,但这涉及的复杂性比我假设的这种情况要多得多。另外,我看了ssml,也没有这个功能。

注意:我不想在讲话中出现停顿,这可以通过break 标签来实现,而是两条实际的单独消息。这背后的动机是,我想在我回复后问一个诸如“您需要更多信息”之类的问题,并且不应该与包含信息的消息在同一条消息中。

我目前正在使用nodejs-sdkthis.emit 函数进行响应。

【问题讨论】:

  • 你想在你的句子之间休息一下吗?这就是你要找的东西
  • 不仅仅是<break>标签可以实现的暂停,而是两种不同的消息。
  • 这是不可能的。您能否提供更多有关您要达到的目标的信息,例如必须说出下一句话的时间。
  • 当然。我想在回答结束时问这个问题。但在单独的回应中。请参阅我在问题中的编辑以更清楚地了解。
  • 除非有请求,否则您无法发起第二次响应。如果您在重新提示时问“您需要更多信息”怎么办?这适合您的用例吗?

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


【解决方案1】:

我们只能从 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

希望对你有帮助

【讨论】:

    【解决方案2】:

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

    编辑: 如果您想通过询问“您想要更多信息”来提供更多信息,那么您实际上是在向用户提示,这意味着您应该期望得到“是”和“否”的答案。只有下一个用户输入,例如“是”可以触发技能的新响应。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-31
      • 2020-02-23
      • 2018-12-03
      • 2019-01-23
      • 2018-11-04
      • 2017-08-28
      • 1970-01-01
      • 2018-09-14
      相关资源
      最近更新 更多