Chatlayer Documentation
Get in touchAbout Chatlayer
  • Welcome
  • What's new
  • Send feedback
  • start quickly
    • Leadzy tutorial
      • 0. Introduction
      • 1. New bot, new block
      • 2. Understand your users
      • 3. Collect and display user input
      • 4. Steer the conversation with Conditions
      • 5. Empower your bot with Actions
      • 6. Set up a channel and publish your bot
    • Templates
      • Banking
      • E-Commerce Returns
      • E-Bike Shop
      • E-Scooter Support
      • Feedback
      • Find Nearest Location
      • GPT
      • 🆕Gym
      • Job applications
      • Knowledge base AI template
      • Lead generation
      • 🆕NPS
      • Restaurant
      • Retail
  • navigation
    • Analytics
      • Dashboard
      • Customers
      • Conversations
      • User flow
      • Intents
      • 🆕Funnels [Beta]
    • Bot builder
      • Flows
        • Canvas functionalities
        • Collaborate with team members
        • Manage your flows
        • 🆕[Beta] Export and import flows
      • Bot dialogs view
      • Translations
      • Events
    • NLP
      • Dashboard
      • Intents
      • Expressions
      • Entities
      • Train
      • NLP settings
      • Improve
    • Knowledge base AI
      • Add content to your KBAI
      • Build your KBAI flow
      • Use your KBAI source URL in a button
      • Use tags to limit your KBAI content
      • 🆕Use Tables to store your KBAI questions
      • 🆕Manage handover where KBAI is unsatisfactory
    • History
      • Conversations
      • Execution logs
      • Versions
    • Channels
    • Tables
      • Create a table with records
      • Column types
      • Operate on your records
        • Insert record
        • Update record
        • Retrieve record
        • Delete record
      • API
    • Settings
      • Bot settings
      • Offloading
      • Variables
      • Voice
      • Import/Export
  • build your bot
    • Conversation design
      • Plan your bot
      • Conversation design workflow
    • Flow logic
      • Blocks
        • Message
        • Condition
        • Collect input
        • Action
      • Go-to connections
    • 🆕Emulator
    • Tips & best practices
      • Route your flow depending on the time
      • Improve the Not understood block
        • How to create better not understood messages
        • Not understood counter
        • Not understood Google search
      • Go to previous block
      • Recognizing a returning user
      • Skip introduction message
      • Route your flow depending on the channel
      • Reuse flows
      • Connect two bots to each other
  • understand users
    • Natural language processing (NLP)
      • Basic NLP concepts
      • Detect information with entities
        • Match entities
        • Contextual entities
        • System entities
        • Composite entities
      • NLP best practices
        • Word order and diversity of expressions
      • AI intent booster
      • Train your NLP
      • Context
      • NLP import & export
      • Sentiment analysis
    • Languages
      • Supported languages
      • Make your bot multilingual
      • Change language within the conversation
  • set up channels
    • Add a channel to your bot
    • All channels
      • 🚨Facebook Messenger [Deprecated soon]
        • Facebook Admin Removal
        • Facebook Webview Whitelisting
        • Facebook Messenger API updates for Europe
      • 🚨Google Assistant [Deprecated soon]
      • Webhook
      • Web
        • 🚨Web V1 [Deprecated]
          • Customize web widget
          • Live example web widget
        • 🆕Web V2
          • 🆕From Web V1 to V2
          • 🆕Web V2 methods and options
    • Sinch Conversation API
      • Configure your Sinch Conversation API
      • 🆕 Make the most of RCS with Carousels
      • WhatsApp Business API
  • integrate & code
    • API calls
      • Configure your API integration
      • Advanced API features
      • V1 API Reference
      • Custom integrations 101
    • Code editor
      • [Example] Sending data to Airtable (POST)
      • [Example] Retrieving data from Airtable (GET)
      • [Example] Making SOAP requests
    • App integrations
      • Airtable
      • Freshdesk
      • Freshdesk Messaging
      • 🆕Gmail
      • Intercom
      • Mailgun
      • OpenAI: GPT-3, ChatGPT and GPT-4
      • Salesforce
      • 🆕Slack
      • Topdesk
      • Zendesk Support
      • Zendesk Sunshine (beta)
    • 🆕Expression syntax
    • Human handover & live chat
      • Sinch Contact Pro
      • #Interact
      • Genesys Cloud
      • Offloading Webhook
      • Salesforce Service Cloud
      • Sparkcentral by Hootsuite
      • Zendesk Chat
    • Chatlayer messages specifications
  • Publish
    • Publish your bot
      • Publish a flow
  • Analyze & maintain
    • Analytics definitions
    • Data retention
    • Maintenance
    • Session
    • Track events for analytics
  • VOICE
    • 🆕Send bot response as audio
    • Voicebots
      • Create a voicebot
      • Voicebot-specific actions
      • Test your voicebot
      • From chat to voice
  • access & support
    • Identity & Access
      • Single Sign-On (SAML SSO)
    • Billing & subscription
    • Get in touch
    • Chatlayer glossary
    • SaaS Regions & IP Ranges
    • Status
    • Debug your bot
      • No correct response
      • Collect input not working
      • Video isn't working
