feat: add cartesia tts

This commit is contained in:
Abhishek Kumar 2026-02-20 20:41:11 +05:30
parent 20b8dc60c1
commit e111cbb36d
2 changed files with 28 additions and 0 deletions

View file

@ -7,6 +7,7 @@ from api.constants import MPS_API_URL
from api.services.configuration.registry import ServiceProviders
from pipecat.services.azure.llm import AzureLLMService
from pipecat.services.cartesia.stt import CartesiaSTTService
from pipecat.services.cartesia.tts import CartesiaTTSService
from pipecat.services.deepgram.flux.stt import DeepgramFluxSTTService
from pipecat.services.deepgram.stt import DeepgramSTTService, LiveOptions
from pipecat.services.deepgram.tts import DeepgramTTSService
@ -191,6 +192,13 @@ def create_tts_service(user_config, audio_config: "AudioConfig"):
),
text_filters=[xml_function_tag_filter],
)
elif user_config.tts.provider == ServiceProviders.CARTESIA.value:
return CartesiaTTSService(
api_key=user_config.tts.api_key,
voice_id=user_config.tts.voice,
model=user_config.tts.model,
text_filters=[xml_function_tag_filter],
)
elif user_config.tts.provider == ServiceProviders.DOGRAH.value:
# Convert HTTP URL to WebSocket URL for TTS
base_url = MPS_API_URL.replace("http://", "ws://").replace("https://", "wss://")