GPT-3 In Your Pocket? Why Not!

pixabay_balloon_chat_2000-1333

GPT has become a very popular topic in recent times and is being used in many different ways, from automated customer service to natural language processing.

This tutorial will show you how to create a GPT-powered chatbot for the Viber app, using the WordPress and no-code plugin Convoworks WP. In it, we’ll explain how to set up the chatbot so that you can use GPT-3’s natural language technology to ask questions and converse about any topic.

Let’s get started!

Setup

To begin setting up your GPT powered chatbot for Viber, you will need to have a WordPress installation that is publicly accessible so it can receive requests from the Viber app. Then, navigate to the Plugin Installer and install and activate Convoworks WP. Once that is done, open Convoworks WP and create a new service using the “Import from file” option. The service definition (json file) can be downloaded here.

Import Convoworks service definition

Create a Viber bot on https://partners.viber.com/account/. In order to do that, the only thing you need is an installed and working Viber app. Once you create it you will have an API access token which will be used in Convoworks. Note the QR code which you can use to invite users.

Viber bot account setup

Now open your service in Convoworks, navigate to the Configuration view and click to enable the Viber platform. Here you have to enter Viber “Auth Token” and the “Account ID”. You can find account id number in your Viber account url at https://partners.viber.com/account/.

Viber platform configuration in Convoworks

Read More  The Coca-Cola Company And Microsoft Announce Five-year Strategic Partnership To Accelerate Cloud And Generative AI Initiatives

The last step is to set OpenAI auth key in the Convoworks service. In your service navigate to the Variables view and set the correct value. Here you can also set which model you are using and other parameters GPT API is using.

OpenAI GPT API configuration in the Convoworks service

Now you just have to start using it. Go to your Viber app, open the More screen and tap on a QR code icon on top. Turn the camera to QR code on your Viber bot account page and you are in!

Viber app – more view

How does it works?

The conversation

GPT (Generative Pre-trained Transformer) is a type of algorithm that can understand natural language and generate new text based on a given prompt. It works by using the input prompt to construct a context, and then using that context to generate text.

The completion principle of GPT is that it will generate new text based on the context provided by the prompt. It is important to provide GPT with a prompt that provides enough context for the algorithm to generate related text. For example, if you provide a prompt like “What is the capital of France?”, then GPT will generate text about France and its capital city.

So, what we are doing here in Convoworks service, is simply setting the ${conversation} variable (empty at the beginning) which contains the full conversation (check for “Set parameter” element). We are adding to it both the user’s inquiry and the bot’s responses.

Http Query element

Read More  Recruiting Artificial Intelligence To Create A More Diverse Workforce

This component allows us to create API requests and use the response data. It will fetch a completion response, add it to conversation and prepare response text we can return to the user. This functionality is placed in a fragment so we can use it in several places in the workflow.

In this service we are using plain text filters to enable handling of the additional commands. Here is an example which catches “restart” or “start over” commands to reset conversation (sets ${conversation} variable to empty string).

HTTP Query element configuration

HTTP Query element configuration

Text filter and special commands

In this service we are using plain text filters to enable handling of the additional commands. Here is an example which catches “restart” or “start over” commands to reset conversation (sets ${conversation} variable to empty string).

Start over command handling

Future ideas

Authentication

When Viber is sending requests, we are receiving the user’s unique id too. If we have that id in our database, we could easily know user details and respond with a personalized message or conversation.

Prompt engineering

There is much power in knowing how to form prompts to get most of the GPT. Forming the right prompt is crucial and you should play with it. Keep in mind that Convoworks is running inside WordPress and can access all its data., meaning that you can pre-populate a prompt with data from the database. You can put different conversation context if it is a new user, what was their last order … whatever you need.

Conclusion

GPT-3 is an amazing technology, and it’s incredible to see how it can be used to create powerful and useful applications. With the help of Convoworks, it’s now possible to use GPT-3 within WordPress and Viber to create an intelligent, conversational bot. With a few simple steps, you can have GPT power in your pocket!

Read More  AI Can Now Describe How Something Will Smell By Analyzing Its Chemical Structure

By: Tihomir Dmitrović
Source: Hackernoon


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Read More

liwaiwai_Apple-WWDC24-Apple-Intelligence-hero-240610_c

Introducing Apple Intelligence, the personal intelligence system that puts powerful generative models at the core of iPhone, iPad, and Mac

10 June 2024PRESS RELEASE Introducing Apple Intelligence, the personal intelligence system that puts powerful gener
Read More
tvOS 18 introduces intelligent new features like InSight that level up cinematic experiences. Users can stream Palm Royale on the Apple TV app with a subscription.

Updates to the Home experience elevate entertainment and bring more convenience 

10 June 2024 PRESS RELEASE tvOS 18 introduces new cinematic experiences with InSight, Enhance Dialogue, and subtitles CU
Read More