Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# BonziAssist Environment Configuration
# Copy this file to .env and fill in your values:
# cp .env.example .env

# LLM Provider (e.g., groq, openai, anthropic)
LLM_PROVIDER=groq

# API Key for your chosen LLM provider
GROQ_API_KEY=your-api-key-here
33 changes: 28 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,40 @@
## BonziAssist: Your New (Old) Assistant!
This project uses the [TETYYS generator](https://www.tetyys.com/SAPI4/). Also see: [BonziBuddy-TTS](https://github.com/dot-Justin/BonziBuddy-TTS).
### ⚠️ Do Not Abuse the API ⚠️
BonziAssist revives the classic BonziBuddy assistant in a modern, voice-activated form, allowing you to interact with an AI through spoken commands. Heres a bit more about what makes BonziAssist special and how to use it.
BonziAssist revives the classic BonziBuddy assistant in a modern, voice-activated form, allowing you to interact with an AI through spoken commands. Here's a bit more about what makes BonziAssist special and how to use it.

### Features
- **Voice Activation**: Simply say "`Bonzi`" and once you hear Bonzi confirm he's listening, you're ready to go!
- **Text-to-Speech**: Utilizes the nostalgic BonziBuddy voice for responses, thanks to the [TETYYS SAPI4 API](https://www.tetyys.com/SAPI4/).
- **Real-Time Interaction**: Communicate in real-time, with responses generated through a lightweight LLM.

### Installation
1. Clone this repository.
2. Ensure you have [Python](https://www.python.org/downloads/) and [Visual CPP Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). installed, and then run `pip install -r requirements.txt` to install the necessary packages.
4. Set up your environment variables. Edit the `.env.example` file in `helpers\` and follow the instructions there. `[INSTRUCTIONS='Remove this line of instructions. Fill out the info below. Rename this file, and remove the .example. It should just be ".env" now.']`

1. **Clone this repository:**
```bash
git clone https://github.com/dot-Justin/BonziAssist.git
cd BonziAssist
```

2. **Install Python 3.8+** from [python.org](https://www.python.org/downloads/).
- **Windows users:** Also install [Visual CPP Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).

3. **Install dependencies:**
```bash
pip install -r requirements.txt
```

4. **Set up your environment variables:**
```bash
cp .env.example .env
```
Then edit `.env` and fill in your API key. You'll need:
- `LLM_PROVIDER` — your LLM provider (e.g., `groq`, `openai`)
- `GROQ_API_KEY` — your API key for the chosen provider

5. **Download the VOSK speech recognition model:**
- Download [vosk-model-small-en-us-0.15](https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip)
- Extract it into the `vosk/` directory so the path looks like: `vosk/vosk-model-small-en-us-0.15/`

### Usage
To start BonziAssist:
Expand Down Expand Up @@ -60,4 +83,4 @@ First of all, I appreciate anyone being excited about this project. That being s
- **SimpleAudio**: Used for playing back audio responses generated by the system.
- **PyAudio**: Handles microphone input and audio stream management.
- **Python-dotenv**: For managing environment variables in a .env file, which helps secure API keys and other sensitive settings.
- **GitHub Community**: For all the open-source contributors who have developed libraries and tools that made this project feasible.
- **GitHub Community**: For all the open-source contributors who have developed libraries and tools that made this project feasible.
2 changes: 1 addition & 1 deletion helpers/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import json

CONFIG_FILE = "config\mic_config.json"
CONFIG_FILE = os.path.join("config", "mic_config.json")

def list_microphones():
p = pyaudio.PyAudio()
Expand Down
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from vosk import Model, KaldiRecognizer

class BonziResponse:
def __init__(self, canned_directory="canned_responses/"):
def __init__(self, canned_directory=os.path.join("canned_responses", "")):
self.canned_directory = canned_directory
self.canned_responses = [os.path.join(canned_directory, f) for f in os.listdir(canned_directory) if f.endswith('.wav')]
self.preloaded_audio = self.preload_audio_files()
Expand Down Expand Up @@ -38,7 +38,11 @@ def play_random_response(self):
self.play_audio(response)

def listen_for_bonzi(device_index=None):
model_path = "vosk/vosk-model-small-en-us-0.15"
model_path = os.path.join("vosk", "vosk-model-small-en-us-0.15")
if not os.path.exists(model_path):
print(f"Error: VOSK model not found at '{model_path}'.")
print("Download it from https://alphacephei.com/vosk/models and extract to the 'vosk/' directory.")
return
model = Model(model_path)
recognizer = KaldiRecognizer(model, 16000)

Expand Down