
    b6i9                        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j*                  ej,                  d      Z G d d      Z G d d      Zy)    )annotationsN   )AsyncClientWrapperSyncClientWrapper)RequestOptions)SimilarVoicesForSpeakerResponse)SpeakerCreatedResponse)SpeakerUpdatedResponse   )AsyncRawSpeakerClientRawSpeakerClient)AsyncSegmentClientSegmentClient.c                      e Zd ZddZedd       Zeeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdd	 	 	 	 	 	 	 dd	Z	ed
        Z
y)SpeakerClientc               B    t        |      | _        || _        d | _        y Nclient_wrapper)r   _raw_client_client_wrapper_segmentselfr   s     u/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/dubbing/resource/speaker/client.py__init__zSpeakerClient.__init__   s    +>J-8<    c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSpeakerClient
        r   r   s    r   with_raw_responsezSpeakerClient.with_raw_response        r   Nspeaker_namevoice_idvoice_stabilityvoice_similarityvoice_style	languagesrequest_optionsc               b    | j                   j                  |||||||||		      }
|
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   
dubbing_id
speaker_idr$   r%   r&   r'   r(   r)   r*   	_responses              r   r-   zSpeakerClient.update%   sG    | $$++%+-#+ , 

	 ~~r   r$   r%   r&   r'   r(   r*   c          	     ^    | j                   j                  |||||||      }|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",
        )
        r3   r   creater.   	r   r0   r$   r%   r&   r'   r(   r*   r2   s	            r   r6   zSpeakerClient.createp   sA    f $$++%+-#+ , 
	 ~~r   r*   c               V    | j                   j                  |||      }|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",
        )
        r8   r   find_similar_voicesr.   r   r0   r1   r*   r2   s        r   r;   z!SpeakerClient.find_similar_voices   s-    D $$88Zap8q	~~r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r   )r   segment.clientr   r   )r   r   s     r   segmentzSpeakerClient.segment   s+    == 5)9M9MNDM}}r   )r   r   )returnr   r0   strr1   rB   r$   typing.Optional[str]r%   rC   r&   typing.Optional[float]r'   rD   r(   rD   r)   z%typing.Optional[typing.Sequence[str]]r*   typing.Optional[RequestOptions]r@   r
   r0   rB   r$   rC   r%   rC   r&   rD   r'   rD   r(   rD   r*   rE   r@   r	   r0   rB   r1   rB   r*   rE   r@   r   __name__
__module____qualname__r   propertyr!   OMITr-   r6   r;   r?    r   r   r   r      sN   =
     .2)-2637.2;?;?II I
 +I 'I 0I 1I ,I 9I 9I 
 I^ .2)-2637.2;?<< +	<
 '< 0< 1< ,< 9< 
 <~ gk##+.#Dc#	(#J  r   r   c                      e Zd ZddZedd       Zeeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdd	 	 	 	 	 	 	 dd	Z	ed
        Z
y)AsyncSpeakerClientc               B    t        |      | _        || _        d | _        y r   )r   r   r   r   r   s     r   r   zAsyncSpeakerClient.__init__   s    0O-=Ar   c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSpeakerClient
        r   r    s    r   r!   z$AsyncSpeakerClient.with_raw_response   r"   r   Nr#   c               ~   K   | j                   j                  |||||||||		       d{   }
|
j                  S 7 w)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#   Nr,   r/   s              r   r-   zAsyncSpeakerClient.update   sU     L **11%+-#+ 2 

 

	 ~~

s   (=;=r3   c          	     z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)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())
        r3   Nr5   r7   s	            r   r6   zAsyncSpeakerClient.create@  sO     v **11%+-#+ 2 
 
	 ~~
s   &;9;r8   c               r   K   | j                   j                  |||       d{   }|j                  S 7 w)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())
        r8   Nr:   r<   s        r   r;   z&AsyncSpeakerClient.find_similar_voices  s:     T **>>z:gv>ww	~~ xs   "757c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r   )r   r>   r   r   )r   r   s     r   r?   zAsyncSpeakerClient.segment  s+    == :.d>R>RSDM}}r   )r   r   )r@   r   rA   rF   rG   rH   rN   r   r   rP   rP      sX   B
     .2)-2637.2;?;?QQ Q
 +Q 'Q 0Q 1Q ,Q 9Q 9Q 
 Qn .2)-2637.2;?DD +	D
 'D 0D 1D ,D 9D 
 DN gk+++.+Dc+	(+Z  r   rP   )
__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_CHECKINGr>   r   r   castAnyrM   r   rP   rN   r   r   <module>rb      sZ    #  I 3 Y E E ?	Av{{6::s#E EP] ]r   