From f8c1ac7db8b508db5a20a2d4a419174cbaadc287 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:59:20 -0800 Subject: [PATCH] feat: add s3-pro model Add s3-pro to the Model Literal so type checkers accept it, show it in the README model examples, and pin the model header in a unit test. The default model is unchanged. Co-Authored-By: Claude Fable 5.2 --- README.md | 6 ++++++ src/fishaudio/types/shared.py | 2 +- tests/unit/test_tts.py | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fbd31e8..521c877 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,12 @@ drama_audio = client.tts.convert( text="Expressive speech", model="drama-3", ) + +# S3 Pro +s3_audio = client.tts.convert( + text="S3 Pro speech", + model="s3-pro", +) ``` **With custom voice:** diff --git a/src/fishaudio/types/shared.py b/src/fishaudio/types/shared.py index 0628f9f..675d7d2 100644 --- a/src/fishaudio/types/shared.py +++ b/src/fishaudio/types/shared.py @@ -22,7 +22,7 @@ class PaginatedResponse(BaseModel, Generic[T]): # Model types -Model = Literal["s1", "s2-pro", "s2.1-pro", "s2.1-pro-free", "drama-3"] +Model = Literal["s1", "s2-pro", "s2.1-pro", "s2.1-pro-free", "drama-3", "s3-pro"] # Deprecated models DEPRECATED_MODELS = {"speech-1.5", "speech-1.6"} diff --git a/tests/unit/test_tts.py b/tests/unit/test_tts.py index 859d90d..a32e2ab 100644 --- a/tests/unit/test_tts.py +++ b/tests/unit/test_tts.py @@ -111,6 +111,18 @@ def test_convert_with_drama_3(self, tts_client, mock_client_wrapper): call_args = mock_client_wrapper.request.call_args assert call_args[1]["headers"]["model"] == "drama-3" + def test_convert_with_s3_pro(self, tts_client, mock_client_wrapper): + """Test the s3-pro model is sent as the model header.""" + mock_response = Mock() + mock_response.iter_bytes.return_value = iter([b"audio"]) + mock_client_wrapper.request.return_value = mock_response + + audio = tts_client.convert(text="Hello world", model="s3-pro") + + assert audio == b"audio" + call_args = mock_client_wrapper.request.call_args + assert call_args[1]["headers"]["model"] == "s3-pro" + def test_convert_with_reference_id(self, tts_client, mock_client_wrapper): """Test TTS with reference voice ID.""" mock_response = Mock()