mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-19 08:28:10 +02:00
fix: add language field to CartesiaTTSConfiguration and pass to Cartesia TTS service (#442)
* fix: add language field to CartesiaTTSConfiguration and pass to TTS service Closes #432 * chore: regenerate OpenAPI spec to fix drift-check The openapi.json snapshot had drifted from the FastAPI app definition because main gained new organization endpoints (billing, credits, context) after this branch was created. Regenerate it with 'python -m scripts.dump_docs_openapi' to bring it back in sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: clarify Cartesia language schema --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
This commit is contained in:
parent
abfd5e4cdd
commit
788ff94cec
4 changed files with 40 additions and 1 deletions
|
|
@ -978,6 +978,11 @@ class CartesiaTTSConfiguration(BaseTTSConfiguration):
|
|||
le=2.0,
|
||||
description="Volume multiplier for generated speech.",
|
||||
)
|
||||
language: str = Field(
|
||||
default="en",
|
||||
description="Cartesia language code for TTS synthesis (e.g. 'en', 'tr', 'fr', 'de').",
|
||||
json_schema_extra={"allow_custom_input": True},
|
||||
)
|
||||
|
||||
|
||||
@register_tts
|
||||
|
|
|
|||
|
|
@ -452,11 +452,13 @@ def create_tts_service(
|
|||
generation_config = (
|
||||
GenerationConfig(**gen_config_kwargs) if gen_config_kwargs else None
|
||||
)
|
||||
language = getattr(user_config.tts, "language", None) or "en"
|
||||
return CartesiaTTSService(
|
||||
api_key=user_config.tts.api_key,
|
||||
settings=CartesiaTTSSettings(
|
||||
voice=user_config.tts.voice,
|
||||
model=user_config.tts.model,
|
||||
language=language,
|
||||
**(
|
||||
{"generation_config": generation_config}
|
||||
if generation_config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue