Teneo Developers

Hands-on

In Teneo, we can use different kinds of Match requirements in our flow triggers. We have already shown some examples of different ones. Now we will show you how to create a conditional trigger.

Both triggers with TLML Syntax Match and those with Class Match can be built automatically from testing examples. The difference between the two is that with conditions, we have the ability to hand-tailor intent trigger using Teneo's condition syntax to either cover a broad use case or a very specific set of words and sentences.

We will now build a new flow for people that are interested in joining the Longberry Baristas' loyalty program, which will have a trigger with a TLML Syntax Match and allow dialogs like the following:

User: How much does it cost to join the loyalty program?
Bot: You can join the loyalty program for free! Just ask your local barista for a club card and you're in!

The final result will look like this:

final flow

Create a new flow

Let's start by creating a new flow to cover this intent.

  1. Click on the 'Flow' icon in the top ribbon.
  2. Name the flow User wants to know if loyalty program is free.
  3. Click the arrow in the top left corner of the window to go to the main flow window.

Populate the trigger

The next step is to populate the trigger to cover the testing examples:

  1. Select the trigger and name it Is the loyalty program free?.
  2. Add a Intent trigger on the right and paste the following Intent examples into the field:

example-inputs

1Do I need to pay for the rewards program
2How much does it cost to join the loyalty program
3Is the rewards program free
4What is the price of the loyalty program
5

Generate a condition

At this point we can either force Teneo to generate a Match or manually select one we are interested in. Let us start off by manually adding a TLML Syntax Requirement and automatically drafting a condition.

  1. Scroll down to the 'Match' section and click on the 'Add' button. This will toggle a drop-down list of different Match to select.
  2. Select 'TLML Syntax'(Teneo Linguistic Modeling Language) and then click on the 'Advanced Options' button under the condition field.
  3. Finally, click on the 'Draft' button. This will draft a condition based on the examples given to the trigger.

Selecting 'Draft' will replace any TLML Syntax condition written inside the Syntax condition panel from the first place.

  1. After a while, the following condition will appear:

Here, we can see that Teneo used the Intent examples to find matching language objects and combine them in a language condition. This is human-readable and, if we understand the syntax, it can be fine-tuned to suit our needs. For now, we will just use the condition as is; later, we will see how to further optimize this language condition in order to shorten and increase the coverage of a Syntax condition.

If you are developing using a language without any Language Resources, Teneo will generate a condition using plain words instead of Language Objects.

Add an answer

To finish the flow, we need to add an answer text to the output.

  1. Select the Output Node and name it You can join the loyalty program for free!.
  2. Paste You can join the loyalty program for free! Just ask your local barista for a club card and you're in! into the 'Answers' field on the right.
  3. Hit 'Save'.

That's it! We now have a flow that includes a trigger with a TLML Syntax Match.

Test yourself

Go ahead and test yourself by adding one more example, Can I join the loyalty program without paying? and draft the condition again following the steps from this page.

Next page
Share information between flows
Was this page helpful?