OpenAI bots

OpenAI bots

Overview

FROM VERSION 3.36.0

OpenAI bots section allows you to configure bots for Voice and other Channels with ChatGPT. From the same section you can configure bots using Deepseek for Voice channel.

image-20240612-142500.jpg

When you enter the OpenAI bots section you find the list of the created bots, with the possibility to edit or delete them clicking the three dots button (⋮) next to the bot of interest.

Benefits

The use of the chatbot ensures:

  • Instant Response Time: Bots can instantly reply to inquiries, reducing wait times and improving customer satisfaction by providing immediate assistance;

  • Cost Efficiency: by automating routine tasks and handling common customer queries, Bots free up human agents to focus on more complex issues, lowering operational costs;

  • Scalability: Bots can handle a large volume of interactions simultaneously, allowing businesses to scale their customer support without needing to add more staff.

Requirements

  • You need to configure a OpenAI Cloud Provider to use ChatGPT bot

  • You need to configure a Deepsek Cloud Provider to use Deepseek bot

  • As user, you need permissions on this section to view created Bots

  • Bot costs will be billed:

    • on your OpenAI account or Deepseek account and

    • on XCALLY based on the number of AI Conversations tracked in the AI Conversation Dashboards

Create an OpenAI bot

To create a new OpenAI bot click the blue + button  located at the bottom-right corner of the interface, under Tools → OpenAI.

Configure the fields:

  1. Choose your OpenAI Cloud Provider Account

  2. Select, if needed, the ChatGPT Assistant. As alternative select “No assistant”.

Starting from version 3.35.0 you can also use Assistants inside the bot configuration.
Explore the relative wiki for more information.

image-20240612-143056.png
  1. Select the ChatGPT Model. Please note each model has different capabilities and prices, which can be viewed in units of either per 1M or 1K tokens.

You can explore OpenAI Pricing documentation to understand which model to use according to your needs. This is a list of ChatGPT default models:

  • gpt-3.5-turbo

  • gpt-4

  • gpt-4-32k

  • gpt-4-turbo

  • gpt-4o

  • gpt-4o-mini

OpenAI documentation

  1. Define a name of the ChatGPT bot

  2. Set the Max conversation lenght in ChatGPT tokens for each session

Tokens are pieces of words. 1000 tokens is about 750 words.

When your session reaches this number of tokens, conversation has to end. You can understand how ChatGPT calculates token at this link OpenAI Tokenizer

image-20240314-131523.png

The max conversation lenght depends on the ChatGPT model you select:

  • gpt-3.5-turbo → max conversation lenght: 4096 tokens

  • gpt-4 → max conversation lenght: 8192 tokens

  • gpt-4-32k → max conversation lenght: 32000 tokens

  • gpt-4-turbo → max conversation lenght: 4096 tokens

  • gpt-4o→ max conversation lenght: 16384 tokens

  • gpt-4o-mini → max conversation lenght: 16384 tokens

Remember that this parameter consider the sum of input customer’s messages + output ChatGPT messages + lenght of prompt inserted

  1. Enter the Exit Phrase to terminate the chat with the bot. In this way the chat will go forward the next action application in the routing.

For example, in case of forward to a queue with human operators, the exit phrase can be "I am redirecting you to a human operator".

  1. Enter the Welcome message that will be sent as first message in every new chat interaction

  • "Hi! I’m your virtual assistant. How can I help you today?"

  • "Hello! I’m here to assist you with any questions or issues. Just type in your request!"

  1. Write the bot Instructions

If you would like to manage the re-routing from the bot to a human agent, it is necessary to explicitly include this phrase key literally in the instructions:

  • If you don't know how to help user, tell the customer "I am redirecting you to a human operator".

  • If customer asks to be redirected to human operator, tell the customer "I am redirecting you to a human operator".

Consider that ChatGPT supports auto language detection. If customer writes in a language different from the instructions' language, the bot will detect it and reply using customer’s language, to guarantee a great user experience.

