o
    "ii                     @   s  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
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 zd dl m!Z" W n e#ys   d dl"Z"Y nw e $e j%dZ&G dd dZ'G dd dZ(dS )    N)JSONDecodeError   )core)ApiError)AsyncClientWrapperSyncClientWrapper)jsonable_encoder)remove_none_from_dict)RequestOptions)UnprocessableEntityError)AddVoiceResponseModel)GetLibraryVoicesResponse)GetVoicesResponse)HttpValidationError)Voice)VoiceSettings.c                   @   x  e Zd ZdefddZdddeje defdd	Z	dddeje de
fd
dZdddedeje de
fddZddddedeje deje defddZdddedeje dejfddZdddede
deje dejfddZdddddedejej deje deje deje defddZddddddededejejej  deje deje deje dejfd d!Zddd"eded#edeje def
d$d%Z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jeeje f  d.ejejeeje f  d/eje d0eje d1eje deje defd2d3ZdS )4VoicesClientclient_wrapperc                C   
   || _ d S N_client_wrapperselfr    r   \/var/www/html/voicebot/backend/venv/lib/python3.10/site-packages/elevenlabs/voices/client.py__init__      
zVoicesClient.__init__Nrequest_optionsr    returnc                C   s&  | j jjdtj| j   ddt|dur|dndtt	i | j 
 |dur/|di ni |durC|ddurC|dndd	|durN|d
nd	d}d|j  kr]dk rgn ntt| S |jdkrvttt| z| }W n ty   t|j|jdw t|j|d)a_  
        Gets a list of all available voices for a user.

        Parameters:
            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_all()
        GET/	v1/voicesNadditional_query_parametersadditional_headerstimeout_in_seconds<   r   max_retriesparamsheaderstimeoutretriesr)      ,    status_codebodyr   httpx_clientrequesturllibparseurljoinget_base_urlr   getr	   get_headersr3   pydanticparse_obj_asr   jsonr   r   r   r   textr   r    	_response_response_jsonr   r   r   get_all"   s>   	

zVoicesClient.get_allc                C   s  | j jjdtj| j   ddt|dur|dndtt	i | j 
 |dur/|di ni |durC|ddurC|dndd	|durN|d
nd	d}d|j  kr]dk rgn ntt| S z| }W n ty|   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_default_settings()
        r"   r#   v1/voices/settings/defaultNr%   r&   r'   r(   r   r)   r*   r/   r0   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r=   r3   r>   r?   r   r@   r   r   rA   rB   r   r   r   get_default_settingsN   s:   	
z!VoicesClient.get_default_settingsvoice_idc                C   s2  | j jjdtj| j   ddt| dt|dur!|dndtt	i | j 
 |dur5|di ni |durI|ddurI|dnd	d
|durT|dnd
d}d|j  krcdk rmn ntt| S |jdkr|ttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_settings(
            voice_id="voice_id",
        )
        r"   r#   
v1/voices/	/settingsNr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r=   r3   r>   r?   r   r@   r   r   r   r   rA   r   rI   r    rC   rD   r   r   r   get_settingsx   sB   	

zVoicesClient.get_settingswith_settingsr    rP   c                C   s>  | j jjdtj| j   ddt| ttd|i|dur%|	di ni tti | j 
 |dur;|	di ni |durO|	ddurO|	dnd	d
|durZ|	dnd
d}d|j  kridk rsn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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]. If set will return settings information corresponding to the voice, requires authorization.

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get(
            voice_id="voice_id",
        )
        r"   r#   rJ   rP   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r	   r<   r=   r3   r>   r?   r   r@   r   r   r   r   rA   r   rI   rP   r    rC   rD   r   r   r   r<      sL   "	

zVoicesClient.getc                C   s2  | j jjdtj| j   ddt| t|dur |dndtt	i | j 
 |dur4|di ni |durH|ddurH|dndd	|durS|d
nd	d}d|j  krbdk rmn n	ttj| S |jdkr|ttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.delete(
            voice_id="voice_id",
        )
        DELETEr#   rJ   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r=   r3   r>   r?   typingAnyr@   r   r   r   r   rA   rM   r   r   r   delete   s>   "	

zVoicesClient.deleter7   c                C   sp  | j jjdtj| j   ddt| dt|dur!|dnd|du s.|ddu r2t|ni t|tt	|di tt	i | j 
 |durS|di ni |durg|d	durg|d	nd
d|durr|dndd}d|j  krdk rn n	ttj| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs import VoiceSettings
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.edit_settings(
            voice_id="voice_id",
            request=VoiceSettings(),
        )
        POSTr#   rJ   /settings/editNr%   additional_body_parametersr&   r'   r(   r   r)   r+   r@   r,   r-   r.   r)   r/   r0   r1   r2   rT   r   rI   r7   r    rC   rD   r   r   r   edit_settings  sP   	

