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:
- Log in to Teneo Studio.
- Select ‘Solutions’ in the menu on the left.
- Click the ‘New’ button in the upper right corner. This opens a dialog box.
- Fill in a name for your solution, for example
My First LUIS^Teneo Solution.
- Make sure the Solution Language for this first bot is English. This will be the mother tongue of your bot.
- 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.
- 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:
- Open your solution by double-clicking its name in the Solutions window.
- Click on the tab ‘SOLUTION’ in the upper left corner.
- Select ‘Resources’ in the purple bar on the left.
- Make sure the ‘Lexical’ tab at the top of the window is selected.
- Click ‘Assign Lexical Resource’ in the upper right corner and select Teneo Lexical Resources English in the drop-down.
- 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.
- While inside the Resources section, select ‘File’ located at the top.
- Use ‘add’ on the upper right to add the .groovy file. Alternatively, you may drag and drop it.
- Change the path to
- 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.
- Download this file your_first_teneo_solution.lu and store it somewhere safe.
- Create a new LUIS application by pressing the dropdown menu beside the ‘New app’ button.
- Select ‘Import as LU’ and choose the LU file you downloaded.
- Press the ‘Train’ button located at the top right corner. This will train the intent and score the examples.
- 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.
- Select ‘MANAGE’ located on the top right bar.
- Select ‘Settings’ from the sidebar to the left store the following value
- App id.
- Select ‘Azure Resources’ from the sidebar to the left.
- You should arrive at this page, and store the following values:
- Primary Key
- Endpoint URL.
Prepare your Teneo Solution
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:
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:
- Select ‘Globals’ in the purple bar on the left-hand side, and then select ‘Variables’.
- Click ‘Add’. A panel for specifying the new variable appears on the right-hand side.
- Name the variable:
- Set its value to the string you created above.
- Hit ‘Save’.
Now, let’s update the global Pre-Matching script:
- Select the ‘Scripts’ tab at the top.
- Select ‘Pre-Matching’.
- Click on the ‘Edit’ button in the top right and add the following groovy line into the editing window
- Hit ‘Save’.
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.
- 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).
- 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.
- Say hello to your bot. The input field is at the bottom of the panel.
- Perhaps you can try some other small talk questions too, like:
My name is Eric
What is my name?
I like you
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.