Learn How to Build your First LUIS^Teneo Solution

Enterprises are accelerating the adoption of AI chatbots to enrich customer experiences, drive revenue and capitalize on new opportunities. However, building a chatbot that is truly conversational is not within everyone’s reach.

That’s why we have launched LUIS^Teneo, a SaaS-based development suite and bot engine that combines the NLU-power of Microsoft LUIS with the conversational power of Teneo, to help developers build, test, and release scalable conversational bots faster.

But how does it work exactly? Here’s a guide on how in just a few minutes you can easily set up and say ‘Hello!’ to your first LUIS^Teneo solution. 

Let’s get started!

Create a Solution

Building a bot in Teneo means building a solution. A solution is a container for all knowledge, conversational logic and additional resources that make up your bot.

This is what you need to do to create a solution:

  1. Log in to Teneo Studio.
  2. Select ‘Solutions’ in the menu on the left.
  3. Click the ‘New’ button in the upper right corner. This opens a dialog box.
  4. Fill in a name for your solution, for example My First LUIS^Teneo Solution.
  5. Make sure the Solution Language for this first bot is English. This will be the mother tongue of your bot.
  6. Under ‘Solution Content’, choose ‘Create from Template’ and select ‘Teneo Dialogue Resources English‘ from the list. This will boost your bot with lots of pre-built flows. The bot will then, right out of the box, understand and respond to greetings, meta-requests (like Can you repeat that?), feedback (like Great! or You are stupid) and conversational small talk.
  7. Click ‘OK’. It may take a couple of minutes for your solution to be created. You will be notified when it’s done.

Assign Teneo Lexical Resources

Teneo comes with pre-built Lexical Resources (TLRs). The TLRs help your bot to understand a specific language, its words, synonyms and expressions.

Now, let’s specify which TLRs to use for your bot. This is what you need to do:

  1. Open your solution by double-clicking its name in the Solutions window.
  2. Click on the tab ‘SOLUTION’ in the upper left corner.
  3. Select ‘Resources’ in the purple bar on the left.
  4. Make sure the ‘Lexical’ tab at the top of the window is selected.
  5. Click ‘Assign Lexical Resource’ in the upper right corner and select Teneo Lexical Resources English in the drop-down.
  6. Repeat step 5 to also assign the Teneo Offensive Language Detector English, the Teneo Sentiment and Intensity English and the DateTime Handler English resources.

Connect your Microsoft LUIS Application to Teneo

Now it’s time to build a bridge between your Microsoft LUIS solution and Teneo. The first step is to add LuisPredict.groovy to your solutions file resources. This .groovy file contains the needed code to make this possible.

  1. While inside the Resources section, select ‘File’ located at the top.
  2. Use ‘add’ on the upper right to add the .groovy file. Alternatively, you may drag and drop it.
  3. Change the path to /script_lib.
  4. Hit ‘Save’.

Prepare your Microsoft LUIS Application

It’s time to visit the LUIS application to collect some details which later will be used to connect this LUIS application to your Teneo solution. But first, we’ll need to import intents to our LUIS application.

When you created your solution, you based it on the ‘Teneo Dialogue Resources English’ template solution which comes with many prebuilt flows and intents. To make sure LUIS is aware of these intents, we’ll need to import them into your LUIS application.

  1. Download this file your_first_teneo_solution.lu and store it somewhere safe.
  2. Create a new LUIS application by pressing the dropdown menu beside the ‘New app’ button.
  3. Select ‘Import as LU’ and choose the LU file you downloaded.
  4. Press the ‘Train’ button located at the top right corner. This will train the intent and score the examples.
  5. Once the training is done press ‘Publish’ at the top right corner. This so Teneo can retrieve it.

Once the application is created and trained it’s time to collect some details, so we can add them to your Teneo solution later. You can temporarily store them in a text file.

  1. Select ‘MANAGE’ located on the top right bar.
  2. Select ‘Settings’ from the sidebar to the left store the following value
    1. App id.
  3. Select ‘Azure Resources’ from the sidebar to the left.
  4. You should arrive at this page, and store the following values:
    1. Primary Key
    2. Endpoint URL.

Prepare your Teneo Solution

Now it’s time to prepare our Teneo solutions by adding a Global Variable and a Global Script.

First, we’ll add a global variable called luisPredict to the solution. This variable should contain the API keys for your LUIS application. Before we add the variable to the solution, let’s prepare its value. Copy the following code and populate it with the values you collected from your LUIS application above:

new LuisPredict('primaryKey','endpointURL','AppId')

The result should look something like this:

new LuisPredict('12345678910abcd','https://www.luis.ai/applications/abcd-efghi-jklmn-opqres-tuvw-qq-112112/'', 'dcba019876543210')

Now let’s add the global variable:

  1. Select ‘Globals’ in the purple bar on the left-hand side, and then select ‘Variables’.
  2. Click ‘Add’. A panel for specifying the new variable appears on the right-hand side.
  3. Name the variable: luisPredict.
  4. Set its value to the string you created above.
  5. Hit ‘Save’.

Now, let’s update the global Pre-Matching script:

  1. Select the ‘Scripts’ tab at the top.
  2. Select ‘Pre-Matching’.
  3. Click on the ‘Edit’ button in the top right and add the following groovy line into the editing window luisPredict.predict(_).
  4. Hit ‘Save’.

Hello World!

Time to talk to your bot! The ‘Try out’ panel in the main solution window allows you to test your bot and chat with it.

  1. If you are still in the Globals window, click on the arrow in the top left to go to the main solution window (the HOME tab).
  2. If the tryout panel is not visible, make it appear by clicking the ‘Try out’ button on the right side of the window.

Because you’ve just assigned the Lexical Resources, there will be a message at the bottom of the tryout panel that says, ‘A reload of the engine is required to apply your recent changes’. Click Reload now to get rid of that message.

  1. Say hello to your bot. The input field is at the bottom of the panel.
  2. Perhaps you can try some other small talk questions too, like:
    1. My name is Eric
    2. What is my name?
    3. I like you

Teneo Developers

Try Before You Buy.
Build. Deploy. Analyze.

Sign up to get your own developer sandbox of Teneo containing all the tools needed to build and manage advanced conversational solutions.

Get Started For Free