Let’s explore in this paragraph how you can configure instructions. Refer the official documentation about how to properly configure the prompt: OpenAI documentation

image-20240612-143539.png
  1. Set ChatGPT Temperature, the parameter related to creativity from 0.0 to 2.0.

Lower temperature is recommended for more solid results.

  • When using 0, the bot will do literally what is written in the prompt

  • If creativity is 1, the bot will try to fill the gaps in the knowledge

  • If it is 2, it will generate very creative results, that can be factually incorrect.

  1. Enable, if needed, Analyze chat to know if you should pass to an agent. If enabled, the escape Prompt inserted is a System message sent to ChatGPT to recognize when the chat with the bot should be interrupted and passed to an agent.

You need to enter an answer in JSON format, with the following keys: CHAT_PROGRESS and REASON.

 

CHAT_PROGRESS is a number and must be 0 if chat has to continue or 1 if:

  • the customer wants to talk with an operator

  • the bot can not help the customer

  • the bot has finished the questions inserted in the prompt

REASON is the value with the reason why CHAT_PROGRESS should be 1.
An example of Exit prompt can be “Answer in a JSON format. The key is ‘chatProgress’, which is equal to ‘1' if the customer asks for a human operator, or the virtual assistant talks about passing to a human operator. Else it is equal to '0’. Write also another key named REASON where you write why you think chat must pass to an operator.

 

Here you can see an example:

Answer in a JSON format. Write a json like this

{
  "CHAT_PROGRESS": "1",
  "REASON": "The customer explicitly requested to speak with a human agent."
}

with CHAT_PROGRESS which is equal to '1' if user want to talk to an human operator or you don't know how to continue the chat. Then populate value REASON with the reason why CHAT_PROGRESS should be '1'

You can customize key for ChatProgress. Moreover it is mandatory to enter JSON word in the prompt, while reason can be optional
The CHAT_PROGRESS is not currently exposed as a variable, if you want to print it, you should use instead {{OPENAI_CHATGPT_EXIT}}.

You can use as variable OPENAI_CHATGPT_EXIT that contains a boolean that is true if the bot deems that the conversations has reached a loop or the exit condition written in "exit prompt".

Another useable variable is OPENAI_CHATGPT_RESULT that contains the answer of the bot.

  1. Set Forward message, sent when max token limit is reached

  2. Set Error message, sent when there is an error with OpenAI APIs

  3. Set ChatGPT Attachment Message, sent in case of an attachment

image-20240613-080115.png

Create a DeepSeek bot

FROM VERSION 3.51.0

Requirements:

  • Setup a DeepSeek Cloud Provider with a valid API key and credit loaded on the account.
    Discover DeepSeek Models and pricing on official documentation: Models & Pricing | DeepSeek API Docs

  • Use the XCALLY new Client Experience

If you use the “old” XCALLY web interface you can’t configure a Deepseek bot

image-20250515-154053.png

 

To create a new Deepseek bot click the blue + button  located at the bottom-right corner of the interface, under Tools → OpenAI.

Configure the fields:

  • On Bot provider service section, it’s possible to choose DeepSeek Provider and the relative DeepSeek cloud provider account

  • DeepSeek Chat Model by choosing between:

    • deepseek-chat: this is the recommended model because it has lower latency

    • deepseek-reasoner

  • Name of the bot will be predefined but you can customize it

  • Max conversation lenght in bot tokens (for each session): you can think of tokens as pieces of words, where 1000 tokens is about 750 words. When your session reaches this number of tokens, conversation has to end. You can understand how DeepSeek calculates token at this link Token & Token Usage | DeepSeek API Docs

  • Exit Phrase: this is the key phrase to finish chat with the bot. In this way chat will go forward the next action application in the routing

  • Welcome message: this message will be sent as first message in every new chat

  • Instructions: these are the bot training “instructions” to explain what it has to say, questions it can manage, phrase it has to say when it doesn't know how to help the customer and so on.

