feat(tts): add gandr_tts extension - #2300
Open
AALG123 wants to merge 1 commit into
Open
Conversation
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.
What
Adds
gandr_tts, a TTS extension for Gandr (https://gandr.ai), underai_agents/agents/ten_packages/extension/gandr_tts/.Gandr exposes an OpenAI compatible speech endpoint, so the extension is a close mirror of the in tree
rime_http_ttspattern: it extendsAsyncTTS2HttpExtensionfromten_ai_baseand streams audio over a plain HTTP POST withhttpx.How it works
POST https://tts.gandr.ai/v1/audio/speechwith a Bearer API key and a JSON body ofmodel,input,voice,response_formatresponse_formatis forced topcm; the service streams s16le mono 24000 Hz andsynthesize_audio_sample_rate()reports a fixed 24000params:api_key(defaults to theGANDR_TTS_API_KEYenv var),voice(defaultgandr-mia),model(defaulttts-1), optionalendpointoverriderime_http_ttsimplementation line for lineGandr serves six voices (gandr-mia, gandr-ava, gandr-jenny, gandr-dane, gandr-leo, gandr-lewis) across 23 languages, and every render is watermarked. Keys are available at https://gandr.ai with a free tier of 50,000 tokens, so smoke testing against the live endpoint is straightforward.
Testing
tests/mirrors therime_http_ttssuite (basic dump/flush, error messages, TTFB metrics, params passthrough, robustness, state machine) adapted to the Gandr config surface; all vendor calls in these tests are mockedDisclosure: I work on Gandr.