Skip to main content
Version: 1.4.0

Attributes

This chapter will explain what metadata and attributes are and how the dialogue platform uses metadata and attributes to excecute personalized reply and response

Metadata definition

In each conversations, in addition to identifying user's key information and main purpose through NLP, you can better help the agent make a more appropriate response by those native information such as timestamp, emotion, user attributes and so on. This kind of native information is called as metadata.

Metadata contains the following common types:

  1. The parameter name and parameter value created externally and passed in together with the message through the dialog interface, such as timestamp, user ID and other information.
  2. The user ID can describe the attribute name and attribute value of the user's portrait, such as user position, member level, etc.
  3. The model calculates based on the message and generates the parameter name and parameter value of additional description information, such as sentiment classification.

Preset metadata

The preset metadata is the information automatically generated by the platform when the dialog interface is called. At present, the preset metadata provided by the platform is as follows:

Metadata namedescriptionexample
Timezonetime zone where the session is located. For details, see agentsAsia/Shanghai
agent_ IDthe agent ID replied. For details, see [agents] (agents)8016
Environmentreply environment. For details, see train&testsketch

Attribute

Attributes are the most commonly used category in metadata. Attributes can often meet most personalized needs, such as:

  • Different responses for users with different attributes or attribute groups
  • In responses, the attribute values of the user are spliced to make the speech of the agent more accurate and personalized
  • Pass user attributes to third-party interface services to provide users with more capabilities than dialogue

The platform provides the user's attribute management ability. On the platform, you can maintain the user's attributes and attribute types, and use these attributes to build the dialogue process.

Attributes can be divided into "single value" and "multi value", and their update strategies are different.

  • A single value attribute has only one value. When it is updated, the original attribute value will be replaced.
  • Multivalued attributes can have multiple values, similar to labels. You can add more values on the basis of retaining the existing attribute values.

Preset properties

Preset attributes are the information automatically generated by the platform for users when creating users. All preset attributes can be seen in the attribute management interface. At present, the preset properties provided by the platform are as follows:

Attribute namedescription
Channelchannel ID of the user

Creation and management

  1. Click the agent menu "Build - Custom Settings - attributes" to enter the attribute management page, displaying the attribute ID, attribute name, attribute type and operation buttons:
  1. Click the "CREATE" button and set attribute name and attribute type to create a new attribute.
  • Single value types are generally mutually exclusive attributes between attribute values. Such as member and non member, highest education, gender, etc
  • Multi value types are generally user labels that can mark multiple users at the same time. Such as specialty, preference, etc

Change attribute value of channel user

  1. After creating a user, you can call the interface to operate the attribute value of the specified user. The interfaces that may be used for calling are as follows (see the interface document for details):
    1. Create channel user interface: /Chatbot/v1alpha1/agents/{AgentID}/channels/{channelid}/users/mutate
    2. Interface for obtaining channel user attribute value: /Chatbot/v1alpha1/agents/{AgentID}/channels/{channelid}/users/{username}/attribute value
    3. Change the attribute value interface of channel users: /Chatbot/v1alpha1/agents/{AgentID}/channels/{channelid}/users/{username}/attribute value/mutate

Personalized reply through metadata

Common reference format and rendering effect of metadata

Reference format: {metadata = NAME OF METADATA}

Rendering effect: if the metadata is empty, the rendering is empty; If the metadata is multivalued, all values will be spliced into a string with "," and rendered as a whole.

Reference metadata value in agent reply content

It can take effect in FAQ answer, agent ask and agent reply in Dialogue trees, as well as message sending and Request Block, Inform Block in Dialogue Flows.

In the response text editing area of the message sent by the agent, the response can be rendered with the metadata value.

The agent will directly replace the corresponding reference text with the metadata value:

The operation assignment unit assigns the metadata value to the word slot

In the edit area of "assign word slot to" in the assignment operation unit copy mode, assign the value with the metadata value.

The agent will assign the corresponding metadata value to the corresponding word slot:

Take the metadata value as the interface request parameter of the multi slot unit

In the request address editing area of the multi slot interface unit, the request parameters are rendered with metadata values.

The agent will directly replace the reference in the request parameter with the metadata value:

Use metadata values in dialog process policies

  1. In the branch jump configuration of the unit, jump according to the metadata value
  2. Use the attribute value to inquire the bottom value of the slot filling unit after the number of inquiries exceeds