refactor: Improve code readability and structure across TTS modules
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
"""Base TTS provider interface."""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any
|
||||
|
||||
# Type alias for TTS options
|
||||
TTSOptions = dict[str, str | bool | int | float]
|
||||
|
||||
|
||||
class TTSProvider(ABC):
|
||||
"""Abstract base class for TTS providers."""
|
||||
|
||||
@abstractmethod
|
||||
async def generate_speech(self, text: str, **options: Any) -> bytes:
|
||||
async def generate_speech(self, text: str, **options: str | bool | float) -> bytes:
|
||||
"""Generate speech from text with provider-specific options.
|
||||
|
||||
Args:
|
||||
@@ -25,7 +27,7 @@ class TTSProvider(ABC):
|
||||
"""Return list of supported language codes."""
|
||||
|
||||
@abstractmethod
|
||||
def get_option_schema(self) -> dict[str, Any]:
|
||||
def get_option_schema(self) -> dict[str, dict[str, str | list[str] | bool]]:
|
||||
"""Return schema for provider-specific options."""
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user