For the complete documentation index, see llms.txt. This page is also available as Markdown.

User variables

The "Custom Variables" option allows you to create one or more variables yourself. Creating variables can be useful when you need the bot to remember specific information that can be later transmitted, referenced, or used to generate correct responses. Variables allow you to reduce context and save tokens.

This option is located in the "Additional Settings" section.

There are 2 variable options available:

  • Fixed variables

  • Dynamic variables

Fixed variables allow you to create variables with a known data type. We choose them when we know in advance what information we need to collect from the user, and what type and format it should be. In other words, when data typing and validation are important. The data contained in such variables can be used to transfer data to another service via an API.

Let's look at an example:

The following information is required to correctly fill out the fields: name, date of birth, and email. The data format must be as follows: Name, 01/15/1990, pochta@mail.ru. We'll enter the variables name, birth_date, and email, with the data type "String." In the instructions, we'll specify the format in which the data should be passed to the variables. "Ask the user for their name, date of birth, and email. The data must be passed in the following format: Name, 01/15/1990, pochta@mail.ru. If the information doesn't match the format, request it again, specifying the required format. Once the information is in the correct format, save it as a string in the variables set_fields_values(name, birth_date, email) accordingly." If the user enters any information incorrectly, the bot will request it again to ensure that the correct information is passed in the correct type and format. The end service will then receive information that won't cause an error.

The user provides information in an incorrect format, the bot clarifies the format and asks to resend it:

Once the information is received in the correct format, it is validated and stored in variables:

Dynamic variables allow you to store any information, of any size. The information is always stored as a string; dynamic variables have no type definition. These variables can be used more flexibly. The neural network automatically determines the important information and defines the variable. We cannot pass this type of variable to other services. Dynamic variables allow for higher-quality generation by the bot. If necessary, we can specify the information to be stored.

Let's look at an example:

We need to store a user's goals for financial planning. We'll specify this in the instructions: "Ask the user for financial goals. Pass the financial goals to the memorize function. Use the financial goals to build a budget."

Fixed variables

To create a Fixed Variable, follow these steps:

1

Step 1

To create one, click the "Add variable" button

2

Step 2

Then specify the variable name, description, and data type.

There are 4 types of variables:

  • String - any information that should be interpreted by the system as text ("watermelon", "suvvy", "+79001234567")

  • Integer - a whole number (1, 2, 5, -1)

  • Integer or fractional - a whole number or fractional number (1, 1.0, 3.4, -1.2)

  • Boolean - true or false (yes or no)

When choosing, carefully consider the type of information that will be contained in the variable.

In our example, we will select the "Integer" type.

3

Step 3

After entering all parameters, click on the "Save" icon

Fixed variables are associated with a function

In the instructions, specify which data should be saved to which variable. It's best to specify the data type that will be saved to avoid confusion and to avoid passing numeric data as a "String" data type.

For example: "Ask the user for their age and save the numeric data to the variable set_fields_values(age)"

Dynamic Variables

To enable Dynamic Variables, activate the corresponding switch. Specify the information you want to save in the instructions.

Describe in detail what exactly needs to be saved.

Once Dynamic Variables are enabled, an additional option will appear to remove information from these variables when clearing.

Dynamic variables are associated with a function

When Dynamic Variables are enabled, the neural network automatically decides which information to remember. However, if we need specific information to be saved, we can specify exactly what needs to be remembered. To do this, we add the phrase "Pass this information to the memorize function" to the instruction.

If necessary, we can retrieve information about variables. To do this, we request the following: "Return the information saved in the memorize function."

Last updated