Conditional components

meya.conditional_exists

Routes flow conditionally based on whether or not a data value is set in the datastore.

Property

Description

key

the key of the data to read

Required

scope

where to retrieve data. One of flow, user, bot

Optional. Default: flow

Transitions

exists: the state to route to if if the data exists
notexists: the state to route to if if the data exists

component: meya.conditional_exists
properties:
  scope: user
  key: name
transitions:
  exists: exists_state
  notexists: notexists_state

meya.conditional_equal

Routes flow conditionally based on whether or not a value is equal to another value.

Property

Description

value1

the first value to compare (can use mustache expression)

Required

value2

the second value to compare (can use mustache expression)

Required

Transitions

equal: the state to route to if equal
notequal: the state to route to if equal

component: meya.conditional_equal
properties:
  value1: '{{ user.name }}'
  value2: Nikola
transitions:
  equal: is_nikola
  notequal: is_not_nikola

meya.conditional_nlp_intent

Routes flow conditionally on the value of an NLP classifier's intent. (wit, luis, other)

Transitions

Looks at the value of flow.intent and routes to the corresponding flow.

component: meya.conditional_nlp_intent
transitions:
  hi: hi
  how_are_you: how_are_you
  help: help
  whats_up: whats_up
  who_are_you: who_are_you
  meaning_of_life: meaning_of_life

meya.conditional_random

Routes randomly to another state. The magic 8 ball of conditionals.

Property

Description

choices

array of random strings

Required

Transitions

Map of choice to state to route to.

component: meya.conditional_random
properties:
  choices:
    - definitely
    - uncertain
    - noway
transitions:
  definitely: yes_state
  uncertain: maybe_state
  noway: no_state