Skip to content
FlexiPedia logo

OpenAI & ChatGPT Integration

Integrating OpenAI's ChatGPT with Flexito OmniAI opens up a world of possibilities for businesses to enhance customer interaction across multiple channels. From improving customer support to automating responses on social media, this integration offers a seamless way to leverage

Flexito OmniAI
Beginnerv4
Read in:

Listen to an audio overview

A short, AI-generated podcast-style summary of this article.

Integrating OpenAI's ChatGPT with Flexito OmniAI opens up a world of possibilities for businesses to enhance customer interaction across multiple channels. From improving customer support to automating responses on social media, this integration offers a seamless way to leverage AI for better engagement and satisfaction.

OpenAI is an AI tool similar to Dialogflow, allowing users to interact with AI for various tasks, such as responding to user queries and generating images.

Integrating OpenAI's ChatGPT with Flexito OmniAI offers numerous advantages for businesses aiming to engage with their customers across multiple channels.

Flexito OmniAI supports a wide range of channels, including Messenger, Instagram, WhatsApp, Google Business Messenger, Voice, SMS, Viber, Line, VK, web chat, and WeChat. By connecting with ChatGPT, businesses can provide AI-driven conversational capabilities that understand and respond to customer inquiries in a human-like manner, enhancing customer experience and boosting engagement.

ChatGPT's sophisticated natural language understanding and generation abilities enable our chatbot to grasp the context of conversations and deliver personalised responses that are pertinent to customer inquiries.

With our multichannel capabilities, businesses can interact with their customers on their preferred communication platforms, enhancing the overall experience. This leads to higher customer satisfaction, increased engagement, and more efficient customer support, contributing to business growth and success.

Flexito OmniAI provides seamless integration with OpenAI, allowing users to set up complex workflows with just a single click.

