Thumbnail

Openai Chatbot

by OpenAI

Chatbot based on OpenAI GPT-3 gives your robot a human-like personality for conversation.

How to add the Openai Chatbot robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Artificial Intelligence category tab.
  5. Press the Openai Chatbot icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Openai Chatbot robot skill.

How to use the Openai Chatbot robot skill

Give your robot a personality and conversational ability. This robot skill adds chatbot capability to your robot so you can have meaningful conversations that it will remember. Configure the personality in any way you wish so the robot can prefer specific subjects or have particular opinions.

OpenAI’s mission is to ensure that artificial intelligence benefits all of humanity. This effort is essential to training AI systems to do what humans want. Generative Pre-trained Transformer 3, commonly known by its abbreviated form GPT-3 robot skill, is an unsupervised Transformer language model. This GPT-3 robot skill can be used with your robot for human-like conversation.

Screenshot
User-inserted image



Disclaimer


Open AI's GPT should not be used as a source of facts or information to help you make a decision. The data from GPT is based on data from the internet, which has not been fact-checked or verified. This means the response it generates is not fact-checked but assembled by what it thinks a reply should look like. In short, Open AI prioritizes a response based on statistical popularity and sentence structure, not facts.

*Note: Open AI responses should be treated as fiction.


User-inserted image



Configuration


The configuration menu has several options. You can add keywords with associated scripts that execute with responses from the Bot. You can also have a script that runs every response received. By default, the All Responses script will speak the response out of the PC speaker.
User-inserted image


Default Script
User-inserted image

By default, the All Responses script from the script tab will speak the response out of the PC speaker. If you use an EZB that supports audio output, the command can be edited to Audio.sayEZB() to speak out of the EZB. 

Variables
Variables are used to store the user's request and the bot response. This allows the robot to speak the response defaulted in the All Response scripts.
User-inserted image


Settings
The settings tab has options for configuring the bot behavior and the API key. Obtain an API Key from the OpenAI website and paste it into the appropriate box. When choosing a model, view the pricing and details on their website here: https://openai.com/api/pricing/
User-inserted image



Best Match
This list of words/phrases will be used to guess the best match based on the conversation. This allows your robot to execute a script matching the conversation's subject or tone. The robot can be sad or happy based on the type of conversation. Or have the robot dance when discussing a party or favorite music. A few examples provide suggestions for scripts to associate with them.

There is an option to determine what input the match should be based on. By default, the match will use the AI response to provide the most accurate interactive responses. If unchecked, the match will be based on the user's input.
User-inserted image



Edit Memory


The Open AI system does not use a session to maintain conversation history. To overcome this, the entire conversation history is held in the robot skill and sent to the Open AI system for every request. Occasionally, the conversation may become too complicated for the Open AI to understand. If you receive many "I have nothing to say to that" responses, the conversation memory may need to be "Cleaned up" or "Cleared." The Memory button allows for resetting or editing the conversation memory. Optionally, there is a ControlCommand() to reset the memory programmatically and set a default Bot Description value to give the chatbot a custom name.

User-inserted image




Control Commands


Several ControlCommand() for this robot skill enables interaction with other robot skills. 

Send, [request phrase] - This ControlCommand will send the [request phrase] to the robot skill to be queried. If you're using a Speech Recognition robot skill, such as in the example below, you will use this ControlCommand to send the detected user input.

ResetMemory - This will reset the conversation and memory to the default state. 

ResetMemory, [Bot Desription] - This will reset the conversation and memory to the default state and set the bot description to a custom value. Use the Memory -> Edit menu option to view the default bot description and see how it can be edited. For example, this is the default bot description "The following is a conversation with an AI robot. The robot is named Synthiam. The robot is friendly, creative, and clever.".  This bot description can be tailored to your needs, such as "The following is a conversation with an AI robot. The robot is named Synthiam. The robot enjoys discussing science. The robot's favorite sport is hockey."

API Key


