Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center

Guides

Debugging

The Debug Console is a tool in Bixby Developer Studio (Bixby Studio) that allows you to view all of the important aspects of how a query runs within your capsule. You can see the query's execution graph and inspect every step's input and output, including associated Actions, Concepts, Functions, Dialogs, Layouts, and Natural Language (NL) information. If you've used the developer tools in Chrome, Firefox, or Safari for inspecting scripts and page elements, Bixby's Debug Console will be familiar.

Many of these examples are drawn from the Dice sample capsule in the Quick Start Guide.

Opening the Debug Console

To open the Debug Console, do one of the following:

  • Select View > Open Debug Console in Bixby Studio. (This is Shift+Cmd+D on macOS and Shift+Ctrl+D on Windows.)
  • Click the Debug Console button in the simulator.
  • Select and run a story in Bixby Studio, and click the Debug Console button.

Debug Console Button

The Debug Console can be switched between displaying in its own window and "docking" to Bixby Studio's main window by clicking on the appropriate button in the upper right of the Console.

Debug Console

Like the editor pane, the Debug Console can have multiple views in tabs listed along the top of its window—for example, simulator output in one tab (which will be titled "Simulator"), and output from stories in other tabs. As with Bixby Studio, a dropdown list of tabs is also available.

Note

You can only use the Debug Console after a query has been executed in the simulator or as a story. If the Console is not displaying information, open the simulator and execute a NL or aligned NL query you wish to debug, or run the story you are trying to debug.

The Execution Graph

The left side of the Debug Console window displays the query's execution graph, starting at the user input at the top and arriving at the final goal output at the bottom. By following the graph, you can see the program that Bixby wrote and executed in order to respond to the query.

Clicking on any node of the graph will change the visible sections in the Inspector pane (the right side of the window), showing only the information used in that execution step. Click outside of a graph node in the execution graph pane to display all the available sections in the Inspector.

Buttons in the upper left of the execution graph window control the magnification settings. Use the magnifying glass icons to zoom in and out on the graph, or click Fit to fit the entire graph in the current window.

Value nodes in the execution graph are annotated by color and text:

  • Grey nodes are values or concepts. A striped background indicates the value is optional.
  • Red nodes indicate missing values. Values may be missing because execution has not completed yet. (If this is the case, the Goal Status in the Inspector will indicate that output is pending.)
  • Blue nodes indicate actions.

Goal nodes may also be annotated by color, with a dot at the top:

  • Green dots indicate successful execution.
  • Red dots indicate a failure.

If an error has occurred during the program's execution, the X-Ray Pane will display the failure message when either no node or a node with a red failure dot is selected. See "Resolving Issues" below.

The Inspector

The right side of the Debug Console window displays information about the models and functions used in the query or, if a node in the execution graph is selected, the models and functions used in that node. The Inspector is itself divided into two panes.

The top pane contains a list of stacked sections that expand or collapse when clicked. These include Actions, Concepts, Functions, Dialogs, and Conversation. When expanded, each section displays a result data structure as a tree of key-value pairs and arrays. "Branches" of the tree can be expanded by clicking on the ⊕ icon to the left of a key name. The icon will change to ⊖ when it is expanded. The size of arrays will be indicated in brackets (for example, "results [1]").

The bottom pane is the X-Ray Pane. Click any individual element in the Inspector to display more detailed information about the selected item:

Inspecting Values

In this view, results is selected under the dice.RollDice Action. The X-Ray Pane shows that roll is a three-element array (the three dice rolled), and sum (the total of the dice rolled) is 9.

Different sections have different displays and functionality, depending on the context of the element being inspected.

Concepts and Actions

Concepts and actions display the values of the models being used in the query execution, or at the specific selected node along the execution graph. All of the values for models can be displayed entirely within the Inspector by expanding their levels in the data structure tree.

In this example, the action section is expanded:

Inspecting Models

This shows us:

  • The dice.RollDice calculation action was called. Clicking the document icon in the X-Ray pane will open the file for that model for editing.
  • The action's result is dice.RollResult, with 3 dice rolled for a sum of 12.
  • There are two inputs, numDice and numSides.
  • The dice.RollDice function implements the action. (See Functions below for more details on this.)

Functions

Functions are annotated in the X-Ray Pane with colored dots (or collapse/expand icons) to denote whether the function executed successfully: green indicates success, and red indicates failure. You can "drill down" in the function section to find the specific error. In this example, viv.geo.FindLocality failed to find a country for the user input "is it raining in helsinki", and displays an EmptyOptionalValue error:

Inspecting Functions

In this display, note that the JSON return value of the function is displayed with its types, and disclosure (⊕) icons to expand them to display their full values. Also, note that this function made a GET web request that returned HTTP 200, and was successful, as denoted by the green dot. Lastly, you can open the endpoint containing this function directly from the X-Ray Pane by clicking the document icon in the X-Ray Pane (to the right of the function name).

Log Output: You can use JavaScript's console logging functions (console.log, console.info, console.warning, and console.error) to send messages and data to logs that will be displayed in the function section.

Suppose that you add a logging statement to the rollDice function in the Dice capsule:

function rollDice(numDice, numSides) {
// ...
console.log("Logging output", result);
// ...
}

When the query is executed, the logs can be selected and viewed in the X-Ray Pane:

Viewing Logs

The message "Logging output" is displayed as-is. The variable sent to the log, result, is displayed as an expandable object (in this case, a three-element array).

Longer logs can be filtered by entering text to match on in the "Filter" field. You can also choose to display only messages that match individual logging levels (info, debug, warning, and error).

Dialogs

Dialogs, like Concepts and Actions, have data structure trees that can be inspected, showing each final dialog output along with the templates and concepts used to construct it. Here's example dialog from a recipe searching capsule, after the user has requested Bixby to find recipes with chicken and tomato, but without rice:

Inspecting Dialogs

In the X-Ray Pane, the template for the selected utterance (the phrase with chicken and tomato) is shown, along with the file containing the template, concepts and their bound values, and other metadata. Click on the file path to open the file in Bixby Studio.

Conversation

The tree in the Conversation section will show you how Bixby has parsed the user's utterance.

Inspecting NL

Understanding shows the user's natural language input: "roll 3 6-sided dice". Under that, Bixby shows you the goal and concept inputs that it's matched to the natural language.

Interpretation shows how Bixby understands this input. First, it shows the aligned NL:

[g:example.dice.RollResult] roll (3)[v:example.dice.NumDice:3]
(6)[v:example.dice.NumSides:6]-sided dice

And from that, Bixby generated the following intent:

intent {
goal {
0.1.1-example.dice.RollResult
@context (Outer)
}
value {
0.1.1-example.dice.NumDice (3)
}
value {
0.1.1-example.dice.NumSides (6)
}
}

You can also use the Conversation inspector to display the user context used for processing this user request. Expand the context tree to see the values used. These are device-specific, and might be different when testing on actual devices rather than the simulator.

Resolving Issues

When there's an error in execution, the Debug Console will display information about the problem:

Inspecting Issues

In this case, an error has happened in the RollDice step: the node in the execution graph is red and marked with an X. The X-Ray Pane identifies this as a ValueCompilationError. Clicking the round crosshairs icon in the upper right corner of the function failure message shows the function generating the issue:

Diagnosing Issues

The viv.dice.RollDice function hasn't returned the required roll value. Clicking the document icon in the upper right corner will open the function's JavaScript source file in Bixby Studio for you to investigate.

Note

Issues might appear in the Debug Console without being fatal. For instance, an action that takes an optional value may produce an error when that value is not present. In non-fatal cases, the failing function might still succeed, and Bixby might process the query correctly.