Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

XCALLY section

SMS Channel → Accounts → Actions → Applications List

On this page

\uD83D\uDCCB What is the OpenAI ChatBot?

AVAILABLE FROM VERSION 3.34.0

The ChatGPT Bot is an application that can be inserted in the action flow of a SMS account to manage interactions with OpenAI models.
This feature is available for SMS Channel and in this way it’s possible to insert a bot in the action flow to collect data about customers, which can be processed by agents.

☑️ Requirements

req-20240104-164920.png

☑️ Cloud provider with service OpenAI is required to install the ChatBot (configuration in Tools section)

☑️ OpenAI credits loaded in OpenAI account

☑️ You have to enable feature on your license. You can send your request on License Portal

⚙️ How to configure Chatbot with OpenAI

First of all, you need to setup Cloud Provider with OpenAI.
On Tools → Cloud Providers you need to configure an OpenAI Account, by inserting as Service OpenAI and ApiKey retrieved on your OpenAI account (find out how at this link).
In this way also users with relative permission on tools section, can configure their own keys.

image-20240313-162051.png

Then you can edit your SMS account and on Actions tab, you can insert in drag & drop routing the ChatGPT application

image-20240409-154539.jpg

image-20240314-152951.png

You can configure your bot:

  • Choose your OpenAI Cloud Provider Account

  • ChatGPT Model: multiple models, each with different capabilities and prices which can be viewed in units of either per 1M or 1K tokens. You can explore OpenAI https://openai.com/pricing documentation to understand which model to use according to your needs. This is a handpicked list of ChatGPT default models:

    • gpt-3.5-turbo: The fastest model. Same responses as the free ChatGPT experiences;

    • gpt-4: More creative than 3.5 but slower;

    • gpt-4-32k: Same as gpt-4 but allows longer conversations.

To understand which model to use, you can explore OpenAI documentation

Consider that in future 2024 developments, it is planned to set up AI assistants, so models trained with your business material and you will be able to configure specific actions based on your needs

  • Name of the ChatGPT bot: this name will be saved to the XCALLY database to help better understand what bot is talking

  • Max conversation lenght in ChatGPT 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 ChatGPT calculates token at this link OpenAI Tokenizer

    image-20240314-131523.png

    The max conversation lenght that you can inserted in configuration is 4000 tokens

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

image-20240409-154800.png

  • 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 (e.g. by forwarding it to a queue with human operators)

  • ChatGPT Prompt: 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. Consider that you can enter prompt in a specific language, but ChatGPT supports auto language detect, so if customer writes in an other languages, the bot will understand it by writing the next messages in customer’s language. Let’s explore in this paragraph how you can configure prompt (and explore in official OpenAI documentation how to properly configure the prompt: https://platform.openai.com/docs/guides/prompt-engineering/prompt-engineering )

image-20240502-084549.png

  • ChatGPT 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 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.

You can customize key for ChatProgress. Moreover it is mandatory to enter JSON word in the prompt, while reason can be optional

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

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

  • ChatGPT Attachment message: message said if user sends an attachment, because ChatGPT doesn't support images or audio files

💡 How does it work?

With the configuration of ChatGPT as first application, all messages will be managed by the bot until it doesn't know what to say and the interaction will pass to the next block configured on action flow (for example a queue). When open channel interaction enters in a queue and it is assigned to an agent, chatGPT gets disabled.

image-20240409-155321.png


Possible scenarios after starting to chat with ChatGPT (followed by queue application):

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

🔧 Prompt 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, ChatPGT is not replying the way you want, you can try changing the ChatGPT model or temperature

(blue star) Related topics

  • No labels