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__": ...
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...