Teneo Developers

Microsoft LUIS and Teneo in 10 minutes

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 us prepare its value. Copy the following code and populate it with the values you collected from your LUIS application above:

groovy

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

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. Use the 'Add' button to creat a new 'Pre-Matching' script.
  3. Click on the 'Add' button in the top right and add the following groovy line into the editing window luisPredict.predict(_).
  4. Click on 'SCRIPT' to name the script Call luisPredict.
  5. Hit 'Save'.

Next page

Your first conversation

Was this page helpful?