A Raspberry Pi-based conversational AI that uses OpenAI's ChatGPT and ElevenLabs TTS to simulate a witty, sarcastic version of God. This project listens for your speech, processes your requests, and responds with humorous audio.
- Speech recognition using the default microphone via the SpeechRecognition library and Google Speech API.
- Text-to-speech using the ElevenLabs API.
- Integration with ChatGPT for dynamic, conversational responses.
- Caching of responses to reduce latency and API calls.
- Idle mode and interruption handling.
- Modes for impressions, compliments, motivational quotes, voice switching, and more.
-
Hardware:
- Raspberry Pi
- USB Microphone
- Speakers or headphones
-
Software:
- Python 3.x
- Git
mpg123for audio playback
-
Python Libraries:
openai==0.28requestsspeech_recognitionpyaudiovoskelevenlabssounddevicepython-dotenvlogging
-
Or install the libraries manually:
pip3 install openai requests speechrecognition pyaudio vosk elevenlabs sounddevice python-dotenv
-
Don't forget to:
sudo apt install portaudio19-dev -y alsa-utils libasound2 alsa-oss -y flac mpg321 vlc -y --upgrade pip setuptools wheel
- Clone the Repository:
git clone https://github.com/melisay/TalkToGod-local.git cd TalkToGod-local
- Environment Variables::
ELEVENLABS_API_KEY=your_elevenlabs_api_key OPENAI_API_KEY=your_openai_api_key
- Voice Settings:
- The project uses preset voices (VOICE_NIKKI) and (VOICE_TOM).
- You can change these in the source code if needed.
- Paths:
- Adjust paths such as BASE_DIR and CACHE_DIR in the source code if required
- Running the Application::
python3 localgod.py
- Running the Application With Vosk::
python3 localgod-vosk.py
- Updating the Code:::
git pull
No Valid Input Devices:
- Ensure your USB microphone is properly connected and set as the default input device.
API Errors:
- Verify that your .env file has the correct API keys and that your network connection is active.
Audio Playback Issues:
- Confirm that mpg123 is installed and functioning correctly.
If you'd like to contribute, please fork the repository and create a pull request with your changes. Follow the coding standards and guidelines outlined in the repository.
MIT License