File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from .environment import ElevenLabsEnvironment
1818from .realtime_tts import RealtimeTextToSpeechClient
1919from .types import OutputFormat
20+ from .webhooks import WebhooksClient
2021
2122
2223DEFAULT_VOICE = Voice (
@@ -122,6 +123,7 @@ def __init__(
122123 httpx_client = httpx_client
123124 )
124125 self .text_to_speech = RealtimeTextToSpeechClient (client_wrapper = self ._client_wrapper )
126+ self .webhooks = WebhooksClient ()
125127
126128 @deprecated
127129 def clone (
@@ -303,6 +305,29 @@ class AsyncElevenLabs(AsyncBaseElevenLabs):
303305 )
304306 """
305307
308+ def __init__ (
309+ self ,
310+ * ,
311+ base_url : typing .Optional [str ] = None ,
312+ environment : ElevenLabsEnvironment = ElevenLabsEnvironment .PRODUCTION ,
313+ api_key : typing .Optional [str ] = os .getenv ("ELEVENLABS_API_KEY" ),
314+ timeout : typing .Optional [float ] = 60 ,
315+ httpx_client : typing .Optional [httpx .AsyncClient ] = None
316+ ):
317+ super ().__init__ (
318+ environment = base_url
319+ and ElevenLabsEnvironment (
320+ base = f"https://{ get_base_url_host (base_url )} " ,
321+ wss = f"wss://{ get_base_url_host (base_url )} " ,
322+ )
323+ or environment ,
324+ api_key = api_key ,
325+ timeout = timeout ,
326+ httpx_client = httpx_client
327+ )
328+ self .text_to_speech = RealtimeTextToSpeechClient (client_wrapper = self ._client_wrapper )
329+ self .webhooks = WebhooksClient ()
330+
306331 @deprecated_async
307332 async def clone (
308333 self ,
Original file line number Diff line number Diff line change 33import hashlib
44import time
55from typing import Any , Dict
6-
76from .errors import BadRequestError
87
98
You can’t perform that action at this time.
0 commit comments