Skip to main content

$caila.getEntity

Makes a call to NLU and returns the array of all the values set for the entity.

Syntax

The method accepts the entity name as the string argument:

$caila.getEntity("Name");

A JSON object with the set of values the entity can take is returned.

How to use

Let us look at an example of how entity values can be output. Define a @Yes entity and specify the reference list of patterns:

[well] [of course|everything|all|seems to |be|possible] (yes|yess|lf|yep|yeah|exactly|aha|correct|ok|ok|o’k|okay|okay|oka|right|confrmd|that’s right) [yes|of course|naturally|sure|everything|all|seems to|be|possible]

Script:

state:
q!: Yes
script:
$reactions.answer(JSON.stringify($caila.getEntity("Yes")));

The following JSON object will be returned in response:

{
"name":"Yes",
"id":52502,
"records":{
"id":902002,
"values":[
"[well of course|everything|all|seems to|be|possible (yes|ye-s|lf|aha|hah|exactly|right|true|ok|ok|okay|okay|okay|okay|specifically|confirm*|yes) yes|of course|naturally|sure|everything|all|seems to|be|possible"
]
}
}