Skip to content

Add speech capabilities: ElevenLabs TTS narration plugin - #2

Merged
jeffrodrych7-stack merged 1 commit into
mainfrom
rebrand/sirgent-ai
Sep 28, 2026
Merged

jeffrodrych7-stack merged 1 commit into
mainfrom
rebrand/sirgent-ai

Conversation

@freebuff-web

@freebuff-web freebuff-web Bot commented Sep 28, 2026

Copy link
Copy Markdown

Summary

Adds speech capabilities to SirGent AI as a new bundled plugin, plugins/speech/:

  • Stop-hook narrator (hooks/speak_response.py) — when SirGent finishes a turn, the final response is distilled (markdown/code/tables stripped, capped at ~400 chars at a sentence boundary), converted to MP3 via the ElevenLabs text-to-speech API, and played through the platform player (afplay on macOS, mpv/ffplay/paplay/aplay/play on Linux, PowerShell Media.SoundPlayer on Windows).
  • /speak command — say arbitrary text aloud on demand.
  • /hush command — mute/unmute the narrator via ~/.sirgent/speech-disabled.
  • Voice skill (skills/voice/SKILL.md) — guidance for preparing natural spoken text, calling the TTS API, and playback per platform.
  • tts-python.sh — Windows-safe python3 finder shim (same pattern as security-guidance).

Setup

Set ELEVENLABS_API_KEY (free tier available at elevenlabs.io). Optional: ELEVENLABS_VOICE_ID, ELEVENLABS_MODEL_ID, SPEECH_MAX_CHARS, SPEECH_DISABLE.

Behavior guarantees

  • Without an API key the narrator stays silent (one setup hint on first run)
  • The hook always exits 0 — API errors, missing players, or kill switches degrade to a systemMessage note, never a failed turn
  • Registered in .sirgent-plugin/marketplace.json and documented in plugins/README.md + main README.md

Validation

  • All JSON manifests parse; hook script is valid Python and exits 0 on empty payloads, kill switch, and missing transcript
  • Markdown stripping/summarization unit-tested inline (code fences, links, tables removed; sentence-boundary cuts verified)

🤖 Generated with Codebuff

New plugins/speech/ plugin with a Stop hook that narrates SirGent's final
response aloud (markdown stripped, capped, played via afplay/mpv/ffplay/
PowerShell), a /speak command for on-demand narration, a /hush mute toggle,
a voice skill, and a Windows-safe python3 shim. Registered in the
marketplace manifest and documented in the plugins README and main README.

Requires ELEVENLABS_API_KEY; degrades silently without one and never
blocks the session (hook always exits 0).

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
@jeffrodrych7-stack
jeffrodrych7-stack merged commit 16a969e into main Sep 28, 2026

@jeffrodrych7-stack jeffrodrych7-stack left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rych BioTech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant