Skip to main content
Version: 1.10.0

Slot

This chapter will introduce: what is slot and how to create and use slots on the platform.

What is Slot?

During conversations, the agent needs a container to save the key information extracted from user messages for further use. The container is called Slot.

Slot is a variable that can be inherited in conversations. The agent gives corresponding responses based on the value saved in the slot.

For example, the agent needs to complete a task called "book a flight".

The information needs to be collected includes "departure", "destination", "class", "departure time", etc.

The variables that store these data are called slots.

The agent taking value and assigning it to a slot is called filling slot.

The filling sources are:

  • Fill with conversation: fill the slot with information extracted from conversations.
    • Fill with word
    • Fill with sentences
  • Fill with APIs: fill the slot with data received from external APIs.

Fill with converstion

There are four rulse to fill a slot by conversation:

  1. Fill with entity
  2. Fill with role
  3. Fill with intent
  4. Fill with original text

You can set multiple rules for one slot, but the priority is:

  1. Fill with role
  2. Fill with entity & Fill with intent
  3. Fill with original text

Fill with word

Fill with entity

For example,

  • the slot "destination" is filled by the entity "station"
  • the entity "station" has the value "Shanghai“
  • the entity value "Shanghai" has the synonym "Shanghai Hongqiao"

User: "Book a train to Shanghai."

Agent: "Got it."

When the user sends the message, the agent makes the following judgments and actions according to the synonym of "Shanghai":

  • User message contains "Shanghai Hongqiao"
  • "Shanghai Hongqiao" is a synonym of the entity value "Shanghai", so the entity value "Shanghai" is extracted
  • Fill "Shanghai" in the slot "destination"

Fill with role

When there are multiple entity values that belongs to the same value, the agent needs to distinguish them by roles. You can define roles in intents.

For more details, see Format: advanced configuration of utterances

Fill with sentence

Fill with intent

When the sentence triggers an intent, the agent will fill the slot by the normalized value of the intention. It is generally used to express various selective branches, such as "that's OK", "forget it" and so on.

Agent: "How are you feeling right now?"

User: "Much better. It hardly hurts."

  • slot [patient symptom] = healthy

Agent: "That's great!"

  • The user's expression of the same meaning is quite casual, so you can choose to fill the slot by intent to push the conversation forward.

Fill with original text

It is gererally used to collect user suggestions, or work as a fallback choice when the agent fails to fill the slot by other rules.

Agent: "Please leave your phone number for further contact."

User: "I don't want to do so."

  • If the slot is not filled by the original text, the agent will fail to extract phone numbers and the conversation will not be pushed forward.

  • If set the rule as "fill with original text", the agent will fill the "phone number" slot with "I don't want to do so." and push the conversation forward.

Agent: "Anything you like to share?"

User: "I'll be away on business for a couple of days, so I may not be able to reply in time."

  • It's hard to predict what the user will send as a response, so filling the slot with the original text is a better choice.

Fill with APIs

To query information from an exteranl API. For more details, see Webhook Block.

<Intent: book a flight>

After a series of queries, the agent obtains the user's "departure", "destination" and "departure time".

The agent passes the "departure", "destination" and "departure time" to the API. The API looks up the flights based on the information and then sends the results to the user.

In this last step, the information needs to be filled in the slot before it being sent to the user.