Selection strategies help inform Bixby's Selection Learning on what are the best choices for users. This often happens in Bixby when a provider has multiple matches for an ambiguous request.
Selection strategies do not provide hard logic for selection behavior. Rather, they simply provide information to Bixby about selection choices.
For more information, see Selection Strategies in the Selection Learning Developers' Guide and the Selection Learning sample capsule.
This key and its child keys must be defined in a *.stratgey.bxb
file, with the file in your resources/base
folder.
In the example below, the selection strategy provides advice for selecting a ride share that matches the user's preferred price range.
selection-strategy {
id (prefer-price-defined)
match {
RideShare (this)
}
named-advice ("less-than-10") {
advice ("${this.priceRange.min.value}")
advise-for { lowerBoundClosed(0.0) upperBoundOpen(10.0) }
}
named-advice ("10-to-50") {
advice ("${this.priceRange.min.value}")
advise-for { lowerBoundClosed(10.0) upperBoundOpen(50.0) }
}
named-advice ("50-to-100") {
advice ("${this.priceRange.min.value}")
advise-for { lowerBoundClosed(50.0) upperBoundOpen(100.0) }
}
named-advice ("more-than-100") {
advice ("${this.priceRange.min.value}")
advise-for { lowerBoundClosed(100) }
}
}
id required | Identifier that is unique for a given capsule |
match required | The match pattern represents the circumstances in which a selection strategy should be applied |
named-advice required | The named-advice block contains all the fields that make up a strategy |
description optional | Optional description of the strategy for documentation purposes |