Aws lambda Amazon技能流生成器超时,并可用于重述和重述
在Aws lambda Amazon技能流生成器超时,并可用于重述和重述,aws-lambda,alexa,alexa-skills-kit,alexa-skill,Aws Lambda,Alexa,Alexa Skills Kit,Alexa Skill,在Skill Flow Builder中,我找不到一个解决方案来检测reprompt或repack的返回频率,以便在尝试2-3次提示用户后,强制执行回退路线 有人有解决办法吗 下面是一个典型的例子: @welcome *say Hello. Where do you want to go? *reprompt Where to go? *recap Where to go? *then hear r
Skill Flow Builder
中,我找不到一个解决方案来检测reprompt
或repack
的返回频率,以便在尝试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”,否则你将永远受到责备
它需要一个
回退
,您可以定义它在多次尝试获得正确响应后触发。如果您定义hear*
,SFB驱动程序将把行为路由到它,而不是重复*repack
消息
时间变化重述的示例如下所示:
@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
@start
*说
你好
你向左走还是向右走?
*责备
你想向左走,还是向右走?
*重述
这是一条重述信息。
*然后
向左听{
将repromptCount设置为0
->左室
}
听对了{
将repromptCount设置为0
->正确的房间
}
听到*{
将repromptCount增加1
将限制设置为3
如果repromptCount<限制{
->开始*重述
}
将repromptingDestination设置为“repromptingDestination”
->太多责备的场面
}
@左室
*说
左室
@正确的房间
*说
正确的房间
@太多责备的场面
*说
你不知道该怎么做。
*然后
->{repromptingDestination}
@重发目的地
*说
重发目的地
感谢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
}