我正在尝试编写一个胶囊,向用户询问geo.SearchRegion
,并给他们提供获得结果后再次搜索的机会。
问题是,我需要在geo.LocalityName
上训练语言模型(以获得城市名称)。我已经创建了自己的别名:
name (LocalityName) {
description (alias of geo.LocalityName)
extends (geo.LocalityName)
features {
transient
}
}
效果很好。问题是,当我对geo.SearchRegion
执行相同操作时,我失去了将LocalityName
与SearchRegion
匹配的内置功能。
structure (SearchRegion) {
description (alias of geo.SearchRegion)
extends (geo.SearchRegion)
features {
transient
}
}
因此,当我执行以下评估操作时:
action (Evaluate) {
description (Find the value)
type (Search)
collect {
input (type) {
type (StatsType)
min (Required) max (One)
default-init {
intent {
goal: GetAllTypes
}
}
}
input-group (location) {
requires (OneOf)
collect {
input (searchRegion) {
type (geo.SearchRegion)
min (Optional) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
}
input (postalCode) {
type (PostalCode)
min (Optional) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
}
}
}
}
output (Result)
}
可以,但是不允许我重新进行搜索。当我将geo.SearchRegion
更改为SearchRegion
时,它不再起作用,因为它与位置名称不匹配。
我应该怎么做才能使用户再次搜索?
我建议在操作中将该输入更改为计算输入(Documentation),并将其提示行为定义为提示行为(AlwaysElicitation)。这将导致Bixby每次都要求用户提供位置。