An account is required on the OpenAI website to use the service. Once an account is created, you will have an API key to use in the robot skill.

1) Visit the OpenAI website and select the API option from the menu. 
User-inserted image


2) Press the SIGNUP option to create an account
User-inserted image


3) Once the account is created, press your Username icon to view the drop-down. And select the View API Keys option.
User-inserted image


4) Copy your API key
User-inserted image



5) Paste the API key in the robot skill configuration menu
User-inserted image



Open AI's GPT-3 Overview


Generative Pre-trained Transformer 3, commonly known by its abbreviated form GPT-3, is an unsupervised Transformer language model and the successor to GPT-2. It was first described in May 2020. OpenAI stated that the full version of GPT-3 contains 175 billion parameters, two orders of magnitude larger than the 1.5 billion parameters in the full version of GPT-2 (although GPT-3 models with as few as 125 million parameters were also trained).

OpenAI stated that GPT-3 succeeds at specific "meta-learning" tasks. It can generalize the purpose of a single input-output pair. The paper gives an example of translation and cross-linguistic transfer learning between English and Romanian and between English and German.

GPT-3 dramatically improved benchmark results over GPT-2. OpenAI cautioned that such scaling up of language models could be approaching or encountering the fundamental capability limitations of predictive language models. Pre-training GPT-3 required several thousand petaflop/s-days of computing, compared to tens of petaflop/s-days for the full GPT-2 model.

Like its predecessor, GPT-3's fully trained model was not immediately released to the public on the grounds of possible abuse until now for select partner companies.




Demo Example


Here is an example of using the OpenAI chatbot to have verbal conversations. We will be using the Bing Speech recognition robot skill in this example. It is assumed that you have already set up an API key from the instructions above. Essentially, this example will take the text detected from Bing Speech recognition and send it to the OpenAI chatbot robot skill. The OpenAI chatbot robot skill will then speak the chatbot's response.

1) Add the OpenAI chatbot to your ARC project. Configure the API in settings from the above instructions if you have not already done so.
User-inserted image


2) Add the Bing Speech Recognition robot skill to your ARC project. 
Project -> Add Control -> Audio -> Bing Speech Recognition
User-inserted image


3) Your project will now have both the OpenAI and Bing Speech recognition robot skills
User-inserted image


4) Press the Configure button on the Bing Speech recognition robot skill
User-inserted image


5) Press the button to edit the script for All Recognized Script
User-inserted image


6) We will use JavaScript in this example. When the script editor loads, select the JavaScript tab.
User-inserted image


7) Right-click in the editor and navigate the menu to the OpenAI selection. Choose the SEND option
User-inserted image


8) A command will be added to the code editor. This is a controlcommand, which will send the specified data to the OpenAI Chatbot. We will edit this command to send the variable containing the Bing Speech Recognition text detected.
User-inserted image


9) Highlight the "[requested phrase]" text
User-inserted image


10) Delete the "[requested phrase]" text
User-inserted image



11) Select the Global Variables tab 
User-inserted image


12) Place your cursor where the text you have just erased once was.
User-inserted image


13) Now click on the $BingSpeech variable from the Global Variables. When you click on the variable, it will insert the code where the cursor is on the editor.
User-inserted image


14) Your line of code should now look like this. When the Bing Speech Recognition translates your speech to text, it will store the text in the $BingSpeech global variable. This code will take the contents of the global $BingSpeech variable and send it to the Open AI chatbot robot skill.

Code:


ControlCommand("OpenAI Chatbot", "Send", getVar("$BingSpeech") );
User-inserted image



15) Save the code editor
User-inserted image


16) Save the configuration
User-inserted image


17) Now press the Start Recording button and speak to the robot. Press the Stop Recording button when you have completed speaking.
User-inserted image


18) You are now having a conversation with your robot!:)

Next Steps


You can add this to any robot and start modifying features to make the robot do specific actions or behaviors based on phrases. Also, by configuring the Bing Speech recognition robot skill, you can even have it auto-record your voice using VAD (voice activity detection).

If your robot has an EZB supporting audio, such as an EZ-Robot v4, you can change the Open AI script to sayEZB() and have the voice come from the robot speaker. There are many things you can do, be creative and have fun!

ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

PRO
Synthiam
#77  
Haha you'll get a kick out of this..

PRO
USA
#78  
Loving that..a whole lot!
PRO
Synthiam
#79  
I sure would like to change the voice more like hal though. I’ve never played much with third party speech synthesis. What’s a good one that ppl use? Might be one online that I’ll expect has the most options
PRO
USA
#80  
I'm not sure whats available now that AI is taking over every corner of every market...including voice cloning...BUT I have voices for Alan, Alena and Arbee from Cepstral, Cerevoice and Ivona ( not sure if still avail?). They are all SAPI 5 voices.
PRO
Canada
#81   — Edited
Wow DJ really like that voice , how did you modify that? Sounds much like a starwars battle droid, the bigger ones. Funny you did Hal 9000 script as I tried something like that yesterday but It refused to sing for me,LoL! ... so I never even thought you could tell the A.I. to act the part from the movie and it will answer just as it did in the real movie, very interesting! Say you want it to act like John Wayne from a famous movie or for me my Cylon Centurian from the Galactica 1980 episode The return of Starbuck where he had multiple conversations with the robot, even played poker with it, gotta try that out!
PRO
Canada
#82   — Edited
So the voiceGPT A.I. on my phone not as good as ARC version,with the role playing as it just makes up most of the story with 50% of true details, not much role play for me either. You can see in this link what happened...https://voicegpt.net/s/m70LVNI9

Edit...And this was the scene I was trying to role play with the A.I. Ya that ending was always a bit cheesy!...
https://youtu.be/pRQ2fRqDJIM
PRO
Canada
#83   — Edited
I finally had an opportunity to play with this plugin. NICE WORK DJ works great. I really wanted to try this skill with an actual robot. So I asked ChatGPT do you know how to play chess? It said yes. E2 to E4 your move.  OK this is great I grabbed a chess board and threw together a quick robot arm, this is going to be fantastic.  E7 to E5 I said so now our two pawns should meet in the middle.  Sadly GPT3 responded E7 to E5 as well.  No you are white that is my pawn and I already moved it. This must be an old GPT3 problem. I jumped over to OpenAI website and launched GPT4. It did the same thing. OK you really don't know how to play a game of chess.  Lets try checkers.  Similar issues.  How about Tic Tac Toe. Yet again it can't even play that.   

I sent off a feedback form. Hey IBM solved this with Deep Blue back in 1997 can you at least teach GPT4 to play a basic game of chess.

Now I am sure GPT5 will fix this but this also leads me to the conclusion we need a good way for an AI to chat to a robot. There needs to be a way to tell OpenAI what my robot is capable of and then send instructions from the robot to OpenAI on what our current sensor and actuator state is, where our presence in the world is, what the task we are trying to accomplish is and then receive new instructions from OpenAI.   I think we need some form of AI Robotic Markup (err Movement) Language (ARML) a simple protocol for defining a robots capabilities and communicating between an AI engine and a robot.
#84  

Quote:

There needs to be a way to tell OpenAI what my robot is capable of and then send instructions from the robot to OpenAI on what our current sensor and actuator state is, where our presence in the world is, what the task we are trying to accomplish is and then receive new instructions from OpenAI.
Are you sure you really want to do that? Remember the Terminator?
PRO
Canada
#85   — Edited
Just went to have another play and I get this error "Error processing the request. Do you have a valid API key in the configuration menu?"

Same key I used yesterday   OK I generated a new one and tried again. same error.

Edit: Quick investigation my free OpenAi account credits expired April 1 and I lost all my free tokens.   I put some money in the slot and it works again.  So no more free ride.   


Quote:

Are you sure you really want to do that? Remember the Terminator?
I'm sorry Dave this mission is too important to allow you to jeopardize it.
#86   — Edited

Quote:

I'm sorry Dave this mission is too important to allow you to jeopardize it.
Lol, a cool terminator quote but it also sonds like Hal from 2001. If I recall something "Wonderus"  happened in the end. Maybe it's going to be ok after all.*cool*
PRO
Canada
#87   — Edited
I have been having a play with the idea of AIRL (Artificial Intelligence Robot Language) and it seems to get it. Here is an example prompt that tells JD to do some exercises and you parse the contents of the < instruction > to perform the task. ChatGPT seemed to handle these well so I think we could create a long document of instructions for a robot humanoid to perform tasks that the AI tells it to do. We can then get it to use these prompts during the chat. This could be change eye color to express emotion, use appropriate body language or move in the location, direction required etc.

Here is an example where it told JD to perform certain exercises using AIRL and JD then performs them

Note: I had to do a screen shot because I can't seem to include the < > signs in code as this forum deletes them.

User-inserted image
PRO
Canada
#88   — Edited

Code:

// Audio.say(getVar("$OpenAIResponse"));
AIResponse = getVar("$OpenAIResponse");
aiText = AIResponse.replace(/<[^>]*>/g, ''); // Remove AIRL tags
airl = AIResponse.replace(aiText, ''); // Get AIRL tags only
Audio.say(aiText);

airlContents = airl.split(':'); // Split at colon
airlCategory = airlContents[0]; //extract category
airlSubCat = airlContents[1]; // extract subcategory after colon
airlValue = parseInt(airlContents[2]); // Extract number after second colon and convert to integer

print (airl);
print (airlCategory);
print (airlSubCat);
print (airlValue);
FYI: Sample code to strip the AIRL code from OpenAIResponse so it doesn't read the AIRL code out load. Also Parse the Category, Subcategory and number
PRO
Canada
#89   — Edited
Trying to get this OpenAI chatbot to give me Toronto time and even specify Eastern time zone but will continue to give time 2 hours behind? Is this because it thinks it is in calgary even though I ask Toronto? API related?....
     Seems to work hit or miss so not entirely accurate yet I just change the API key and sometimes helps,then if it fails really bad I remove the skill and re add, then works great again.
#90  
Open AI responses should be treated as fiction. You're better off treating it like this anyway. Truth is stranger then fiction. LOL. Sorry. I couldn't help myself. 

Alexa gets that question correct every time.
PRO
Canada
#91  
From using chat GPT3.5 on Several phone app versions for many hours already. It honestly tries to give accurate information but just like a person ,it can be sometimes faulty and make it up. Mostly ,I get great info, hours I spent talking about classic muscle cars with it, It would come up with all the accurate history that I was reading in magazines as a teenager. It would describe powerful engine combinations  and talk like a buddy with excited enthusiasm, like another mechanic buddy would. I would ask who was the best Funny car Drag racing driver. Like accurately describe John Force and mostly with Ford engines . I Tried to stump it by saying he drove Mopar motors, but it would correct me and call me an idiot for saying a lie, LoL! Just can't always tell me the time properly, not sure why.
#92  
@Athena when is Synthiam going to release the Chat GPT4 skill?
PRO
Synthiam
#93  
Tomorrow it looks like. The server migration had delayed things a bit - so the robot skill will be updated sometime tomorrow:)
#94  
Thanks DJ! Looking forward to it.
PRO
USA
#95   — Edited
I had heard there was a noticeable delay with Chat GPT 4(maybe servers bogged down?) in the round trip from asking to getting a  reply. Some people said the web UI had an average delay of 8 sec or more...That's why I stuck with ChatGPT3 on my last video (shorter round trip). Let me know how v4 is when its updated.
PRO
Synthiam
#96  
There seems to be quite a delay with the gpt-4. But I can reduce the delay with different parameters. I'm trying to figure out what the best solution is for it