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: Example
q!: Yes
script:
$reactions.answer(JSON.stringify($caila.getEntity("Yes")));

The following JSON object will be returned in response:

{
"id": 460175,
"name": "Yes",
"records": [
{
"id": 28921109,
"values": [
"[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]"
]
}
]
}