If you want to manage the re-routing from the bot to a human agent, it is necessary to explicitly include this phrase key literally in the instructions:
If you don't know how to help user, tell the customer "I am redirecting you to a human operator".
If customer asks to be redirected to human operator, tell the customer "I am redirecting you to a human operator".

  • Bot Temperature: parameter related to creativity from 0.0 to 2.0. Lower temperature is recommended for more solid results. When using 0, the bot will do literally what is written in the prompt, if creativity is 1 it will try to fill the gaps in the knowledge, if it is 2, it will generate very creative results, that can be factually incorrect.

  • Analyze chat to know if you should pass to an agent: by enabling this option, the escape Prompt inserted is a System message sent to DeepSeek to recognize when the chat with the bot should be interrupted and passed to an agent.
    It’s recommended to enable this option because DeepSeek does not correctly transpose the command that is supposed to say ‘I am redirecting you to an human operator’.
    You need to enter an answer in JSON format, with the following keys: CHAT_PROGRESS and REASON.

  • Forward message: message said when max token limit is reached

  • Error message: Message said when there is an error with DeepSeek APIs

  • Attachment Message: in case of an attachment, this message will be sent

How does it work?

After you complete the configuration of bots in this section, you can use them on actions flow of different channels (Chat, SMS, Open Channel, Whatsapp) and on Cally Square OpenAI ChatGPT block or Cally Square DeepkSeek block.

If for example you decide to insert a ChatGPT bot as first application, all messages will be managed by the bot until it doesn't know what to say and the chat will pass to the next block configured on action flow (for example a queue). When chat enters in a queue and it is assigned to an agent, ChatGPT gets disabled.

image (8)-20240313-163640.jpg

By selecting ChatGPT block, you need to choose OpenAI cloud provider account and created OpenAI bot

image-20240612-144314.png

Scenarios

These are some possible scenarios after starting to chat with ChatGPT (followed by queue application):

  1. Every interaction starts with a welcome message

  2. Chat with ChatGPT:

    • If ChatGPT says the exit phrase, the interaction will be passed to the queue

    • If ChatGPT can't help the user, the interaction will be passed to the queue

    • If the total tokens used reach the max tokens value, it will be shown the forward message and the interaction will be passed to the queue

    • If the application runs into an error, the error message will be shown and the interaction will be passed to the queue

During chatbot conversation, agent can not manage it (but if admin wants to see the bot conversation, it’s possible to enter in spy section).
In fact interactions are created on account and they are visible to all associated users like not assigned interactions while chatbot talks with the user. If an agent clicks on a not assigned interaction, XCALLY assigns it to the operator and the bot no longer interacts at the next message.

Instructions tips and tricks

  • Insert in the prompt "Answer in a concise way" to help to set ChatGPT using less words as possible, being still useful and spending less in billed tokens

  • ChatGPT can be used to make multistep dialogues, with prompt instructions like:
    If customer ask for help with an order, you have to request order ID.
    When customer answers with that information then you have to ask order date.
    When customer tells you this information, then redirect to operator

If you realize that despite the configured prompt, ChatGPT is not replying the way you want, you can try changing the ChatGPT model or temperature

 

OpenAI bots on New Client Experience

FROM VERSION 3.50.0

If you enable New Client Experience, you can get this visualisation of the list of created bots:

image-20250416-090059.png

you can:

  • search for a specific bot

  • set and clear filters

  • manage columns

  • activate the advanced search for each field

  • delete bot (single or bulk delete)

  • export data to CSV, if you select at least one bot

  • edit a specific bot

  • create a new bot, by clicking on Add and indicate all the requested fields as described here.

 

FROM VERSION 3.51.0

Starting from version 3.51.0, you will see also the column Provider to view if the bot is configured with OpenAI or DeepSeek:

image-20250512-133509.png

 

Related topics