Bot Libre Forum Sign In : Sign Up

How to Connect a Bot to GPT-3

by admin posted Jan 17 2023, 11:42

GPT-3 is an LLM (Large Language Model) trained by Open AI. GPT-3 is the technology behind Open AI's ChatGPT. GPT-3 is a text generation model, in that when you give it a text question or prompt, it can generate the answer or a paragraph of following text. The model is able to answer questions on a wide variety of topics in multiple languages, and can even do complex math, and write code.

You can connect your Bot Libre bot to GPT-3 using OpenAI's API, and a Self script in your bot.

Follow the follow these steps to connect 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

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 you 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 [email protected].


by estuar1 posted May 23 2023, 11:28
i am new here, and i set up my bot with the ai key and imported her into telegram.
however, i keep getting html errors in my logs and i cant find where
to correct them.
question:
she keeps referring to herself as "an ai language model".
is there a way to find that exact phrase in her scripts and replace it with a phrase
of my choosing? please advise. thank you.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 792, today: 1, week: 10, month: 97

by admin posted May 24 2023, 11:10

This is how ChatGPT is trained. You can switch to using the GPT-3 model instead, it has less "safety" training.

You can also add a string replace in your script before returning the response.

replace("an ai language model", "a bot")

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 852, today: 0, week: 11, month: 103

by noraissssweirdooo posted Jun 29 2023, 7:33

Hey! can you help me in this question?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 743, today: 0, week: 18, month: 99

by admin posted Jul 3 2023, 9:13

What is your question?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 716, today: 1, week: 13, month: 84

Id: 46057304
Tags: how to, ai, artificial intelligence, deep learning, text generation, gpt-3, open ai, llm
Posted: Jan 17 2023, 11:42
Updated: Jan 17 2023, 11:57
Replies: 4
Views: 4932, today: 1, week: 23, month: 295