zVoicesClient.edit_settingsdescriptionlabelsr    namefilesr_   r`   c                C   s  | j jjdtj| j   ddt|dur|dnd|du s(|ddu r2tt	|||dni tt	|||dtt	|di t
t	d|itt	i | j  |dura|d	i ni |duru|d
duru|d
ndd|dur|dndd	}d|j  krdk rn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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

            - description: typing.Optional[str]. How would you describe the voice?

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

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.add()
        rX   r#   v1/voices/addNr%   rZ   ra   r_   r`   rb   r&   r'   r(   r   r)   r+   datarb   r,   r-   r.   r)   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r   !convert_file_dict_to_httpx_tuplesr=   r3   r>   r?   r   r@   r   r   r   r   rA   r   ra   rb   r_   r`   r    rC   rD   r   r   r   addY  sN   	

zVoicesClient.addrb   r_   r`   r    c          	      C   s  | j jjdtj| j   ddt| dt|dur!|dnd|du s.|ddu r8tt	|||dni tt	|||dtt	|di t
t	d	|itt	i | j  |durg|d
i ni |dur{|ddur{|dndd|dur|dndd	}d|j  krdk rn n	ttj| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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

            - description: typing.Optional[str]. How would you describe the voice?

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

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.edit(
            voice_id="string",
        )
        rX   r#   rJ   /editNr%   rZ   rd   rb   r&   r'   r(   r   r)   re   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r   rh   r=   r3   r>   r?   rU   rV   r@   r   r   r   r   rA   	r   rI   ra   rb   r_   r`   r    rC   rD   r   r   r   edit  sR   #	

zVoicesClient.editpublic_user_idnew_namec                C   s~  | j jjdtj| j   ddt| dt| t|dur%|dnd|du s2|ddu r8td|ini td|itt	|di tt	i | j 
 |dur[|di ni |duro|d	duro|d	nd
d|durz|dndd}d|j  krdk rn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)aM  
        Add a sharing voice to your collection of voices in VoiceLab.

        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.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.add_sharing_voice(
            public_user_id="public_user_id",
            voice_id="voice_id",
            new_name="new_name",
        )
        rX   r#   v1/voices/add/Nr%   rZ   rq   r&   r'   r(   r   r)   r[   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r<   r	   r=   r3   r>   r?   r   r@   r   r   r   r   rA   r   rp   rI   rq   r    rC   rD   r   r   r   add_sharing_voice  sR   
	

zVoicesClient.add_sharing_voice	page_sizecategorygenderageaccentsearch	use_casesdescriptivessortfeaturedpager    rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   c                C   sH  | j jjdtj| j   ddtt|||||||||	|
|d|dur*|	di ni tti | j 
 |dur@|	di ni |durT|	ddurT|	dnd	d
|dur_|	dnd
d}d|j  krndk rxn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)a  
        Gets a list of shared voices.

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

            - category: typing.Optional[str]. 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

            - 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

            - sort: typing.Optional[str]. sort criteria

            - featured: typing.Optional[bool]. Filter featured voices

            - page: typing.Optional[int].

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.get_voices()
        r"   r#   v1/shared-voicesrw   rx   ry   rz   r{   r|   r}   r~   r   r   r   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r   r6   r7   r8   r9   r:   r;   r   r	   r<   r=   r3   r>   r?   r   r@   r   r   r   r   rA   r   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r    rC   rD   r   r   r   
get_voices,  s`   3	
'
zVoicesClient.get_voices) __name__
__module____qualname__r   r   rU   Optionalr
   r   rE   r   rH   strrN   boolr   r<   rV   rW   r]   Listr   Filer   rj   ro   ru   intUnionSequencer   r   r   r   r   r   r      s    ,"*6
$A1
C

H	
P
I	
r   c                   @   r   )4AsyncVoicesClientr   c                C   r   r   r   r   r   r   r   r     r   zAsyncVoicesClient.__init__Nr   r    r!   c                   s.  | j jjdtj| j   ddt|dur|dndtt	i | j 
 |dur0|di ni |durD|ddurD|dndd	|durO|d
nd	dI dH }d|j  kradk rkn ntt| S |jdkrzttt| z| }W n ty   t|j|jdw t|j|d)ao  
        Gets a list of all available voices for a user.

        Parameters:
            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.get_all()
        r"   r#   r$   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r5   rB   r   r   r   rE     s@   	

zAsyncVoicesClient.get_allc                   s  | j jjdtj| j   ddt|dur|dndtt	i | j 
 |dur0|di ni |durD|ddurD|dndd	|durO|d
nd	dI dH }d|j  kradk rkn ntt| S z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.get_default_settings()
        r"   r#   rF   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r2   rG   rB   r   r   r   rH     s<   	
z&AsyncVoicesClient.get_default_settingsrI   c                   s:  | j jjdtj| j   ddt| dt|dur"|dndtt	i | j 
 |dur6|di ni |durJ|ddurJ|dnd	d
|durU|dnd
dI dH }d|j  krgdk rqn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.get_settings(
            voice_id="voice_id",
        )
        r"   r#   rJ   rK   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   rL   rM   r   r   r   rN     sD   	

zAsyncVoicesClient.get_settingsrO   rP   c                   sF  | j jjdtj| j   ddt| ttd|i|dur&|	di ni tti | j 
 |dur<|	di ni |durP|	ddurP|	dnd	d
|dur[|	dnd
dI dH }d|j  krmdk rwn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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]. If set will return settings information corresponding to the voice, requires authorization.

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.get(
            voice_id="voice_id",
        )
        r"   r#   rJ   rP   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   rQ   rR   r   r   r   r<     sN   "	

zAsyncVoicesClient.getc                   s:  | j jjdtj| j   ddt| t|dur!|dndtt	i | j 
 |dur5|di ni |durI|ddurI|dndd	|durT|d
nd	dI dH }d|j  krfdk rqn n	ttj| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.delete(
            voice_id="voice_id",
        )
        rS   r#   rJ   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   rT   rM   r   r   r   rW   `  s@   "	

