Skip to main content

Posts

Showing posts from May, 2023

ChatGPT Voice Assisant on Raspberry Pi using custom data, ChatGPT, Whisper API, Speech Recognition and Pyttsx3

Raspberry Pi can be used to build a voice assistant using Chat GPT and Whisper API as shown here . This article shows how to customize the voice assistant application using your own data, e.g., pdf documents, financial data etc. Now, to train and create an AI chatbot based on a custom knowledge base, we need to get an API key from OpenAI. The API key will allow you to use OpenAI’s model as the LLM to study your custom data and draw inferences. The Chat GPT  library needs to be configured with an account's secret key which is available on the   website . Set the api key  OPENAI_API_KEY.   This API key let you  use OpenAI’s model as the LLM for any  custom data and draw inferences. os.environ["OPENAI_API_KEY"] = 'YOUR API KEY' Copy the custom data documents on a specific directory on Raspberry pi. e.g., /home/pi/Documents Use the  Recognizer class from the Speech Recognition library to recognize spoken words and phrases. if __name__ == "__main__": ...

ChatGPT Voice Assistant for Raspberry Pi Using ChatGPT, Whisper API, Speech Recognition and Pyttsx3

  OpenAI provides API for ChatGPT and Whisper models that would enable developers to access cutting-edge language and speech to text capabilities. This article shows how to use the ChatGPT and Whisper APIs from OpenAI along with Speech Recognition and text to Text-to-Speech libraries to build a voice-enabled chatbot.  Th e i nstallation instructions required Chat GPT and Whisper etc., libraries are provided  here  . First Connect USB Microphone and USB Speaker to Raspberry pi. The Chat GPT  library needs to be configured with an account's secret key which is available on the   website . Set the api key  OPENAI_API_KEY. OPENAI_API_KEY = 'Your API Key Here' openai.api_key = OPENAI_API_KEY Use the  Recognizer class from the Speech Recognition library to recognize spoken words and phrases. if __name__ == "__main__": # create a recognizer recoginzer = sr.Recognizer() mcrophone = sr.Microphone() # start the bot voice_bot(mcro...

Raspberry Pi Setup for Voice Assistant Applications Using ChatGPT, Whisper API, gTTS and Pysstx3

  Raspberry Pi can be used for providing voice assistant capabilities by integrating with ChatGPT and Whisper APIs from OpenAI. This article shows how to set up the required libraries such as Chat GPT, Whisper API, Text-to-speech Pysttx3 etc., on Raspberry Pi for enabling voice  assistant  applications.   Hardware components Raspberry Pi Micro SD Card Power Supply USB Speaker USB Microphone Recommended for initial setup USB Mouse USB Keyboard HDMI Cable Monitor Software Apps: Python ChatGPT, Whisper, Speech Recognition, Pysttx3 libraries Raspberry pi operating system needs to be installed on a micro SD card before installing any ChatGPT based libraries. Raspberry Pi Imager running on another computer can be used to copy the operating system into the SD card.  Click on 'CHOOSE OS' button and select Raspberry Pi OS (64-bit) option and select 'WRITE' button to install the operating system on the SD card. After installing Raspberry pi os on SD card, it can be insert...