Your First LUIS^Teneo Solution

In a few minutes you can 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 funny) 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.

Connect your LUIS application to Teneo

Now it's time to build a bridge between your LUIS solution and Teneo. This will make your solution to bypass Teneo's native classifier together with it's classes inside Class Manager and instead use LUIS native intent classifier.
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 Published Location to /script_lib.
  4. Hit 'Save'.

Prepare your 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:
    • App id.
  3. Select 'Azure Resources' from the sidebar to the left.
  4. You should arrive to this page, and store the following values:
    • Primary Key
    • Endpoint URL.

Screenshot from Azure LUIS site

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 of 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 Try Out 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 Try Out panel that says, 'A reload of the engine is required to apply your recent changes'. Click Reload now to get rid of that message.

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

Where to go next?

You have now connected your LUIS solution with Teneo. Let's continue by adding a new LUIS intent.

Was this page helpful?