Powered by GitBook
On this page
  • What is GPT
  • [Video] GPT in customer-facing conversations
  • Set up your OpenAI integration
  • How to use OpenAI GPT models inside a bot
  • Generate a GPT response
  • Display a GPT response
  • Limitations of GPT models

Was this helpful?

  1. integrate & code
  2. App integrations

OpenAI: GPT-3, ChatGPT and GPT-4

OpenAI offers GPT-3, ChatGPT and GPT-4. The GPT-series uses state-of-the-art NLP technology to generate responses in your chatbot, by providing answers that fit the context of the conversation.

PreviousMailgunNextSalesforce

Last updated 2 months ago

Was this helpful?

What is GPT

GPT is a series of advanced Natural Language Processing systems developed by OpenAI that allow you to execute several text-based tasks.

The OpenAI integration allows you to generate responses in your chatbot. As a bot builder or conversation designer, all you need to do is select the GPT-3, ChatGPT or GPT-4 model and tell it the right query that defines the kind of answer that you would like, and it will make it up for you!

[Video] GPT in customer-facing conversations

Here is a video we made about how and why you could bring value to your bot if you use GPT.

Set up your OpenAI integration

Before being able to use GPT inside blocks, you need to connect an OpenAI account to the OpenAI integration on Chatlayer. For this, you might require an OpenAI API key.

To connect your chatbot with GPT:

1

On your Chatlayer home page, go to Integrations.

2

Search for "OpenAI" in the search bar.

3

Click on Open AI.

4

Click on + Add Account to start connecting your OpenAI account with the OpenAI integration.

5

Paste your access token in the Access token field

6

Under Display name, write an identifier that can be later used to select this specific access token when using the OpenAI integration inside a bot. In this example, we have used the identifier Chatlayer Token OpenAI Example.

7

Optionally, you can provide an OpenAI API key.

8

Click on Submit when you're done.

The OpenAI account should now be visible under the Connected Accounts tab. Note that the word "Auth" was automatically added in front of the "Display Name".

Your OpenAI integration is set up! Now it's time to use it inside the conversation.

How to use OpenAI GPT models inside a bot

You will need to do two things so that your customers can interact with GPT-3, ChatGPT or GPT-4: generate a response, and display it.

Generate a GPT response

To generate a GPT-3, ChatGPT or GPT-4 response:

1
2

Search for the OpenAI integration in the search bar and select it

3

In our case, it is called "Auth Chatlayer Token OpenAI Example".

4

Select the action to execute, called "GPT response".

This means the action will send the conversation to OpenAI and retrieve a response.

5

Now, give to OpenAI the required information to be able to generate an answer. These are called the Action fields:

  • Fill the Bot description, which is a small depiction of what your bot is about. For instance, a restaurant bot.

  • Fill the Bot prompt, which is a description of the response that you would like GPT to generate. Example: generate a personalized message to apologize for an inconvenience.

Be mindful: the longer you make your bot description or bot prompt, the longer it will take to get a response from OpenAI.

6

Click on Create to save your GPT integrated Action block

You have made an Action block that uses GPT to generate a response based on your chatbot description! Now, let's see how we can display that generated response within the conversation.

Display a GPT response

To display the GPT response in the conversation:

1
2

Add a text field and fill it with the{apps.openai.gpt.text} variable.

You know now how to set up an Action blocks that generates a GPT response, and how to display this response within a block.

In the sections below, we will take a use-case to exemplify how you can use GPT for your bot.

[Use-case] GPT for fallback messages

One way to use the OpenAI integration is as a fallback message for when your bot didn't understand the user question.