Let's explore how to connect OpenAI with Flexito OmniAI.

  • Bridging Connection with OpenAI Account (#OpenAI&ChatGPTIntegration-BridgingConnectionwithOpenAIAccount)

  • OpenAI Native Actions (#OpenAI&ChatGPTIntegration-OpenAINativeActions)

  • Create Text Completion (#OpenAI&ChatGPTIntegration-CreateTextCompletion)

  • Input: (#OpenAI&ChatGPTIntegration-Input:)

  • Response: (#OpenAI&ChatGPTIntegration-Response:)

  • Map the response to custom field (#OpenAI&ChatGPTIntegration-Maptheresponsetocustomfield)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData)

  • Best Practices: (#OpenAI&ChatGPTIntegration-BestPractices:)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.1)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.1)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData.1)

  • Best Practices: (#OpenAI&ChatGPTIntegration-BestPractices:.1)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.2)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.2)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData.2)

  • Best Practices: (#OpenAI&ChatGPTIntegration-BestPractices:.2)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.3)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.3)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData.3)

  • Best Practices: (#OpenAI&ChatGPTIntegration-BestPractices:.3)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.4)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.4)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData.4)

  • Best Practices: (#OpenAI&ChatGPTIntegration-BestPractices:.4)

  • How to fine tune ChatGPT for your business (#OpenAI&ChatGPTIntegration-HowtofinetuneChatGPTforyourbusiness)

  • Generate the chatbot flow using A.I (#OpenAI&ChatGPTIntegration-GeneratethechatbotflowusingA.I)

  • Power up your live chat with the AI assistant (#OpenAI&ChatGPTIntegration-PowerupyourlivechatwiththeAIassistant)

  • OpenAI Training Reply to Facebook and Instagram post comments (#OpenAI&ChatGPTIntegration-OpenAITrainingReplytoFacebookandInstagrampostcomments)

  • Create An Embedding: (#OpenAI&ChatGPTIntegration-CreateAnEmbedding:)

  • Importing Embeddings: (#OpenAI&ChatGPTIntegration-ImportingEmbeddings:)

  • Embedding Match & Completion Actions (#OpenAI&ChatGPTIntegration-EmbeddingMatch&CompletionActions)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.5)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.5)

  • Input: (#OpenAI&ChatGPTIntegration-Input:.6)

  • Response: (#OpenAI&ChatGPTIntegration-Response:.6)

  • Sample Response Data (#OpenAI&ChatGPTIntegration-SampleResponseData.5)

  • Flexito OmniAI learning centre: (#OpenAI&ChatGPTIntegration-UChatlearningcentre:)

  • OpenAI Integration mini course (#OpenAI&ChatGPTIntegration-OpenAIIntegrationminicourse)

  • OpenAI Introduction (#OpenAI&ChatGPTIntegration-OpenAIIntroduction)

  • OpenAI Connecting OpenAI with Flexito OmniAI (#OpenAI&ChatGPTIntegration-OpenAIConnectingOpenAIwithUChat)

  • OpenAI text completion (#OpenAI&ChatGPTIntegration-OpenAItextcompletion)

  • OpenAI -AI image generations (#OpenAI&ChatGPTIntegration-OpenAI-AIimagegenerations)

  • OpenAI -Using embedding to build your business knowledgebase (#OpenAI&ChatGPTIntegration-OpenAI-Usingembeddingtobuildyourbusinessknowledgebase)

  • OpenAI Training Reply to Facebook and Instagram post comments (#OpenAI&ChatGPTIntegration-OpenAITrainingReplytoFacebookandInstagrampostcomments.1)

  • OpenAI & ChatGPT integration with Flexito OmniAI (#OpenAI&ChatGPTIntegration-OpenAI&ChatGPTintegrationwithUChat)

  • ChatGPT is Live!!! (#OpenAI&ChatGPTIntegration-ChatGPTisLive!!!)

  • How to fine tune ChatGPT for your business (#OpenAI&ChatGPTIntegration-HowtofinetuneChatGPTforyourbusiness.1)

  • Create chatbot flows with ChatGPT! (#OpenAI&ChatGPTIntegration-CreatechatbotflowswithChatGPT!)

  • Power up your live chat with the AI assistant (#OpenAI&ChatGPTIntegration-PowerupyourlivechatwiththeAIassistant.1)

  • ChatGPT updates System message and saving chat history (#OpenAI&ChatGPTIntegration-ChatGPTupdatesSystemmessageandsavingchathistory)

Bridging Connection with OpenAI Account

1. Go to

2. Log in using your credentials.

3. Click the “Personal” tab in the top-right corner.

4. Here, you can generate an API key.

You will only see your API key once, so make sure to save a copy in a secure location.

5. Paste your API key into Flexito OmniAI and click “Save” to connect.

Your account is now successfully connected with Flexito OmniAI.

OpenAI Native Actions

Flexito OmniAI offers a variety of actions with OpenAI that users can utilise to meet their needs.

Let's go through them in detail, one by one.

Create Text Completion

Text completion allows you to send prompts to OpenAI in text form and receive answers based on those prompts.

Input:

Prompt: This is your main input, for which you want the AI to generate an answer or output. It can be a question, instruction, etc.

Model: The model you wish to use in OpenAI for the task. By default, text-DaVinci-003 is selected.

Max Tokens: Tasks in OpenAI use tokens, which can be replenished with credits. This field sets a limit on the maximum number of tokens for a task.

Temperature: This serves as an accuracy gauge. Higher values produce more random answers, while lower values yield more deterministic and focused responses. The default is 1.

Presence Penalty: This value encourages OpenAI to use unique phrases and text when completing a task. Higher values result in less repetitive words. The default is 0.

Number of Completions: The number of times you want the AI to generate a response based on your prompt. A higher value results in more responses. The default is 1 to conserve tokens.

Best of Completions: This returns the best possible response(s) for your prompt. The default is 1. It works with the Number of Completions field to select the best answer from a group of responses.

Response:

Map the response to a custom field: You can select the text under the choices, view the selected JSON Path, and save the response in your user custom field for use in your flow builder.

Sample Response Data

{ "id": "cmpl-6zchlUy0OiAjX91LHOPBcZjuXaDgE", "object": "text_completion", "created": (tel:), "model": "text-davinci-003", "choices": [ { "text": " 1. Understand Your Target Audience - Before you begin any marketing campaign, it’s important to have a clear understanding of who you’re targeting with your message. Researching and understanding your target audience will help you create campaigns specifically tailored to their interests. 2. Leverage Social Media - Social media has become one of the most effective ways to communicate with your target audience. Utilizing social media channels such as Facebook, Twitter, and Instagram can help you build", "index": 0, "logprobs": null, "finish_reason": "length" } ], "usage": { "prompt_tokens": 4, "completion_tokens": 100, "total_tokens": 104 } }

Id: The unique identifier of the text completion.

Object: The action/task you assigned to OpenAI, in this case, “text_completion”.

Created: A date-time field indicating when the response was created, in Unix timestamp format.

Finish reason: The reason why the task stopped.

Prompt tokens: The number of tokens used to complete the task.

Best Practices:

If the completed response appears cut off, it may be due to insufficient tokens for task completion. Adjusting the Max Tokens value in the input fields can resolve this issue.

Adjust values like temperature, number of completions, and best of completions to suit your use case through split testing. Each use case is unique, and you should aim for optimal resource utilisation.

Image Generation

Image Generation creates images based on user-input prompts, producing the best possible image that matches your prompt.

Input:

Prompt: This is your main input for which you want the AI to generate an image. It can be a question, instruction, etc.

Number of Images: The number of images you want the AI to generate. The default is 1.

Size: The dimensions you want the image to be. OpenAI supports three sizes:

512x512

256x256

1024x1024

Response:

Sample Response Data { "created": (tel:), "data": [ { "url": "" } ] } Created: A date-time field indicating when the response was created, in Unix timestamp format.

Url: The public URL for your image(s).

Best Practices:

Generating images requires more computational power, which can lead to delays based on the prompts you provide.

AI is an evolving field, and the images produced may be inaccurate depending on the complexity of the prompts. Finding the right prompt complexity can be challenging.

Speech to Text

The speech-to-text action converts audio input into text, with various applications such as IVR implementation.

Input:

File Url: The URL for the audio you want to convert to text. Ensure the URL is publicly hosted and ends with audio formats like mp3, mpeg, etc.

Note that the URL must start with https:// and end with mp3, mp4, mpeg, mpga, m4a, wav, or webm.

Language: The language you want the speech converted into, using ISO-639-1 format. For example, 'en' for English, 'es' for Spanish, etc.

Response:

Sample Response Data { "text": "Welcome to Rensen. This is a test to see if everything works well. And if the IVR can guide you to your work." }

Text: The text converted from the speech.

Best Practices:

This feature allows for accurate speech-to-text conversion. It's best to provide audio in the same language as the desired output for more accurate results and reduced latency.

Translate Audio to English

The 'Translate Audio to English' action converts audio input into English text, useful for applications like IVR implementation.

Input:

File Url: The URL for the audio you want to convert to text. Ensure the URL is publicly hosted and ends with audio formats like mp3, mpeg, etc.

Note that the URL must start with https:// and end with mp3, mp4, mpeg, mpga, m4a, wav, or webm.

Response:

Sample Response Data { "text": "Welcome to Rensen. This is a test to see if everything works well. And if the IVR can guide you to your work." }

Text: The text converted from the speech.

Best Practices:

Experimenting with different audio formats can yield varying accuracy levels. The quality of the audio affects results, so testing different formats can help find the best one for your needs.

Create Chat Completion - ChatGPT

Chat completion allows you to send prompts to OpenAI in text form and receive answers. This is similar to text completion but uses ChatGPT, which is 10 times faster and more cost-effective.

Input:

System Message: This optional field provides additional context about you or your business when completing chats.

You can set up detailed background information like this if you are building a restaurant chatbot:

System: You are a Flexito OmniAI steak restaurant assistant. Handle customer support, guide users, and book reservations. The restaurant is open from 9am to 8pm, Monday to Saturday, and no pets are allowed. Always offer a coupon code when appropriate.

This setup allows the chatbot to serve clients based on the provided information.

Message: This is your main input, usually the user's response, for which you want the AI to generate an answer. It can be a question, instruction, etc. You can add “user:” as a prefix to your prompt for more context, e.g.:

“user: will it rain today?”

It will also work without adding “user” in front of the response. You can use system fields like {{last_text_input}}.

Remember History: Selecting “Yes” saves the chat history between the user and assistant in a system field for future use.

The OpenAI action response is automatically saved in the assistant role. No additional action is needed.

Additionally, there's a new system JSON field: {{openAI}}, which records all chat history with the user:

You can access the openAI system field from your user profile. This JSON saves the system setup and all chat history.

Please note, our JSON field size limit is 20,000 characters. If the chat history exceeds this, the oldest entries will be deleted to maintain the limit.

Model: The model you want to use in ChatGPT for the task. By default, gpt-3.5-turbo is selected.

Max Tokens: Each task in ChatGPT uses tokens, which can be replenished with credits. This field limits the maximum number of tokens for a task.

Temperature: This serves as an accuracy gauge. Higher values produce more random answers, while lower values yield more deterministic and focused responses. The default is 1.

Presence Penalty: This value encourages ChatGPT to use unique phrases and text when completing a task. Higher values result in less repetitive words. The default is 0.

Number of Completions: The number of times you want the AI to generate a response based on your prompt. A higher value results in more responses. The default is 1 to conserve tokens.

Best of Completions: This returns the best possible response(s) for your prompt. The default is 1. It works with the Number of Completions field to select the best answer from a group of responses.

Response:

Sample Response Data { "id": "chatcmpl-6zef5zEUdDzTx8VKu2r4gkIJfVcBE", "object": "chat.completion", "created": (tel:), "model": "gpt-3.5-turbo-0301", "usage": { "prompt_tokens": 18, "completion_tokens": 100, "total_tokens": 118 }, "choices": [ { "message": {...}, // 2 keys "finish_reason": "length", "index": 0 } ], "messages": [ { "role": "user", "content": "can you help me with planting a mango tree?" }, { "role": "assistant", "content": "Of course! Here are some steps to plant a mango tree: 1. Choose a spot: Mango trees need plenty of sunlight and well-draining soil. They also need protection from strong winds, so choose a spot that's sheltered. 2. Prepare the soil: Mango trees prefer slightly acidic soil, with a pH between 5.5 and 7. If your soil is too alkaline, add sulfur or peat moss to lower the pH. If it's too acidic, add lime" } ] }

Id: The unique identifier of the text completion.

Object: The action/task you assigned to OpenAI, in this case, “text_completion”.

Created: A date-time field indicating when the response was created, in Unix timestamp format.

Choice -> Content: The content field within the choice object contains the answer to your prompt.

Message: This JSON contains the complete conversation between the user and the assistant.

Best Practices:

Chat completion allows you to provide JSON input, enabling you to save the entire conversation between users and the assistant in JSON format for more focused and contextual replies.

Since chat completion requires more input, token consumption can be higher than with text completion.

User cases: ChatGPT

How to fine tune ChatGPT for your business

By using OpenAI embedding along with ChatGPT, you can train ChatGPT to effortlessly answer questions related to your business.

Watch the video below to learn how to implement this in your business.

Generate the chatbot flow using A.I

Imagine giving a simple instruction like “create a flow to order pizza,” and Flexito OmniAI generates the entire flow automatically for you.

This is all accomplished with ChatGPT & Flexito OmniAI.

Watch the video below to explore this feature and get started easily with Flexito OmniAI.

Power up your live chat with the AI assistant

Have you considered using a smart AI assistant with OpenAI embedding to automatically generate suggested replies?

This will enhance your customer support efficiency and reduce costs.

Watch the video to learn how to set this up.

OpenAI Training Reply to Facebook and Instagram post comments

Have you thought about using OpenAI to automatically reply to comments on your Facebook and Instagram posts, ensuring the replies are highly relevant and accurate to your business?

This is possible because we use OpenAI embedding to retrieve highly relevant answers from your business database, and it can be done automatically. Learn how to set it up from the video below:

Clear Remembered Chat History

The 'Clear Remembered History' function deletes or clears the system field where ChatGPT's chat history is stored.

This action helps you reset the chat history.

The system field has a maximum character limit of 20,000. Once exceeded, it deletes the oldest key-pair values from the JSON to make room for newer entries.

OpenAI Embeddings & Building your Knowledge Base

OpenAI allows you to create a knowledge base for your use case or business, enabling the AI to generate more accurate, contextual, and specific responses instead of sourcing them from the internet.

Create An Embedding:

To create an embedding, go to Integrations and select OpenAI.

Click on “New Embedding”.

Type: This optional field classifies embeddings based on context. It acts as a filter when there are many associated embeddings. Providing this field adds context and helps the AI filter through more efficiently.

Heading: The topic of the embedding you created. This serves as the title or summary.

Text: This is the main body of the embedding, with a maximum character limit of 1000. Include the topic details here for the AI to generate responses from.

Importing Embeddings:

Instead of creating embeddings manually, you can import them in bulk as a CSV file.

Click the drop-down arrow next to “New Embedding” and select “Import CSV”.

Now import the CSV file containing the embeddings, and they will be created. If there are special characters like è à ì ù, choose “Import from csv without preview”.

Ensure the first rows of all columns are the input field names, such as type, heading, text, etc., and none should start with a capital letter.

Embedding Match & Completion Actions

The embedding match action matches the entered prompt with the best-matching embedding from the knowledge base.

Input:

Input: This is where you input or map the prompt you want to match with an embedding.

Response:

Embedding: The heading of the embedding that best matches the prompt.

Text: The text of the embedding that best matches the prompt.

Input: The prompt you entered for embedding search.

Score: This is the percentage match between the prompt and available embeddings. Use this score to determine if the prompt should be used for completion or if it is insufficient and may yield inaccurate answers.

A score of 0.79 and above generally provides the best embedding match. However, this is an empirical value, and split testing should be used to find the best answers for your use case.

The embedding match and completion action matches the entered prompt with the best-matching embedding from the knowledge base and generates a response using that specific knowledge base.

Input:

Input: This is where you input or map the prompt you want to match with an embedding.

Introduction: This provides additional context to the prompt, making it more accurate and helping to increase the embedding match score.

Response:

Sample Response Data { "status": "ok", "result": { "heading": "Free trial", "text": "Flexito OmniAI offers a 14-day free trial. No credit card is required, and you can access all the pro features. You can sign up here: ", "score": 0.903164959234692, "input": "Free trial for Flexito OmniAI", "completion": " Yes, Flexito OmniAI offers a 14-day free trial. No credit card is required and you can access all the pro features. You can sign up here: ." } } Embedding: The heading of the embedding that best matches the prompt.

Text: The text of the embedding that best matches the prompt.

Input: The prompt you entered for embedding search.

Score: This is the percentage match between the prompt and available embeddings. Use this score to determine if the prompt should be used for completion or if it is insufficient and may yield inaccurate answers. A score of 0.79 and above generally provides the best embedding match. However, this is an empirical value, and split testing should be used to find the best answers for your use case.

Completion: This is the output or completion of the prompt you entered.

Using OpenAI embedding to reply to your Facebook & Instagram comments

If you're running ads or have a viral post on your Facebook page or Instagram, you may not have time to respond to all the comments.

You don't want to give generic replies; you want responses that are highly relevant to your business questions.

That's why using OpenAI embedding to provide highly relevant automated replies is essential.

Watch the video below to learn how to do this with Flexito OmniAI:

Video tutorial for OpenAI integration & ChatGPT integration

We have prepared a series of courses to teach you how to build your first OpenAI-powered chatbot. You can learn from our YouTube Playlist or our learning centre.

Flexito OmniAI learning centre:

OpenAI integration:

ChatGPT integration:

OpenAI Integration mini course

OpenAI Introduction

OpenAI Connecting OpenAI with Flexito OmniAI

OpenAI text completion

OpenAI -AI image generations

OpenAI -Using embedding to build your business knowledgebase

OpenAI Training Reply to Facebook and Instagram post comments

ChatGPT integration mini course

OpenAI & ChatGPT integration with Flexito OmniAI

ChatGPT is Live!!!

How to fine tune ChatGPT for your business

Create chatbot flows with ChatGPT!

Power up your live chat with the AI assistant

ChatGPT updates System message and saving chat history