
    >|h*                     |   d dl Z ddlmZ d dlZd dlZddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddlm/Z/ ddlm0Z0 ddl	m1Z1 ddlm2Z2 ddlm3Z3 ddlm4Z4 ddlm5Z5 dd lm6Z6 dd!lm7Z7 dd"lm8Z8 dd#lm9Z9 dd$lm:Z: dd%lm;Z; dd&lm<Z< dd'l!m=Z= dd(l#m>Z> dd)l%m?Z? dd*l'm@Z@ dd+l)mAZA dd,l+mBZB dd-l-mCZC  G d. d/      ZD G d0 d1      ZEdd2d3e j                  eG   d4ed5eGfd6ZHy)7    N   )ElevenLabsEnvironment)SyncClientWrapper)HistoryClient)TextToSoundEffectsClient)AudioIsolationClient)SamplesClient)TextToSpeechClient)SpeechToSpeechClient)VoiceGenerationClient)TextToVoiceClient)
UserClient)VoicesClient)StudioClient)ProjectsClient)DubbingClient)ModelsClient)AudioNativeClient)UsageClient)PronunciationDictionaryClient)WorkspaceClient)SpeechToTextClient)ConversationalAiClient)AsyncClientWrapper)AsyncHistoryClient)AsyncTextToSoundEffectsClient)AsyncAudioIsolationClient)AsyncSamplesClient)AsyncTextToSpeechClient)AsyncSpeechToSpeechClient)AsyncVoiceGenerationClient)AsyncTextToVoiceClient)AsyncUserClient)AsyncVoicesClient)AsyncStudioClient)AsyncProjectsClient)AsyncDubbingClient)AsyncModelsClient)AsyncAudioNativeClient)AsyncUsageClient)"AsyncPronunciationDictionaryClient)AsyncWorkspaceClient)AsyncSpeechToTextClient)AsyncConversationalAiClientc                   
   e Zd ZdZdej
                   ej                  d      dddddej                  e
   dedej                  e
   d	ej                  e   d
