/capsule-sample-country-info

Country Info capsule used for the Advanced Bixby Tutorial

Primary LanguageJavaScript


Bixby Advanced Tutorial: Country Info Capsules

Overview

This repo contains sample code for a tutorial that covers advanced features of the Bixby platform. See the tutorial here

The tutorial shows users how to create a Bixby capsule that can answer questions about world countries using a free remote service called REST Countries, which provides country information through a JSON API.

The tutorial teaches the following key concepts:

  • Fetch data from API calls in your actions
  • Add continuations, flags, and routes to your Natural Language training
  • Use complex macros and Expression Language constructions

To get started, download this repo. There are two capsules in this repo:

  • capsule-sample-country-info-initial: starter/initial capsule code
  • capsule-sample-country-info-full: fully functional capsule

You should then open either of the capsules in Bixby Studio. The suggested first capsule you open and the one the tutorial starts with is: capsule-sample-country-info-initial

You can then launch the simulator and type:

start

The capsule will then prompt you for a country name, you can either type it in, speak it (using the microphone icon) or enter it into the simulators form field.

The capsule will then present you with information about the country. Alternatively you can try utterances which ask for a country directly e.g.:

tell me about switzerland


In the full capsule, you can do things like this:

What is the population of France

After the answer is given, try:

What is the capital

This will give you the capital of France. If you then ask:

What about Portugal

The capsule will give you the capital of Portugal. You could then ask:

Tell me about Canada

Which would give you full information about Canada.

This latter functionality used more advanced training including continuations, flags and routes and advanced views and usage of macros in views (using EL e.g. Bixby Expression Language)


Additional Resources

Your Source for Everything Bixby

Guides & Best Practices

Bixby Videos

Bixby Podcast

Bixby on Social Media

Need Support?

  • Have a feature request? Please suggest it in our Support Community to help us prioritize.
  • Have a technical question? Ask on Stack Overflow with tag “bixby”