🦸AI functions | AI-functions
How to give AI the ability to perform actions in internal and external systems.
Choose how to get information: video instruction (timestamp 07:55 — 10:49) or the text with images below.
Professional settings — a settings block where you can create various functions for the AI manager to interact with internal and external APIs. The block is located in the AI manager editing form.

Setting tags on a dialog via functions
Tags are used so that the AI manager can automatically mark dialogs at the right moment. This is needed for convenient visualization and filtering of dialogs in the dashboard, as well as for performing actions in external integrations.
How to set tags via a function:
In the Selarti dashboard go to the "AI". Then click on the row with the AI to which you want to add tags.

Go to the "Professional settings" section.

In the dropdown menu "AI functions" select the desired tag.

If necessary, supplement or change the function description, to do this click "Add function".

To reset AI function parameters, click "Cancel".

Test the correctness of tag setup, to do this click "Test AI".

Click "Save", to save changes.

Custom API setup
Function custom API allows you to connect external services and integrations so that the AI manager can process user requests and send data to external systems. This is a simple and convenient way to automate various tasks.
Examples of use
Connecting an external resource: you can connect the AI to any external service. For example, with an integration to a weather service the AI will be able to provide up-to-date weather information in response to user requests. When requesting current weather information, the AI will send an API request to the external service, receive data and return an answer taking into account the dialog context.
Call scheduling function: the AI manager can assist in scheduling calls by integrating with external systems. For example, the AI will request available time slots for a call, receive the necessary data and record the event in a calendar or CRM system.
Task or user contact scheduling: using an external API the AI can track and schedule actions based on time conditions, for example, send a reminder to the user or schedule a follow-up contact after a specified time interval.
Advanced capabilities: integrations can include ordering goods or services. For example, the AI manager can help order a taxi or coffee from a nearby café by integrating with the appropriate services.
How to configure custom API
Concept description
Custom API functions allow integrating the AI with external resources by sending POST requests via API to transmit and receive data. You can configure sending structured JSON requests to your server, for example, to create deals in a CRM or to get information such as available calendar slots.
When a user sends a message, the AI automatically checks whether functions need to be executed. If there is insufficient data, it will request the missing information, after which it will send a request to your server. The server will process the webhook, return a response that will be sent to the AI, and then the final reply will be generated. One user message can trigger an unlimited number of different functions.
In the Selarti dashboard go to the "AI". Then click on the row with the AI to which you want to connect the external resource.

Go to the "Professional settings" section.

In the dropdown menu select "custom api".

Write instructions for the AI, describe what this function should do.

Create a JSON object describing the structure of the POST request to your server. All types of json schema are supported https://json-schema.org/understanding-json-schema
Example for creating a deal in CRM:
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "user name"
},
"phone": {
"type": "string",
"description": "User's phone"
}
},
"additionalProperties": false,
"required": [
"name",
"phone"
]
}On the server we expect to receive an object like this.
{
"name": "Sergey",
"phone": "+7999999999"
}If the dialog lacks the necessary data to perform the function, the AI can ask for it additionally by itself.
Add the server URL that will handle webhooks from the AI, for example, Make.

Write rules in the AI instruction on how to correctly interact with the function.

Example implementation of receiving data in Google Sheets.

Add the response to the webhook. This information will be sent to the AI, processed, after which a reply to the user will be formed based on the dialog context and information from the server response.

Test the correctness of the function execution.

Check the request logs and its processing.

In Google Sheets we received the created row.

Last updated