Elevenlabs synthesize#87
Draft
pragmatrix wants to merge 17 commits into
Draft
Conversation
…to pass multiple voices and rotate them
Contributor
There was a problem hiding this comment.
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::Text→Input::Text) with anis_finalflag (defaulting totrue) 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
synthesizeexample, 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 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}"); | ||
| } | ||
| } |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.