Conditional components

meya.conditional_exists

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

PropertyDescription
keythe key of the data to readRequired
scopewhere to retrieve data. One of flow, user, botOptional. 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.

PropertyDescription
value1the first value to compare (can use mustache expression)Required
value2the 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.

PropertyDescription
choicesarray of random stringsRequired

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