This program integrates IBM Watson's Speech to Text and Text to Speech services with OpenAI's GPT-3.5 model, providing a seamless voice-interactive chatbot experience.
- Speech to Text: Converts voice to text using IBM Watson's API.
- ChatGPT Interaction: Processes the text with OpenAI's GPT-3 to generate responses.
- Text to Speech: Converts the chatbot's text responses back into voice using IBM Watson's API.
- IBM Cloud account with Watson Speech to Text and Text to Speech services.
- OpenAI account with GPT-3 API access.
- Python 3.x.
Ensure you have the API keys for IBM Watson and OpenAI, and install the required Python packages.
-
Clone or download this repository.
git clone git@github.com:maxstocklin/VoiceBotAI.git -
Edit Bash Profile:
vim ~/.zshrc -
Set your API keys as environment variables:
export STT_API_KEY='your-ibm-speech-to-text-key' export TTS_API_KEY='your-ibm-text-to-speech-key' export OPENAI_API_KEY='your-openai-key'
-
Install Python packages
pip install --upgrade openai pip install --upgrade ibm-watson pip install --upgrade ibmcloud
Run the script with the path to your audio file:
python chatbot.py <audiofile_path>Replace <audiofile_path> with your audio file's path.
Transcribes audio to text using IBM's API.
Sends text to ChatGPT for response.
Converts response to speech using IBM's API.