
    hTC                       d dl 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 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/m0Z0 ddlm1Z1  e j2        e j3        d          Z4 G d d          Z5 G d  d!          Z6dS )"    N   )SyncClientWrapper)RequestOptions)GetProjectsResponse)construct_type)UnprocessableEntityError)HttpValidationError)JSONDecodeError)ApiError)core   ) ProjectsAddRequestTargetAudience)ProjectsAddRequestFiction)(ProjectsAddRequestApplyTextNormalization)ProjectsAddRequestSourceType)AddProjectResponseModel)ProjectExtendedResponseModel)jsonable_encoder)EditProjectResponseModel)DeleteProjectResponseModel)ConvertProjectResponseModel)ProjectSnapshotsResponse)$ProjectSnapshotExtendedResponseModel)%PronunciationDictionaryVersionLocator)*CreatePronunciationDictionaryResponseModel)'convert_and_respect_annotation_metadata)AsyncClientWrapper.c            9       N   e Zd ZdefdZdddej        e         defdZ	e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
ddd	ed
edededej        e         dej        ej                 dej        e         dej        e         dej        e         dej        e         dej        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                  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f8d#Zddd$edej        e         defd%Ze
e
e
e
dd&d$ed	ed
ededej        e         dej        e         dej        e         dej        e         dej        e         defd'Zddd$edej        e         defd(Ze
e
e
dd)d$edej        e         dej        ej                 d ej        e         dej        e         defd*Zddd$edej        e         defd+Zddd$edej        e         defd,Z ddd$ed-edej        e         de!fd.Z"e
dd/d$ed-ed0ej        e         dej        e         ddf
d1Z#ddd$ed-edej        e         dej$        e%         fd2Z&e
dd3d$edej'        e(         d4ej        e         dej        e         de)f
d5Z*dS )6ProjectsClientclient_wrapperc                    || _         d S N_client_wrapperselfr    s     c/var/www/html/prod/cognitive/venv/lib/python3.11/site-packages/elevenlabs/studio/projects/client.py__init__zProjectsClient.__init__+       -    Nrequest_optionsr,   returnc          
         | j         j                            d| j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |
                                                    S |j        dk    rMt          t          j        t          t          t          |
                                                              |
                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )	a  
        Returns a list of your Studio projects with metadata.

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

        Returns
        -------
        GetProjectsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.get_all()
        v1/studio/projectsGETbase_urlmethodr,      ,  type_object_  status_codebodyr$   httpx_clientrequestget_environmentbaser;   typingcastr   r   jsonr   r	   r
   r   textr&   r,   	_response_response_jsons       r'   get_allzProjectsClient.get_all.   s\   . (5== )99;;@+	 > 
 
		Si+1111c11111{'"1 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   AD A,D &D)from_urlfrom_documentquality_presettitleauthordescriptiongenrestarget_audiencelanguagecontent_typeoriginal_publication_datemature_contentisbn_numberacx_volume_normalizationvolume_normalization!pronunciation_dictionary_locatorscallback_urlfictionapply_text_normalizationauto_convertauto_assign_voicessource_typer,   namedefault_title_voice_iddefault_paragraph_voice_iddefault_model_idrK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   c                   | j         j                            d| j                                         j        di d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|||||||||dd|i|t
                    }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )at  
        Creates a new Studio project, it can be either initialized as blank, from a document or from a URL.

        Parameters
        ----------
        name : str
            The name of the Studio project, used for identification only.

        default_title_voice_id : str
            The voice_id that corresponds to the default voice used for new titles.

        default_paragraph_voice_id : str
            The voice_id that corresponds to the default voice used for new paragraphs.

        default_model_id : str
            The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models.

        from_url : typing.Optional[str]
            An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank.

        from_document : typing.Optional[core.File]
            See core.File for more documentation

        quality_preset : typing.Optional[str]
            Output quality of the generated audio. Must be one of:
            standard - standard output format, 128kbps with 44.1kHz sample rate.
            high - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. Using this setting increases the credit cost by 20%.
            ultra - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. Using this setting increases the credit cost by 50%.
            ultra lossless - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. Using this setting increases the credit cost by 100%.

        title : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        author : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        description : typing.Optional[str]
            An optional description of the Studio project.

        genres : typing.Optional[typing.List[str]]
            An optional list of genres associated with the Studio project.

        target_audience : typing.Optional[ProjectsAddRequestTargetAudience]
            An optional target audience of the Studio project.

        language : typing.Optional[str]
            An optional language of the Studio project. Two-letter language code (ISO 639-1).

        content_type : typing.Optional[str]
            An optional content type of the Studio project.

        original_publication_date : typing.Optional[str]
            An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY.

        mature_content : typing.Optional[bool]
            An optional specification of whether this Studio project contains mature content.

        isbn_number : typing.Optional[str]
            An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.

        acx_volume_normalization : typing.Optional[bool]
            [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

        volume_normalization : typing.Optional[bool]
            When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

        pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
            A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"Vmd4Zor6fplcA7WrINey","version_id":"hRPaxjlTdR7wFMhV4w0b"}"' --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"JzWtcGQMJ6bnlWwyMo7e","version_id":"lbmwxiLu4q6txYxgdZqn"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first.

        callback_url : typing.Optional[str]
            A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion

        fiction : typing.Optional[ProjectsAddRequestFiction]
            An optional specification of whether the content of this Studio project is fiction.

        apply_text_normalization : typing.Optional[ProjectsAddRequestApplyTextNormalization]

                This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
                When set to 'auto', the system will automatically decide whether to apply text normalization
                (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
                with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.


        auto_convert : typing.Optional[bool]
            Whether to auto convert the Studio project to audio or not.

        auto_assign_voices : typing.Optional[bool]
            [Alpha Feature] Whether automatically assign voices to phrases in the create Project.

        source_type : typing.Optional[ProjectsAddRequestSourceType]
            The type of Studio project to create.

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

        Returns
        -------
        AddProjectResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.add(
            name="name",
            default_title_voice_id="default_title_voice_id",
            default_paragraph_voice_id="default_paragraph_voice_id",
            default_model_id="default_model_id",
        )
        r/   POSTra   rb   rc   rd   rK   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   rL   r2   r3   datafilesr,   omitr4   r5   r6   r9   r:   r$   r>   r?   r@   rA   OMITr;   rB   rC   r   r   rD   r   r	   r
   r   rE   r&   ra   rb   rc   rd   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   r,   rG   rH   s                                 r'   addzProjectsClient.addc   sk   b (5== )99;;@(*@ -.H #$4	
 H !.  & { & "? H  ,-F !.  {!" +,D#$ )=5V ,",D ,&8*3  8   ,G > $
 $
	J	Si+1111c11111{+"5 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   	AE A,E &E1
project_idc          
         | j         j                            dt          |           | j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )	a  
        Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ProjectExtendedResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.get(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        v1/studio/projects/r0   r1   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   r&   rp   r,   rG   rH   s        r'   getzProjectsClient.get1  sn   B (5==@"2:">">@@)99;;@+	 > 
 
		Si+1111c11111{0": ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNN   AD &A,D &D9rN   rO   rW   rY   r,   c                   | j         j                            dt          |           | j                                         j        d|||||||dddi|	t                    }
	 d|
j        cxk    rdk     rCn n@t          j	        t          t          t          |
                                	                    S |
j        d
k    rMt          t          j	        t          t          t          |
                                	                              |
                                }n)# t          $ r t!          |
j        |
j                  w xY wt!          |
j        |          )a  
        Updates the specified Studio project by setting the values of the parameters passed.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        name : str
            The name of the Studio project, used for identification only.

        default_title_voice_id : str
            The voice_id that corresponds to the default voice used for new titles.

        default_paragraph_voice_id : str
            The voice_id that corresponds to the default voice used for new paragraphs.

        title : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        author : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        isbn_number : typing.Optional[str]
            An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.

        volume_normalization : typing.Optional[bool]
            When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

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

        Returns
        -------
        EditProjectResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.update_metadata(
            project_id="21m00Tcm4TlvDq8ikWAM",
            name="Project 1",
            default_title_voice_id="21m00Tcm4TlvDq8ikWAM",
            default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   rf   ra   rb   rc   rN   rO   rW   rY   content-typeapplication/jsonr2   r3   rD   headersr,   rk   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   rm   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   r&   rp   ra   rb   rc   rN   rO   rW   rY   r,   rG   rH   s               r'   update_metadatazProjectsClient.update_metadatap  s   @ (5==@"2:">">@@)99;;@*@.H *(<   2 ,# > 
 
	&	Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   #AD% 8A,D% %&Ec          
         | j         j                            dt          |           | j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )	aY  
        Deletes a Studio project.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        DeleteProjectResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.delete(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   DELETEr1   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   rt   s        r'   deletezProjectsClient.delete  sn   B (5==@"2:">">@@)99;;@+	 > 
 
		Si+1111c11111{."8 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNrv   rK   rL   r^   r,   c          
         | j         j                            dt          |           d| j                                         j        d||dd|i|t                    }	 d|j        cxk    rdk     rCn n@t          j	        t          t          t          |                                	                    S |j        d
k    rMt          t          j	        t          t          t          |                                	                              |                                }n)# t          $ r t!          |j        |j                  w xY wt!          |j        |          )aY  
        Updates Studio project content.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        from_url : typing.Optional[str]
            An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank.

        from_document : typing.Optional[core.File]
            See core.File for more documentation

        auto_convert : typing.Optional[bool]
            Whether to auto convert the Studio project to audio or not.

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

        Returns
        -------
        EditProjectResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.update_content(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   /contentrf   rK   r^   rL   rh   r4   r5   r6   r9   r:   r~   r&   rp   rK   rL   r^   r,   rG   rH   s           r'   update_contentzProjectsClient.update_content  s   Z (5==H"2:">">HHH)99;;@$ , 
   , > 
 
		Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   AD! 4A,D! !&Ec          
         | j         j                            dt          |           d| j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
a  
        Starts conversion of a Studio project and all of its chapters.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ConvertProjectResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.convert(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   /convertrf   r1   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   rt   s        r'   convertzProjectsClient.convertm  sq   B (5==H"2:">">HHH)99;;@+	 > 
 
		Si+1111c11111{/"9 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNN   AD 'A,D &D:c          
         | j         j                            dt          |           d| j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
ax  
        Retrieves a list of snapshots for a Studio project.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ProjectSnapshotsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.get_snapshots(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   
/snapshotsr0   r1   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   rt   s        r'   get_snapshotszProjectsClient.get_snapshots  sq   B (5==J"2:">">JJJ)99;;@+	 > 
 
		Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNr   project_snapshot_idc          
         | j         j                            dt          |           dt          |           | j                                         j        d|          }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
a  
        Returns the project snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

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

        Returns
        -------
        ProjectSnapshotExtendedResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.get_project_snapshot(
            project_id="21m00Tcm4TlvDq8ikWAM",
            project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   /snapshots/r0   r1   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r;   rB   rC   r   r   rD   r   r	   r
   r   rE   r&   rp   r   r,   rG   rH   s         r'   get_project_snapshotz#ProjectsClient.get_project_snapshot  s   L (5==r"2:">">rrK[\oKpKprr)99;;@+	 > 
 
		Si+1111c11111{8"B ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   !AD# 6A,D# #&E	convert_to_mpegr,   r   c          
      b   | j         j                            dt          |           dt          |           d| j                                         j        dd|iddi|t                    }	 d	|j        cxk    rd
k     rn ndS |j        dk    rMt          t          j
        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )a8  
        Stream the audio from a Studio project snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        convert_to_mpeg : typing.Optional[bool]
            Whether to convert the audio to mpeg format.

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

        Returns
        -------
        None

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.stream_audio(
            project_id="21m00Tcm4TlvDq8ikWAM",
            project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        rr   r   /streamrf   r   rz   r{   r|   r4   r5   Nr9   r6   r:   r$   r>   r?   r   r@   rA   rm   r;   r   rB   rC   r	   r   rD   r
   r   rE   r&   rp   r   r   r,   rG   rH   s          r'   stream_audiozProjectsClient.stream_audio/  si   R (5==y"2:">">yyK[\oKpKpyyy)99;;@!?  2 , > 
 
		Si+1111c11111$++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   .C2 A,C2 2&Dc             #     K   | j         j                            dt          |           dt          |           d| j                                         j        d|          5 }	 d|j        cxk    rdk     rHn nE||                    d	d
          nd
}|                    |          D ]}|V  	 ddd           dS |	                                 |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t           $ r t#          |j        |j                  w xY wt#          |j        |          # 1 swxY w Y   dS )a9  
        Returns a compressed archive of the Studio project's audio.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Yields
        ------
        typing.Iterator[bytes]
            Streaming archive data
        rr   r   /archiverf   r1   r4   r5   N
chunk_size   r   r9   r6   r:   )r$   r>   streamr   r@   rA   r;   ru   
iter_bytesreadr   rB   rC   r	   r   rD   r
   r   rE   r&   rp   r   r,   rG   _chunk_size_chunkrH   s           r'   stream_archivezProjectsClient.stream_archivew  s#     4 !.55z"2:">">zzK[\oKpKpzzz)99;;@+	 6 
 
 	S
 W)/5555#55555M\Mh/"5"5lD"I"I"InrK"+"6"6+"6"N"N % %$	S 	S 	S 	S 	S 	S 	S 	S    (C//2/*&9(1(8(8      "+!1!1" W W W9+@y~VVVVWy'<>RRRR5	S 	S 	S 	S 	S 	S 	S 	S 	S 	Ss2   #E?%AE ?B E ?E? &E&&E??FFinvalidate_affected_textr,   r   c          
      
   | j         j                            dt          |           d| j                                         j        dt          |t          j        t                   d          |dddi|t          	          }	 d
|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt!          t          j        t"          t          t"          |                                                              |                                }n)# t$          $ r t'          |j        |j                  w xY wt'          |j        |          )a_  
        Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator]
            A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"Vmd4Zor6fplcA7WrINey","version_id":"hRPaxjlTdR7wFMhV4w0b"}"' --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"JzWtcGQMJ6bnlWwyMo7e","version_id":"lbmwxiLu4q6txYxgdZqn"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first.

        invalidate_affected_text : typing.Optional[bool]
            This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does.

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

        Returns
        -------
        CreatePronunciationDictionaryResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, PronunciationDictionaryVersionLocator

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.update_pronunciation_dictionaries(
            project_id="21m00Tcm4TlvDq8ikWAM",
            pronunciation_dictionary_locators=[
                PronunciationDictionaryVersionLocator(
                    pronunciation_dictionary_id="pronunciation_dictionary_id",
                )
            ],
        )
        rr   /pronunciation-dictionariesrf   writer8   
annotation	directionrZ   r   rz   r{   r|   r4   r5   r6   r9   r:   r$   r>   r?   r   r@   rA   r   rB   Sequencer   rm   r;   rC   r   r   rD   r   r	   r
   r   rE   r&   rp   rZ   r   r,   rG   rH   s          r'   !update_pronunciation_dictionariesz0ProjectsClient.update_pronunciation_dictionaries  s   \ (5==["2:">">[[[)99;;@5\=%/TU%6 6 6
 -E   2 ,! > 
 
	$	Si+1111c11111{>"H ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   AE A,E &E,)+__name__
__module____qualname__r   r(   rB   Optionalr   r   rI   rm   strr   FileListr   boolr   r   r   r   ro   r   ru   r   r   r   r   r   r   r   r   r   r   r   r   Iteratorbytesr   r   r   r   r    r*   r'   r   r   *   sk       .*; . . . . MQ 3O 3O 3O&/.*I 3OUh 3O 3O 3O 3Ox *.48/3&*'+,048MQ)--1:>04,0:>6:OS-1>B^b.248EI;?;LO LO LO LO !$	LO
 %(LO LO /#&LO ty1LO ,LO s#LO $LO _S)LO C 01LO  )IJLO /#&LO  oc*!LO" $*?3#7#LO$ -%LO& _S)'LO( #)/$"7)LO* %od3+LO, ,2?6;s;K+L-LO. oc*/LO0 !:;1LO2 #)/2Z"[3LO4 od+5LO6 #OD17LO8 _%AB9LO:  8;LO< 
!=LO LO LO LOd <@	=O =O =O=O  8	=O
 
&=O =O =O =OL '+'+,06:;?iO iO iOiO 	iO
 !$iO %(iO s#iO $iO _S)iO %od3iO  8iO 
"iO iO iO iO^ <@	=O =O =O=O  8	=O
 
$=O =O =O =OF *.48.2;?QO QO QOQO /#&	QO
 ty1QO od+QO  8QO 
"QO QO QO QOn <@	=O =O =O=O  8	=O
 
%=O =O =O =OF <@	=O =O =O=O  8	=O
 
"=O =O =O =OH <@BO BO BOBO !BO
  8BO 
.BO BO BO BOR 26;?FO FO FOFO !FO
  .FO  8FO 
FO FO FO FOZ <@4S 4S 4S4S !4S
  84S 
	4S 4S 4S 4Sv ;?;?VO VO VOVO ,2?;`+a	VO
 #)/$"7VO  8VO 
4VO VO VO VO VO VOr*   r   c            9       N   e Zd ZdefdZdddej        e         defdZ	e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
ddd	ed
edededej        e         dej        ej                 dej        e         dej        e         dej        e         dej        e         dej        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                  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f8d#Zddd$edej        e         defd%Ze
e
e
e
dd&d$ed	ed
ededej        e         dej        e         dej        e         dej        e         dej        e         defd'Zddd$edej        e         defd(Ze
e
e
dd)d$edej        e         dej        ej                 d ej        e         dej        e         defd*Zddd$edej        e         defd+Zddd$edej        e         defd,Z ddd$ed-edej        e         de!fd.Z"e
dd/d$ed-ed0ej        e         dej        e         ddf
d1Z#ddd$ed-edej        e         dej$        e%         fd2Z&e
dd3d$edej'        e(         d4ej        e         dej        e         de)f
d5Z*dS )6AsyncProjectsClientr    c                    || _         d S r"   r#   r%   s     r'   r(   zAsyncProjectsClient.__init__  r)   r*   Nr+   r,   r-   c          
        K   | j         j                            d| j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |
                                                    S |j        dk    rMt          t          j        t          t          t          |
                                                              |
                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
aa  
        Returns a list of your Studio projects with metadata.

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

        Returns
        -------
        GetProjectsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.get_all()


        asyncio.run(main())
        r/   r0   r1   Nr4   r5   r6   r9   r:   r=   rF   s       r'   rI   zAsyncProjectsClient.get_all
  s     > .;CC )99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{'"1 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   	AD A,D &D1rJ   ra   rb   rc   rd   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   c                $  K   | j         j                            d| j                                         j        di d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|||||||||dd|i|t
                     d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )a  
        Creates a new Studio project, it can be either initialized as blank, from a document or from a URL.

        Parameters
        ----------
        name : str
            The name of the Studio project, used for identification only.

        default_title_voice_id : str
            The voice_id that corresponds to the default voice used for new titles.

        default_paragraph_voice_id : str
            The voice_id that corresponds to the default voice used for new paragraphs.

        default_model_id : str
            The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models.

        from_url : typing.Optional[str]
            An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank.

        from_document : typing.Optional[core.File]
            See core.File for more documentation

        quality_preset : typing.Optional[str]
            Output quality of the generated audio. Must be one of:
            standard - standard output format, 128kbps with 44.1kHz sample rate.
            high - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. Using this setting increases the credit cost by 20%.
            ultra - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. Using this setting increases the credit cost by 50%.
            ultra lossless - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. Using this setting increases the credit cost by 100%.

        title : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        author : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        description : typing.Optional[str]
            An optional description of the Studio project.

        genres : typing.Optional[typing.List[str]]
            An optional list of genres associated with the Studio project.

        target_audience : typing.Optional[ProjectsAddRequestTargetAudience]
            An optional target audience of the Studio project.

        language : typing.Optional[str]
            An optional language of the Studio project. Two-letter language code (ISO 639-1).

        content_type : typing.Optional[str]
            An optional content type of the Studio project.

        original_publication_date : typing.Optional[str]
            An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY.

        mature_content : typing.Optional[bool]
            An optional specification of whether this Studio project contains mature content.

        isbn_number : typing.Optional[str]
            An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.

        acx_volume_normalization : typing.Optional[bool]
            [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

        volume_normalization : typing.Optional[bool]
            When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

        pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
            A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"Vmd4Zor6fplcA7WrINey","version_id":"hRPaxjlTdR7wFMhV4w0b"}"' --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"JzWtcGQMJ6bnlWwyMo7e","version_id":"lbmwxiLu4q6txYxgdZqn"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first.

        callback_url : typing.Optional[str]
            A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion

        fiction : typing.Optional[ProjectsAddRequestFiction]
            An optional specification of whether the content of this Studio project is fiction.

        apply_text_normalization : typing.Optional[ProjectsAddRequestApplyTextNormalization]

                This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
                When set to 'auto', the system will automatically decide whether to apply text normalization
                (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
                with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.


        auto_convert : typing.Optional[bool]
            Whether to auto convert the Studio project to audio or not.

        auto_assign_voices : typing.Optional[bool]
            [Alpha Feature] Whether automatically assign voices to phrases in the create Project.

        source_type : typing.Optional[ProjectsAddRequestSourceType]
            The type of Studio project to create.

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

        Returns
        -------
        AddProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.add(
                name="name",
                default_title_voice_id="default_title_voice_id",
                default_paragraph_voice_id="default_paragraph_voice_id",
                default_model_id="default_model_id",
            )


        asyncio.run(main())
        r/   rf   ra   rb   rc   rd   rK   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rg   rL   rh   Nr4   r5   r6   r9   r:   rl   rn   s                                 r'   ro   zAsyncProjectsClient.addG  s     r .;CC )99;;@(*@ -.H #$4	
 H !.  & { & "? H  ,-F !.  {!" +,D#$ )=5V ,",D ,&8*3  8   ,G D $
 $
 $
 $
 $
 $
 $
 $
	J	Si+1111c11111{+"5 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   AE &A,E &E9rp   c          
        K   | j         j                            dt          |           | j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
a@  
        Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ProjectExtendedResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.get(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r0   r1   Nr4   r5   r6   r9   r:   rs   rt   s        r'   ru   zAsyncProjectsClient.get  s     R .;CC@"2:">">@@)99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{0": ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNN   AD .A,D &Erw   c                  K   | j         j                            dt          |           | j                                         j        d|||||||dddi|	t                     d{V }
	 d|
j        cxk    rd	k     rCn n@t          j	        t          t          t          |
                                
                    S |
j        dk    rMt          t          j	        t          t          t          |
                                
                              |
                                }n)# t          $ r t!          |
j        |
j                  w xY wt!          |
j        |          )a?  
        Updates the specified Studio project by setting the values of the parameters passed.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        name : str
            The name of the Studio project, used for identification only.

        default_title_voice_id : str
            The voice_id that corresponds to the default voice used for new titles.

        default_paragraph_voice_id : str
            The voice_id that corresponds to the default voice used for new paragraphs.

        title : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        author : typing.Optional[str]
            An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.

        isbn_number : typing.Optional[str]
            An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.

        volume_normalization : typing.Optional[bool]
            When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements

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

        Returns
        -------
        EditProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.update_metadata(
                project_id="21m00Tcm4TlvDq8ikWAM",
                name="Project 1",
                default_title_voice_id="21m00Tcm4TlvDq8ikWAM",
                default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   rf   ry   rz   r{   r|   Nr4   r5   r6   r9   r:   r~   r   s               r'   r   z#AsyncProjectsClient.update_metadatad  s     P .;CC@"2:">">@@)99;;@*@.H *(<   2 ,# D 
 
 
 
 
 
 
 
	&	Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   +AD-  A,D- -&Ec          
        K   | j         j                            dt          |           | j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        	          w xY wt          |j        |	          )
a  
        Deletes a Studio project.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        DeleteProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.delete(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   r1   Nr4   r5   r6   r9   r:   r   rt   s        r'   r   zAsyncProjectsClient.delete  s     R .;CC@"2:">">@@)99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{."8 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNr   r   c          
        K   | j         j                            dt          |           d| j                                         j        d||dd|i|t                     d{V }	 d|j        cxk    rd	k     rCn n@t          j	        t          t          t          |                                
                    S |j        dk    rMt          t          j	        t          t          t          |                                
                              |                                }n)# t          $ r t!          |j        |j                  w xY wt!          |j        |          )a  
        Updates Studio project content.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        from_url : typing.Optional[str]
            An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank.

        from_document : typing.Optional[core.File]
            See core.File for more documentation

        auto_convert : typing.Optional[bool]
            Whether to auto convert the Studio project to audio or not.

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

        Returns
        -------
        EditProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.update_content(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   rf   r   rL   rh   Nr4   r5   r6   r9   r:   r~   r   s           r'   r   z"AsyncProjectsClient.update_content  s     j .;CCH"2:">">HHH)99;;@$ , 
   , D 
 
 
 
 
 
 
 
		Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   'AD) <A,D) )&Ec          
        K   | j         j                            dt          |           d| j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        d	k    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        
          w xY wt          |j        |
          )a  
        Starts conversion of a Studio project and all of its chapters.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ConvertProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.convert(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   rf   r1   Nr4   r5   r6   r9   r:   r   rt   s        r'   r   zAsyncProjectsClient.converty  s     R .;CCH"2:">">HHH)99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{/"9 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNN   AD /A,D &Ec          
        K   | j         j                            dt          |           d| j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        d	k    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        
          w xY wt          |j        |
          )a  
        Retrieves a list of snapshots for a Studio project.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

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

        Returns
        -------
        ProjectSnapshotsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.get_snapshots(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   r0   r1   Nr4   r5   r6   r9   r:   r   rt   s        r'   r   z!AsyncProjectsClient.get_snapshots  s     R .;CCJ"2:">">JJJ)99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{,"6 ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNr   r   c          
        K   | j         j                            dt          |           dt          |           | j                                         j        d|           d{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        d	k    rMt          t          j        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j        
          w xY wt          |j        |
          )a}  
        Returns the project snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

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

        Returns
        -------
        ProjectSnapshotExtendedResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.get_project_snapshot(
                project_id="21m00Tcm4TlvDq8ikWAM",
                project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   r0   r1   Nr4   r5   r6   r9   r:   r   r   s         r'   r   z(AsyncProjectsClient.get_project_snapshot  s     \ .;CCr"2:">">rrK[\oKpKprr)99;;@+	 D 
 
 
 
 
 
 
 
		Si+1111c11111{8"B ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   )AD+ >A,D+ +&Er   r   c          
      r  K   | j         j                            dt          |           dt          |           d| j                                         j        dd|iddi|t                     d	{V }	 d
|j        cxk    rdk     rn nd	S |j        dk    rMt          t          j
        t          t          t          |                                                              |                                }n)# t          $ r t          |j        |j                  w xY wt          |j        |          )a  
        Stream the audio from a Studio project snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        convert_to_mpeg : typing.Optional[bool]
            Whether to convert the audio to mpeg format.

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.stream_audio(
                project_id="21m00Tcm4TlvDq8ikWAM",
                project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        rr   r   r   rf   r   rz   r{   r|   Nr4   r5   r9   r6   r:   r   r   s          r'   r   z AsyncProjectsClient.stream_audioS  s     b .;CCy"2:">">yyK[\oKpKpyyy)99;;@!?  2 , D 
 
 
 
 
 
 
 
		Si+1111c11111$++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   6C: A,C: :&D c               X  K   | j         j                            dt          |           dt          |           d| j                                         j        d|          4 d{V 	 }	 d|j        cxk    rdk     rUn nR||                    d	d
          nd
}|                    |          2 3 d{V }|W V  6 	 ddd          d{V  dS |	                                 d{V  |j        dk    rMt          t          j        t          t          t          |                                                              |                                }n)# t           $ r t#          |j        |j                  w xY wt#          |j        |          # 1 d{V swxY w Y   dS )a>  
        Returns a compressed archive of the Studio project's audio.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Yields
        ------
        typing.AsyncIterator[bytes]
            Streaming archive data
        rr   r   r   rf   r1   Nr4   r5   r   r   r   r9   r6   r:   )r$   r>   r   r   r@   rA   r;   ru   aiter_bytesareadr   rB   rC   r	   r   rD   r
   r   rE   r   s           r'   r   z"AsyncProjectsClient.stream_archive  s     4 '4;;z"2:">">zzK[\oKpKpzzz)99;;@+	 < 
 
 	S 	S 	S 	S 	S 	S 	S 	S
 W)/5555#55555M\Mh/"5"5lD"I"I"InrK(1(=(=(=(U(U % % % % % % %f$ )V	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S  oo'''''''''(C//2/*&9(1(8(8      "+!1!1" W W W9+@y~VVVVWy'<>RRRR5	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	Ss>   *F,AE1B>7EBEF&F  F
F#&F#r   r   c          
        K   | j         j                            dt          |           d| j                                         j        dt          |t          j        t                   d          |dddi|t          	           d
{V }	 d|j        cxk    rdk     rCn n@t          j        t          t          t          |                                                    S |j        dk    rMt!          t          j        t"          t          t"          |                                                              |                                }n)# t$          $ r t'          |j        |j                  w xY wt'          |j        |          )a  
        Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator]
            A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"Vmd4Zor6fplcA7WrINey","version_id":"hRPaxjlTdR7wFMhV4w0b"}"' --form 'pronunciation_dictionary_locators="{"pronunciation_dictionary_id":"JzWtcGQMJ6bnlWwyMo7e","version_id":"lbmwxiLu4q6txYxgdZqn"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first.

        invalidate_affected_text : typing.Optional[bool]
            This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does.

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

        Returns
        -------
        CreatePronunciationDictionaryResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, PronunciationDictionaryVersionLocator

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.update_pronunciation_dictionaries(
                project_id="21m00Tcm4TlvDq8ikWAM",
                pronunciation_dictionary_locators=[
                    PronunciationDictionaryVersionLocator(
                        pronunciation_dictionary_id="pronunciation_dictionary_id",
                    )
                ],
            )


        asyncio.run(main())
        rr   r   rf   r   r   r   rz   r{   r|   Nr4   r5   r6   r9   r:   r   r   s          r'   r   z5AsyncProjectsClient.update_pronunciation_dictionaries  s     l .;CC["2:">">[[[)99;;@5\=%/TU%6 6 6
 -E   2 ,! D 
 
 
 
 
 
 
 
	$	Si+1111c11111{>"H ) 0 0     $++.K+&"5$-NN$4$4      '^^--NN 	S 	S 	Sy'<9>RRRR	S9#8~NNNNs   AE !A,E &E4)+r   r   r   r   r(   rB   r   r   r   rI   rm   r   r   r   r   r   r   r   r   r   r   ro   r   ru   r   r   r   r   r   r   r   r   r   r   r   r   AsyncIteratorr   r   r   r   r   r   r   r*   r'   r   r     s       .*< . . . . SW ;O ;O ;O0O ;O[n ;O ;O ;O ;OH *.48/3&*'+,048MQ)--1:>04,0:>6:OS-1>B^b.248EI;?;TO TO TO TO !$	TO
 %(TO TO /#&TO ty1TO ,TO s#TO $TO _S)TO C 01TO  )IJTO /#&TO  oc*!TO" $*?3#7#TO$ -%TO& _S)'TO( #)/$"7)TO* %od3+TO, ,2?6;s;K+L-TO. oc*/TO0 !:;1TO2 #)/2Z"[3TO4 od+5TO6 #OD17TO8 _%AB9TO:  8;TO< 
!=TO TO TO TOt <@	EO EO EOEO  8	EO
 
&EO EO EO EO\ '+'+,06:;?qO qO qOqO 	qO
 !$qO %(qO s#qO $qO _S)qO %od3qO  8qO 
"qO qO qO qOn <@	EO EO EOEO  8	EO
 
$EO EO EO EOV *.48.2;?YO YO YOYO /#&	YO
 ty1YO od+YO  8YO 
"YO YO YO YO~ <@	EO EO EOEO  8	EO
 
%EO EO EO EOV <@	EO EO EOEO  8	EO
 
"EO EO EO EOX <@JO JO JOJO !JO
  8JO 
.JO JO JO JOb 26;?NO NO NONO !NO
  .NO  8NO 
NO NO NO NOj <@4S 4S 4S4S !4S
  84S 
	e	$4S 4S 4S 4Sv ;?;?^O ^O ^O^O ,2?;`+a	^O
 #)/$"7^O  8^O 
4^O ^O ^O ^O ^O ^Or*   r   )7rB   core.client_wrapperr   core.request_optionsr   types.get_projects_responser   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.http_validation_errorr	   json.decoderr
   core.api_errorr    r   *types.projects_add_request_target_audiencer   "types.projects_add_request_fictionr   3types.projects_add_request_apply_text_normalizationr   &types.projects_add_request_source_typer    types.add_project_response_modelr   %types.project_extended_response_modelr   core.jsonable_encoderr   !types.edit_project_response_modelr   #types.delete_project_response_modelr   $types.convert_project_response_modelr    types.project_snapshots_responser   .types.project_snapshot_extended_response_modelr   .types.pronunciation_dictionary_version_locatorr   4types.create_pronunciation_dictionary_response_modelr   core.serializationr   r   rC   Anyrm   r   r   r   r*   r'   <module>r      s    4 4 4 4 4 4 2 2 2 2 2 2 > > > > > > 7 7 7 7 7 7 I I I I I I > > > > > > ( ( ( ( ( ( & & & & & &       X X X X X X I I I I I I      Q P P P P P G G G G G G Q Q Q Q Q Q 5 5 5 5 5 5 I I I I I I M M M M M M O O O O O O H H H H H H                J I I I I I 5 5 5 5 5 5 v{6:s##YO YO YO YO YO YO YO YOxqO qO qO qO qO qO qO qO qO qOr*   