
    >|h                     v   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+  e jX                  e jZ                  d      Z. G d d      Z/ G d d      Z0y)    N   )SyncClientWrapper)RequestOptions)GetVoicesResponse)construct_type)UnprocessableEntityError)HttpValidationError)JSONDecodeError)ApiError)VoiceSettings)jsonable_encoder)Voice)DeleteVoiceResponseModel)EditVoiceSettingsResponseModel)'convert_and_respect_annotation_metadata)core)AddVoiceIvcResponseModel)EditVoiceResponseModel)AddVoiceResponseModel   )VoicesGetSharedRequestCategory)GetLibraryVoicesResponse)ProfilePageResponseModel)AsyncClientWrapper.c            #          e Zd ZdefdZddddej                  e   dej                  e   de	fdZ
dd	dej                  e   defd
Zdd	dedej                  e   defdZddddedej                  e   dej                  e   defdZdd	dedej                  e   defdZdd	dededej                  e   defdZeeedddedej,                  ej0                     dej                  e   dej                  e   dej                  e   dej                  e   defdZeeeedddededej                  ej,                  ej0                        dej                  e   dej                  e   dej                  e   dej                  e   defdZdd	dedededej                  e   def
dZdddddddddddddddddd ej                  e   d!ej                  e    d"ej                  e   d#ej                  e   d$ej                  e   d%ej                  e   d&ej                  e   d'ej                  ejB                  eejD                  e   f      d(ej                  ejB                  eejD                  e   f      d)ej                  e   d*ej                  e   d+ej                  e   d,ej                  e   d-ej                  e   d.ej                  e   dej                  e   de#f"d/Z$eeedd0d1ej                  ej0                     d2ej                  e%   d3ej                  e   dej                  e   de#f
d4Z&dd	d5edej                  e   de'fd6Z(y)7VoicesClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     W/var/www/html/test/engine/venv/lib/python3.12/site-packages/elevenlabs/voices/client.py__init__zVoicesClient.__init__    
    -    Nshow_legacyrequest_optionsr)   r*   returnc          
      @   | j                   j                  j                  ddd|i|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
