Skip to content

Elevenlabs synthesize#87

Draft
pragmatrix wants to merge 17 commits into
masterfrom
elevenlabs-synthesize
Draft

Elevenlabs synthesize#87
pragmatrix wants to merge 17 commits into
masterfrom
elevenlabs-synthesize

Conversation

@pragmatrix

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds ElevenLabs realtime streaming text-to-speech support and introduces partial text fragments (via an isFinal/is_final flag) so a single synthesis request can be streamed across multiple text events while preserving per-request completion semantics.

Changes:

  • Extend the protocol (ClientEvent::TextInput::Text) with an is_final flag (defaulting to true) to support partial text fragments.
  • Add an ElevenLabs multi-context WebSocket synthesize service and register/export it alongside existing providers.
  • Replace provider-specific synthesize examples with a single generic synthesize example, plus ADR/docs updates.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/protocol.rs Adds is_final to ClientEvent::Text with a serde default.
core/src/conversation.rs Adds is_final to core Input::Text.
src/context_switch.rs Plumbs is_final from protocol events into core input; registers ElevenLabs synthesize service.
src/lib.rs Re-exports synthesize services (Azure/Aristech/ElevenLabs).
services/elevenlabs/src/lib.rs Exposes new synthesize module and shared ws plumbing.
services/elevenlabs/src/ws.rs Adds shared WebSocket writer/shutdown utilities for ElevenLabs realtime APIs.
services/elevenlabs/src/transcribe.rs Refactors transcribe to use shared ws writer utilities.
services/elevenlabs/src/synthesize.rs Implements ElevenLabs multi-context realtime TTS with partial-fragment support.
services/playback/src/lib.rs Updates Input::Text handling for the new is_final field and forwards synthesize requests.
examples/synthesize.rs Adds a unified synthesize example supporting Azure/ElevenLabs/Aristech + voice listing + interactive partial fragments.
examples/azure-synthesize.rs Removed in favor of the generic synthesize example.
examples/aristech-synthesize.rs Removed in favor of the generic synthesize example.
README.md Updates example commands to the new generic synthesize example.
docs/adr/0002-partial-text-input.md ADR documenting isFinal-based partial text fragments.
docs/adr/0003-elevenlabs-multi-context-synthesis.md ADR documenting ElevenLabs multi-context design for request boundaries.
CONTEXT.md Adds protocol glossary entry for “Partial Text”.
Cargo.toml Bumps workspace version; adds aristech-tts-client for voice listing in example.
.harper-dictionary.txt Adds “ElevenLabs” / “camelCase” to dictionary.
.github/copilot-instructions.md Adds an explicit YAGNI section.

Comment thread services/elevenlabs/src/synthesize.rs Outdated
Comment thread services/elevenlabs/src/synthesize.rs Outdated
Comment on lines +255 to +263
None => {
input_closed = true;
// Close the socket; buffered audio is flushed first. Best-effort: the
// writer task result is still surfaced by shutdown_writer_task, but log
// here so a dead writer during shutdown is visible.
if let Err(e) = outbound_tx.send(text_message(json!({ "close_socket": true }))) {
error!("Failed to send ElevenLabs close_socket message: {e}");
}
}
pragmatrix and others added 2 commits July 2, 2026 17:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants