Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): Support for text iterators in AsyncElevenLabs #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rootux
Copy link
Collaborator

@rootux rootux commented Dec 10, 2024

Why:
Allowing the async client to utilize incoming text streams when generating voice. Very useful when feeding the realtime output of an LLM into the TTS.

Closes elevenlabs#344

What:

  1. Copied RealtimeTextToSpeechClient and text_chunker into AsyncRealtimeTextToSpeechClient and async_text_chunker Most of the logic is intact, aside from async stuff
  2. Added AsyncRealtimeTextToSpeechClient into AsyncElevenLabs just like RealtimeTextToSpeechClient is in ElevenLabs
  3. Added rudimentary testing

The code is basically a copy-paste of what I found in the repo. We can rewrite it to be more elegant, but I figured parity with the sync code is more important.

Why:
Allowing the async client to utilize incoming text streams when generating voice.
Very useful when feeding the realtime output of an LLM into the TTS.

Closes elevenlabs#344

What:
1. Copied `RealtimeTextToSpeechClient` and `text_chunker` into `AsyncRealtimeTextToSpeechClient` and `async_text_chunker`
   Most of the logic is intact, aside from async stuff
2. Added `AsyncRealtimeTextToSpeechClient` into `AsyncElevenLabs` just like `RealtimeTextToSpeechClient` is in `ElevenLabs`
3. Added rudimentary testing

The code is basically a copy-paste of what I found in the repo. We can rewrite it to be more elegant, but I figured parity with the sync code is more important.
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.

Async client doesn't support streaming input
2 participants