add configurable provider in settings.py and update ElevenLabs Api (#2065) (#2074)

This commit is contained in:
Nihar
2025-10-22 21:37:21 +05:30
committed by GitHub
parent c4e8daf50e
commit f448e4a615
7 changed files with 112 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ from application.api import api
from application.api.user.base import agents_collection, storage
from application.api.user.tasks import store_attachment
from application.core.settings import settings
from application.tts.google_tts import GoogleTTS
from application.tts.tts_creator import TTSCreator
from application.utils import safe_filename
@@ -133,7 +133,7 @@ class TextToSpeech(Resource):
data = request.get_json()
text = data["text"]
try:
tts_instance = GoogleTTS()
tts_instance = TTSCreator.create_tts(settings.TTS_PROVIDER)
audio_base64, detected_language = tts_instance.text_to_speech(text)
return make_response(
jsonify(