Skip to content

Commit aaa8489

Browse files
committed
changed to list clones
1 parent 6be8edd commit aaa8489

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

jigsawstack/audio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TTSCloneParams(TypedDict):
2222
name: str
2323

2424

25-
class GetTTSVoiceClonesParams(TypedDict):
25+
class ListTTSVoiceClonesParams(TypedDict):
2626
limit: NotRequired[int]
2727
page: NotRequired[int]
2828

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

123123
return resp
124124

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

218-
async def get_clones(self, params: GetTTSVoiceClonesParams) -> TextToSpeechResponse:
218+
async def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
219219
path = "/ai/tts/clone"
220220
resp = await AsyncRequest(
221221
config=self.config,

tests/test_audio.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ async def _test():
7575
asyncio.run(_test())
7676

7777

78-
def test_get_clones():
78+
def test_list_clones():
7979
async def _test():
8080
client = AsyncJigsawStack()
81-
"""Test getting voice clones"""
81+
"""Test listing voice clones"""
8282
try:
8383
# List available voice clones
84-
clones_response = await client.audio.get_clones({"limit": 10, "page": 1})
84+
clones_response = await client.audio.list_clones({"limit": 10, "page": 1})
8585

8686
assert clones_response["success"] == True
8787

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

109109
except Exception as e:
110-
print(f"Error in get_clone test: {e}")
110+
print(f"Error in list_clones test: {e}")
111111

112112
asyncio.run(_test())

0 commit comments

Comments
 (0)