Sunday, January 22, 2023

Generative AI - How To Connect Your Bot To Chat GPT-3



Whether it’s to write a research paper, solve calculus questions, write a code, debate about world affairs or find a date online, Chat GPT-3 is the latest AI generative technology that promises to accomplish all of this. The technology is created by Open AI and answers questions on a wide variety of topics in multiple languages.

With Bot Libre being a language independent, open source platform with a wide variety of chatbots for all industries and topics, new and existing clients can still hop on the Chat GPT-3 train without discarding their Bots. 

In this article, we show you how to connect your Bot Libre bot to GPT-3 using OpenAI's API, and a Self script in your bot.

1 - Create Your Bot

From the Bot Libre website click on "New Bot",

enter your bots name, and select "gpt3_template" as your bot template

click on "Create"

Another option if you already have an existing bot is to import the "GPT-3" script from the Bot Libre Script library, from your bot's Scripts page select "Import".

2 - Create Your Open AI Account

From the Open AI website create an account and API key,

Click on "View API Keys",

then "Create new secret key", and copy the key.

3 - Set Your Key In Your Script

From your bot's Admin Console, select "Scripts" and edit the "proxy" script.

Enter your Open AI API key in the line,

var apiKey = "";

4 - Edit your greeting

Your bot's greeting is the first message the bot send new users. It is also used as the first message in the text prompt sent to GPT-3.

Your greeting lets GPT-3 know what you want it to be.

i.e. here are some example greetings,

"Hello, I am Julie, product support for ACME, how can I help?"

"Hello, I am Joe, and can help you with any questions you have on plumbing."

"Hi, I am Jane, your best friend."

"Hello, I am Dexter, your virtual math tutor, ask me anything about math."

"Bonjour, je suis Céline, votre tutrice virtuelle de français."

 5 - Chat With Your Bot

You can now chat with your bot and it will respond to a wide variety of questions in multiple languages in the context of your conversation.

If you exceed your API quota, or the API is busy you will get the error "Bot is not available", which you can change in the script.

You can chat with GPT-3 here

Maximize Chat GPT-3 Potential With Bot Libre 

Using Bot Libre you can also now connect your GPT-3 bot to avatars, speech, the web, mobile, social media, and the metaverse. You can also enhance the bot by adding in your own responses, these will overlay the GPT-3 responses and take precedence if they are a good match.

Currently the GPT-3 proxy script forwards every question, but you can change this by editing the pattern in the script. To allow trained responses to take precedence you can change the pattern to "proxy *", and change your default response to redirect("proxy " + input.input) to only engage GPT-3 when your bot does not have a trained response.

If you need help setting up or training your bot, or are interested in training GPT-3 or other GPT models such as GPT-J on your own dataset please contact

Learned something? Please leave a comment and share with others!

No comments:

Post a Comment