o
    lWi                     @   s  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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 'e j(dZ)G dd dZ*G dd dZ+dS )    N)JSONDecodeError   )core)ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type)UnprocessableEntityError)AddVoiceResponseModel)DeleteVoiceResponseModel)EditVoiceResponseModel)GetLibraryVoicesResponse)GetVoicesResponse)GetVoicesV2Response)HttpValidationError)Voice   )VoicesGetSharedRequestCategory.c                *   @   H  e Zd ZdefddZddddeje deje de	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 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 de	e fddZddddedeje deje de	e fddZdddedeje de	e fdd Zeeee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e de	e fd'd(Zddd)eded*edeje de	e f
d+d,Zddd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 d0eje d1eje d2eje deje d3ejejeeje f  d4ejejeeje f  d5eje d6eje d7eje d8eje d9eje d:eje deje d;eje deje de	e f(d<d=Z eeedd>d?ejej d@eje! dAeje deje de	e f
dBdCZ"dS )DRawVoicesClientclient_wrapperc                C   
   || _ d S N_client_wrapperselfr    r!   `/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/voices/raw_client.py__init__      
zRawVoicesClient.__init__Nshow_legacyrequest_optionsr&   r'   returnc             	   C   s   | j jjddd|i|d}z>d|j  krdk r.n ntttt| d}t	||dW S |jd	krFt
t|jtttt| dd
| }W n ty^   t|jt|j|jdw t|jt|j|d)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
        -------
        HttpResponse[GetVoicesResponse]
            Successful Response
        	v1/voicesGETr&   methodparamsr'      ,  type_object_responsedata  headersbodystatus_coder8   r9   )r   httpx_clientrequestr;   typingcastr   r   jsonr	   r   dictr8   r   r   r   textr    r&   r'   	_response_data_response_jsonr!   r!   r"   get_all    sB   

zRawVoicesClient.get_allnext_page_token	page_sizesearchsortsort_direction
voice_typecategoryfine_tuning_statecollection_idinclude_total_count	voice_idsr'   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   c                C   s   | j jjdd|||||||||	|
|d|d}z>d|j  kr#dk r8n ntttt| d}t	||dW S |jd	krPt
t|jtttt| dd
| }W n tyh   t|jt|j|jdw t|jt|j|d)a	  
        Gets a list of all available voices for a user with search, filtering and pagination.

        Parameters
        ----------
        next_page_token : typing.Optional[str]
            The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination.

        page_size : typing.Optional[int]
            How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included.

        search : typing.Optional[str]
            Search term to filter voices by. Searches in name, description, labels, category.

        sort : typing.Optional[str]
            Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices.

        sort_direction : typing.Optional[str]
            Which direction to sort the voices in. 'asc' or 'desc'.

        voice_type : typing.Optional[str]
            Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'.

        category : typing.Optional[str]
            Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional'

        fine_tuning_state : typing.Optional[str]
            State of the voice's fine tuning to filter by. Applicable only to professional voices clones. One of 'draft', 'not_verified', 'not_started', 'queued', 'fine_tuning', 'fine_tuned', 'failed', 'delayed'

        collection_id : typing.Optional[str]
            Collection ID to filter voices by.

        include_total_count : typing.Optional[bool]
            Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost.

        voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Voice IDs to lookup by. Maximum 100 voice IDs.

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

        Returns
        -------
        HttpResponse[GetVoicesV2Response]
            Successful Response
        	v2/voicesr*   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   r+   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   r'   rD   rE   rF   r!   r!   r"   rK   U   sV   >

zRawVoicesClient.searchwith_settingsr'   voice_idrX   c             	   C   s   | j jjdt| dd|i|d}z>d|j  krdk r3n ntttt|	 d}t
||dW S |jd	krKtt|jtttt|	 dd
|	 }W n tyc   t|jt|j|jdw t|jt|j|d)a`  
        Returns metadata about a specific voice.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        HttpResponse[Voice]
            Successful Response
        
v1/voices/r*   rX   r+   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rY   rX   r'   rD   rE   rF   r!   r!   r"   get   sB   

zRawVoicesClient.getr'   c             	   C   s   | j jjdt| d|d}z>d|j  krdk r0n ntttt|	 d}t
||dW S |jdkrHtt|jtttt|	 dd	|	 }W n ty`   t|jt|j|jd
w t|jt|j|d
)a  
        Deletes a voice by its ID.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.

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

        Returns
        -------
        HttpResponse[DeleteVoiceResponseModel]
            Successful Response
        rZ   DELETEr,   r'   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rY   r'   rD   rE   rF   r!   r!   r"   delete   s>   

zRawVoicesClient.deletefilesremove_background_noisedescriptionlabelsr'   namerc   rd   re   rf   c             	   C   s   | j jjdt| dd||||di |durd|ini |tdd}z>d	|j  kr/d
k rDn nttt	t|
 d}	t||	dW S |jdkr\tt|jttt	t|
 dd|
 }
W n tyt   t|jt|j|jdw t|jt|j|
d)aU  
        Edit a voice created by you.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        HttpResponse[EditVoiceResponseModel]
            Successful Response
        rZ   /editPOSTrg   rd   re   rf   Nrc   Tr,   r5   rc   r'   omitforce_multipartr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   OMITr;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rY   rg   rc   rd   re   rf   r'   rD   rE   rF   r!   r!   r"   update-  sR   *

zRawVoicesClient.updatepublic_user_idnew_namec             	   C   s   | j jjdt| dt| dd|iddi|td}z>d|j  kr'd	k r<n nttt	t|
 d
}t||dW S |jdkrTtt|jttt	t|
 d
d|
 }W n tyl   t|jt|j|jdw t|jt|j|d)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
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        HttpResponse[AddVoiceResponseModel]
            Successful Response
        v1/voices/add//ri   rr   content-typeapplication/jsonr,   r@   r8   r'   rl   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   rn   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rq   rY   rr   r'   rD   rE   rF   r!   r!   r"   share  sH   

zRawVoicesClient.sharerJ   rO   genderageaccentlanguagelocalerK   	use_casesdescriptivesfeaturedmin_notice_period_daysinclude_custom_ratesinclude_live_moderatedreader_app_enabledowner_idrL   pager'   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   c             	   C   s>  | j jjddi d|d|d|d|d|d|d	|d
|d|	d|
d|d|d|d|d|d|d|d|i|d}z>d|j  krNdk rcn ntttt| d}t	||dW S |jdkr{t
t|jtttt| dd| }W n ty   t|jt|j|jdw t|jt|j|d)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

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

        include_custom_rates : typing.Optional[bool]
            Include/exclude voices with custom rates

        include_live_moderated : typing.Optional[bool]
            Include/exclude voices that are live moderated

        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
        -------
        HttpResponse[GetLibraryVoicesResponse]
            Successful Response
        v1/shared-voicesr*   rJ   rO   r{   r|   r}   r~   r   rK   r   r   r   r   r   r   r   r   rL   r   r+   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    rJ   rO   r{   r|   r}   r~   r   rK   r   r   r   r   r   r   r   r   rL   r   r'   rD   rE   rF   r!   r!   r"   
get_shared  s   Y	


zRawVoicesClient.get_shared
audio_filesimilarity_thresholdtop_kr'   r   r   r   c             	   C   s   | j jjdd||di |durd|ini |tdd}z>d|j  kr'd	k r<n ntttt|	 d
}t
||dW S |jdkrTtt|jtttt|	 d
d|	 }W n tyl   t|jt|j|jdw t|jt|j|d)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
        -------
        HttpResponse[GetLibraryVoicesResponse]
            Successful Response
        v1/similar-voicesri   r   r   Nr   Trk   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   rn   r;   r>   r?   r   r   r@   r	   r   rA   r8   r   r   r   rB   r    r   r   r   r'   rD   rE   rF   r!   r!   r"   find_similar_voicesQ  sN   

z#RawVoicesClient.find_similar_voices)#__name__
__module____qualname__r   r#   r>   Optionalboolr   r	   r   rG   strintUnionSequencer   rK   r   r\   r   ra   rn   Listr   Filer   rp   r   ry   r   r   r   floatr   r!   r!   r!   r"   r      d   
8	

n
=
7	

Z
G	

 
r   c                *   @   r   )DAsyncRawVoicesClientr   c                C   r   r   r   r   r!   r!   r"   r#     r$   zAsyncRawVoicesClient.__init__Nr%   r&   r'   r(   c             	      s   | j jjddd|i|dI dH }z>d|j  krdk r2n ntttt| d}t	||d	W S |jd
krJt
t|jtttt| dd| }W n tyb   t|jt|j|jdw t|jt|j|d)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
        -------
        AsyncHttpResponse[GetVoicesResponse]
            Successful Response
        r)   r*   r&   r+   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   rC   r!   r!   r"   rG     sD   

zAsyncRawVoicesClient.get_allrH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   c                   s   | j jjdd|||||||||	|
|d|dI dH }z>d|j  kr'dk r<n ntttt| d}t	||d	W S |jd
krTt
t|jtttt| dd| }W n tyl   t|jt|j|jdw t|jt|j|d)a	  
        Gets a list of all available voices for a user with search, filtering and pagination.

        Parameters
        ----------
        next_page_token : typing.Optional[str]
            The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination.

        page_size : typing.Optional[int]
            How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included.

        search : typing.Optional[str]
            Search term to filter voices by. Searches in name, description, labels, category.

        sort : typing.Optional[str]
            Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices.

        sort_direction : typing.Optional[str]
            Which direction to sort the voices in. 'asc' or 'desc'.

        voice_type : typing.Optional[str]
            Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'.

        category : typing.Optional[str]
            Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional'

        fine_tuning_state : typing.Optional[str]
            State of the voice's fine tuning to filter by. Applicable only to professional voices clones. One of 'draft', 'not_verified', 'not_started', 'queued', 'fine_tuning', 'fine_tuned', 'failed', 'delayed'

        collection_id : typing.Optional[str]
            Collection ID to filter voices by.

        include_total_count : typing.Optional[bool]
            Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost.

        voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Voice IDs to lookup by. Maximum 100 voice IDs.

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

        Returns
        -------
        AsyncHttpResponse[GetVoicesV2Response]
            Successful Response
        rT   r*   rU   r+   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   rV   r!   r!   r"   rK     sX   >

zAsyncRawVoicesClient.searchrW   rY   rX   c             	      s   | j jjdt| dd|i|dI dH }z>d|j  kr"dk r7n ntttt|	 d}t
||d	W S |jd
krOtt|jtttt|	 dd|	 }W n tyg   t|jt|j|jdw t|jt|j|d)ae  
        Returns metadata about a specific voice.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        AsyncHttpResponse[Voice]
            Successful Response
        rZ   r*   rX   r+   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   r[   r!   r!   r"   r\   ;  sD   

zAsyncRawVoicesClient.getr]   c             	      s   | j jjdt| d|dI dH }z>d|j  krdk r4n ntttt|	 d}t
||dW S |jd	krLtt|jtttt|	 dd
|	 }W n tyd   t|jt|j|jdw t|jt|j|d)a  
        Deletes a voice by its ID.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.

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

        Returns
        -------
        AsyncHttpResponse[DeleteVoiceResponseModel]
            Successful Response
        rZ   r^   r_   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   r`   r!   r!   r"   ra   w  s@   

