
    b6i                     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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 jR                  e jT                  d      Z+ G d d      Z, G d d      Z-y)    N)JSONDecodeError   )core)ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type)UnprocessableEntityError)AddVoiceResponseModel)DeleteVoiceResponseModel)EditVoiceResponseModel)GetLibraryVoicesResponse)GetVoicesResponse)GetVoicesV2Response)HttpValidationError)Voice   )VoicesGetSharedRequestCategory)VoicesUpdateRequestLabels.c            *          e Zd ZdefdZddddej                  e   dej                  e   de	e
   f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Zddddedej                  e   dej                  e   de	e   fdZdddedej                  e   de	e   fdZeeeedddededej                  ej.                  ej2                        dej                  e   d ej                  e   d!ej                  e   dej                  e   de	e   fd"Zddd#eded$edej                  e   de	e   f
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   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   d/ej                  e   d0ej                  e   d1ej                  e   d2ej                  e   d3ej                  e   dej                  e   d4ej                  e   dej                  e   de	e    f(d5Z!eeedd6d7ej                  ej2                     d8ej                  e"   d9ej                  e   dej                  e   de	e    f
d:Z#y);RawVoicesClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     g/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/voices/raw_client.py__init__zRawVoicesClient.__init__   
    -    Nshow_legacyrequest_optionsr(   r)   returnc                   | j                   j                  j                  ddd|i|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  d	k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                     
      |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                         w xY 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
        -------
        HttpResponse[GetVoicesResponse]
            Successful Response
        	v1/voicesGETr(   methodparamsr)      ,  type_object_responsedata  headersbodystatus_coder;   r<   )r    httpx_clientrequestr>   typingcastr   r   jsonr
   r   dictr;   r   r   r   textr"   r(   r)   	_response_data_response_jsons         r#   get_allzRawVoicesClient.get_all!   s@   & ((55=={ , > 
		ti++1c1%"/ ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD( 	A4D( (?E'next_page_token	page_sizesearchsortsort_direction
voice_typecategoryfine_tuning_statecollection_idinclude_total_count	voice_idsr)   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   c                   | j                   j                  j                  dd|||||||||	|
|d|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  d	k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                     
      |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                         w xY w)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', 'saved'. 'non-default' is equal to all but 'default'. 'saved' is equal to non-default, but includes default voices if they have been added to a collection.

        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-   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   r.   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   r)   rG   rH   rI   s                   r#   rN   zRawVoicesClient.searchV   s]   | ((55==#2& "0($%6!.':& ,! > 
	$	ti++1c1'"1 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD2 A4D2 2?E1with_settingsr)   voice_idr\   c                   | j                   j                  j                  dt        |       dd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                  d	k(  rUt        t        |j                        t        j                  t        t        t        |j                                     
      |j                         }t!        |j                  t        |j                        |      # t        $ r6 t!        |j                  t        |j                        |j"                        w xY w)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-   r\   r.   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   r]   r\   r)   rG   rH   rI   s          r#   getzRawVoicesClient.get   sN   4 ((55==)(345 , > 
		ti++1c1"# ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD4 A4D4 4?E3r)   c                   | j                   j                  j                  dt        |       d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                                     	      |j                         }t!        |j                  t        |j                        |
      # t        $ r6 t!        |j                  t        |j                        |j"                  
      w xY w)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
        r_   DELETEr/   r)   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   r]   r)   rG   rH   rI   s         r#   deletezRawVoicesClient.delete   sB   & ((55==)(345+ > 
	
	ti++1c1,"6 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD1 A4D1 1?E0filesremove_background_noisedescriptionlabelsr)   nameri   rj   rk   rl   c                   | j                   j                  j                  dt        |       dd||||di |d|ini |t        d      }	 d|j
                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }	t        ||	      S |j
                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                         
                  |j                         }