ar  
        Returns a list of all available voices for a user.

        Parameters
        ----------
        show_legacy : typing.Optional[bool]
            If set to true, legacy premade voices will be included in responses from /v1/voices

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetVoicesResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_all()
        	v1/voicesGETr)   methodparamsr*      ,  type_object_  status_codebodyr!   httpx_clientrequestr9   typingcastr   r   jsonr   r	   r
   r   textr#   r)   r*   	_response_response_jsons        r$   get_allzVoicesClient.get_all#   s
   8 ((55=={ , > 
		Si++1c1{{%"/ ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC2 <AC2 2+Dr*   c                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)av  
        Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoiceSettings
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_default_settings()
        v1/voices/settings/defaultr.   r0   r*   r2   r3   r4   r8   r!   r<   r=   r9   r>   r?   r   r   r@   r
   r   rA   r#   r*   rC   rD   s       r$   get_default_settingsz!VoicesClient.get_default_settings_   s    . ((55==(+ > 
	
	Si++1c1{{!"+ ) 0  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AB  9B   +Cvoice_idc          
      T   | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a4  
        Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoiceSettings
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_settings(
            voice_id="JBFqnCBsd6RMkjVDRZzb",
        )
        
v1/voices/	/settingsr.   rI   r2   r3   r4   r7   r8   r!   r<   r=   r   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   rM   r*   rC   rD   s        r$   get_settingszVoicesClient.get_settings   s   8 ((55==)(34I>+ > 
	
	Si++1c1{{!"+ ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC< AC< <+D'with_settingsr*   rU   c          
      X   | j                   j                  j                  dt        |       dd|i|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a   
        Returns metadata about a specific voice.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        with_settings : typing.Optional[bool]
            This parameter is now deprecated. It is ignored and will be removed in a future version.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Voice
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get(
            voice_id="JBFqnCBsd6RMkjVDRZzb",
        )
        rO   r.   rU   r/   r2   r3   r4   r7   r8   r!   r<   r=   r   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   rM   rU   r*   rC   rD   s         r$   getzVoicesClient.get   s   J ((55==)(345 , > 
		Si++1c1{{"# ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC> AC> >+D)c          
      R   | j                   j                  j                  dt        |       d|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	a  
        Deletes a voice by its ID.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DeleteVoiceResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.delete(
            voice_id="VOICE_ID",
        )
        rO   DELETErI   r2   r3   r4   r7   r8   r!   r<   r=   r   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   rR   s        r$   deletezVoicesClient.delete  s   < ((55==)(345+ > 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   AC; AC; ;+D&r=   c          
         | j                   j                  j                  dt        |       ddt	        |t
        d      |t              }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)a  
        Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request : VoiceSettings

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        EditVoiceSettingsResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, VoiceSettings

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.edit_settings(
            voice_id="VOICE_ID",
            request=VoiceSettings(
                stability=0.1,
                similarity_boost=0.3,
                style=0.2,
            ),
        )
        rO   /settings/editPOSTwriter6   
annotation	directionr0   r@   r*   omitr2   r3   r4   r7   r8   r!   r<   r=   r   r   r   OMITr9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   rM   r=   r*   rC   rD   s         r$   edit_settingszVoicesClient.edit_settingsB  s    J ((55==)(34NC8Ubnuv+ > 
		Si++1c1{{2"< ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   AD AD +D=remove_background_noisedescriptionlabelsr*   namefilesrn   ro   rp   c          
      V   | j                   j                  j                  dd||||dd|i|t              }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      # t        $ r" t        |j                  |j                  
      w xY w)a  
        Add a new voice to your collection of voices in VoiceLab.

        Parameters
        ----------
        name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        files : typing.List[core.File]
            See core.File for more documentation

        remove_background_noise : typing.Optional[bool]
            If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.

        description : typing.Optional[str]
            A description of the voice.

        labels : typing.Optional[str]
            Serialized labels dictionary for the voice.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVoiceIvcResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.add(
            name="Alex",
        )
        v1/voices/addra   rq   rn   ro   rp   rr   r0   datarr   r*   rg   r2   r3   r4   r7   r8   r!   r<   r=   ri   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   	r#   rq   rr   rn   ro   rp   r*   rC   rD   s	            r$   addzVoicesClient.add  s!   b ((55==+B* 	  , > 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC= AC= =+D(rr   rn   ro   rp   r*   c          
      p   | j                   j                  j                  dt        |       dd||||dd|i|t              }	 d|j
                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j
                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }	t        |j
                  |	      # t        $ r" t        |j
                  |j                        w xY w)a%  
        Edit a voice created by you.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        files : typing.Optional[typing.List[core.File]]
            See core.File for more documentation

        remove_background_noise : typing.Optional[bool]
            If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.

        description : typing.Optional[str]
            A description of the voice.

        labels : typing.Optional[str]
            Serialized labels dictionary for the voice.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        EditVoiceResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.edit(
            voice_id="VOICE_ID",
            name="George",
        )
        rO   /editra   ru   rr   rv   r2   r3   r4   r7   r8   r!   r<   r=   r   ri   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   
r#   rM   rq   rr   rn   ro   rp   r*   rC   rD   s
             r$   editzVoicesClient.edit  s1   l ((55==)(34E:+B* 	  , > 
		Si++1c1{{*"4 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD
 AD
 
+D5public_user_idnew_namec          
         | j                   j                  j                  dt        |       dt        |       dd|iddi|t              }	 d|j
                  cxk  rd	k  r:n n7t        j                  t        t        t        |j                         
            S |j
                  dk(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t        |j
                  |      # t        $ r" t        |j
                  |j                        w xY w)a  
        Add a shared voice to your collection of voices.

        Parameters
        ----------
        public_user_id : str
            Public user ID used to publicly identify ElevenLabs users.

        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        new_name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVoiceResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.add_sharing_voice(
            public_user_id="63e84100a6bf7874ba37a1bab9a31828a379ec94b891b401653b655c5110880f",
            voice_id="sB1b5zUrxQVAFl2PhZFp",
            new_name="Alita",
        )
        v1/voices/add//ra   r   content-typeapplication/jsonr0   r@   headersr*   rg   r2   r3   r4   r7   r8   r!   r<   r=   r   ri   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   r   rM   r   r*   rC   rD   s          r$   add_sharing_voicezVoicesClient.add_sharing_voice;  s7   V ((55==-n=>a@PQY@Z?[\H  2 , > 
		Si++1c1{{)"3 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srl   	page_sizecategorygenderageaccentlanguagesearch	use_casesdescriptivesfeaturedmin_notice_period_daysreader_app_enabledowner_idsortpager*   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                \   | j                   j                  j                  dd|||||||||	|
|||||d|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a  
        Retrieves a list of shared voices.

        Parameters
        ----------
        page_size : typing.Optional[int]
            How many shared voices to return at maximum. Can not exceed 100, defaults to 30.

        category : typing.Optional[VoicesGetSharedRequestCategory]
            Voice category used for filtering

        gender : typing.Optional[str]
            Gender used for filtering

        age : typing.Optional[str]
            Age used for filtering

        accent : typing.Optional[str]
            Accent used for filtering

        language : typing.Optional[str]
            Language used for filtering

        search : typing.Optional[str]
            Search term used for filtering

        use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Use-case used for filtering

        descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Search term used for filtering

        featured : typing.Optional[bool]
            Filter featured voices

        min_notice_period_days : typing.Optional[int]
            Filter voices with a minimum notice period of the given number of days.

        reader_app_enabled : typing.Optional[bool]
            Filter voices that are enabled for the reader app

        owner_id : typing.Optional[str]
            Filter voices by public owner ID

        sort : typing.Optional[str]
            Sort criteria

        page : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetLibraryVoicesResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_shared(
            page_size=1,
            gender="female",
            language="en",
        )
        v1/shared-voicesr.   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r/   r2   r3   r4   r7   r8   r!   r<   r=   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   rC   rD   s                      r$   
get_sharedzVoicesClient.get_shared  s3   t ((55==&$  $ & ,$*@&8$" ,) > 
	,	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD  
AD   +D+
audio_filesimilarity_thresholdtop_kr*   r   r   r   c          
      R   | j                   j                  j                  dd||dd|i|t              }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      # t        $ r" t        |j                  |j                  
      w xY w)a~  
        Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values.

        Parameters
        ----------
        audio_file : typing.Optional[core.File]
            See core.File for more documentation

        similarity_threshold : typing.Optional[float]
            Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned.

        top_k : typing.Optional[int]
            Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetLibraryVoicesResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_similar_library_voices()
        v1/similar-voicesra   r   r   r   rv   r2   r3   r4   r7   r8   r!   r<   r=   ri   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   r   r   r   r*   rC   rD   s          r$   get_similar_library_voicesz'VoicesClient.get_similar_library_voices  s   N ((55==(<
 j , > 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr^   handlec          
      R   | j                   j                  j                  dt        |       d|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	aV  
        Gets a profile page based on a handle

        Parameters
        ----------
        handle : str
            Handle for a VA's profile page

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProfilePageResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_a_profile_page(
            handle="talexgeorge",
        )
        profile/r.   rI   r2   r3   r4   r7   r8   r!   r<   r=   r   r9   r>   r?   r   r   r@   r   r	   r
   r   rA   r#   r   r*   rC   rD   s        r$   get_a_profile_pagezVoicesClient.get_a_profile_page^  s   < ((55=='/01+ > 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr^   ))__name__
__module____qualname__r   r%   r>   Optionalboolr   r   rE   r   rL   strrS   r   rY   r   r]   r   rk   ri   Listr   Filer   rz   r   r   r   r   intr   UnionSequencer   r   floatr   r   r    r'   r$   r   r      st   .*; . 7;os:O$ood3:OMS__]kMl:O	:Ox Z^ (Ov~7V (Obo (OT ae 7OS 7Ofoon>] 7Oiv 7Oz 04;?COCO t,	CO
  8CO 
COL TX9O9O171P9O	!9Ox lpBOBO)6BOIOYgIhBO	'BOR :>,0'+;?VO VO {{499%	VO
 "(!6VO __S)VO $VO  8VO 
"VOz :>9=,0'+;?[O[O 	[O
 v{{49956[O "(!6[O __S)[O $[O  8[O 
 [OF <@MOMO MO
 MO  8MO 
MOd +/DH'+$('+)-'+NRQU*.7;48)-%)%);?%FO ??3'FO //"@A	FO
 $FO __S!FO $FO //#&FO $FO ??6<<V__S5I0I#JKFO oofll38L3L&MNFO //$'FO !' 4FO #OOD1FO //#&FO  ooc"!FO" ooc"#FO$  8%FO& 
"'FOV 267;&*;?JO OODII.JO %ooe4	JO
 s#JO  8JO 
"JOZ RV9O9O/5~/N9O	!9Or'   r   c            #          e Zd ZdefdZddddej                  e   dej                  e   de	fdZ
dd	dej                  e   defd
Zdd	dedej                  e   defdZddddedej                  e   dej                  e   defdZdd	dedej                  e   defdZdd	dededej                  e   defdZeeedddedej,                  ej0                     dej                  e   dej                  e   dej                  e   dej                  e   defdZeeeedddededej                  ej,                  ej0                        dej                  e   dej                  e   dej                  e   dej                  e   defdZdd	dedededej                  e   def
dZdddddddddddddddddd ej                  e   d!ej                  e    d"ej                  e   d#ej                  e   d$ej                  e   d%ej                  e   d&ej                  e   d'ej                  ejB                  eejD                  e   f      d(ej                  ejB                  eejD                  e   f      d)ej                  e   d*ej                  e   d+ej                  e   d,ej                  e   d-ej                  e   d.ej                  e   dej                  e   de#f"d/Z$eeedd0d1ej                  ej0                     d2ej                  e%   d3ej                  e   dej                  e   de#f
d4Z&dd	d5edej                  e   de'fd6Z(y)7AsyncVoicesClientr   c                    || _         y r   r    r"   s     r$   r%   zAsyncVoicesClient.__init__  r&   r'   Nr(   r)   r*   r+   c          
      \  K   | j                   j                  j                  ddd|i|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  d	k(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Returns a list of all available voices for a user.

        Parameters
        ----------
        show_legacy : typing.Optional[bool]
            If set to true, legacy premade voices will be included in responses from /v1/voices

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetVoicesResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_all()


        asyncio.run(main())
        r-   r.   r)   r/   Nr2   r3   r4   r7   r8   r;   rB   s        r$   rE   zAsyncVoicesClient.get_all  s    H ..;;CC{ , D 
 
		Si++1c1{{%"/ ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN=
8  	Sy'<'<9>>RR	Ss4   /D,C<D,AC> D,AC> %D,>+D))D,rF   c                  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                         }t        |j                  |      7 {# t        $ r" t        |j                  |j                        w xY ww)	a  
        Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoiceSettings
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_default_settings()


        asyncio.run(main())
        rH   r.   rI   Nr2   r3   r4   r8   rJ   rK   s       r$   rL   z&AsyncVoicesClient.get_default_settings  s     > ..;;CC(+ D 
 
	
	Si++1c1{{!"+ ) 0  '^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss3   ,CB*CAB, CB, C,+CCrM   c          
      p  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoiceSettings
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_settings(
                voice_id="JBFqnCBsd6RMkjVDRZzb",
            )


        asyncio.run(main())
        rO   rP   r.   rI   Nr2   r3   r4   r7   r8   rQ   rR   s        r$   rS   zAsyncVoicesClient.get_settings  s    L ..;;CC)(34I>+ D 
 
	
	Si++1c1{{!"+ ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss5   9D6DD6AD D6AD /D6+D33D6rT   rU   c          
      t  K   | j                   j                  j                  dt        |       dd|i|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Returns metadata about a specific voice.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        with_settings : typing.Optional[bool]
            This parameter is now deprecated. It is ignored and will be removed in a future version.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Voice
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get(
                voice_id="JBFqnCBsd6RMkjVDRZzb",
            )


        asyncio.run(main())
        rO   r.   rU   r/   Nr2   r3   r4   r7   r8   rW   rX   s         r$   rY   zAsyncVoicesClient.getW  s'    Z ..;;CC)(345 , D 
 
		Si++1c1{{"# ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN=
8  	Sy'<'<9>>RR	Ss5   ;D8DD8AD
 D8AD
 1D8
+D55D8c          
      n  K   | j                   j                  j                  dt        |       d|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
a  
        Deletes a voice by its ID.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DeleteVoiceResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.delete(
                voice_id="VOICE_ID",
            )


        asyncio.run(main())
        rO   r[   rI   Nr2   r3   r4   r7   r8   r\   rR   s        r$   r]   zAsyncVoicesClient.delete  s    L ..;;CC)(345+ D 
 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	S5   8D5DD5 AD D5AD .D5+D22D5r=   c          
        K   | j                   j                  j                  dt        |       ddt	        |t
        d      |t               d{   }	 d|j                  cxk  rd	k  r:n n7t        j                  t        t        t        |j                         
            S |j                  dk(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)a  
        Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        request : VoiceSettings

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        EditVoiceSettingsResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, VoiceSettings

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.edit_settings(
                voice_id="VOICE_ID",
                request=VoiceSettings(
                    stability=0.1,
                    similarity_boost=0.3,
                    style=0.2,
                ),
            )


        asyncio.run(main())
        rO   r`   ra   rb   rc   rf   Nr2   r3   r4   r7   r8   rh   rj   s         r$   rk   zAsyncVoicesClient.edit_settings  s.    Z ..;;CC)(34NC8Ubnuv+ D 
 
		Si++1c1{{2"< ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN;
6  	Sy'<'<9>>RR	S8   AEDEAD %E&AD E+E		Erm   rq   rr   rn   ro   rp   c          
      r  K   | j                   j                  j                  dd||||dd|i|t               d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)a  
        Add a new voice to your collection of voices in VoiceLab.

        Parameters
        ----------
        name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        files : typing.List[core.File]
            See core.File for more documentation

        remove_background_noise : typing.Optional[bool]
            If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.

        description : typing.Optional[str]
            A description of the voice.

        labels : typing.Optional[str]
            Serialized labels dictionary for the voice.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVoiceIvcResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.add(
                name="Alex",
            )


        asyncio.run(main())
        rt   ra   ru   rr   rv   Nr2   r3   r4   r7   r8   rx   ry   s	            r$   rz   zAsyncVoicesClient.add3  s1    r ..;;CC+B* 	  , D 
 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNK
F  	Sy'<'<9>>RR	Ss5   :D7DD7AD	 D7AD	 0D7	+D44D7r{   c          
        K   | j                   j                  j                  dt        |       dd||||dd|i|t               d{   }	 d|j
                  cxk  rd	k  r:n n7t        j                  t        t        t        |j                         
            S |j
                  dk(  r@t        t        j                  t        t        t        |j                         
                  |j                         }	t        |j
                  |	      7 # t        $ r" t        |j
                  |j                        w xY ww)a  
        Edit a voice created by you.

        Parameters
        ----------
        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        files : typing.Optional[typing.List[core.File]]
            See core.File for more documentation

        remove_background_noise : typing.Optional[bool]
            If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.

        description : typing.Optional[str]
            A description of the voice.

        labels : typing.Optional[str]
            Serialized labels dictionary for the voice.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        EditVoiceResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.edit(
                voice_id="VOICE_ID",
                name="George",
            )


        asyncio.run(main())
        rO   r}   ra   ru   rr   rv   Nr2   r3   r4   r7   r8   r~   r   s
             r$   r   zAsyncVoicesClient.edit  sA    | ..;;CC)(34E:+B* 	  , D 
 
		Si++1c1{{*"4 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNK
F  	Sy'<'<9>>RR	Ss8   AE	D
EAD EAD =E+EEr   r   c          
        K   | j                   j                  j                  dt        |       dt        |       dd|iddi|t               d{   }	 d	|j
                  cxk  rd
k  r:n n7t        j                  t        t        t        |j                                     S |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j
                  |      7 # t        $ r" t        |j
                  |j                        w xY ww)a  
        Add a shared voice to your collection of voices.

        Parameters
        ----------
        public_user_id : str
            Public user ID used to publicly identify ElevenLabs users.

        voice_id : str
            Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

        new_name : str
            The name that identifies this voice. This will be displayed in the dropdown of the website.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVoiceResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.add_sharing_voice(
                public_user_id="63e84100a6bf7874ba37a1bab9a31828a379ec94b891b401653b655c5110880f",
                voice_id="sB1b5zUrxQVAFl2PhZFp",
                new_name="Alita",
            )


        asyncio.run(main())
        r   r   ra   r   r   r   r   Nr2   r3   r4   r7   r8   r   r   s          r$   r   z#AsyncVoicesClient.add_sharing_voice  sG    f ..;;CC-n=>a@PQY@Z?[\H  2 , D 
 
		Si++1c1{{)"3 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNE
@  	Sy'<'<9>>RR	Sr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                x  K   | j                   j                  j                  dd|||||||||	|
|||||d|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  d	k(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a*  
        Retrieves a list of shared voices.

        Parameters
        ----------
        page_size : typing.Optional[int]
            How many shared voices to return at maximum. Can not exceed 100, defaults to 30.

        category : typing.Optional[VoicesGetSharedRequestCategory]
            Voice category used for filtering

        gender : typing.Optional[str]
            Gender used for filtering

        age : typing.Optional[str]
            Age used for filtering

        accent : typing.Optional[str]
            Accent used for filtering

        language : typing.Optional[str]
            Language used for filtering

        search : typing.Optional[str]
            Search term used for filtering

        use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Use-case used for filtering

        descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Search term used for filtering

        featured : typing.Optional[bool]
            Filter featured voices

        min_notice_period_days : typing.Optional[int]
            Filter voices with a minimum notice period of the given number of days.

        reader_app_enabled : typing.Optional[bool]
            Filter voices that are enabled for the reader app

        owner_id : typing.Optional[str]
            Filter voices by public owner ID

        sort : typing.Optional[str]
            Sort criteria

        page : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetLibraryVoicesResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_shared(
                page_size=1,
                gender="female",
                language="en",
            )


        asyncio.run(main())
        r   r.   r   r/   Nr2   r3   r4   r7   r8   r   r   s                      r$   r   zAsyncVoicesClient.get_sharedO  sC    D ..;;CC&$  $ & ,$*@&8$" ,) D 
 
	,	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNY
T  	Sy'<'<9>>RR	Ss6   =D:D
 D:AD D:AD 3D:+D77D:r   r   r   r   c          
      n  K   | j                   j                  j                  dd||dd|i|t               d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)a  
        Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values.

        Parameters
        ----------
        audio_file : typing.Optional[core.File]
            See core.File for more documentation

        similarity_threshold : typing.Optional[float]
            Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned.

        top_k : typing.Optional[int]
            Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetLibraryVoicesResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_similar_library_voices()


        asyncio.run(main())
        r   ra   r   r   rv   Nr2   r3   r4   r7   r8   r   r   s          r$   r   z,AsyncVoicesClient.get_similar_library_voices  s+    ^ ..;;CC(<
 j , D 
 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNG
B  	Sy'<'<9>>RR	Sr   r   c          
      n  K   | j                   j                  j                  dt        |       d|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
a  
        Gets a profile page based on a handle

        Parameters
        ----------
        handle : str
            Handle for a VA's profile page

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProfilePageResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.get_a_profile_page(
                handle="talexgeorge",
            )


        asyncio.run(main())
        r   r.   rI   Nr2   r3   r4   r7   r8   r   r   s        r$   r   z$AsyncVoicesClient.get_a_profile_page3  s    L ..;;CC'/01+ D 
 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Sr   ))r   r   r   r   r%   r>   r   r   r   r   rE   r   rL   r   rS   r   rY   r   r]   r   rk   ri   r   r   r   r   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r'   r$   r   r     s   .*< . 7;osBO$ood3BOMS__]kMlBO	BOH `d 0OV__^=\ 0Ohu 0Of TXAOAO171PAO	AON 04;?KOKO t,	KO
  8KO 
KO\ TXAOAO171PAO	!AOH lpJOJO)6JOIOYgIhJO	'JOb :>,0'+;?^O ^O {{499%	^O
 "(!6^O __S)^O $^O  8^O 
"^OJ :>9=,0'+;?cOcO 	cO
 v{{49956cO "(!6cO __S)cO $cO  8cO 
 cOV <@UOUO UO
 UO  8UO 
UOt +/DH'+$('+)-'+NRQU*.7;48)-%)%);?%NO ??3'NO //"@A	NO
 $NO __S!NO $NO //#&NO $NO ??6<<V__S5I0I#JKNO oofll38L3L&MNNO //$'NO !' 4NO #OOD1NO //#&NO  ooc"!NO" ooc"#NO$  8%NO& 
"'NOf 267;&*;?RO OODII.RO %ooe4	RO
 s#RO  8RO 
"ROj RVAOAO/5~/NAO	!AOr'   r   )1r>   core.client_wrapperr   core.request_optionsr   types.get_voices_responser   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.http_validation_errorr	   json.decoderr
   core.api_errorr   types.voice_settingsr   core.jsonable_encoderr   types.voicer   !types.delete_voice_response_modelr   (types.edit_voice_settings_response_modelr   core.serializationr    r   "types.add_voice_ivc_response_modelr   types.edit_voice_response_modelr   types.add_voice_response_modelr   (types.voices_get_shared_request_categoryr   !types.get_library_voices_responser   !types.profile_page_response_modelr   r   r?   Anyri   r   r   r   r'   r$   <module>r      s     3 1 9 6 H = ( % 0 4  H U H  I D B T H H 4 v{{6::s#xO xOvZO ZOr'   