o
    lWi9                     @  s   d dl mZ d dl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r=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   )AsyncClientWrapperSyncClientWrapper)RequestOptions)SimilarVoicesForSpeakerResponse)SpeakerCreatedResponse)SpeakerUpdatedResponse   )AsyncRawSpeakerClientRawSpeakerClient)AsyncSegmentClientSegmentClient.c                   @  v   e Zd Zd&ddZed'ddZeeeeeed	d
d(ddZeeeeed	dd)ddZd	d d*d"d#Z	ed$d% Z
d	S )+SpeakerClientclient_wrapperr   c                C     t |d| _|| _d | _d S Nr   )r   _raw_client_client_wrapper_segmentselfr    r   n/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/dubbing/resource/speaker/client.py__init__      
zSpeakerClient.__init__returnr   c                 C     | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSpeakerClient
        r   r   r   r   r   with_raw_response      	zSpeakerClient.with_raw_responseNspeaker_namevoice_idvoice_stabilityvoice_similarityvoice_style	languagesrequest_options
dubbing_idstr
speaker_idr%   typing.Optional[str]r&   r'   typing.Optional[float]r(   r)   r*   %typing.Optional[typing.Sequence[str]]r+   typing.Optional[RequestOptions]r	   c                C  s$   | j j|||||||||	d	}
|
jS )a  
        Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_id : str
            ID of the speaker.

        speaker_name : typing.Optional[str]
            Name to attribute to this speaker.

        voice_id : typing.Optional[str]
            Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].

        voice_stability : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].

        voice_similarity : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        voice_style : typing.Optional[float]
            For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        languages : typing.Optional[typing.Sequence[str]]
            Languages to apply these changes to. If empty, will apply to all languages.

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

        Returns
        -------
        SpeakerUpdatedResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.resource.speaker.update(
            dubbing_id="dubbing_id",
            speaker_id="speaker_id",
        )
        r$   r   updatedatar   r,   r.   r%   r&   r'   r(   r)   r*   r+   	_responser   r   r   r4   %   s   >zSpeakerClient.updater%   r&   r'   r(   r)   r+   r   c          	   	   C  s    | j j|||||||d}|jS )aP  
        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_name : typing.Optional[str]
            Name to attribute to this speaker.

        voice_id : typing.Optional[str]
            Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].

        voice_stability : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].

        voice_similarity : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        voice_style : typing.Optional[float]
            For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

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

        Returns
        -------
        SpeakerCreatedResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.resource.speaker.create(
            dubbing_id="dubbing_id",
        )
        r8   r   creater5   	r   r,   r%   r&   r'   r(   r)   r+   r7   r   r   r   r:   p   s   3	zSpeakerClient.creater+   r   c                C  s   | j j|||d}|jS )a6  
        Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_id : str
            ID of the speaker.

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

        Returns
        -------
        SimilarVoicesForSpeakerResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.resource.speaker.find_similar_voices(
            dubbing_id="dubbing_id",
            speaker_id="speaker_id",
        )
        r<   r   find_similar_voicesr5   r   r,   r.   r+   r7   r   r   r   r>      s   "z!SpeakerClient.find_similar_voicesc                 C  *   | j d u rddlm} || jd| _ | j S )Nr
   )r   r   )r   segment.clientr   r   )r   r   r   r   r   segment      
zSpeakerClient.segment)r   r   )r   r   r,   r-   r.   r-   r%   r/   r&   r/   r'   r0   r(   r0   r)   r0   r*   r1   r+   r2   r   r	   r,   r-   r%   r/   r&   r/   r'   r0   r(   r0   r)   r0   r+   r2   r   r   r,   r-   r.   r-   r+   r2   r   r   __name__
__module____qualname__r   propertyr"   OMITr4   r:   r>   rB   r   r   r   r   r      s.    
O?%r   c                   @  r   )+AsyncSpeakerClientr   r   c                C  r   r   )r   r   r   r   r   r   r   r   r      r   zAsyncSpeakerClient.__init__r   r   c                 C  r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSpeakerClient
        r    r!   r   r   r   r"      r#   z$AsyncSpeakerClient.with_raw_responseNr$   r,   r-   r.   r%   r/   r&   r'   r0   r(   r)   r*   r1   r+   r2   r	   c                  s,   | j j|||||||||	d	I dH }
|
jS )aV  
        Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_id : str
            ID of the speaker.

        speaker_name : typing.Optional[str]
            Name to attribute to this speaker.

        voice_id : typing.Optional[str]
            Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].

        voice_stability : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].

        voice_similarity : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        voice_style : typing.Optional[float]
            For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        languages : typing.Optional[typing.Sequence[str]]
            Languages to apply these changes to. If empty, will apply to all languages.

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

        Returns
        -------
        SpeakerUpdatedResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.resource.speaker.update(
                dubbing_id="dubbing_id",
                speaker_id="speaker_id",
            )


        asyncio.run(main())
        r$   Nr3   r6   r   r   r   r4      s   FzAsyncSpeakerClient.updater8   r   c          	   	     s(   | j j|||||||dI dH }|jS )a  
        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_name : typing.Optional[str]
            Name to attribute to this speaker.

        voice_id : typing.Optional[str]
            Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].

        voice_stability : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].

        voice_similarity : typing.Optional[float]
            For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

        voice_style : typing.Optional[float]
            For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].

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

        Returns
        -------
        SpeakerCreatedResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.resource.speaker.create(
                dubbing_id="dubbing_id",
            )


        asyncio.run(main())
        r8   Nr9   r;   r   r   r   r:   @  s   ;	zAsyncSpeakerClient.creater<   r   c                  s    | j j|||dI dH }|jS )a  
        Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        speaker_id : str
            ID of the speaker.

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

        Returns
        -------
        SimilarVoicesForSpeakerResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.resource.speaker.find_similar_voices(
                dubbing_id="dubbing_id",
                speaker_id="speaker_id",
            )


        asyncio.run(main())
        r<   Nr=   r?   r   r   r   r>     s   *z&AsyncSpeakerClient.find_similar_voicesc                 C  r@   )Nr
   )r   r   )r   rA   r   r   )r   r   r   r   r   rB     rC   zAsyncSpeakerClient.segment)r   r   )r   r   rD   rE   rF   rG   r   r   r   r   rM      s.    
WG-rM   )
__future__r   typingcore.client_wrapperr   r   core.request_optionsr   )types.similar_voices_for_speaker_responser   types.speaker_created_responser   types.speaker_updated_responser	   
raw_clientr   r   TYPE_CHECKINGrA   r   r   castAnyrL   r   rM   r   r   r   r   <module>   s    I