Skip to main content

Talk with GLaDOS using Ollama + Piper TTS + Whisper STT

Project description

GLaDOS Chat Library — Usage Guide

Talk with GLaDOS (Portal 2 style) via Ollama + Piper TTS + Whisper STT, either in your terminal or in Python scripts.


Features

  • Interactive Chatting
    • One-shot answers or sentence-by-sentence streaming.
  • Text-to-Speech (TTS)
    • Uses Piper with the GLaDOS voice model.
  • Speech-to-Text (STT)
    • Uses Whisper to transcribe microphone input.
  • Audio Device Control
    • Choose and persist your preferred output device.
  • CLI with colors
    • Clean, color-coded output for user and GLaDOS lines.
  • Sarcasm detection
    • Optional helper to flag user sarcasm.

Command Line Usage

Once installed, you have access to the glados-cli command.

1. Select your audio output device

glados-cli audiosource
  • Lists all available audio devices.
  • Prompts you to choose one.
  • Saves your selection for future sessions in ~/.glados-cli.json.

2. Start a chat session

glados-cli start

Plain text chat (no TTS/STT).
Type exit or quit to leave.

3. Start with TTS

glados-cli start --tts

Replies are spoken in GLaDOS’s voice.

4. Start with Streaming

glados-cli start --stream

Replies print sentence-by-sentence as they’re generated.

5. Combine streaming + TTS

glados-cli start --stream --tts

Replies stream sentence-by-sentence and each is spoken aloud.

6. Override audio device (session only)

glados-cli start --tts --audiosource 27

Plays on device index 27 (from the device list).
Does not affect your saved config.

7. Enable Speech-to-Text

glados-cli start --stt

If integrated with a mic, transcriptions are fed into the chat.


Python Usage

Embed GLaDOS directly in your own scripts:

from glados_chat_lib import GladosChat

# Create a chat instance
chat = GladosChat(enable_tts=True, enable_stt=False, model="llama2:7b")

# One-shot conversation
reply = chat.ask("Do you hate humans?")
print("GLaDOS:", reply)
chat.speak(reply)

# Streaming mode
for piece in chat.ask("Tell me about science.", stream=True):
    print(piece, end="", flush=True)

Audio Devices

  • Run glados-cli audiosource to choose and persist your output.
  • To override without saving:
    glados-cli start --audiosource <index>
    
  • To reset to default, delete ~/.glados-cli.json.

Quick Examples

Hear GLaDOS out loud in two steps:

glados-cli audiosource
glados-cli start --stream --tts

Embed in Python (minimal TTS only):

from glados_chat_lib import GladosChat

chat = GladosChat(enable_tts=True)
print("GLaDOS:", chat.ask("Sing me a song about testing."))

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glados_chat_lib-0.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glados_chat_lib-0.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file glados_chat_lib-0.1.tar.gz.

File metadata

  • Download URL: glados_chat_lib-0.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for glados_chat_lib-0.1.tar.gz
Algorithm Hash digest
SHA256 49fc98af3f8410151bbd6fa72c35104d4c1db795535c50b5be33e056dfaf16b1
MD5 7f63d3e8d53825b6477b8ac5800d92ab
BLAKE2b-256 6b16c2dc19390955e9856de108772c44a6e3993a70f1bf6a5f159732ce25c557

See more details on using hashes here.

File details

Details for the file glados_chat_lib-0.1-py3-none-any.whl.

File metadata

  • Download URL: glados_chat_lib-0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for glados_chat_lib-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64bcb294769ddfc52f1198ea9c6af14d4a0911b9ec61672a0e5ad3d009d2ff55
MD5 02743aa724964a82cc4cebf3abe2541b
BLAKE2b-256 f6466eced0edb7c3c6768f5e7f185a276e1d425ca52a75caf4329f24705c57ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page