我在Skill Flow Builder中找不到一个解决方案来检测返回reprompt或recap的频率,这样我就可以在2-3次尝试提示用户后强制执行后备路由。
有谁有解决方案吗?
下面是一个典型的例子:
@welcome
*say
Hello. Where do you want to go?
*reprompt
Where to go?
*recap
Where to go?
*then
hear route A {
-> route_a
}
hear route B {
-> route_b
}这样做的问题是,除非你说“路由A”或“路由B”,否则你将永远得到重新提示。
它需要一个fallback,您可以定义它,以便在多次尝试获得正确响应后触发。
发布于 2019-11-02 05:43:24
如果您定义了hear *,SFB驱动程序会将行为路由到它,而不只是重复*recap消息。
时间变化重述的#示例如下所示:
@start
*say
hello.
Do you go to left or right?
*reprompt
Do you want to go left, or right?
*recap
This is a recap message.
*then
hear left {
set repromptCount as 0
-> left room
}
hear right {
set repromptCount as 0
-> right room
}
hear * {
increase repromptCount by 1
set limit as 3
if repromptCount < limit {
-> start *recap
}
set repromptingDestination as 'reprompting destination'
-> too many reprompts scene
}
@left room
*say
left room
@right room
*say
right room
@too many reprompts scene
*say
You didn't know what to do too much.
*then
-> {repromptingDestination}
@reprompting destination
*say
Reprompt destination发布于 2019-11-02 21:11:14
感谢Ezra的这个解决方案。我添加了一些内容,以使其更容易在全球范围内实现:
@global prepend
*then
hear * {
-> recapHandler
}
@recapHandler
// *say
// DEBUG Recap count is {recapCount} [pause] Recap limit is {recapLimit}
*then
increase recapCount by 1
if recapCount <= recapLimit {
-> {recapScene} *recap
}
set recapCount as 0
-> {fallbackScene}请注意必须在每个场景中设置的变量名称。在存在当前场景的全局变量之前,必须手动设置此变量。
@aScene
*say
blah blah
*recap
recap message
*then
set recapScene as 'aScene'
set fallbackScene as 'aFallbackScene'
hear * {
-> recapHandler
}https://stackoverflow.com/questions/58656764
复制相似问题