t#        |j
                  t        |j                        |
      # t         $ r6 t#        |j
                  t        |j                        |j$                        w xY w)a  
        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[VoicesUpdateRequestLabels]
            Labels for the voice. Keys can be language, accent, gender, or age.

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

        Returns
        -------
        HttpResponse[EditVoiceResponseModel]
            Successful Response
        r_   /editPOSTrm   rj   rk   rl   ri   Tr/   r8   ri   r)   omitforce_multipartr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   OMITr>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   r]   rm   ri   rj   rk   rl   r)   rG   rH   rI   s              r#   updatezRawVoicesClient.update.  sw   T ((55==)(34E:+B* 	','8GU#b ,  > 
	 	ti++1c1*"4 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AE (A4E ?F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  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j
                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                         
                  |j                         }t#        |j
                  t        |j                        |      # t         $ r6 t#        |j
                  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
            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//rp   ry   content-typeapplication/jsonr/   rC   r;   r)   rs   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   ru   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   rx   r]   ry   r)   rG   rH   rI   s           r#   sharezRawVoicesClient.share  sl   < ((55==-n=>a@PQY@Z?[\H  2 , > 
		ti++1c1)"3 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AE )A4E ?FrM   rR   genderageaccentlanguagelocalerN   	use_casesdescriptivesfeaturedmin_notice_period_daysinclude_custom_ratesinclude_live_moderatedreader_app_enabledowner_idrO   pager)   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                >   | 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|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  dk(  rUt        t        |j                        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  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

        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-   rM   rR   r   r   r   r   r   rN   r   r   r   r   r   r   r   r   rO   r   r.   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   rM   rR   r   r   r   r   r   rN   r   r   r   r   r   r   r   r   rO   r   r)   rG   rH   rI   s                          r#   
get_sharedzRawVoicesClient.get_shared  s   r ((55==YH & s	
 & H & & Y  H )*@ '(< )*@ %&8  H!" #$ %( ,/ > 
	2	ti++1c1,"6 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   "AE >A4E ?F
audio_filesimilarity_thresholdtop_kr)   r   r   r   c                   | j                   j                  j                  dd||di |d|ini |t        d      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                         	                  |j                         }t!        |j                  t        |j                        |      # t        $ r6 t!        |j                  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
        -------
        HttpResponse[GetLibraryVoicesResponse]
            Successful Response
        v1/similar-voicesrp   r   r   r   Trr   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   ru   r>   rA   rB   r   r   rC   r
   r   rD   r;   r   r   r   rE   r"   r   r   r   r)   rG   rH   rI   s           r#   find_similar_voicesz#RawVoicesClient.find_similar_voicesR  s`   < ((55==(<1;1GL*-R ,  > 
		ti++1c1,"6 ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD8 A4D8 8?E7)$__name__
__module____qualname__r   r$   rA   Optionalboolr   r
   r   rJ   strintUnionSequencer   rN   r   ra   r   rg   ru   Listr   Filer   r   rw   r   r   r   r   r   floatr    r&   r#   r   r      s   .*; . 7;os3p$ood33pMS__]kMl3p	'	(3pp 15*.'+%)/3+/)-26.259NR;?hp  -hp ??3'	hp
 $hp ooc"hp ,hp OOC(hp //#&hp "??3/hp s+hp $__T2hp ??6<<V__S5I0I#JKhp  8hp 
)	*hp\ 04;?:p:p t,	:p
  8:p 
e	:pz TX0p0p171P0p	.	/0pn :>9=,0=A;?RpRp 	Rp
 v{{49956Rp "(!6Rp __S)Rp  9:Rp  8Rp 
,	-Rpt <@BpBp Bp
 Bp  8Bp 
+	,BpN +/DH'+$('+)-'+'+NRQU*.7;6:8<48)-%)%);?+Jp ??3'Jp //"@A	Jp
 $Jp __S!Jp $Jp //#&Jp $Jp $Jp ??6<<V__S5I0I#JKJp oofll38L3L&MNJp //$'Jp !' 4Jp %ood3Jp  !' 5!Jp" #OOD1#Jp$ //#&%Jp& ooc"'Jp( ooc")Jp*  8+Jp, 
.	/-Jp^ 267;&*;?Dp OODII.Dp %ooe4	Dp
 s#Dp  8Dp 