Once you've created a bot, go into your General flow, and open the Not Understood block. From there, we will modify the Not Understood block so that it uses the OpenAI integration:

  1. Delete the text message inside the Not Understood block by clicking on the bin icon

  2. In the Go To field, create a new Action block that you will call "Generate GPT response", then save your changes

  3. In the Go To field, create a Bot message block and call it "Display GPT response" , then save your changes

  4. Open the Display GPT response block and add the {apps.openai.gpt.text} variable inside the text field

If you talk to your bot now and ask something the bot doesn't know, the "Not Understood" block state should be triggered. Next, OpenAI will be called and the response will be displayed to you.

[Use-case] GPT for contextualized responses

GPT is able to read the whole conversation between your customer and the bot, which means that it can generate text based on the context of the conversation.

As for an example of contextualized GPT responses:

  1. Create an intent that will trigger a GPT response. In this example, we created an intent_not_delivered intent.

  1. Do the same for any other block that you would like to have personalized. In our example, we have created a chitchat.tell_a_joke intent that triggers a GPT-generated response of a joke that takes into account the context above:

  1. Your can now have more contextualized interactions with your customers!

Limitations of GPT models

GPT-3, ChatGPT and GPT-4 are generative AI models built by OpenAI, which is located in the US. Because it is generative, we do not control what GPT creates. Depending on the input it receives, the answer can either be very good, contain wrong info or even be offensive. Therefore, we do not recommend GPT be used in production (i.e. a customer facing bot) without thorough testing and understanding the risks.

To be able to use GPT models on Chatlayer, you will need to , then blocks.

Using the OpenAI integration means that your data is sent to OpenAI services which are based in the United States. Make sure you understand the and implications. Use OpenAI in production bots with caution, Chatlayer is not held responsible for generated content.

Chatlayer provides customers with its own OpenAI API key to use GPT with a limit of 100 messages per bot. This means that from the 101st message, GPT will stop generating and send errors. If you wish to be able to use an unlimited amount of GPT-generated messages, you will need to create .

If you do not have a Chatlayer access token, you can generate one .

To try the OpenAI integration, Chatlayer offers 100 messages per bot. If this suits you, you can leave the OpenAI key field empty. Yet if you would like to go unlimited in the your number of GPT-generated messages, you will need to .

You've set up your GPT account and would like to jump straight to bot building? We've got you covered with our bot. Give it a go!

Create an block and open it.

Under OpenAI account, select your

Select the Model type, which is either GPT-3, ChatGPT or GPT-4. Note that GPT-4 is only available in due to European GDPR regulations.

The generated answer from GPT is available on the data after executing the above Action block. This response is saved under the {apps.openai.gpt.text} variable.

Create a block.

If you do not have a bot yet, you can use one of our pre-built .

Open the Generate GPT response block that you have just created and

Create an Action block that generates a GPT answer and connect it to a block that displays it, as . In our example, we have queried the following text to GPT-3:

We do not recommend the OpenAI integration to be used in production (i.e. a customer facing bot). Still, if you want to use it in production anyway you should Please also check the to understand the implications of using OpenAI services.

OpenAI terms of service
your own API key on the OpenAI's website
here
get your own API key on the OpenAI's website
GPT-3 template
Action
Chatlayer US
session
Message
template bots
configure this Action block so that it integrates GPT
set up the OpenAI integration
use this integration inside
OpenAI account that you connected to Chatlayer earlier.
explained in the tutorial above
OpenAI terms of service
use your own OpenAI API key.
How your fallback flow should look like if you use GPT as a Not Understood message
Search for OpenAI and you will find the OpenAI integration ready to be configured
View of the OpenAI integration when open.
Pop-up to provide the necessary credentials for connecting OpenAI to Chatlayer
You can see your OpenAI account under the Connected Accounts tab.
Search for the OpenAI integration in the Action block toolbar and select it.
Enter your OpenAI account to connect it to the Action block.
Select the action for the GPT-3 integration.
Fill the Action fields so that OpenAI gets all the necessary information to generate a response.
Add the variable that holds the generated response from OpenAI to a text field to display it in your conversation.
How your fallback flow should look like if you use GPT as a Not Understood message
Example of a fallback flow where GPT-3 was asked to generate an apology for an inconvenience in a restaurant bot.
Example of action fields for a personalized apology response made by GPT-3
Example of action fields for a personalized joke made by GPT-3 and based on the context of the conversation
Conversation sample of a flow that uses GPT-3 to generate a personalized apology then a joke