o
    lWi8                     @  s   d dl mZ d dlZddlmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZ d
dlmZmZ ejrSd
dlmZmZ d
dlmZmZ d
dlmZmZ eejdZG dd dZ G dd dZ!dS )    )annotationsN   )core)AsyncClientWrapperSyncClientWrapper)RequestOptions)AddVoiceResponseModel)DeleteVoiceSampleResponseModel)VoiceSample   )AsyncRawSamplesClientRawSamplesClient)AsyncAudioClientAudioClient)AsyncSpeakersClientSpeakersClient)AsyncWaveformClientWaveformClient.c                   @     e Zd Zd,ddZed-ddZed	d
d.ddZeeeeed	dd/d d!Zd	d"d0d$d%Z	ed&d' Z
ed(d) Zed*d+ Zd	S )1SamplesClientclient_wrapperr   c                C  (   t |d| _|| _d | _d | _d | _d S Nr   )r   _raw_client_client_wrapper_audio	_waveform	_speakersselfr    r!   h/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/voices/pvc/samples/client.py__init__   
   
zSamplesClient.__init__returnr   c                 C     | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSamplesClient
        r   r    r!   r!   r"   with_raw_response      	zSamplesClient.with_raw_responseNremove_background_noiserequest_optionsvoice_idstrfilestyping.List[core.File]r,   typing.Optional[bool]r-   typing.Optional[RequestOptions]typing.List[VoiceSample]c                C  s   | j j||||d}|jS )a  
        Add audio samples to a PVC voice

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

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

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

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

        Returns
        -------
        typing.List[VoiceSample]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.pvc.samples.create(
            voice_id="21m00Tcm4TlvDq8ikWAM",
        )
        r0   r,   r-   r   createdatar    r.   r0   r,   r-   	_responser!   r!   r"   r7   *   s   )zSamplesClient.creater,   selected_speaker_idstrim_start_timetrim_end_time	file_namer-   	sample_idr<   %typing.Optional[typing.Sequence[str]]r=   typing.Optional[int]r>   r?   typing.Optional[str]r   c          
   
   C  s"   | j j||||||||d}	|	jS )a  
        Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name.

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

        sample_id : str
            Sample ID to be used

        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.

        selected_speaker_ids : typing.Optional[typing.Sequence[str]]
            Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.

        trim_start_time : typing.Optional[int]
            The start time of the audio to be used for PVC training. Time should be in milliseconds

        trim_end_time : typing.Optional[int]
            The end time of the audio to be used for PVC training. Time should be in milliseconds

        file_name : typing.Optional[str]
            The name of the audio file to be used for PVC training.

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

        Returns
        -------
        AddVoiceResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.pvc.samples.update(
            voice_id="21m00Tcm4TlvDq8ikWAM",
            sample_id="VW7YKqPnjY4h39yTbx2L",
        )
        r;   r   updater8   
r    r.   r@   r,   r<   r=   r>   r?   r-   r:   r!   r!   r"   rE   X   s   :
zSamplesClient.updater-   r	   c                C  s   | j j|||d}|jS )a  
        Delete a sample from a PVC voice.

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

        sample_id : str
            Sample ID to be used

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

        Returns
        -------
        DeleteVoiceSampleResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.pvc.samples.delete(
            voice_id="21m00Tcm4TlvDq8ikWAM",
            sample_id="VW7YKqPnjY4h39yTbx2L",
        )
        rG   r   deleter8   r    r.   r@   r-   r:   r!   r!   r"   rI      s   "zSamplesClient.deletec                 C  *   | j d u rddlm} || jd| _ | j S )Nr   )r   r   )r   audio.clientr   r   )r    r   r!   r!   r"   audio      
zSamplesClient.audioc                 C  rK   )Nr   )r   r   )r   waveform.clientr   r   )r    r   r!   r!   r"   waveform   rN   zSamplesClient.waveformc                 C  rK   )Nr   )r   r   )r   speakers.clientr   r   )r    r   r!   r!   r"   speakers   rN   zSamplesClient.speakers)r   r   )r%   r   
r.   r/   r0   r1   r,   r2   r-   r3   r%   r4   r.   r/   r@   r/   r,   r2   r<   rA   r=   rB   r>   rB   r?   rC   r-   r3   r%   r   r.   r/   r@   r/   r-   r3   r%   r	   __name__
__module____qualname__r#   propertyr)   OMITr7   rE   rI   rM   rP   rR   r!   r!   r!   r"   r      s,    
3G%

r   c                   @  r   )1AsyncSamplesClientr   r   c                C  r   r   )r   r   r   r   r   r   r   r!   r!   r"   r#      r$   zAsyncSamplesClient.__init__r%   r   c                 C  r&   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSamplesClient
        r'   r(   r!   r!   r"   r)      r*   z$AsyncSamplesClient.with_raw_responseNr+   r.   r/   r0   r1   r,   r2   r-   r3   r4   c                  s"   | j j||||dI dH }|jS )a`  
        Add audio samples to a PVC voice

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

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

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

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

        Returns
        -------
        typing.List[VoiceSample]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.pvc.samples.create(
                voice_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r5   Nr6   r9   r!   r!   r"   r7      s
   1zAsyncSamplesClient.creater;   r@   r<   rA   r=   rB   r>   r?   rC   r   c          
   
     s*   | j j||||||||dI dH }	|	jS )aN  
        Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name.

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

        sample_id : str
            Sample ID to be used

        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.

        selected_speaker_ids : typing.Optional[typing.Sequence[str]]
            Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.

        trim_start_time : typing.Optional[int]
            The start time of the audio to be used for PVC training. Time should be in milliseconds

        trim_end_time : typing.Optional[int]
            The end time of the audio to be used for PVC training. Time should be in milliseconds

        file_name : typing.Optional[str]
            The name of the audio file to be used for PVC training.

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

        Returns
        -------
        AddVoiceResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.pvc.samples.update(
                voice_id="21m00Tcm4TlvDq8ikWAM",
                sample_id="VW7YKqPnjY4h39yTbx2L",
            )


        asyncio.run(main())
        r;   NrD   rF   r!   r!   r"   rE   %  s   B
zAsyncSamplesClient.updaterG   r	   c                  s    | j j|||dI dH }|jS )a  
        Delete a sample from a PVC voice.

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

        sample_id : str
            Sample ID to be used

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

        Returns
        -------
        DeleteVoiceSampleResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.pvc.samples.delete(
                voice_id="21m00Tcm4TlvDq8ikWAM",
                sample_id="VW7YKqPnjY4h39yTbx2L",
            )


        asyncio.run(main())
        rG   NrH   rJ   r!   r!   r"   rI   s  s   *zAsyncSamplesClient.deletec                 C  rK   )Nr   )r   r   )r   rL   r   r   )r    r   r!   r!   r"   rM     rN   zAsyncSamplesClient.audioc                 C  rK   )Nr   )r   r   )r   rO   r   r   )r    r   r!   r!   r"   rP     rN   zAsyncSamplesClient.waveformc                 C  rK   )Nr   )r   r   )r   rQ   r   r   )r    r   r!   r!   r"   rR     rN   zAsyncSamplesClient.speakers)r   r   )r%   r   rS   rT   rU   rV   r!   r!   r!   r"   r\      s,    
;O-

r\   )"
__future__r   typing r   core.client_wrapperr   r   core.request_optionsr   types.add_voice_response_modelr   (types.delete_voice_sample_response_modelr	   types.voice_sampler
   
raw_clientr   r   TYPE_CHECKINGrL   r   r   rQ   r   r   rO   r   r   castAnyr[   r   r\   r!   r!   r!   r"   <module>   s"    F