Bixby Developer Center

Guides
References

delegate-to[deprecated]

optional

Delegates output generation to a set of planned (external) or direct sources. For example, if you have a capsule that sends payments between friends, you use delegate-to to call a function implementation and another capsule to show payee information.

action (<name>) {
delegate-to {
direct-source { }
planned-source { }
selection-prompt { }
}
}

Example

action (FindPayee) {
type (Search)
output (Payee)

input (name) {
type (viv.contact.SearchTerm)
min (Required)
max (One)
}

delegate-to {

//delegate to direct function implementation of this action
direct-source {
display (payee) {
primary-text {
if (exists(payee.name)) {
template ("${value(payee.name)}")
}
}
secondary-text {
if (exists(payee.username)) {
template ("@${value(payee.username)}")
}
}
image-url {
template ("${raw(payee.imageUrl)}")
}
}
}

// use the contact capsule as a source
planned-source {
type (viv.contact.Contact)

collect {
intent {
goal { viv.contact.FindContacts }
value { $expr("name.cast('person.GivenName')") }
}
}

display (contact) {
primary-text {
template ("${value(contact.name)}")
}
secondary-text {
if(exists(contact.emailAddresses.address)) {
template ("${value(contact.emailAddresses.address)}")
}
}
}
}
}
}

Child Keys

allow-external-sources[deprecated]
optional
This key is deprecated
direct-source[deprecated]
optional
Special form of delegate where results are collected from the function implementations of the action itself
planned-source[deprecated]
optional
Delegates to an external source using a planned intent, collects intermediate results from all external sources, prompts the user to choose one, and transforms that result into the output
selection-prompt[deprecated]
optional
Dialog for a prompt to choose between collected results from all external sources