An interaction with the ChatGPT API using speech to speech. Converting speech to text using OpenAI Whisper API and then sending the text to the ChatGPT API. The response from the ChatGPT API is then converted to speech using Google Text to Speech API.
- OpenAI API Key with Whisper Access and ChatGPT Access (https://openai.com/waitlist/gpt-4-api)
- Google Text to Speech API Key
- Install the requirements
pip install -r requirements.txt
-
Create the json file for Google Text to Speech API Key
-
Create the .env file for OpenAI API Key
OPENAI_API_KEY=YOUR-SECRET-KEY
Be careful, the speech to text and text to speech conversion can be charged by the API providers. Read the documentation of the API providers for more information.