Bixby Developer Center

Guides
References

computed-input

optionalmultiple allowedvalue required

A shortcut for specifying an input with plan-behavior(Never). Use computed-input when you need a safe way to add inputs to your function implementation that can be derived from other inputs, or when you want to store an intermediate value for use by other inputs, intents, or effects later in the action definition. In the latter case, you may want to hide the computed-input from the function implementation via Hidden). You should use computed-inputs because it does not have a side effect on the planner.

action (<name>) {
collect {
computed-input (<type>)
}
}

Example

action (CreateOrder) {

description (Create an empty cart.)
type (BeginTransaction)

collect {
input (restaurant) {
type (Restaurant)
min (Required) max (One)
}

//do not plan to this, either grab from restaurant or prompt
//we need this here so that we can prompt for deliver address when we start with "find restaurant" use case and then try to create an order from there

computed-input (deliveryAddress) {
type (DeliveryAddress)
min (Required) max (One)
compute {
if (exists(deliveryAddress)) {
value: $expr(deliveryAddress)
}
}
}
}

output (Order)
}

Child Keys

compute
required
Specifies an intent, describing the computation that should derive the input's value
type
required
Specifies the variable type
default-select
optional
Enables selection rules in your action using the with-rule key and selection learning with the with-learning key
description
optional
Adds text describing the variable, which is useful for documenting models
hidden
optional
Hide this input from function implementations
instantiation-behavior[deprecated]
optional
This key is deprecated
max
optional
Maximum cardinality of the input (One or Many)
min
optional
Minimum cardinality of the input (Optional or Required)
order
optional
Defines an explicit order in which to collect the inputs
prompt-behavior
optional
A behavioral mode that modifies how the system will prompt on the input or at a prompt during plan execution time
validate
optional
Lists validation rules for an input or variable