Skip to content

Commit 119bf13

Browse files
committed
Update response type
1 parent 4802701 commit 119bf13

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

src/elevenlabs/speech_engine/client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from ..types.asr_conversational_config import AsrConversationalConfig
1010
from ..types.base_turn_config import BaseTurnConfig
1111
from ..types.conversation_config_input import ConversationConfigInput
12-
from ..types.create_speech_engine_response import CreateSpeechEngineResponse
1312
from ..types.list_speech_engines_response import ListSpeechEnginesResponse
1413
from ..types.privacy_config_input import PrivacyConfigInput
1514
from ..types.sort_direction import SortDirection
@@ -114,7 +113,7 @@ def create(
114113
language: typing.Optional[str] = OMIT,
115114
tags: typing.Optional[typing.Sequence[str]] = OMIT,
116115
request_options: typing.Optional[RequestOptions] = None,
117-
) -> CreateSpeechEngineResponse:
116+
) -> SpeechEngineResponse:
118117
"""
119118
Create a new Speech Engine resource
120119
@@ -155,7 +154,7 @@ def create(
155154
156155
Returns
157156
-------
158-
CreateSpeechEngineResponse
157+
SpeechEngineResponse
159158
Successful Response
160159
161160
Examples
@@ -429,7 +428,7 @@ async def create(
429428
language: typing.Optional[str] = OMIT,
430429
tags: typing.Optional[typing.Sequence[str]] = OMIT,
431430
request_options: typing.Optional[RequestOptions] = None,
432-
) -> CreateSpeechEngineResponse:
431+
) -> SpeechEngineResponse:
433432
"""
434433
Create a new Speech Engine resource
435434
@@ -470,7 +469,7 @@ async def create(
470469
471470
Returns
472471
-------
473-
CreateSpeechEngineResponse
472+
SpeechEngineResponse
474473
Successful Response
475474
476475
Examples

src/elevenlabs/speech_engine/raw_client.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from ..types.asr_conversational_config import AsrConversationalConfig
1717
from ..types.base_turn_config import BaseTurnConfig
1818
from ..types.conversation_config_input import ConversationConfigInput
19-
from ..types.create_speech_engine_response import CreateSpeechEngineResponse
2019
from ..types.list_speech_engines_response import ListSpeechEnginesResponse
2120
from ..types.privacy_config_input import PrivacyConfigInput
2221
from ..types.sort_direction import SortDirection
@@ -122,7 +121,7 @@ def create(
122121
language: typing.Optional[str] = OMIT,
123122
tags: typing.Optional[typing.Sequence[str]] = OMIT,
124123
request_options: typing.Optional[RequestOptions] = None,
125-
) -> HttpResponse[CreateSpeechEngineResponse]:
124+
) -> HttpResponse[SpeechEngineResponse]:
126125
"""
127126
Create a new Speech Engine resource
128127
@@ -163,7 +162,7 @@ def create(
163162
164163
Returns
165164
-------
166-
HttpResponse[CreateSpeechEngineResponse]
165+
HttpResponse[SpeechEngineResponse]
167166
Successful Response
168167
"""
169168
_response = self._client_wrapper.httpx_client.request(
@@ -204,9 +203,9 @@ def create(
204203
try:
205204
if 200 <= _response.status_code < 300:
206205
_data = typing.cast(
207-
CreateSpeechEngineResponse,
206+
SpeechEngineResponse,
208207
construct_type(
209-
type_=CreateSpeechEngineResponse, # type: ignore
208+
type_=SpeechEngineResponse, # type: ignore
210209
object_=_response.json(),
211210
),
212211
)
@@ -527,7 +526,7 @@ async def create(
527526
language: typing.Optional[str] = OMIT,
528527
tags: typing.Optional[typing.Sequence[str]] = OMIT,
529528
request_options: typing.Optional[RequestOptions] = None,
530-
) -> AsyncHttpResponse[CreateSpeechEngineResponse]:
529+
) -> AsyncHttpResponse[SpeechEngineResponse]:
531530
"""
532531
Create a new Speech Engine resource
533532
@@ -568,7 +567,7 @@ async def create(
568567
569568
Returns
570569
-------
571-
AsyncHttpResponse[CreateSpeechEngineResponse]
570+
AsyncHttpResponse[SpeechEngineResponse]
572571
Successful Response
573572
"""
574573
_response = await self._client_wrapper.httpx_client.request(
@@ -609,9 +608,9 @@ async def create(
609608
try:
610609
if 200 <= _response.status_code < 300:
611610
_data = typing.cast(
612-
CreateSpeechEngineResponse,
611+
SpeechEngineResponse,
613612
construct_type(
614-
type_=CreateSpeechEngineResponse, # type: ignore
613+
type_=SpeechEngineResponse, # type: ignore
615614
object_=_response.json(),
616615
),
617616
)

tests/test_speech_engine_custom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from elevenlabs.speech_engine.client import SpeechEngineClient as AutogeneratedSpeechEngineClient
99
from elevenlabs.speech_engine.resource import SpeechEngineResource
1010
from elevenlabs.speech_engine_custom import AsyncSpeechEngineClient, SpeechEngineClient
11-
from elevenlabs.types.create_speech_engine_response import CreateSpeechEngineResponse
1211
from elevenlabs.types.speech_engine_config import SpeechEngineConfig
12+
from elevenlabs.types.speech_engine_response import SpeechEngineResponse
1313

1414

1515
def _make_sync_client() -> SpeechEngineClient:
@@ -27,7 +27,7 @@ def _make_async_client() -> AsyncSpeechEngineClient:
2727

2828
def test_create_returns_resource() -> None:
2929
client = _make_sync_client()
30-
mock_response = CreateSpeechEngineResponse(speech_engine_id="seng_abc")
30+
mock_response = MagicMock(spec=SpeechEngineResponse, speech_engine_id="seng_abc")
3131

3232
with patch.object(AutogeneratedSpeechEngineClient, "create", return_value=mock_response):
3333
result = client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test"))
@@ -64,7 +64,7 @@ def test_update_returns_resource() -> None:
6464
@pytest.mark.asyncio
6565
async def test_async_create_returns_resource() -> None:
6666
client = _make_async_client()
67-
mock_response = CreateSpeechEngineResponse(speech_engine_id="seng_abc")
67+
mock_response = MagicMock(spec=SpeechEngineResponse, speech_engine_id="seng_abc")
6868

6969
with patch.object(AutogeneratedAsyncSpeechEngineClient, "create", new_callable=AsyncMock, return_value=mock_response):
7070
result = await client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test"))

0 commit comments

Comments
 (0)