From df8b170d5eddb2a7286c51a2e3a27b01c9432602 Mon Sep 17 00:00:00 2001 From: Kilerd Chan Date: Wed, 2 Apr 2025 16:00:46 +0800 Subject: [PATCH] fix: rename the API parameter self to self_only to avoid python conflict --- src/fish_audio_sdk/apis.py | 4 ++-- tests/test_apis.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fish_audio_sdk/apis.py b/src/fish_audio_sdk/apis.py index dfaa180..a75aa00 100644 --- a/src/fish_audio_sdk/apis.py +++ b/src/fish_audio_sdk/apis.py @@ -52,7 +52,7 @@ def list_models( page_number: int = 1, title: str | None = None, tag: list[str] | str | None = None, - self: bool = False, + self_only: bool = False, author_id: str | None = None, language: list[str] | str | None = None, title_language: list[str] | str | None = None, @@ -67,7 +67,7 @@ def list_models( "page_number": page_number, "title": title, "tag": tag, - "self": self, + "self": self_only, "author_id": author_id, "language": language, "title_language": title_language, diff --git a/tests/test_apis.py b/tests/test_apis.py index 760d7c8..0e6d137 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -50,6 +50,11 @@ async def test_list_models_async(session: Session): assert res.total > 0 +def test_list_self_models(session: Session): + res = session.list_models(self_only=True) + assert res.total > 0 + + def test_get_model(session: Session): res = session.get_model(model_id="7f92f8afb8ec43bf81429cc1c9199cb1") assert res.id == "7f92f8afb8ec43bf81429cc1c9199cb1"