An AI chatbot designed to serve as an improvisational "second chair" and comedy partner for a live stream of the video game X4: Foundations.
- Actor Core Prompt: A foundational prompt baked into the Ollama model that defines the AI's role as an improvisational actor.
- Personalities: Character sheets (e.g.,
graham.txt
) that are loaded at runtime to give the AI a specific persona. - Heuristic Operating System (HOS): A Python application (
hos.py
) that acts as the "Stage Manager," handling the text-based conversation loop and a "dead air" timer.
- Clone the repository.
- Create a Python virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
- Install the required Python packages:
pip install -r requirements.txt
- Install PortAudio (for
PyAudio
):- macOS (Homebrew):
brew install portaudio
- Debian/Ubuntu:
sudo apt-get install portaudio19-dev
- Windows: Download the binaries or use a package manager like Chocolatey.
- macOS (Homebrew):
- Install a TTS Engine (for
pyttsx3
):- Windows/macOS: Should work out of the box using native OS capabilities.
- Linux: You may need to install a backend like eSpeak:
sudo apt-get install espeak
The system is designed to be run as a chain of three separate applications, piping the output of one into the input of the next.
First, ensure your custom Ollama model is built using the provided Makefile
.
make model
2. Run the Full Pipeline
To run the complete system with speech-to-text and text-to-speech, open your terminal and execute the following command. Replace larry with the personality you wish to use (e.g., graham, fiona).
python stt.py | python hos.py -p larry | python tts.py
stt.py will listen to your microphone.
hos.py will receive your transcribed text and generate an AI response.
tts.py will speak the AI's response aloud.
3. Run in Text-Only Mode
If you wish to run the system without voice (typing your input as before), simply run hos.py by itself:
python hos.py -p larry