Bixby Developer Center


Library Capsules

This section describes how to use Bixby's library capsules, which let your capsules work with complex concepts such as dates, times, and geography.

Using Capsules

To use a library capsule, it must be imported. In your capsule.bxb file, include an import statement in the capsule-imports block:

capsule {
capsule-imports {
import (viv.time) {
as (time) version (2.58.56)

This import lets you refer to concepts and actions in the viv.time.* namespace simply with time.*.

Capsules import their own dependencies; your capsule does not need to import these separately.

What Library Capsules Provide

Library capsules always provide concepts for use in your capsules. They might also provide actions, dialog, and training.

Extending Library Capsule Concepts

Many concepts in library capsules can be used directly by your capsules, but some are designed to be extended or given roles by your capsule. Consult the specific library capsule documentation for guidance. You can always extend library capsule concepts to provide extra functionality relevant to your capsule.

Overriding with Match Patterns

When capsules provide dialog, you might want to override their prompts to be more specific for your capsule's use case. In order to do this, you'll need to provide a match pattern that matches the library capsule'a dialog but contains at least one model (concept or action) unique to your capsule. That way, your match pattern is more specific than the match patterns contained in the library, and will be chosen as the "best" match pattern for that use case when Bixby's planner dynamically generates its programs.

For example, if you're trying to override dialog for an address prompt coming from viv.self, you might try:

dialog (Elicitation) {
match: viv.self.Address (address) {
to-input: viv.self.GetProfile {
to-output: viv.self.Profile {
to-input: BookRoom (book)
template ("What is your address?")

Most of the concepts in this match pattern come from viv.self, but the last concept referred to, BookRoom, is specific to the capsule importing the library, making this match pattern more specific than any pattern imported from viv.self.

If you're having trouble overriding library dialog, the debug console in Bixby Developer Studio can help. Try a query that produces the dialog you're trying to override and examine the planner output to see what models you'll need to specify in your match pattern.

Library Capsule Versions

Last updated November 5, 2020

When importing library capsules, these are the current versions to specify:

Library CapsuleVersion

Importing Capsule Versions

Instead of indicating a version for each imported capsule, once you import a library, you should use version-from to transitively import any of its dependencies. This is useful in order to keep versions aligned and prevent your capsule dependency chain from using two different versions of the same imported capsule.

Because of the transitive nature of version-from, you only have to point to a capsule that indirectly imports that capsule.

In the example below, the capsule first specifies the version when importing viv.location. It then uses location to get capsule versions for other imported capsules.

  capsule-imports {
import (viv.location) { as (location) version (1.0.48)}
import (viv.geo) { as (geo) version-from (location)}
import (viv.self) { as (self) version-from (location) }
import ( {as (contact) version-from (location)}

View on GitHub


These are some of the most commonly used library capsules along with links to further discussion.


Watch does not currently support viv.sharevia, bixby.audioPlayer.