A simple voice-controlled assistant that combines speech recognition, OpenAI ChatGPT, and text-to-speech capabilities, designed for Raspberry Pi 5.
- Speech recognition for hands-free interaction
- Integration with OpenAI ChatGPT API
- Text-to-speech output using gTTS
- Optimized for Raspberry Pi 5
- Python 3.x
- Working microphone
- Internet connection
- OpenAI API key
- Raspberry Pi 5 (recommended) or other compatible system
-
Clone the repository
git clone [email protected]:TaraJura/rpi5-assistant.git cd rpi5-assistant
-
Create and activate virtual environment (recommended)
python3 -m venv venv source venv/bin/activate # On Linux/macOS # Or on Windows: # .\venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure the assistant
- Create a copy of
config.example.pyasconfig.py - Add your OpenAI API key to
config.py
OPENAI_API_KEY = 'your-api-key-here'
- Create a copy of
-
Run the assistant
python3 main.py
- The assistant will start listening for voice input when launched
- Speak clearly into your microphone
- Wait for the ChatGPT response and audio playback
- The conversation will continue until you stop the program
- Adjust microphone sensitivity in
config.py - Modify TTS voice settings
- Configure ChatGPT model parameters
- Customize wake word/phrase (if implemented)
- Ensure your microphone is properly connected and recognized
- Check your internet connection for TTS and ChatGPT functionality
- Verify your OpenAI API key is valid and has sufficient credits
- Run
python3 test_audio.pyto verify audio input/output setup
rpi5-assistant/
├── main.py # Main application file
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
├── test_audio.py # Audio testing utility
└── output/ # TTS output directory
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
# Virtual environment
venv/
# Python cache
__pycache__/
*.pyc
# Output folder
output/
# Configuration
config.py
# OS-specific
.DS_Store
Thumbs.db
- OpenAI for ChatGPT API
- Google Text-to-Speech (gTTS)
- Speech Recognition library contributors
- Raspberry Pi Foundation