OpenAI & ChatGPT Integration
Open AI is an AI tool just like Dialogflow which enables the users to interact using AI. From replying to users to generating images, you can use OpenAI for a variety of tasks.
Integrating OpenAI's ChatGPT with UChat can provides numerous benefits to businesses looking to engage with their customers across various channels.
With all the channels UChat support, such as Messenger, Instagram, WhatsApp, Google Business Messenger, Voice, SMS, Viber, Line, VK, web chat, WeChat, and more, connecting with ChatGPT, You can offer businesses AI-powered conversational capabilities that can understand and respond to customer queries in a human-like manner, improving the customer experience and increasing engagement.
ChatGPT's advanced natural language understanding and generation capabilities enable our chatbot to understand the context of the conversation and offer personalised responses that are relevant to customer queries.
Combined with our multichannel capabilities, businesses can engage with their customers across their preferred communication channels, enhancing their overall experience. The result is improved customer satisfaction, increased engagement, and streamlined customer support, all of which can help businesses grow and succeed.
UChat offers native integration with OpenAI, which enables users to set up the complex flow with just a click of a button.
Let us first see how we can establish a connection between OpenAI and Uchat.
- 1 Bridging Connection with OpenAI Account
- 2 OpenAI Native Actions
- 3 Create Text Completion
- 4 Image Generation
- 4.1 Input:
- 4.2 Response:
- 4.3 Sample Response Data
- 4.4 Best Practices:
- 5 Speech to Text
- 5.1 Input:
- 5.2 Response:
- 5.3 Sample Response Data
- 5.4 Best Practices:
- 6 Translate Audio to English
- 6.1 Input:
- 6.2 Response:
- 6.3 Sample Response Data
- 6.4 Best Practices:
- 7 Create Chat Completion - ChatGPT
- 7.1 Input:
- 7.2 Response:
- 7.3 Sample Response Data
- 7.4 Best Practices:
- 8 User cases: ChatGPT
- 9 Clear Remembered Chat History
- 10 OpenAI Embeddings & Building your Knowledge Base
- 10.1 Create An Embedding:
- 10.2 Importing Embeddings:
- 10.3 Embedding Match & Completion Actions
- 10.3.1 Input:
- 10.3.2 Response:
- 10.3.3 Input:
- 10.3.4 Response:
- 10.3.5 Sample Response Data
- 11 Video tutorial for openAI integration & ChatGPT integration
Bridging Connection with OpenAI Account
1. Visit https://platform.openai.com
2. Login using your credentials.
3. Click on top-right corner on the “Personal” tab.
4. From here, you will be able to generate an api key.
You will only be able to see your api key once, so you can save the copy to a safe place.
5. Paste your API key inside UChat and click “Save” to establish the connection.
Your account has successfully been connected with UChat.
OpenAI Native Actions
UChat gives a lot of actions with OpenAI which users can use for their needs.
We will now discuss them in detail one by one.
Create Text Completion
Text completion offers the functionality of sending prompts to OpenAI in textual form and based on the prompt receiving an answer.
Input:
Prompt: This is your main input for which you want the AI to give you an answer or output of. This can be a question, an instruction, etc.
Model: The model you want to use inside OpenAI for the task. By default, text-DaVinci-003 has been selected.
Max Tokens: Each task inside OpenAI consumes tokens. These tokens can be replenished using credit. This field puts a limit on the maximum number of tokens you want to use for a particular task.
Temperature: This acts as an accuracy gauge where higher values give more random answers and lower values give more deterministic and focused answers. It defaults to 1
Presence Penalty: This value makes OpenAI use unique phrases and texts when completing a task. The higher the value, less repetitive the words. It defaults to 0.
Number of Completions: The number of times you want the AI to generate a response based on your prompt. The higher value will result in more responses. It defaults to 1 in order to avoid the consumption of tokens.
Best of Completions: This returns the best possible response(s) for your prompt. It defaults to 1. This works with the Number of Completion field to choose the best possible answer from a group of responses.
Response:
Map the response to custom field
You can select the text under the choices, and then you can see the JSON Path selected, and then you can save the response into your own user custom field, and then use this response in your flow builder.
Sample Response Data
{
"id": "cmpl-6zchlUy0OiAjX91LHOPBcZjuXaDgE",
"object": "text_completion",
"created": 1680144809,
"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 id