Ai-assistant with MaviBot table
Using a function developed by Mavibot team, the AI chatbot perfectly understands the values entered into the sheet, and then writes them to a system variable in the project settings.
For example, you may need this for an AI assistant who will advise your clients on the available range of products in your online store, as well as to advertise your capabilities with a smart bot.
Exactly how to use a bot to read a Google-sheets is up to you, and we, in turn, will show you how to create a sheet and configure the bot to work with it.
Getting ready a table
To get started, go to the sheets section:

Next, you will see the "Add sheet" button, which opens a modal window in which you need to enter the name of the sheet:

Enter the name for the sheet and click on the "Done" button. Then a new sheet will be created in the project and will appear in the "Sheets" section:

Sheet settings
After creating the sheet, you need to add rows and columns. To do this, find the "Go to" button on the card of the desired sheet and click on it.
You see next settings:

To add column with a name, click "Plus":

when you click on the button, a modal window will appear in which you need to enter a name for added column:

Afte entering the column name, click on the "Done" button, then the new column will be added to the sheet. Add the required number of columns and then rows:

Now, you sheet looks like this:

Copy (remember) the sheet ID: to do this, click on the address bar:

Next, let's go to configuring the blocks in the builder.
Working in the funnel constructor
Function get_records_from_table()
To use the get_info_from_table() function, you need one block in the funnel constructor.
Go to the appropriate tab in Mavibot and create a block with a condition (starting condition or non-state with a condition):

Define a variable (it will be used for the AI assistant's knowledge): in this example, the variable is 'online_shop'.
Example of code from the calculator
project.online_shop = get_records_from_table(5)
project. - is a constructor for setting a variable in the project configuration;online_shop - name variable;get_records_from_table(5) - function, where the parameter is passed as table ID.
Instead of #{none}, we will write our variable in the message using the #{} construct to visually see what data has been written to the project variable.

Pay attention!
The variable embedded in the message is needed to check whether the bot reads the function correctly. When you run the block in test mode, the bot will display the values that will be assigned to the variable.
Pay attention!
After configuring the block call in test mode and saving the variable in the project settings, do not delete this block.
You may need it: for example, if you have added any more values to the table, just launch the block in test mode. Then the data in the project variable will be updated.
Data trasnfer block
Next, we will create "Status" block for transferring data to the client's card.

"This block can also transmit a closing message from the bot, such as: 'Thank you for your order! Your data has been forwarded to the manager.'"

Next, copy the block ID. You will need it to configure the AI assistant in the command "calling block 31241050", where instead of the block ID from the example, you need to insert your block ID.
Attention!
After testing, replace "calling block 31241050" with the command "start_block_from_ai 31241050".
The command "calling block 31241050" is debugging and helps to understand what data the bot is recording (see the section "Testing"). ссылка "Тестирование"
To launch the bot for clients, specify the command "start_block_from_ai 31241050".
Reading the table
Now go to the bot testing and launch the block with the condition:

Thus, the block worked correctly: you can see the values that are in the variable in the project settings.
You can verify this by going to the appropriate section:

In the "Variables" tab in the project settings, you will see your variable with the values added in it from the table. So now, inside your project, there is a variable with goods, cost, and everything that you specified in the table.
Working in AI-assistant
Go to the "AI assistant" section and start chatbot with AI settings.
"AI Assistant Role: Sales Representative"

We will also set additional settings:

AI-assistant settings
In the bot settings we write the following data:
The position and instructions for the bot.

The command to call the block and transfer variables to the system is written as follows:
<If the customer wrote "The order is correct" or "Correct", then write "start_block_from_ai N">, where instead of N the block ID is written with the final message: the Status block transmits data to the customer's card:

Bot Knowledge
In the "Bot Knowledge" field, pass the variable that was previously cached as a block with the condition:

Bot knowledge:

This way, the bot will take information from a variable in the project settings and advise your clients on the available product range.
Data format
In the format of the transmitted data, you specify the data you are collecting yourself (for example, a product), then enter the phrase with the "key" and assign a value to the key:

This way, when calling the block, variables will be passed to the client's card: then you can work with variables, for example, in the constructor:

"Since we declared the variable payment_sum in the data format, you will be able to generate a payment link directly in the bot when payment services are connected.

When declaring the payment_sum amount variable, the payment link is generated automatically!
Not suitable for legal entities or sole proprietors with VAT.
We strongly recommend you to provide a payment link after checking the payment amount by the manager to avoid inaccuracies!
At this stage, the AI assistant setup is complete.
The remaining parameters can be set at your discretion:

Testing a bot
"If you already have bots running, specify in the AI assistant's launch condition to start only in the testing window."
Step 1. Click on the condition constructor

Step 2. Select the tab with the test window and click "Add":

Now, in the launch condition, you will see the following value:

In the example, we will test it directly in the messenger:

Do not send a payment link without testing payments!
For more information about the settings of each payment system, see the "Payment Services" section. ссылка "Платежные сервисы".
This message is being sent in test mode due to the command "calling block 31241050"

After testing and debugging the bot, write the command in the settings of the bot "start_block_from_ai 31241050".
This way you can create any kind of online store and use any necessary values inside the table.
The main limitation - is only your imagination!
Last updated


