$caila
The built-in $caila
service allows you to access NLU and client entities from the bot script.
NLU
The following methods make available the NLU core utilities for natural language processing and understanding, e.g. intent and entity recognition, word inflection, and language identification.
Method | Description |
---|---|
cdqaQuery | Retrieve excerpts from a CDQA document. |
markup markupWithToken | Markup of the argument text. |
getEntity getEntityWithToken | Retrieval of all the values set for the entity. |
entitiesLookup entitiesLookupWithToken | Search for entities in the argument text. |
simpleInference simpleInferenceWithToken | Text classification without additional parameters. |
inference inferenceWithToken | Text classification with additional parameters. |
detectLanguage | Text language detection. |
Passing the API key
Most of the methods above have analogous methods with a WithToken
suffix, e.g. markupWithToken
, entitiesLookupWithToken
.
These methods work the same but accept an additional last argument: the NLP Direct API key.
WithToken
methods rather than their regular counterparts when the bot and the trained classifier intended for it exist in separate projects. In this case, the classifier API token must be passed explicitly.Client entities
Client entities are entities that the client can personalize during their conversation with the bot. The contents of such entities are unique to every client and unaccessible to others.
The following methods can be used to manage the contents of client entities from the script.
Method | Description |
---|---|
addClientEntityRecords | Adds a record for a certain client to existing records of an entity. |
deleteClientEntityRecords | Removes the records with the specified id for a certain client. |
getClientEntityRecords | Returns the list of all the records of an entity for a certain client. |
setClientEntityRecords | Overwrites all the records of an entity for a certain client. |
setClientEntityRecord | Updates the record of an entity for a certain client. |
setClientNerId | Sets a custom clientId that is to be used later to parse text. |
clearClientNerId | Removes a custom clientId set by the $caila.setClientNerId method earlier. |