Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center

Guides

Introduction to Modeling

In the Overview and Quick Start Guide, you learned how Bixby turns natural language input into a structured intent. Bixby's Planner takes the intent and builds an execution graph out of your models.

Models come in two kinds in Bixby: concepts and actions in the *.bxb format. For more information on formatting and language conventions, see the Bixby Language Conventions topic.

Concepts

A concept describes any "thing." It could represent a concrete object, such as coffee, flowers, or an airport. A concept can also be abstract, such as a day, flight, or order. Well-modeled concepts are essential to Bixby because the planner uses concept models as inputs and goals when executing plans. Concepts are comparable to data types and data structures in a programming language.

Examples of concepts from the dice rolling sample capsule in the Quick Start Guide include NumDice (the number of dice being rolled) and NumSides (how many sides the dice have), as well as RollResult (the result of rolling the dice). The first two are examples of primitive concepts, simple types. RollResult is an example of a structure concept, a more complex concept with named properties (which are themselves other concepts defined in the capsule):

structure (RollResult) {
description (The result object produced by the RollDice action)
property (sum) {
type (Sum)
min (Required)
max (One)
}
property (roll) {
description (The list of results for each dice roll.)
type (Roll)
min (Required)
max (Many)
}
}

Modeling Concepts describes concepts in great detail, including how to express relationships between concepts.

Actions

An action defines an operation that Bixby can perform, directly or indirectly, on behalf of a user. If concepts are nouns, actions are verbs.

In the dice rolling sample capsule, there's only one action: RollDice, which takes NumSides and NumDice as inputs and outputs a RollResult:

action (RollDice) {
// specify action as calculation
type (Calculation)
collect {
input (numDice) {
type (NumDice)
min (Required)
max (One)
// add a default value of two dice
default-init {
intent {
goal {NumDice}
value {
NumDice (2)
}
}
}
// add a validation for # of dice
validate {
if (numDice < 1) {
prompt {
dialog {
template ("You must have at least one dice.")
}
}
}
}
}

input (numSides) {
type (NumSides)
min (Required)
max (One)
// add a default value of six sides
default-init {
intent {
goal {NumSides}
value {
NumSides (6)
}
}
}
// add a validation for # of sides
validate {
if (numSides < 2) {
prompt {
dialog {
template ("A dice must have at least 2 sides.")
}
}
}
}
}
}
output (RollResult)
}

Modeling Actions goes into more detail about actions, including validation and error handling.