fed8b2eed7
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Backend release / release (push) Has been cancelled
Bandit Security Scan / bandit_scan (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / manifest (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / manifest (push) Has been cancelled
Python linting / ruff (push) Has been cancelled
Run python tests with pytest / Run tests and count coverage (3.12) (push) Has been cancelled
React Widget Build / build (push) Has been cancelled
18 lines
541 B
Python
18 lines
541 B
Python
from application.tts.google_tts import GoogleTTS
|
|
from application.tts.elevenlabs import ElevenlabsTTS
|
|
from application.tts.base import BaseTTS
|
|
|
|
|
|
|
|
class TTSCreator:
|
|
tts_providers = {
|
|
"google_tts": GoogleTTS,
|
|
"elevenlabs": ElevenlabsTTS,
|
|
}
|
|
|
|
@classmethod
|
|
def create_tts(cls, tts_type, *args, **kwargs)-> BaseTTS:
|
|
tts_class = cls.tts_providers.get(tts_type.lower())
|
|
if not tts_class:
|
|
raise ValueError(f"No tts class found for type {tts_type}")
|
|
return tts_class(*args, **kwargs) |