A microservices-based WhatsApp bot that automatically transcribes voice messages and provides AI-powered responses.
- Real-time voice message transcription
- AI-powered responses (powered by Groq API)
- Integration with WhatsApp
- Microservices architecture for scalability
- Go
- Python
- Flask
- SQLite
- WhatsApp API (via whatsmeow)
- Faster-Whisper (for speech recognition)
- Groq API
To run this application, make sure you have the following installed:
Important
In order to use the Whatsmeow library on Windows, ensure that you have GCC installed.
Alternatively, you can use WSL for running the Go code. The Python code can run normally on any machine.
go mod tidy
- Create a virtual environment
python -m venv .venv
- Activate the virtual environment
# For Linux
source .venv/bin/activate
# For Windows
.venv\Scripts\activate
- Install the required packages
pip install -r requirements.txt
Note
Before you start, make sure to configure your IP Address in main.go
for sending the audio data to the Flask server.
To start, you need to start the Go application as well as the Flask server.
- Start the Flask server
python main.py
Note down the IP Address mentioned in the terminal, as you would need it to configure the Go application for sending the audio data.
- Start the Go application
go run main.go
-
Scan the QR Code displayed in the terminal to log into WhatsApp
-
Once logged in, any audio message sent to you will be transcribed and you will receive the response from the AI model sent back as a WhatsApp message.
- You would need to change your IP Address in
main.go
that sends the POST request to the Flask server. - The transcription model can be changed in the
transcribe.py
file by modifying themodel_name
parameter. - To use a different AI model, update the
Model
field in theRequestPayload
struct within thegroq/groq.go
file.
The transcription service exposes a single endpoint:
- POST
/transcribe
Accepts binary audio data in the request body.
Returns a JSON object with transcription and language fields
- Create a new issue
- Fork the repository
- Create a new branch
- Commit your changes
- Push to the branch
- Create a new Pull Request