new AskAndMap()
Members
-
parameters :Object
-
Node parameters
Type:
- Object
Properties:
Name Type Description parameters
Properties
Name Type Description prompt
ExpressionString | Object | Array.<ExpressionString> | Array.<TextObject> a textual message to the user. can contains an array for random messages. can contain an object with "language" keys. cyclePrompts
boolean if true, will show the prompts cyclicly. false: will stay on the last prompt forever. view
ExpressionString | Object a file name of a view, or a view JSON object, to be used instead of the prompt in order to send native json image
ExpressionString an html string or a file name, that is rendered as an image to send the user imageDataArrayName
MemoryField composite (message./global./context./volatile./local.) field name for an array object that contains data for the images contexts
Array.<ContextItem> an array of contexts, each consists of expected entities, intents and more (ContextItem) replayActionOnReturnFromContextSwitch
boolean if false, this node is not closed and re-opened when return from context switch
Methods
-
contextChildren()
-
the context children are all the children
-
contextProperties()
-
get the properties of all contexts on the contextmanager node
-
currentContextChild(tick)
-
get current context child
Parameters:
Name Type Description tick
* -
findTimeoutChild()
-
find the first child that doesnt have any intent or entities
-
handleTimeout(tick)
-
selects a timeout child if exists
Parameters:
Name Type Description tick
Tick -
tick(tick, target)
-
map entities and tick down The context can be searched only below a certain point in the tree. If the conversation is at a certain context, and the context is switched to a different context, then that switch point is the place to start. otherwise, we dont have a context yet, so we search from the top
Parameters:
Name Type Description tick
Tick target
* -
tickMessagePromise(tick [, fieldName])
-
send a message method. output a message asynchrously
Parameters:
Name Type Argument Description tick
Tick fieldName
string <optional>
to use when building a message. ,instead of prompt Returns:
A state constant.- Type
- Promise
-
validators()
-
defines validation methods to execute at the editor; if one of them fails, a dashed red border is displayed for the node
Returns:
- Type
- Array.<Validator>
-
wasEntityUsed(target, ett, searchDirection)
-
for AskAndMap, return true if entity was used, period, regardless of the direction (for ContextSelector on downwards direction you can use for mappings even if used )
Parameters:
Name Type Argument Description target
Target ett
* : entity searchDirection
string <nullable>
"upwards" or "downwards" Returns:
- Type
- boolean