Objects
Last updated
Last updated
Objects represent a set, or type, of information. For example, if you want the bot to access a list of products, first we need to create an object called Product and then create fields within this object that define the properties of this product, for example: Name, Color, Size, etc.
For developer readers, objects are similar to a database table.
There are now 2 standard objects in the Cosmos:
User: refers to user properties. Here are the standard fields:
- First Name - Last Name - Email - Telephone - Age - Language - Sex
Conversation: refers to the messages exchanged with the user during the conversation. Here are the standard fields:
- User (related to the User object) - Channel (Website, Facebook, etc...) - Duration (Duration of current conversation context) - First Message (Time) - Last Message (Time) - Messages (List all messages in the context of the current conversation) - Message (Message sent by the user) - Perception (Sets message characteristics, including NLP) - Steps (The steps covered by the current message) - Time (referring to sending the message)
Of the 2 objects above, only in User can create custom fields.
And of course you can create new objects, with custom fields, related or not to each other.
To create, simply go to the Data tab and click New Object.
Here, for example, we are creating the Request Object and defining that the Controller Object is User, that is, we want 1 user to have 1 or more related requests. Therefore to exist 1 request there must be 1 user.
In the Cosmo, for now, you can have an object with at most 2 levels of hierarchy if the controller object is User, and at most 1 level of hierarchy if the controller object is a custom object.
The hierarchy level here is defined as the relationship between an object and its controller object. That is, a parent object relationship to child object, where a parent record can be related to 1 or more child records. Therefore considering 2 levels we would have: Object Grandfather> Father Object> Son Object.
CAUTION: With this controller object model, if you delete any record from the controller object, for example the user, all records controlled by this user record are also deleted.
The Name field refers to how this field can be used as a reference in the conversation flow.
The Controller object can not be changed after the object is created.
The Reference Field means which field is used when the request appears in the search list or is referenced in other objects. In the example above, the order record will be represented by the Order Number field.
Remember that in case you need to download your custom objects, you need to follow a JavaScript code, which you can find here.