intent
Description
intent — the path to the intent is written after the tag. An intent is a key entity of the NLU service; it unifies a set of phrases, user intent and other metadata.
The local tag intent is active only in the dialog context, and transition to the state is possible from the nearest parent state or from child states. You can use the global tag intent! to transfer the dialogue into this state from any other state.
Value type
- string; the path to the intent.
Parameters
fromState(string) — defines a state from which the transition is possible.toState(string) — defines a state to which the transition is possible.onlyThisState(boolean) — iftrue, the transition to a state can only be made from the state specified in thefromStateflag, not from the child states. The default isfalse.
Learn more about context managing
Nested data
- multiline data
Syntax
/ is the delimiter in the hierarchy of elements in the intent path:
/hi— the path comprises the/ character and the intent name./hi/politely— a nested intent. The nesting depth of intents is unlimited.
How to use
- Simple example of use:
theme: /
state: Hello
intent: /hi
a: Hello.
state: Goodbye
intent: /bye
a: Bye.
state: CatchAll
event: noMatch
a: You said: {{ $request.query }}- Example of using flags
fromState,onlyThisState:
theme: /
state: HowAreYou || modal = true
intent: /HowAreYou
a: And you
state: Bad
intent: /Bad
a: Don't be upset!
state: Good
intent: /Good
a: Where are you from?
state: Time
intent: /WhatTime || fromState=/HowAreYou, onlyThisState = true
a: It's perfect time to order food!
In this example the transition to Time state is only possible from HowAreYou state as we specified it in the fromState flag. In this case, the transition from the nested states Good or Bad will not occur.