Bixby Developer Center

Guides
References

replan

optional

Effect that re-plans to a new intent, after an optional dialog event.

Examples

Example - validate

When purchasing tickets to a show, we would like to not only fetch the user's email address, but also save it to their profile. We can do this when validating the incoming profile email using replan:

input (self) {
type (profile.Self)
min (Required)
default-init {
intent {
goal: profile.GetSelf
}
}
validate {
if ("!(exists(self) && exists(self.emailAddresses))") {
replan {
intent {
subplan {
value { $expr(self.emailAddresses) }
goal { @prompt-behavior(AlwaysElicitation) contact.EmailInfo }
}
goal { profile.UpdateSelf }
}
}
}
}
}

Example - on-catch

We can use the replan effect to redirect the user when we catch a checked error from the action implementation. Here we redirect the user to the select payments screen upon detecting invalid payment information:

error (InvalidPayment) {
on-catch {
replan {
dialog {
template ("We couldn’t process the payment on your card. Please double check the details or try a different card")
}
intent {
goal: ticketmaster.BuyTickets
value: $expr(cart)
}
}
}
}

Child Keys

dialog
optional
Dialog enables you to communicate to users of your capsule, such as asking questions, providing status, or paraphrasing results
intent
optional
A set of signals that the Bixby planner interprets to create a plan