Quote

One of the key advantages of our BigDuck.ai platform is the ability to teach a bot to communicate with any external system that has an API. The scheme of operation is quite simple; to integrate with an external system, you need to:

  • Implement an HTTP service that will process requests from the bot. This service will act as an intermediary between the bot and the external system.
  • Implement a prompt that involves calling the necessary methods (for example, the method of creating a card)
  • Fill out a contract between the bot and the implemented service in the bot settings.

The main “engine compartment” technology of this solution is OpenAI Function Calling. For clarity, here is a top-level interaction scheme:

Based on the scheme, the sequence of operations of this solution is obvious, and the initiator is the decision to call the function by OpenAI.

In this guide, we'll look at an example of using the “External API” functionality using the example of connecting to amoCRM.

First of all, you need to log in to the bot control panel:

Next, go to the Chatbots section and select Edit for the required bot:

We are interested in the External API tab, let's go directly to it:

Fill out the “API gateway” form, everything is simple:

  • URL: intermediary service address
  • API Token: an authorization token for your service, it can be transferred both in the request body and in the header, and it is also possible to specify a name (key) for the token

Let's move on to the most interesting part, the API specification form:

The descriptions of the values of each field can be seen right on the form; we will duplicate it:

  • API Name: a short comment for us
  • Path: the endpoint of our method
  • The purpose of the API call: Get or Post request
  • Select the type of result: type of response returned
  • Description of the action: the most important description field that the bot will rely on when deciding whether to call a method

Then, once all the required fields are filled in, the form expands to fill in more details about the method:

An example of a completed method for integration with amoCRM:

After filling out the specification, it is necessary to upgrade the bot's prompt by adding conditions for calling certain methods that we filled in in the section under consideration. Also, after updating the prompt and API specifications, you should definitely go to the Deploy section and activate the bot training

Thus, using the capabilities of our BigDuck.ai platform, the range of use cases for integrated AI bots is enormous and is limited only by the API capabilities of external systems.

Bonus: a few examples of good offers from our prompt engineer.

  • A simple prompt in English:

When the client has provided a phone number - call the lead creation method and pass the data received from the client: client name, client email, client phone number, date of meeting with the client. If the client has not provided an email or date of meeting, pass Null, and if the client has not provided a name - pass Unknown.

  • With the following actions (algorithmic instructions):

If a client asks a question about finance: Credit payment/installments/refunds, then {

1. First, send a message to the Finance Department's TG chat with the following information:

  • - customer name
  • - WhatsApp number
  • - the text of the client's request

2. Reply to the client: [client_name], I have forwarded your request to our specialists from the finance department. They will contact you shortly to offer the best solutions for you.

}

Читайте также