feat: Add ModelsLab TTS provider#300
Open
adhikjoshi wants to merge 2 commits into
Open
Conversation
Adds ModelsLab (https://modelslab.com) as a new text-to-speech provider for podcastfy, following the same factory/registry pattern used by the existing ElevenLabs, OpenAI, Gemini, and Edge TTS integrations. Changes: - podcastfy/tts/providers/modelslab.py — new ModelsLabTTS class - podcastfy/tts/factory.py — register 'modelslab' in _providers - podcastfy/conversation_config.yaml — add modelslab default voices - tests/test_audio.py — skipped integration test Features: - 10 voices: Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi - Default podcast voices: Bella (question) and Antoni (answer) - Async polling support (handles 'processing' status, polls for up to 5 min) - API key via constructor arg or MODELSLAB_API_KEY environment variable - 2 500-character limit enforced automatically Usage: from podcastfy.text_to_speech import TextToSpeech tts = TextToSpeech(model='modelslab', api_key='YOUR_KEY') tts.convert_to_speech(text, 'output.mp3')
- Remove aligned spaces in _VOICE_MAP dict values (E241) - Remove aligned spaces in _API_URL/FETCH_URL assignments (E221) - Remove aligned spaces in payload dict (E241) - Remove aligned spaces in _poll_for_url assignments (E221) - Fix docstring arg indentation for consistency - Add missing docstring to _extract_url helper
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.
Summary
Adds ModelsLab as a new TTS provider for podcastfy, following the same factory/registry pattern as the existing ElevenLabs, OpenAI, Gemini, and Edge integrations.
Changes
podcastfy/tts/providers/modelslab.pyModelsLabTTSclass implementingTTSProviderpodcastfy/tts/factory.py'modelslab': ModelsLabTTSin_providerspodcastfy/conversation_config.yamlmodelslab:config section with default voicestests/test_audio.pyUsage
Or set the
MODELSLAB_API_KEYenvironment variable and just passmodel='modelslab'.Features
status: "processing"responses (polls every 5s, up to 5 min)requests(already in project dependencies)conversation_config.yaml
About ModelsLab
ModelsLab is an AI inference platform offering TTS, image generation, and video generation via REST API. API docs: https://docs.modelslab.com/text-to-audio/realtime/tts