Brodie AI is a wearable conversational AI bot powered by the OpenAI completions API, as well as Azures TTS and STT APIs. This repo contains the code running on both the Raspberry Pi and server so that you can recreate it.
DISCLAIMER: This code is NOT perfect. It's buggy and we built this in 24 hours during a hackathon, but it works and you can probably do it better.
- Raspberry Pi 2B (you can use any model)
- Any computer that can run a server + Ngrok to tunnel for local development and testing
- A Rapsberry Pi kit, (the one we used) or a breadboard, button, some resistors/wires, and a way to connect to the GPIO on the Pi.
There's a python script running on the Rapsberry Pi listening for a button input on the board. Once a user has clicked, the microphone listens for the audio and saves a .WAV file into the directory on the second button click. The conversate function is called which pings the API with the .WAV file.
The API takes the file, pushes it to Azure Speech to Text API, sends the text to the OpenAI Completions API, and finally we send that to Azure's TTS API and send the .wav file back to the user, and the script plays the audio file back.
Please DM @ryan_haraki on Twitter if you need any help! You're free to re-use this code in your own projects.
Credits go to Borna Shani, Alison Hardy, and Ryan Haraki.