ej                  e   dej                  ej                     fdZy)BaseElevenLabsa  
    Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.

    Parameters
    ----------
    base_url : typing.Optional[str]
        The base url to use for requests from the client.

    environment : ElevenLabsEnvironment
        The environment to use for requests from the client. from .environment import ElevenLabsEnvironment



        Defaults to ElevenLabsEnvironment.PRODUCTION



    api_key : typing.Optional[str]
    timeout : typing.Optional[float]
        The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.

    follow_redirects : typing.Optional[bool]
        Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.

    httpx_client : typing.Optional[httpx.Client]
        The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.

    Examples
    --------
    from elevenlabs import ElevenLabs

    client = ElevenLabs(
        api_key="YOUR_API_KEY",
    )
    NELEVENLABS_API_KEYTbase_urlenvironmentapi_keytimeoutfollow_redirectshttpx_clientr3   r4   r5   r6   r7   r8   c                   ||n|dnd }t        t        ||      |||n.|t        j                  ||      nt        j                  |      |      | _        t        | j                        | _        t        | j                        | _        t        | j                        | _
        t        | j                        | _        t        | j                        | _        t        | j                        | _        t#        | j                        | _        t'        | j                        | _        t+        | j                        | _        t/        | j                        | _        t3        | j                        | _        t7        | j                        | _        t;        | j                        | _        t?        | j                        | _         tC        | j                        | _"        tG        | j                        | _$        tK        | j                        | _&        tO        | j                        | _(        tS        | j                        | _*        tW        | j                        | _,        y N<   r3   r4   )r6   r7   )r6   )r3   r5   r8   r6   )client_wrapper)-r   _get_base_urlhttpxClient_client_wrapperr   historyr   text_to_sound_effectsr   audio_isolationr	   samplesr
   text_to_speechr   speech_to_speechr   voice_generationr   text_to_voicer   userr   voicesr   studior   projectsr   dubbingr   modelsr   audio_nativer   usager   pronunciation_dictionaryr   	workspacer   speech_to_textr   conversational_aiselfr3   r4   r5   r6   r7   r8   _defaulted_timeouts           U/var/www/html/test/engine/venv/lib/python3.12/site-packages/elevenlabs/base_client.py__init__zBaseElevenLabs.__init__X   s    )0(;W|G[ae0"H+N' &  + &8K[\&89&	 
 %D4H4HI%=TMaMa%b"34CWCWX$D4H4HI0@T@TU 4DDXDX Y 5TEYEY Z.d>R>RSd.B.BC	"$2F2FG"$2F2FG&d6J6JK$D4H4HI"$2F2FG-T=Q=QR 0D0DE
(EUYUiUi(j%(8L8LM0@T@TU!7tG[G[!\    )__name__
__module____qualname____doc__r   
PRODUCTIONosgetenvtypingOptionalstrfloatboolr?   r@   rZ    r[   rY   r0   r0   3   s    "N *.-B-M-M(1		2F(G*.266:(] //#&(] +	(]
 %(] '(] !//$/(] ooell3(]r[   r0   c                   
   e Zd ZdZdej
                   ej                  d      dddddej                  e
   dedej                  e
   d	ej                  e   d
ej                  e   dej                  ej                     fdZy)AsyncBaseElevenLabsa  
    Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.

    Parameters
    ----------
    base_url : typing.Optional[str]
        The base url to use for requests from the client.

    environment : ElevenLabsEnvironment
        The environment to use for requests from the client. from .environment import ElevenLabsEnvironment



        Defaults to ElevenLabsEnvironment.PRODUCTION



    api_key : typing.Optional[str]
    timeout : typing.Optional[float]
        The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.

    follow_redirects : typing.Optional[bool]
        Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.

    httpx_client : typing.Optional[httpx.AsyncClient]
        The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.

    Examples
    --------
    from elevenlabs import AsyncElevenLabs

    client = AsyncElevenLabs(
        api_key="YOUR_API_KEY",
    )
    Nr1   Tr2   r3   r4   r5   r6   r7   r8   c                   ||n|dnd }t        t        ||      |||n.|t        j                  ||      nt        j                  |      |      | _        t        | j                        | _        t        | j                        | _        t        | j                        | _
        t        | j                        | _        t        | j                        | _        t        | j                        | _        t#        | j                        | _        t'        | j                        | _        t+        | j                        | _        t/        | j                        | _        t3        | j                        | _        t7        | j                        | _        t;        | j                        | _        t?        | j                        | _         tC        | j                        | _"        tG        | j                        | _$        tK        | j                        | _&        tO        | j                        | _(        tS        | j                        | _*        tW        | j                        | _,        y r:   )-r   r>   r?   AsyncClientrA   r   rB   r   rC   r   rD   r   rE   r   rF   r    rG   r!   rH   r"   rI   r#   rJ   r$   rK   r%   rL   r&   rM   r'   rN   r(   rO   r)   rP   r*   rQ   r+   rR   r,   rS   r-   rT   r.   rU   rV   s           rY   rZ   zAsyncBaseElevenLabs.__init__   s    )0(;W|G[ae1"H+N' &  + ""+=P`a""+=>&	 
 *9M9MN%BRVRfRf%g"8H\H\])9M9MN5TEYEYZ 9I]I] ^ :$J^J^ _34CWCWX#43G3GH	't7K7KL't7K7KL+4;O;OP)9M9MN't7K7KL2$BVBVW%T5I5IJ
(JZ^ZnZn(o%-T=Q=QR5TEYEYZ!<DL`L`!ar[   )r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   rf   rg   r?   rl   rZ   rh   r[   rY   rj   rj      s    "N *.-B-M-M(1		2F(G*.26;?(b //#&(b +	(b
 %(b '(b !//$/(b ooe&7&78(br[   rj   )r3   r3   r4   returnc                 <    | | S ||j                   S t        d      )NzEPlease pass in either base_url or environment to construct the client)value	Exceptionr<   s     rY   r>   r>      s+    		    _``r[   )Irc   r4   r   ra   r?   core.client_wrapperr   history.clientr   text_to_sound_effects.clientr   audio_isolation.clientr   samples.clientr	   text_to_speech.clientr
   speech_to_speech.clientr   voice_generation.clientr   text_to_voice.clientr   user.clientr   voices.clientr   studio.clientr   projects.clientr   dubbing.clientr   models.clientr   audio_native.clientr   usage.clientr   pronunciation_dictionary.clientr   workspace.clientr   speech_to_text.clientr   conversational_ai.clientr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r0   rj   rd   re   r>   rh   r[   rY   <module>r      s     . 	  2 ) B 8 ) 5 9 : 3 # ' ' + ) ' 2 % J - 5 < 3 . G = . : > ? 8 ( , , 0 . , 7 * O 2 : AM] M]`Mb Mb` 7; avs3 aI^ acf ar[   