Building Your First Buddy

Steps to building your first Buddy using the Slang Console

The Slang Console is the primary interface for businesses to configure their app's use-cases and features that they would like to integrate with Slang's Voice Augmented eXperience.

The Slang Console is a web-application and is best viewed on a desktop browser.

Step 0: Create your account and login

Visit the Slang Console at https://console.slanglabs.in, sign-up using your email-id. Once you've signed-up successfully, you can sign-in to the Console using the same credentials.

Step 1: Get familiar with the Slang Console

Upon successful login to the Slang Console, you'll land on the Home page. The Home page is the section that allows you to create your first buddy. In the Home page, you'll notice two panes:

  • A navigation pane on the left hand side that contains links to:

    • Your account information

    • A detailed help section

    • Logout

  • The main pane which contains an action button to create a new buddy, as well as a prebuilt buddy (travel.sample) that you can explore and play with to get a better understanding of what a buddy looks like.

Click on "Create Buddy" to get started with creating a new buddy for your app

Step 2: Create a buddy

After clicking on the "Create Buddy" button on the Home page, you will be presented with a dialog that lets you specify the name of your buddy. Choose a name that close matches the app for which you're creating the buddy. Once you provide the name and click on the "Create New Buddy" button, a new, empty buddy is created and placed on the Home page, next to the prebuilt buddy (travel.demo).

Your buddy is now created and ready to be configured and trained.

Step 3: Configure your buddy

Before we get started, to get a quick primer on the terminology used in this section, please visit the Terminology page. To understand the details behind the concepts referred to in this section, please review the Buddy Building Tips page.

Once you click on your buddy in the Console home page, you will land on the Buddy page. The Buddy page consists of two panes. The main pane on the left side is the buddy configuration pane. The pane on the right is the playground pane, which allows you to test your buddy's configuration once it's complete.

The buddy configuration pane consists of the following tabs:

  • Intents

  • Entity Types

  • App Prompts

Initially all these sections are blank. Once you have added some intents, entity types & app prompts, they appear here. You can then,

  • Search for a particular intent or entity type

  • Use the arrows to move across the pages

  • Edit or delete a particular intent, entity type or app prompt. The edit and delete options appear once you hover over a particular intent or entity type.

  • Create a new intents, entity types & app prompts

Step 3a. Create a new Intent

To understand the concepts behind Intents, please read Intents

You can follow these steps to create a new intent from the Buddy Home page:

  1. On the Buddy Home page, click the '+' button.

  2. On the Create New Intent page that appears, type a unique name for the intent.

  3. Click CREATE NEW INTENT. The Intent page appears.

The Intent page has the following three tabs:

  • Utterances / Entities

  • Intent Prompts

  • Intent Help

This is where you add additional information that further helps Slang recognize, interpret, and process information when the end user talks to the app. We will now help you add utterances, entities, intent prompts & intent help from this page.

Step 3b. Add Utterances

An Utterance indicates the various ways a user may utter a particular command (related to the intent that you have defined above). For example, to find out about his current plan details, end user can make the following voice requests:

  • Show plan for mobile number 93xx8 xx38x

  • What is my plan?

  • Show my current plan

  • My plan

  • Get plan details

The way these searches are uttered may be different, but they ultimately serve the same purpose.

Slang requires you to add the various utterances that can possibly be associated with a particular command. The following steps guide you to do so:

  1. On the Intent Home page, go to the Utterances section in the Utterances/Entities tab.

  2. Type the utterance in the text field between the two quotes.

  3. Once you have finished typing the utterance, click the '+' icon or press the 'Enter' key in your keyboard to add it. A new line appears with the added utterance.

Step 3c. Add an Entity

To understand the concepts behind entities, please read Entities and Entity Types

Once you have added the utterances, you will next need to define entities. Entities are parameters that can be extracted from user utterances in addition to figuring out the intent.

In the above example, the entity is the mobile number

Each entity in an intent needs to have a type. Slang provides a standard library of entity types representing most common types such as std.integer, std.duration, std.geo.city and so on. However, there may be cases where the specific needs of a type are not covered by a standard type, in which case a custom entity type can be defined as seen in the following section.

Standard Entity Types
Custom Entity Types

