Skip to main content

User phrases and events

In the J‑Graph visual editor, the bot business logic is built upon states. Blocks describe how the bot can switch between states and what it should do after switching.

tip
User phrases (intents) and events are the blocks that determine how the dialog can switch from the current state of the script to other states.

User phrases (intents)

An intent is a set of phrases which are similar in meaning and express some user intention. For example, phrases like Hello, Good day, and their synonyms an all be recognized with the Greeting system intent.

To add an intent to a state, go to the state editing menu, find User phrases and events, and select User phrase. Alternatively, you can select Add phrase at the bottom of the state on the canvas.

On the User phrase tab, you can:

  • Create an intent:
Intent editing menu
Intent creation
  • Select among existing custom and system intents. System intents are marked with the special icon.

    tip
    The  button will take you to the Intent selection window. Here you can view all project intents (except for those from knowledge base) and edit them.
    Intent selection
  • Fill the intent with training phrases. To do this, choose the desired intent in the state editing menu and select Add alternative examples.

  • Choose where the bot should go when the intent is triggered:

    • To a new state — a new state and a link leading to it from the current intent will appear on the canvas.
    • To an existing state — a link leading from the current intent to an existing state will be created on the canvas.

Events

An event is an action happening in the account, the bot script, or a channel connected to the project, which the bot can react to. JAICP supports a lot of built-in events, for example:

  • noMatch — the user request was not recognized.
  • fileEvent — the user sent the bot a file in the messenger.
  • hangup — the customer finished the call (this event is specific to the phone channel).
tip
Users can create their own custom events. Such events can have arbitrary names. They can be triggered by external systems or by JAICP itself: for example, when a text campaign is launched.

To add an event to a state:

  1. Go to the state editing menu, find User phrases and events and select Event.
  2. Select one of the built-in events, or a custom event and enter its name manually.
  3. Enter the name of a new or existing state where the bot should transition to by this event.
Event selection

Settings

You can configure the following settings for user phrases and events:

SettingDescription
Go to state
The bot should go…
The state where transitions can be made from the current state and other states in the same group.
Ignore transitions from nested statesIf the checkbox is active, transitions to the selected state can be made strictly from the current state but not from others in its group.