Instruction on Function Calling in AI Assistants on the Leeloo.AI Platform
UA | US | RU |
---|
1. Introduction
AI Assistants from OpenAI can perform various actions on the Leeloo.AI platform and call functions under specified conditions.
These conditions are defined in the assistant's instructions. One of the key capabilities is subscribing a lead to a sales funnel block. This allows for automatically directing the user to the appropriate segment of the sales funnel, ensuring personalized interaction and increasing conversion rates.
With AI Assistant functions, you can:
Add clients to the CRM and change their status for efficient lead management.
Issue invoices with automated payment processing.
Add tags and custom fields for flexible customer segmentation.
Notify a manager about important requests or the need for intervention.
Send messages or a series of messages using the "Sales Funnels" section capabilities.
2. How It Works
AI Assistants interact with users through messengers (Telegram, WhatsApp, Facebook Messenger, etc.) and can subscribe leads to specific blocks in the sales funnel when specified conditions are met.
Process:
The user sends a message to the AI Assistant.
The AI Assistant analyzes the message and determines the user's intent.
If the condition matches the specified scenario, the AI Assistant calls the appropriate function.
The function executes, and the user is subscribed to the specified block in the sales funnel.
The user receives an offer or buttons for further interaction (contact a manager, purchase a product, etc.).
3. Creating a Function to Subscribe to a Block in the Funnel
To configure the lead subscription function to a block in the funnel, describe it as follows:
{
"name": "START_TUNNEL",
"description": "Subscribe user to a tunnel block 67923e109cf6cf5c3ca547c3",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"tunnel_block_id": {
"type": "string",
"description": "Id in description"
}
},
"required": ["tunnel_block_id"],
"additionalProperties": false
}
}
IMPORTANT!
function_name – must be only START_TUNNEL!
description – The only edit field in the code above for correct operation. In it, you describe the actions and conditions of subscribing to a block in the sales funnel. In this line, you need to specify the subscription action by specifying your block ID from the desired sales funnel. Replace
67923e109cf6cf5c3ca547c3
specified in the example above with your block ID.
4. Adding a Function to AI Assistant
To add a function to AI Assistant:
Go to the Assistants section on the OpenAI platform and create or select an existing AI Assistant.
Navigate to the System instructions section of your AI Assistant.
Add a condition to the base instruction or a condition file specifying when the assistant should call the function. Example:
"If the client asks about membership, provide information about membership and then activate the function (START_TUNNEL)"
In the Functions section of your assistant, enter the function execution command (START_TUNNEL).
Insert the JSON code of the function and specify tunnel_block_id in the description of your function.
Now, the AI Assistant will analyze client dialogues and, based on their messages, execute the appropriate actions on the platform.
You can also write in the description of your function, which allows you to sign leads on several different blocks in the sales tunnel, for one additional function.
5. Testing and Verifying the Function
After setting up the assistant:
Activate the AI Assistant for the selected communication channel.
Send a test message that matches the trigger condition in the chatbot (communication channel).
Ensure the function executed successfully. You can check this by looking at the lead's status in the chat.
If errors occur, verify that the function parameters and call conditions are correctly configured.
Make necessary adjustments to the assistant's instructions if required.