Skip to content

fix: update get_clones to list_clones #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jigsawstack/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TTSCloneParams(TypedDict):
name: str


class GetTTSVoiceClonesParams(TypedDict):
class ListTTSVoiceClonesParams(TypedDict):
limit: NotRequired[int]
page: NotRequired[int]

Expand Down Expand Up @@ -122,7 +122,7 @@ def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:

return resp

def get_clones(self, params: GetTTSVoiceClonesParams) -> TextToSpeechResponse:
def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = Request(config=self.config, path=path, params=cast(Dict[Any, Any], params), verb="get").perform_with_content()
return resp
Expand Down Expand Up @@ -215,7 +215,7 @@ async def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
).perform_with_content()
return resp

async def get_clones(self, params: GetTTSVoiceClonesParams) -> TextToSpeechResponse:
async def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = await AsyncRequest(
config=self.config,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="jigsawstack",
version="0.2.3",
version="0.2.4",
description="JigsawStack - The AI SDK for Python",
long_description=open("README.md", encoding="utf8").read(),
long_description_content_type="text/markdown",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ async def _test():
asyncio.run(_test())


def test_get_clones():
def test_list_clones():
async def _test():
client = AsyncJigsawStack()
"""Test getting voice clones"""
"""Test listing voice clones"""
try:
# List available voice clones
clones_response = await client.audio.get_clones({"limit": 10, "page": 1})
clones_response = await client.audio.list_clones({"limit": 10, "page": 1})

assert clones_response["success"] == True

Expand All @@ -99,14 +99,14 @@ async def _test():
create_clone_response = await client.audio.create_clone(
{"name": "Test Voice Clone URL", "file_store_key": "hello_audio"}
)
clones = await client.audio.get_clones({"limit": 10, "page": 1})
clones = await client.audio.list_clones({"limit": 10, "page": 1})
print("Clones:", clones)
clone_id = clones["data"][0]["id"]
delete_clone_response = await client.audio.delete_clone(clone_id)
print("Delete clone response:", delete_clone_response)
assert delete_clone_response["success"] == True

except Exception as e:
print(f"Error in get_clone test: {e}")
print(f"Error in list_clones test: {e}")

asyncio.run(_test())