zAsyncRawVoicesClient.deleterb   rg   rc   rd   re   rf   c             	      s  | j jjdt| dd||||di |durd|ini |tddI dH }z>d	|j  kr3d
k rHn nttt	t|
 d}	t||	dW S |jdkr`tt|jttt	t|
 dd|
 }
W n tyx   t|jt|j|jdw t|jt|j|
d)aZ  
        Edit a voice created by you.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        AsyncHttpResponse[EditVoiceResponseModel]
            Successful Response
        rZ   rh   ri   rj   Nrc   Trk   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   rn   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   ro   r!   r!   r"   rp     sT   *

zAsyncRawVoicesClient.updaterq   rr   c             	      s   | j jjdt| dt| dd|iddi|tdI dH }z>d	|j  kr+d
k r@n nttt	t|
 d}t||dW S |jdkrXtt|jttt	t|
 dd|
 }W n typ   t|jt|j|jdw t|jt|j|d)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
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint 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
        -------
        AsyncHttpResponse[AddVoiceResponseModel]
            Successful Response
        rs   rt   ri   rr   ru   rv   rw   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r
   rn   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   rx   r!   r!   r"   ry     sJ   

zAsyncRawVoicesClient.sharerz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   c             	      sF  | j jjddi d|d|d|d|d|d|d	|d
|d|	d|
d|d|d|d|d|d|d|d|i|dI dH }z>d|j  krRdk rgn ntttt| d}t	||dW S |jdkrt
t|jtttt| dd| }W n ty   t|jt|j|jdw t|jt|j|d)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

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

        include_custom_rates : typing.Optional[bool]
            Include/exclude voices with custom rates

        include_live_moderated : typing.Optional[bool]
            Include/exclude voices that are live moderated

        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
        -------
        AsyncHttpResponse[GetLibraryVoicesResponse]
            Successful Response
        r   r*   rJ   rO   r{   r|   r}   r~   r   rK   r   r   r   r   r   r   r   r   rL   r   r+   Nr.   r/   r0   r3   r6   r7   r:   )r   r<   r=   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   r   r!   r!   r"   r   A  s   Y	


zAsyncRawVoicesClient.get_sharedr   r   r   r   c             	      s   | j jjdd||di |durd|ini |tddI dH }z>d|j  kr+d	k r@n ntttt|	 d
}t
||dW S |jdkrXtt|jtttt|	 d
d|	 }W n typ   t|jt|j|jdw t|jt|j|d)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
        -------
        AsyncHttpResponse[GetLibraryVoicesResponse]
            Successful Response
        r   ri   r   Nr   Trk   r.   r/   r0   r3   r6   r7   r:   )r   r<   r=   rn   r;   r>   r?   r   r   r@   r   r   rA   r8   r   r   r   rB   r   r!   r!   r"   r     sP   

z(AsyncRawVoicesClient.find_similar_voices)#r   r   r   r   r#   r>   r   r   r   r   r   rG   r   r   r   r   r   rK   r   r\   r   ra   rn   r   r   r   r   rp   r   ry   r   r   r   r   r   r!   r!   r!   r"   r     r   r   ),r>   json.decoderr    r   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.add_voice_response_modelr   !types.delete_voice_response_modelr   types.edit_voice_response_modelr   !types.get_library_voices_responser   types.get_voices_responser   types.get_voices_v_2_responser   types.http_validation_errorr   types.voicer   (types.voices_get_shared_request_categoryr   r?   Anyrn   r   r   r!   r!   r!   r"   <module>   s6        