|
7 | 7 | from .environment import ElevenLabsEnvironment |
8 | 8 | from .music_custom import AsyncMusicClient, MusicClient |
9 | 9 | from .realtime_tts import RealtimeTextToSpeechClient |
| 10 | +from .speech_engine_custom import AsyncSpeechEngineClient, SpeechEngineClient |
10 | 11 | from .speech_to_text_custom import AsyncSpeechToTextClient, SpeechToTextClient |
11 | 12 | from .webhooks_custom import AsyncWebhooksClient, WebhooksClient |
12 | 13 |
|
@@ -62,24 +63,11 @@ def __init__( |
62 | 63 | self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper) |
63 | 64 | self._music = MusicClient(client_wrapper=self._client_wrapper) |
64 | 65 | self._speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper) |
| 66 | + self._speech_engine = SpeechEngineClient(client_wrapper=self._client_wrapper) |
65 | 67 |
|
66 | | - |
67 | | -class _AsyncSpeechEngineAccessor: |
68 | | - """Stub accessor for speech engine resources. |
69 | | -
|
70 | | - Will be replaced with a Fern-generated client once CRUD endpoints exist. |
71 | | - """ |
72 | | - |
73 | | - def __init__(self, client_wrapper: typing.Any) -> None: |
74 | | - self._client_wrapper = client_wrapper |
75 | | - |
76 | | - async def get(self, engine_id: str) -> typing.Any: |
77 | | - from .speech_engine.resource import SpeechEngineResource # noqa: E402 |
78 | | - |
79 | | - return SpeechEngineResource( |
80 | | - engine_id=engine_id, |
81 | | - client_wrapper=self._client_wrapper, |
82 | | - ) |
| 68 | + @property |
| 69 | + def speech_engine(self) -> SpeechEngineClient: |
| 70 | + return self._speech_engine |
83 | 71 |
|
84 | 72 |
|
85 | 73 | class AsyncElevenLabs(AsyncBaseElevenLabs): |
@@ -125,10 +113,8 @@ def __init__( |
125 | 113 | self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) |
126 | 114 | self._music = AsyncMusicClient(client_wrapper=self._client_wrapper) |
127 | 115 | self._speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper) |
128 | | - self._speech_engine = None # type: typing.Optional[_AsyncSpeechEngineAccessor] |
| 116 | + self._speech_engine = AsyncSpeechEngineClient(client_wrapper=self._client_wrapper) |
129 | 117 |
|
130 | 118 | @property |
131 | | - def speech_engine(self) -> _AsyncSpeechEngineAccessor: |
132 | | - if self._speech_engine is None: |
133 | | - self._speech_engine = _AsyncSpeechEngineAccessor(self._client_wrapper) |
| 119 | + def speech_engine(self) -> AsyncSpeechEngineClient: |
134 | 120 | return self._speech_engine |
0 commit comments