
    b6i4                        d dl 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  e j6                  e j8                  d      Z G d d      Z G d d      Zy)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)'convert_and_respect_annotation_metadata)construct_type)UnprocessableEntityError)EditVoiceSettingsResponseModel)HttpValidationError)VoiceSettings.c            
           e Zd ZdefdZdddej                  e   dee	   fdZ
dddedej                  e   dee	   fd	Zddded
e	dej                  e   dee   fdZy)RawSettingsClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     p/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/voices/settings/raw_client.py__init__zRawSettingsClient.__init__   
    -    Nrequest_optionsr    returnc                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)	a  
        Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

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

        Returns
        -------
        HttpResponse[VoiceSettings]
            Successful Response
        v1/voices/settings/defaultGETmethodr       ,  type_object_responsedatastatus_codeheadersbody)r   httpx_clientrequestr0   typingcastr   r   jsonr	   r   r   dictr1   textr   r    	_response_data_response_jsons        r   get_defaultzRawSettingsClient.get_default   s     ((55==(+ > 
	
	ti++1c1!"+ ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?D voice_idc                   | 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                        |      # t        $ r6 t!        |j                  t        |j                        |j"                        w xY w)aN  
        Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

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

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

        Returns
        -------
        HttpResponse[VoiceSettings]
            Successful Response
        
v1/voices/	/settingsr$   r%   r'   r(   r)   r,     r1   r2   r/   )r   r3   r4   r
   r0   r5   r6   r   r   r7   r	   r   r8   r1   r   r   r   r9   r   r?   r    r;   r<   r=   s         r   getzRawSettingsClient.get<   sD   & ((55==)(34I>+ > 
	
	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D2 A4D2 2?E1r4   c                   | j                   j                  j                  dt        |       ddt	        |t
        d      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  
        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
            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 : VoiceSettings

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

        Returns
        -------
        HttpResponse[EditVoiceSettingsResponseModel]
            Successful Response
        rA   /settings/editPOSTwriter+   
annotation	directioncontent-typeapplication/jsonr&   r7   r1   r    omitr'   r(   r)   r,   rC   rD   r/   )r   r3   r4   r
   r   r   OMITr0   r5   r6   r   r   r7   r	   r   r8   r1   r   r   r   r9   r   r?   r4   r    r;   r<   r=   s          r   updatezRawSettingsClient.updaten   sb   * ((55==)(34NC8Ubnuv 2 , > 	
		ti++1c12"< ) 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
)__name__
__module____qualname__r   r   r5   Optionalr   r	   r   r>   strrF   r   rT    r   r   r   r      s    .*; . QU  pfoon.M  pYefsYt  pF TX0p0p171P0p	m	$0pf lp7p7p)67pIOYgIh7p	4	57pr   r   c            
           e Zd ZdefdZdddej                  e   dee	   fdZ
dddedej                  e   dee	   fd	Zddded
e	dej                  e   dee   fdZy)AsyncRawSettingsClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawSettingsClient.__init__   r   r   Nr   r    r!   c                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
a  
        Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

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

        Returns
        -------
        AsyncHttpResponse[VoiceSettings]
            Successful Response
        r#   r$   r%   Nr'   r(   r)   r,   r/   )r   r3   r4   r0   r5   r6   r   r   r7   r   r   r   r8   r1   r9   r:   s        r   r>   z"AsyncRawSettingsClient.get_default   s       ..;;CC(+ D 
 
	
	ti++1c1!"+ ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts3   ,DCDAC DC  ,D?DDr?   c                  K   | j                   j                  j                  dt        |       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)aS  
        Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.

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

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

        Returns
        -------
        AsyncHttpResponse[VoiceSettings]
            Successful Response
        rA   rB   r$   r%   Nr'   r(   r)   r,   rC   rD   r/   )r   r3   r4   r
   r0   r5   r6   r   r   r7   r   r   r8   r1   r   r   r   r9   rE   s         r   rF   zAsyncRawSettingsClient.get   sR    & ..;;CC)(34I>+ D 
 
	
	ti++1c1!"+ ) 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   9FD<FAD? FA4D? ,F??E>>Fr4   c                8  K   | j                   j                  j                  dt        |       ddt	        |t
        d      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  
        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
            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 : VoiceSettings

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

        Returns
        -------
        AsyncHttpResponse[EditVoiceSettingsResponseModel]
            Successful Response
        rA   rH   rI   rJ   rK   rN   rO   rP   Nr'   r(   r)   r,   rC   rD   r/   )r   r3   r4   r
   r   r   rR   r0   r5   r6   r   r   r7   r   r   r8   r1   r   r   r   r9   rS   s          r   rT   zAsyncRawSettingsClient.update  sr    * ..;;CC)(34NC8Ubnuv 2 , D 	
 	
		ti++1c12"< ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooE	
@  	ty'<'<d9K\K\F]dmdrdrss	ts8   AFEFAE 5F6A4E *,F?FF)rU   rV   rW   r   r   r5   rX   r   r   r   r>   rY   rF   r   rT   rZ   r   r   r\   r\      s    .*< . EI"p"(//."A"p	=	)"pJ TX0p0p171P0p	=	)0pf lp7p7p)67pIOYgIh7p	9	:7pr   r\   ) r5   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.serializationr   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   (types.edit_voice_settings_response_modelr   types.http_validation_errorr   types.voice_settingsr   r6   AnyrR   r   r\   rZ   r   r   <module>rn      sc     ( & H A 5 2 I 7 I V > 1 v{{6::s#Op OpdQp Qpr   