Skip to content

Commit 682494f

Browse files
committed
undo breaking change
1 parent ddc0ee3 commit 682494f

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/elevenlabs/speech_engine/resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ async def on_transcript(transcript, session):
115115

116116
def __init__(
117117
self,
118-
id: str,
118+
engine_id: str,
119119
client_wrapper: typing.Any = None,
120120
response: typing.Optional[SpeechEngineResponse] = None,
121121
) -> None:
122-
self.id = id
122+
self.engine_id = engine_id
123123
self._client_wrapper = client_wrapper
124124

125125
# Full API response, accessible as engine.config.asr, engine.config.overrides, etc.

src/elevenlabs/speech_engine_custom.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create( # type: ignore[override]
5858
request_options=request_options,
5959
)
6060
return SpeechEngineResource(
61-
id=response.speech_engine_id,
61+
engine_id=response.speech_engine_id,
6262
client_wrapper=self._raw_client._client_wrapper,
6363
response=response,
6464
)
@@ -79,7 +79,7 @@ def get( # type: ignore[override]
7979
"""
8080
response = super().get(speech_engine_id, request_options=request_options)
8181
return SpeechEngineResource(
82-
id=speech_engine_id,
82+
engine_id=speech_engine_id,
8383
client_wrapper=self._raw_client._client_wrapper,
8484
response=response,
8585
)
@@ -123,7 +123,7 @@ def update( # type: ignore[override]
123123
request_options=request_options,
124124
)
125125
return SpeechEngineResource(
126-
id=speech_engine_id,
126+
engine_id=speech_engine_id,
127127
client_wrapper=self._raw_client._client_wrapper,
128128
response=response,
129129
)
@@ -171,7 +171,7 @@ async def create( # type: ignore[override]
171171
request_options=request_options,
172172
)
173173
return SpeechEngineResource(
174-
id=response.speech_engine_id,
174+
engine_id=response.speech_engine_id,
175175
client_wrapper=self._raw_client._client_wrapper,
176176
response=response,
177177
)
@@ -192,7 +192,7 @@ async def get( # type: ignore[override]
192192
"""
193193
response = await super().get(speech_engine_id, request_options=request_options)
194194
return SpeechEngineResource(
195-
id=speech_engine_id,
195+
engine_id=speech_engine_id,
196196
client_wrapper=self._raw_client._client_wrapper,
197197
response=response,
198198
)
@@ -236,7 +236,7 @@ async def update( # type: ignore[override]
236236
request_options=request_options,
237237
)
238238
return SpeechEngineResource(
239-
id=speech_engine_id,
239+
engine_id=speech_engine_id,
240240
client_wrapper=self._raw_client._client_wrapper,
241241
response=response,
242242
)

tests/test_speech_engine_custom.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_create_returns_resource() -> None:
3333
result = client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test"))
3434

3535
assert isinstance(result, SpeechEngineResource)
36-
assert result.id == "seng_abc"
36+
assert result.engine_id == "seng_abc"
3737

3838

3939
def test_get_returns_resource() -> None:
@@ -43,7 +43,7 @@ def test_get_returns_resource() -> None:
4343
result = client.get("seng_abc")
4444

4545
assert isinstance(result, SpeechEngineResource)
46-
assert result.id == "seng_abc"
46+
assert result.engine_id == "seng_abc"
4747

4848

4949
def test_update_returns_resource() -> None:
@@ -53,7 +53,7 @@ def test_update_returns_resource() -> None:
5353
result = client.update("seng_abc", name="Renamed")
5454

5555
assert isinstance(result, SpeechEngineResource)
56-
assert result.id == "seng_abc"
56+
assert result.engine_id == "seng_abc"
5757

5858

5959
# ---------------------------------------------------------------------------
@@ -70,7 +70,7 @@ async def test_async_create_returns_resource() -> None:
7070
result = await client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test"))
7171

7272
assert isinstance(result, SpeechEngineResource)
73-
assert result.id == "seng_abc"
73+
assert result.engine_id == "seng_abc"
7474

7575

7676
@pytest.mark.asyncio
@@ -81,7 +81,7 @@ async def test_async_get_returns_resource() -> None:
8181
result = await client.get("seng_abc")
8282

8383
assert isinstance(result, SpeechEngineResource)
84-
assert result.id == "seng_abc"
84+
assert result.engine_id == "seng_abc"
8585

8686

8787
@pytest.mark.asyncio
@@ -92,4 +92,4 @@ async def test_async_update_returns_resource() -> None:
9292
result = await client.update("seng_abc", name="Renamed")
9393

9494
assert isinstance(result, SpeechEngineResource)
95-
assert result.id == "seng_abc"
95+
assert result.engine_id == "seng_abc"

0 commit comments

Comments
 (0)