🦸AI functions | AI-functions

How to enable AI to perform actions in internal and external systems.

Choose how to get information: video tutorial (timestamp 07:55 — 10:49) or the text with images below.

Video on Zen.

Video on Rutube.

Video on YouTube.

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 your personal account, as well as for performing actions in external integrations.

How to set tags via a function:

  1. In your Selarti personal account, go to the section AI. Then click on the row with the AI to which you want to add tags.

  1. Go to the section “Professional settings”.

  1. In the dropdown menu “AI functions” select the desired tag.

Tags in the dropdown list “AI functions”
  • success: applied when the dialog is successfully completed (for example, an agreement on a meeting or call is reached). After adding this tag, the dialog is marked as successful and the information can be transferred to a CRM or another system via webhook.

  • get_contact: is used when the bot receives the user's contact details (for example, a phone number or Telegram username). This tag marks the dialog as containing contact information, and the data is sent to an external system via webhook.

  • interest: applied when the user shows interest in the offer (for example, agrees to discuss details). This tag allows you to track the sales funnel or interaction effectiveness. Webhook sending is also supported.

  • close: used to end the dialog. After applying this tag, the bot stops responding to messages, and further communication is transferred to the manager in the personal account. This helps avoid endless communication cycles, for example, when two bots start a dialog with each other.

  • operator: used to transfer the dialog to an operator. After applying this tag, the bot transfers the dialog to the operator and stops responding to messages.

  • scheduler: used to send a scheduled message. If the client writes messages like: “Write to me on the 30th” or “Write the day after tomorrow” — the bot will schedule the message to be sent at the specified time.

  1. If necessary, supplement or change the function description, to do this click “Add function”.

To reset AI function parameters, click “Cancel”.

  1. Test the correctness of tag assignment, to do this click 'AI Testing'.

  1. 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 transfer data to external systems. This is a simple and convenient way to automate various tasks.

Usage examples

Connecting an external resource: you can connect the AI to any external service. For example, by integrating with 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 the data, and return a response, taking the dialog context into account.

Call scheduling function: The AI manager can help schedule 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 scheduling or user follow-up: 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 cafe by integrating with the relevant services.

How to set up custom API

Concept description

  1. In your Selarti personal account, go to the “AI” section. Then click on the row with the AI to which you want to connect an external resource.

  1. Go to the section “Professional settings”.

  1. In the dropdown menu, select “custom api”.

  1. Write an instruction for the AI, describe what this function should do.

  1. 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"
    ]
  }

We expect to receive such an object on the server.

{
"name": "Sergey",
"phone": "+7999999999"
}

If the dialog lacks the necessary data to perform the function, the AI can ask for it additionally.

  1. Add the server URL that will process webhooks from the AI, for example, Make.

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

  1. Example of implementing data reception in Google Sheets.

  1. Add a webhook response. This information will be sent to the AI, processed, and then a response will be generated for the user based on the dialog context and the server response information.

  1. Test the correctness of the function execution.

  1. Check the request and processing logs.

  1. In Google Sheets, we received the created row.

If you have difficulties connecting external resources, you can order a turnkey setup of functions from us. You can contact us on Telegram — @selarti_support_bot.

Last updated