This repository contains a voice-activated chatbot that utilizes the Vosk and OpenAI APIs to recognize speech, transcribe audio, and generate responses using a pre-trained language model.
- Listens for a trigger phrase to start processing user input
- Transcribes user speech using the Vosk speech recognition library
- Generates responses to user questions or statements using the OpenAI API
- Uses the pyttsx3 library for text-to-speech output
- Continues listening and responding until a termination phrase is detected
- vosk
- pyaudio
sudo apt-get install portaudio19-dev python3-pyaudio
- pyttsx3
sudo apt-get install espeak
- openai
- Clone this repository
- Install the required dependencies:
pip install vosk pyaudio pyttsx3 openai
- Create a credentials file at
./etc/credentials.txt
and add your open ai API key to{"openai_api": OPEN_AI_API_KEY}
. - Store the voks model at
./etc/models
and set the path as value ofMODEL_PATH
in stt.py - Check the constants in stt.py
Run the main script: python main.py
The chatbot will listen for the trigger phrase (e.g., "Hey, computer") before processing user input. It will continue listening and responding until the termination phrase (e.g., "Ende") is detected.
This project is licensed under the MIT License. See the LICENSE file for details.