首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Alexa自定义技能分解消息

Alexa自定义技能分解消息
EN

Stack Overflow用户
提问于 2018-07-31 01:17:17
回答 2查看 385关注 0票数 0

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

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

代码语言:javascript
复制
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.....

我想要的是,

代码语言:javascript
复制
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函数进行响应。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-08-01 15:19:26

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

代码语言:javascript
复制
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

希望这能有所帮助

票数 3
EN

Stack Overflow用户

发布于 2018-07-31 03:33:38

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51599204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档