The following steps guide you to add an entity belonging to a standard type.

  1. On the Intent Home page, go to the Entities section in the Utterances/Entities tab.

  2. Use the '+' button to open the 'Add / Edit Entity' page

  3. From the Select Type drop-down menu, choose the appropriate entity type.

  4. Under the PROMPTS section, type a prompt for the entity in both the English and Hindi options.

The entity is successfully added on clicking 'Save' and appears in a separate line under the Entities section of the Intent Home page.

If your buddy requires a custom entity type, you can create one using the following steps.

  1. On the Buddy Home page, click the '+' button.

  2. On the Add Entity Type page that appears, type the following:

    1. Type a unique name for the entity type. For example, plan.name.

    2. Add a description, value & synonyms for the entity type. Synonyms are the various ways in which the end user can speak out the various values in this entity type.

    3. Click DONE. You are taken to the Intent Home page. The entities that you have added, are displayed here.

Once the type is created, it will appear in the Entity Type drop-down, along with standard entity types and can be added to the intent by following the same steps as those for a standard entity type.

Step 3d. Mark Entities in each Utterance

The entities that have been created also need to be marked in the utterances.

  1. Next, highlight the entities in the utterance that you have just added. For example, in the utterance, Show plan for mobile number 93xx8 xx38x, the mobile number is the entity.

  2. On highlighting, a drop-down menu appears. Choose the appropriate entity from the list.

Step 3d. Add app prompts

To understand the concepts behind Prompts, please read Prompts

The app prompts tab in the Buddy Home page allows you to set the greeting and clarifications messages to be spoken out by Slang when the app user is using the voice feature in the app. Both these prompts can be defined in multiple languages and Slang automatically uses the language that is being selected by the app user.

The greeting message is the welcome message spoken out by Slang as soon as the app user initiated use of the voice feature in the app.

The clarification message is used automatically when Slang is unable to hear or understand the user.

Step 3e. Add Intent Prompts

The intent prompts tab in the Intent Home page allows you to set the confirmation messages specific to an intent and will be spoken by Slang when a user intent is recognized and successfully fulfilled by the voice feature.

Step 3f. Add Intent Help

The intent help tab in the Intent Home page is used to configure the on-screen help messages that are specific to the intent. These will be used automatically when a user requires assistance to use the voice feature in the app. The help message includes a title to specify the intent and a few example sentences that the user can speak for this intent.

Step 4: Train your buddy

Once you have created the intents, entities, utterances, prompts and help messages you can save them for later modification, by clicking the Save button. However, the buddy is not ready for integration yet. To make it ready for integration, you will need to train it by publishing to either the Staging or Production environments.

An ideal workflow is to first publish your changes to the Staging environment, test and iterate on the changes and finally publish to Production environment when the configuration feels complete.

Note that publishing your buddy configuration to the Production environment could break existing integrations if the new configuration contains backwards-incompatible changes.

Step 5: Test your buddy

After configuring and publishing a buddy to either of the environments, the last step remaining is to test that the buddy works like you expect by using one of the available playgrounds: Web or Android

The Android playground app is available on the Android Play Store. You can find a link to the playground app on the console. After installing the app on your Android device, you can login to it using your account credentials and test your buddy configuration.

The Web playground is available for you to use right within the Slang Console. You can choose the correct language and environment for your buddy, click on the mic icon at the bottom and speak any utterance that you would like to test. Once the utterance is spoken, Slang will try to resolve the utterance into appropriate intent and entities according to the buddy's configuration. If you do not see the appropriate responses from Slang, you may need to update the configuration to better match the utterances, retrain the buddy and try again.

An example usage of the Web playground for our sample buddy is show below

When your configured buddy is showing an acceptable level of accuracy in one of the playgrounds, your configuration process is complete and you are now ready to integrate your buddy with one of Slang's client SDKs. To get started with integrations, please refer to the following guides:

Step 6: Gather required credentials for integration

One last bit of book-keeping we need to do is to gather the credentials required by the client SDKs for integration. Here are the required credentials and the steps to get them

  • API Key: The API Key is used to identify your account for any billing purposes. Its available via the "account" page of the Console as shown below.

  • Buddy ID: The Buddy ID uniquely identifies your app. Open your buddy and look for the Buddy ID on the right side of the page

That's it! You're all set to being integration with your application. Happy coding!