.	/Dp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	e
   f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Zddddedej                  e   dej                  e   de	e   fdZdddedej                  e   de	e   fdZeeeedddededej                  ej.                  ej2                        dej                  e   d ej                  e   d!ej                  e   dej                  e   de	e   fd"Zddd#eded$edej                  e   de	e   f
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   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   d/ej                  e   d0ej                  e   d1ej                  e   d2ej                  e   d3ej                  e   dej                  e   d4ej                  e   dej                  e   de	e    f(d5Z!eeedd6d7ej                  ej2                     d8ej                  e"   d9ej                  e   dej                  e   de	e    f
d:Z#y);AsyncRawVoicesClientr   c                    || _         y r   r   r!   s     r#   r$   zAsyncRawVoicesClient.__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  rGn nDt	        j
                  t        t        t        |j                                     }t        ||	      S |j                  d
k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  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
        -------
        AsyncHttpResponse[GetVoicesResponse]
            Successful Response
        r,   r-   r(   r.   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   rF   s         r#   rJ   zAsyncRawVoicesClient.get_all  sO    & ..;;CC{ , D 
 
		ti++1c1%"/ ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooA
<  	ty'<'<d9K\K\F]dmdrdrss	ts4   /E7D2E7AD5 E7A4D5 ,E75?E44E7rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   c                  K   | j                   j                  j                  dd|||||||||	|
|d|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||	      S |j                  d
k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                         w xY ww)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', 'saved'. 'non-default' is equal to all but 'default'. 'saved' is equal to non-default, but includes default voices if they have been added to a collection.

        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
        rX   r-   rY   r.   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   rZ   s                   r#   rN   zAsyncRawVoicesClient.search  sm    | ..;;CC#2& "0($%6!.':& ,! D 
 
	$	ti++1c1'"1 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooU
P  	ty'<'<d9K\K\F]dmdrdrss	ts5   9FD<FAD? FA4D? ,F??E>>Fr[   r]   r\   c                
  K   | j                   j                  j                  dt        |       dd|i|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                  d
k(  rUt        t        |j                        t        j                  t        t        t        |j                                           |j                         }t!        |j                  t        |j                        |      7 # t        $ r6 t!        |j                  t        |j                        |j"                        w xY ww)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
        r_   r-   r\   r.   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   r`   s          r#   ra   zAsyncRawVoicesClient.get<  s]    4 ..;;CC)(345 , D 
 
		ti++1c1"# ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooA
<  	ty'<'<d9K\K\F]dmdrdrss	ts5   ;FD>FAE FA4E ,F?F  Frb   c                  K   | j                   j                  j                  dt        |       d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                  d	k(  rUt        t        |j                        t        j                  t        t        t        |j                                     
      |j                         }t!        |j                  t        |j                        |      7 # t        $ r6 t!        |j                  t        |j                        |j"                        w xY ww)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
        r_   rd   re   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   rf   s         r#   rg   zAsyncRawVoicesClient.deletex  sP    & ..;;CC)(345+ D 
 
	
	ti++1c1,"6 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo;
6  	ty'<'<d9K\K\F]dmdrdrss	ts5   8F D;F  AD> F A4D> ,F >?E==F rh   rm   ri   rj   rk   rl   c                0  K   | j                   j                  j                  dt        |       dd||||di |d|ini |t        d       d{   }	 d	|j
                  cxk  rd
k  rGn nDt        j                  t        t        t        |j                                     }	t        ||	      S |j
                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                                           |j                         }
t#        |j
                  t        |j                        |
      7 # t         $ r6 t#        |j
                  t        |j                        |j$                        w xY ww)a  
        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[VoicesUpdateRequestLabels]
            Labels for the voice. Keys can be language, accent, gender, or age.

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

        Returns
        -------
        AsyncHttpResponse[EditVoiceResponseModel]
            Successful Response
        r_   ro   rp   rq   Nri   Trr   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   ru   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   rv   s              r#   rw   zAsyncRawVoicesClient.update  s    T ..;;CC)(34E:+B* 	','8GU#b ,  D 
 
	 	ti++1c1*"4 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooQ
L  	ty'<'<d9K\K\F]dmdrdrss	ts8   AFEFAE 1F2A4E &,F?FFrx   ry   c                2  K   | j                   j                  j                  dt        |       dt        |       dd|iddi|t               d{   }	 d	|j
                  cxk  rd
k  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j
                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                                           |j                         }t#        |j
                  t        |j                        |      7 # t         $ r6 t#        |j
                  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
            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
        r{   r|   rp   ry   r}   r~   r   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r   ru   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   r   s           r#   r   zAsyncRawVoicesClient.share  s|    < ..;;CC-n=>a@PQY@Z?[\H  2 , D 
 
		ti++1c1)"3 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooI
D  	ty'<'<d9K\K\F]dmdrdrss	ts8   AFEFAE 2F3A4E ',F?FFr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                \  K   | 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{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  dk(  rUt        t        |j                        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  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

        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-   rM   rR   r   r   r   r   r   rN   r   r   r   r   r   r   r   r   rO   r   r.   Nr1   r2   r3   r6   r9   r:   r=   )r    r?   r@   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   r   s                          r#   r   zAsyncRawVoicesClient.get_sharedB  s$    r ..;;CCYH & s	
 & H & & Y  H )*@ '(< )*@ %&8  H!" #$ %( ,/ D 
 
	2	ti++1c1,"6 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooc
^  	ty'<'<d9K\K\F]dmdrdrss	ts8   A$F,&E''F,,AE* F,A4E* <,F,*?F))F,r   r   r   r   c                  K   | j                   j                  j                  dd||di |d|ini |t        d       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                  dk(  rUt        t        |j                        t        j                  t        t        t        |j                         
                  |j                         }t!        |j                  t        |j                        |      7 # t        $ r6 t!        |j                  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
        -------
        AsyncHttpResponse[GetLibraryVoicesResponse]
            Successful Response
        r   rp   r   Nr   Trr   r1   r2   r3   r6   r9   r:   r=   )r    r?   r@   ru   r>   rA   rB   r   r   rC   r	   r   rD   r;   r   r   r   rE   r   s           r#   r   z(AsyncRawVoicesClient.find_similar_voices  sp    < ..;;CC(<1;1GL*-R ,  D 
 
		ti++1c1,"6 ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooM
H  	ty'<'<d9K\K\F]dmdrdrss	ts7   ?FEFAE "F#A4E ,F?FF)$r   r   r   r   r$   rA   r   r   r   r	   r   rJ   r   r   r   r   r   rN   r   ra   r   rg   ru   r   r   r   r   r   rw   r   r   r   r   r   r   r   r   r&   r#   r   r     s   .*< . 7;os3p$ood33pMS__]kMl3p	,	-3pp 15*.'+%)/3+/)-26.259NR;?hp  -hp ??3'	hp
 $hp ooc"hp ,hp OOC(hp //#&hp "??3/hp s+hp $__T2hp ??6<<V__S5I0I#JKhp  8hp 
.	/hp\ 04;?:p:p t,	:p
  8:p 
5	!:pz TX0p0p171P0p	3	40pn :>9=,0=A;?RpRp 	Rp
 v{{49956Rp "(!6Rp __S)Rp  9:Rp  8Rp 
1	2Rpt <@BpBp Bp
 Bp  8Bp 
0	1BpN +/DH'+$('+)-'+'+NRQU*.7;6:8<48)-%)%);?+Jp ??3'Jp //"@A	Jp
 $Jp __S!Jp $Jp //#&Jp $Jp $Jp ??6<<V__S5I0I#JKJp oofll38L3L&MNJp //$'Jp !' 4Jp %ood3Jp  !' 5!Jp" #OOD1#Jp$ //#&%Jp& ooc"'Jp( ooc")Jp*  8+Jp, 
3	4-Jp^ 267;&*;?Dp OODII.Dp %ooe4	Dp
 s#Dp  8Dp 
3	4Dpr&   r   ).rA   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   "types.voices_update_request_labelsr   rB   Anyru   r   r   r   r&   r#   <module>r      sx     (  % G @ 4 1 6 H B H D H 9 ? =  T I v{{6::s#y	p y	pxy	p y	pr&   