zAsyncVoicesClient.deleter7   c                   sx  | j jjdtj| j   ddt| dt|dur"|dnd|du s/|ddu r3t|ni t|tt	|di tt	i | j 
 |durT|di ni |durh|d	durh|d	nd
d|durs|dnddI dH }d|j  krdk rn n	ttj| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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.
        ---
        from elevenlabs import VoiceSettings
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.edit_settings(
            voice_id="voice_id",
            request=VoiceSettings(),
        )
        rX   r#   rJ   rY   Nr%   rZ   r&   r'   r(   r   r)   r[   r/   r0   r1   r2   rT   r\   r   r   r   r]     sR   	

zAsyncVoicesClient.edit_settingsr^   ra   rb   r_   r`   c                   s  | j jjdtj| j   ddt|dur|dnd|du s)|ddu r3tt	|||dni tt	|||dtt	|di t
t	d|itt	i | j  |durb|d	i ni |durv|d
durv|d
ndd|dur|dndd	I dH }d|j  krdk rn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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

            - description: typing.Optional[str]. How would you describe the voice?

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

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.add()
        rX   r#   rc   Nr%   rZ   rd   rb   r&   r'   r(   r   r)   re   r/   r0   r1   r2   rg   ri   r   r   r   rj     sP   	

zAsyncVoicesClient.addrk   c          	         s  | j jjdtj| j   ddt| dt|dur"|dnd|du s/|ddu r9tt	|||dni tt	|||dtt	|di t
t	d	|itt	i | j  |durh|d
i ni |dur||ddur||dndd|dur|dndd	I dH }d|j  krdk rn n	ttj| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)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

            - description: typing.Optional[str]. How would you describe the voice?

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

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.edit(
            voice_id="string",
        )
        rX   r#   rJ   rl   Nr%   rZ   rd   rb   r&   r'   r(   r   r)   re   r/   r0   r1   r2   rm   rn   r   r   r   ro     sT   #	

zAsyncVoicesClient.editrp   rq   c                   s  | j jjdtj| j   ddt| dt| t|dur&|dnd|du s3|ddu r9td|ini td|itt	|di tt	i | j 
 |dur\|di ni |durp|d	durp|d	nd
d|dur{|dnddI dH }d|j  krdk rn ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)a]  
        Add a sharing voice to your collection of voices in VoiceLab.

        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.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.add_sharing_voice(
            public_user_id="public_user_id",
            voice_id="voice_id",
            new_name="new_name",
        )
        rX   r#   rr   Nr%   rZ   rq   r&   r'   r(   r   r)   r[   r/   r0   r1   r2   rs   rt   r   r   r   ru   [  sT   
	

z#AsyncVoicesClient.add_sharing_voicerv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   c                   sP  | j jjdtj| j   ddtt|||||||||	|
|d|dur+|	di ni tti | j 
 |durA|	di ni |durU|	ddurU|	dnd	d
|dur`|	dnd
dI dH }d|j  krrdk r|n ntt| S |jdkrttt| z| }W n ty   t|j|jdw t|j|d)a  
        Gets a list of shared voices.

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

            - category: typing.Optional[str]. 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

            - 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

            - sort: typing.Optional[str]. sort criteria

            - featured: typing.Optional[bool]. Filter featured voices

            - page: typing.Optional[int].

            - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
        ---
        from elevenlabs.client import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )
        await client.voices.get_voices()
        r"   r#   r   r   Nr%   r&   r'   r(   r   r)   r*   r/   r0   r1   r2   r   r   r   r   r   r     sb   3	
'
zAsyncVoicesClient.get_voices) r   r   r   r   r   rU   r   r
   r   rE   r   rH   r   rN   r   r   r<   rV   rW   r]   r   r   r   r   rj   ro   ru   r   r   r   r   r   r   r   r   r   r     s    ,+
8
$A1
C

H	
P
I	
r   ))rU   urllib.parser8   json.decoderr    r   core.api_errorr   core.client_wrapperr   r   core.jsonable_encoderr   core.remove_none_from_dictr	   core.request_optionsr
   !errors.unprocessable_entity_errorr   types.add_voice_response_modelr   !types.get_library_voices_responser   types.get_voices_responser   types.http_validation_errorr   types.voicer   types.voice_settingsr   pydantic.v1v1r>   ImportErrorcastrV   OMITr   r   r   r   r   r   <module>   s8       w