From 38b78d8a4aef48b5b19308dd90182844ade2b74d Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Mon, 10 Aug 2026 07:13:10 -0700 Subject: [PATCH] =?UTF-8?q?feat(tts):=20migrate=20RP-surface=20TTS=20chatt?= =?UTF-8?q?erbox-fast=20=E2=86=92=20dots-tts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap the voice synthesis backend from chatterbox-fast (:8197 bespoke /tts) to dots-tts (rednote-hilab dots.tts-soar, :8198 OpenAI-shaped /v1/audio/speech), operator-directed after an A/B win. tts.py stays the single swap seam. - gateway body OpenAI-shaped: {input, voice, response_format, stream} (was chatterbox {text, voice, format, stream}) - sample rate 24000 -> 48000 Hz (browser Web Audio SR) - default voice glados_25s -> glados; donut voice carries over - serialized single-consumer (satisfied by the existing DEC-5 lock) - affect stays dropped (dots has no emotion knob, same as chatterbox) DOTS_TTS_URL replaces CHATTERBOX_TTS_URL; RATATOSKR_TTS_URL override unchanged. chatterbox-fast :8197 kept up as rollback. Contract amended (donut_voiced_interview.contract.md). Live-verified end-to-end on :8765 (RIFF/WAVE 48kHz mono s16le through /api/tts). 520 tests green. --- .../donut_voiced_interview.contract.md | 70 ++++++++++----- pyproject.toml | 2 +- src/ratatoskr/tts.py | 85 +++++++++---------- src/ratatoskr/web/entrypoint.py | 4 +- src/ratatoskr/web/server.py | 39 ++++----- src/ratatoskr/web/static/index.html | 6 +- tests/test_tts.py | 48 +++++------ tests/test_web_server.py | 34 ++++---- uv.lock | 2 +- 9 files changed, 153 insertions(+), 137 deletions(-) diff --git a/docs/contracts/donut_voiced_interview.contract.md b/docs/contracts/donut_voiced_interview.contract.md index 5a2273c..4f77298 100644 --- a/docs/contracts/donut_voiced_interview.contract.md +++ b/docs/contracts/donut_voiced_interview.contract.md @@ -4,8 +4,9 @@ module: "ratatoskr.web.tts_kb" purpose: > A voiced, corpus-grounded Tier-3 interview character in the ratatoskr web console. Two capabilities plus one character: (a) auto-TTS via the - chatterbox-fast gateway, spoken on SSE `done` (migrated off Zonos 2026-08-07; - no affect modulation β€” chatterbox Turbo has no emotion knob); (b) a + dots-tts gateway, spoken on SSE `done` (migrated Zonosβ†’chatterbox-fast + 2026-08-07, then chatterbox-fastβ†’dots-tts 2026-08-10; no affect modulation β€” + dots has no emotion knob); (b) a consumer-side KB-retrieval + `memory_context` pinning BRIDGE that grounds the character's recall in the ingested corpus while she stays in-voice; (c) Princess Donut (Dungeon Crawler Carl) as the first @@ -20,14 +21,14 @@ scope: > consult (an existing agent turn). touches: - src/ratatoskr/web/server.py # /api/tts route + the retrieval-pinning seam on the turn path - - src/ratatoskr/web/static/index.html # speak-on-done playback, πŸ”Š toggle,