diff --git a/pyflowery/models.py b/pyflowery/models.py index 8203e7a..e5a2960 100644 --- a/pyflowery/models.py +++ b/pyflowery/models.py @@ -42,12 +42,12 @@ class Result: success (bool): Boolean of whether the request was successful status_code (int): Standard HTTP Status code message (str = ''): Human readable result - data (Union[List[Dict], Dict]): Python List of Dictionaries (or maybe just a single Dictionary on error) + data (Union[List[Dict], Dict, bytes]): Python List of Dictionaries (or maybe just a single Dictionary on error), can also be a ByteString """ success: bool status_code: int message: str = '' - data: Union[List[Dict], Dict] = field(default_factory=dict) + data: Union[List[Dict], Dict, bytes] = field(default_factory=dict) @dataclass diff --git a/pyflowery/pyflowery.py b/pyflowery/pyflowery.py index a773fd6..e32e0f9 100644 --- a/pyflowery/pyflowery.py +++ b/pyflowery/pyflowery.py @@ -90,7 +90,7 @@ class FloweryAPI: language=Language(**voice['language']), ) - async def fetch_tts(self, text: str, voice: Voice | str | None = None, translate: bool = False, silence: int = 0, audio_format: str = 'mp3', speed: float = 1.0): + async def fetch_tts(self, text: str, voice: Voice | str | None = None, translate: bool = False, silence: int = 0, audio_format: str = 'mp3', speed: float = 1.0) -> bytes: """Fetch a TTS audio file from the Flowery API Args: @@ -109,7 +109,7 @@ class FloweryAPI: RetryLimitExceeded: Raised when the retry limit defined in the `FloweryAPIConfig` class (default 3) is exceeded Returns: - bytes: The audio file + bytes: The audio file in bytes """ if len(text) > 2048: if not self.config.allow_truncation: