mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-05-24 14:33:26 +00:00
fix: [#47] check not is none
This commit is contained in:
parent
cc550ce1e7
commit
6ed4928ced
|
@ -20,6 +20,8 @@ class BaseVoiceModel(pydantic.BaseModel):
|
|||
@pydantic.model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_voice_name_exists(cls, data: typing.Any) -> typing.Any:
|
||||
if not data:
|
||||
return data
|
||||
voice_id = data.get("voice_id")
|
||||
voice_name = data.get("voice_name")
|
||||
if not voice_name and voice_id:
|
||||
|
|
|
@ -16,6 +16,8 @@ class YandexVoiceModel(models_tts_base.BaseVoiceModel):
|
|||
@pydantic.model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_voice_name_exists(cls, data: typing.Any) -> typing.Any:
|
||||
if not data:
|
||||
return data
|
||||
voice_id = data.get("voice_id")
|
||||
voice_name = data.get("voice_name")
|
||||
role = data.get("role")
|
||||
|
|
Loading…
Reference in New Issue
Block a user