EDCoPilot voice integration with Open AI ChatGPT
Updated: Nov 8
You can now hold a voice conversation with EDCoPilot integrated with ChatGPT and VoiceAttack. This all integrates so it appears as if it you are chatting with EDCoPilot. You can ask it anything !
EDCoPilot will speak the response, and print its reply on the Voice Log panel (see image), as it does with any regular Voice Attack command you give it
In the above Voice Log output, the Request> lines are my spoken input, followed by EDCoPilot / ChatGPT's reply.
Note: if you are in conversation with it, you can still issue the standard Voice Attack commands which will be processed as per usual.
What you need
- Voice Attack (the paid version, demo version will not work)
- The OpenAI-Voice Attack Plug-In (free to download and use)
- An Open AI account with API credits available,
You have to prepay for API credits. As an indicator on cost, 300 interactions with ChatGPT during testing over 3 days cost me $0.44 (44 cents)
This assumes you have installed Voice Attack, and imported the EDCoPilot VAP as per the Installation Instructions document in your EDCoPilot / docs folder.
Download and install the OpenAI-Voice Attack Plug-In from here : https://github.com/SemlerPDX/OpenAI-VoiceAttack-Plugin#readme
Note, you do not need to keep the AVCS or OpenAI Voice Attack profiles loaded in Voice Attack. All commands required are contained in the EDCoPilot profile. Only the base Voice Attack plug-in is required.
Create an OpenAI account, and load with API credits : https://openai.com/
Generate an OpenAI API key (in your account section on the OpenAI site)
Use the VoiceCommand "Open AI key menu" which will pop up a panel where you can paste the API key and save.
Start EDCoPilot as per normal
Issue command "Hey CoPilot" or "Chat query" (instructions to customise this phrase are later in the article)
EDCoPilot / OpenAI plug-in responds with a "Yes Commander?" response
Ask your question. After a 1-2 second pause, if all is working OK, you will hear a thinking sound, while ChatGPT processes and replies to your request.
EDCoPilot will read the ChatGPT response, breaking the response into chunks if necessary.
If there is a "There is more" message, you can use voice command "Tell Me More" to have the next paragraph read, or "Display Remaining" to simply display the rest of the text on the Voice Log. "There is more" responses are typically given if you have asked for a list ... eg. "give me 5 facts about the planet Mars"
If paragraphs are too long, EDCoPilot will read the first few lines followed by a "more follows" message. EDCoPilot will read that line, then proceed automatically to read the next block of text, and so on.
Once EDCoPilot has finished reading the response, you have a few seconds to reply / ask the next question.
If you dont respond in a few seconds, the OpenAI plugin will stop listening. You will get an INFO message on the Voice Log that the conversation is sleeping. You can resume the conversation by issuing another "chat query" command
If you do respond, OpenAI will process your verbal response, and repeat process from step 4
You can use voice command "stop chatting" to close a conversation, or "reset chat / stop all commands" if the thinking sound loops and no reply (an indication something has gone wrong such as OpenAI too busy, or just taking too long to respond)
Customising the Voice Attack phrases:
All of the Voice Attack commands used for OpenAI chat are tokenised, with token definitions defined in a master config file in EDCoPilot \ working \ EDCoPilot.VoiceCommands.ini.
Do not make changes to this file, as this will be overwritten by updates in new releases.
Users can override the definition in the master config file, by copying lines into the file EDCoPilot \ working \ EDCoPilot.VoiceCommandsCustom.ini and modifying the trigger phrase portion:
Edit the EDCoPilot.VoiceCommandsCustom.ini file and add these line:
OPENAIQUERY = Initiate / continue an Open AI conversation|Hey CoPilot; chat query; chatbot [entry; query]
OPENAIKEYMENU = Open the key menu to enter your Open AI API key (setup)|Open AI key menu
OPENAISTOPCHAT = Stop the current OpenAI ChatGPT conversation|Stop chatting; stop conversations|crew
OPENAIREMAINING = Display remaining ChatGPT response text if "there is more" in the voice log (but do not speak the text)|display remaining
OPENAITELLMORE = Speak and display the next few sentences of ChatGPT response (if "there is more")|Tell me more
OPENAICANCEL = Cancel a thinking loop (Note: also stops all VA commands and ends the conversation)|Reset chat
b. Change the last portion of each line after the | to the voice trigger you want. Example: to use "Hey Holly" instead of "Hey CoPilot" change the OPENAIQUERY line to say OPENAIQUERY = Initiate / continue an Open AI conversation|Hey Holly; chat query; chatbot [entry; query]
c. Save the file, and either restart EDCoPilot, or issue the voice command "Refresh CoPilot" to reload the variables. Your custom voice command should now be recognised.