🦸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.

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 the dashboard, as well as for performing actions in external integrations.

How to set tags via a function:

  1. In the Selarti dashboard go to the "AI". Then click on the row with the AI to which you want to add tags.

  1. Go to the "Professional settings" section.

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

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

  • get_contact: used when the bot obtains the user's contact details (for example, a phone number or Telegram username). The 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 an offer (for example, agrees to discuss details). The tag allows tracking the sales funnel or the effectiveness of interactions. Webhook sending is also supported.

  • close: used to end the dialog. After applying the tag the bot stops replying to messages, and further communication is handed over to a manager in the dashboard. This helps avoid endless loops of communication, for example, when two bots start talking to each other.

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

  • abort_reply: a tag to cancel generation of a reply. Used in cases where you need to set a condition under which the AI will not respond. For example, to ignore insults in chat.

  • 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 sending the message at the specified time.

  • custom api: a tag for embedding work of external services to obtain or record some information. For example, if you need to find out the current dollar exchange rate, send a request through the Central Bank API, thereby the AI will learn the information and be able to advise the client on the current rate. The tag is used by developers.

  • Web search: the tag allows searching for information in open sources. If the AI cannot find something from the context, it will refer to information on the internet.

  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 setup, to do this click "Test AI".

  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 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

  1. 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.

  1. Go to the "Professional settings" section.

  1. In the dropdown menu select "custom api".

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

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.

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

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

  1. Example implementation of receiving data in Google Sheets.

  1. 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.

  1. Test the correctness of the function execution.

  1. Check the request logs and its processing.

  1. In Google Sheets we received the created row.

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

Last updated