An input value to the plan created by an intent
block.
A value
can assign an explicit concept and value to the intent, as in this example from the refreshing content sample capsule:
action (CheckRideShareStatus) {
type (Calculation)
collect {
input (activity) {
type (Activity)
min (Required)
default-init {
intent {
goal: Activity
value: Countdown (20)
}
}
}
}
output (Activity)
}
Frequently, you'll use a expression for the value rather than an explicit concept. In this example from the audio sample capsule, meowToPlay
is a concept that specifies the sound to play; this intent passes the value of that concept to the PlayAudio
action.
computed-input (meow) {
description (By passing in the AudioInfo object to the PlayAudio action, we ask the client to play our sound.)
type (audioPlayer.Result)
compute {
intent {
goal: audioPlayer.PlayAudio
value: $expr(meowToPlay)
}
}
hidden
}
You can also cast concept values to different types by explicitly declaring them. This example casts a viv.time.StartDate
to a property in viv.time.dateTimeInterval
.
match: viv.time.DateTimeInterval(dateTimeInterval)
intent {
goal: viv.time.DateInterval
value: viv.time.DateInterval {
start:
viv.time.StartDate {
$expr(dateTimeInterval.start.date)
}
}
}
It's also possible to use an intent
to assign explicit values to properties within structure concepts:
intent {
goal: viv.time.DateInterval
value: viv.time.DateInterval {
start:
viv.time.StartDate {
year: viv.time.Year(2010)
month: viv.time.Month(11)
day: viv.time.Day(20)
}
}
}
@prompt-behavior optional | Modify Bixby's prompting behavior for a node |