def create(
self,
name: str,
description: str,
embedding: List[float],
base_voice_id: Optional[str] = None,
) -> VoiceMetadata:
"""Create a new voice.
Args:
name: The name of the voice.
description: The description of the voice.
embedding: The embedding of the voice. This should be generated with :meth:`clone`.
base_voice_id: The ID of the base voice. This should be a valid voice ID if specified.
Returns:
A dictionary containing the voice metadata.
"""
response = httpx.post(
f"{self._http_url()}/voices",
headers=self.headers,
json={
"name": name,
"description": description,
"embedding": embedding,
# Add "language"
"base_voice_id": base_voice_id,
},
timeout=self.timeout,
)
if not response.is_success:
raise ValueError(f"Failed to create voice. Error: {response.text}")
return response.json()
Add language code to this method of class Voices: