mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
feat: add Rime TTS
This commit is contained in:
parent
78e4abc796
commit
e255b33813
9 changed files with 79 additions and 8 deletions
|
|
@ -51,6 +51,7 @@ class UserConfigurationValidator:
|
|||
ServiceProviders.GOOGLE_REALTIME.value: self._check_google_api_key,
|
||||
ServiceProviders.ASSEMBLYAI.value: self._check_assemblyai_api_key,
|
||||
ServiceProviders.GLADIA.value: self._check_gladia_api_key,
|
||||
ServiceProviders.RIME.value: self._check_rime_api_key,
|
||||
}
|
||||
|
||||
async def validate(
|
||||
|
|
@ -225,3 +226,6 @@ class UserConfigurationValidator:
|
|||
|
||||
def _check_gladia_api_key(self, model: str, api_key: str) -> bool:
|
||||
return True
|
||||
|
||||
def _check_rime_api_key(self, model: str, api_key: str) -> bool:
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class ServiceProviders(str, Enum):
|
|||
SPEACHES = "speaches"
|
||||
ASSEMBLYAI = "assemblyai"
|
||||
GLADIA = "gladia"
|
||||
RIME = "rime"
|
||||
OPENAI_REALTIME = "openai_realtime"
|
||||
GOOGLE_REALTIME = "google_realtime"
|
||||
|
||||
|
|
@ -49,6 +50,7 @@ class BaseServiceConfiguration(BaseModel):
|
|||
ServiceProviders.SPEACHES,
|
||||
ServiceProviders.ASSEMBLYAI,
|
||||
ServiceProviders.GLADIA,
|
||||
ServiceProviders.RIME,
|
||||
ServiceProviders.OPENAI_REALTIME,
|
||||
ServiceProviders.GOOGLE_REALTIME,
|
||||
# ServiceProviders.SARVAM,
|
||||
|
|
@ -588,6 +590,25 @@ class CambTTSConfiguration(BaseTTSConfiguration):
|
|||
language: str = Field(default="en-us", description="BCP-47 language code")
|
||||
|
||||
|
||||
RIME_TTS_MODELS = ["arcana", "mistv3", "mistv2", "mist"]
|
||||
|
||||
|
||||
@register_tts
|
||||
class RimeTTSConfiguration(BaseTTSConfiguration):
|
||||
provider: Literal[ServiceProviders.RIME] = ServiceProviders.RIME
|
||||
model: str = Field(
|
||||
default="arcana",
|
||||
json_schema_extra={"examples": RIME_TTS_MODELS, "allow_custom_input": True},
|
||||
)
|
||||
voice: str = Field(
|
||||
default="celeste",
|
||||
description="Rime voice ID",
|
||||
)
|
||||
speed: float = Field(
|
||||
default=1.0, ge=0.5, le=2.0, description="Speech speed multiplier"
|
||||
)
|
||||
|
||||
|
||||
SPEACHES_TTS_MODELS = ["hexgrad/Kokoro-82M"]
|
||||
|
||||
|
||||
|
|
@ -625,6 +646,7 @@ TTSConfig = Annotated[
|
|||
DograhTTSService,
|
||||
SarvamTTSConfiguration,
|
||||
CambTTSConfiguration,
|
||||
RimeTTSConfiguration,
|
||||
SpeachesTTSConfiguration,
|
||||
],
|
||||
Field(discriminator="provider"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue