
    >|h                       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l1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 dd l9m:Z: dd!l;m<Z< dd"lm=Z=  e j|                  e j~                  d#      Z@ G d$ d%      ZA G d& d'      ZBy)(    N   )SyncClientWrapper   )0BodyCreatePodcastV1ProjectsPodcastCreatePostMode)2BodyCreatePodcastV1ProjectsPodcastCreatePostSource)9BodyCreatePodcastV1ProjectsPodcastCreatePostQualityPreset)9BodyCreatePodcastV1ProjectsPodcastCreatePostDurationScale)RequestOptions)PodcastProjectResponseModel)'convert_and_respect_annotation_metadata)construct_type)UnprocessableEntityError)HttpValidationError)JSONDecodeError)ApiError)GetProjectsResponse)core)0AddProjectV1ProjectsAddPostRequestTargetAudience))AddProjectV1ProjectsAddPostRequestFiction)8AddProjectV1ProjectsAddPostRequestApplyTextNormalization)AddProjectResponseModel)ProjectExtendedResponseModel)jsonable_encoder)EditProjectResponseModel)ProjectSnapshotsResponse)GetChaptersResponse)ChapterWithContentResponseModel)ChapterContentInputModel)EditChapterResponseModel)AddChapterResponseModel)ChapterSnapshotsResponse)%PronunciationDictionaryVersionLocator)AsyncClientWrapper.c            5       
   e Zd ZdefdZeeeeedddeded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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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f4d)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	j                  e	j@                     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d0Z"ddd*ede	j                  e   de	j                  e	j@                     fd1Z#ddd*ede	j                  e   de$fd2Z%edd3d*ed4ed5e	j                  e   de	j                  e   de	jL                  e'   f
d6Z(ddd*ed4ede	j                  e   ddfd7Z)ddd*ede	j                  e   de*fd8Z+ddd*ed9ede	j                  e   de,fd:Z-ddd*ed9ede	j                  e   de	j                  e	j@                     fd;Z.eedd<d*ed9ede	j                  e   d=e	j                  e/   de	j                  e   de0fd>Z1edd?d*edede	j                  e   de	j                  e   de2f
d@Z3ddd*ed9ede	j                  e   de	j                  e	j@                     fdAZ4ddd*ed9ede	j                  e   de5fdBZ6edd3d*ed9edCed5e	j                  e   de	j                  e   ddfdDZ7eddEd*ed$e	j                  e8   dFe	j                  e   de	j                  e   de	j                  e	j@                     f
dGZ9y)HProjectsClientclient_wrapperc                    || _         y N_client_wrapperselfr&   s     Y/var/www/html/test/engine/venv/lib/python3.12/site-packages/elevenlabs/projects/client.py__init__zProjectsClient.__init__5   
    -    Nquality_presetduration_scalelanguage
highlightscallback_urlrequest_optionsmodel_idmodesourcer2   r3   r4   r5   r6   r7   returnc       	            | j                   j                  j                  dd|t        |t        d      t        |t
        d      |||||dddi|	t              }
	 d	|
j                  cxk  rd
k  r:n n7t        j                  t        t        t        |
j                                     S |
j                  dk(  r@t        t        j                  t        t        t        |
j                                           |
j                         }t!        |
j                  |      # t        $ r" t!        |
j                  |
j"                        w xY w)a  
        Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs.

        Parameters
        ----------
        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.

        mode : BodyCreatePodcastV1ProjectsPodcastCreatePostMode
            The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue.

        source : BodyCreatePodcastV1ProjectsPodcastCreatePostSource
            The source content for the Podcast.

        quality_preset : typing.Optional[BodyCreatePodcastV1ProjectsPodcastCreatePostQualityPreset]
            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%.


        duration_scale : typing.Optional[BodyCreatePodcastV1ProjectsPodcastCreatePostDurationScale]
            Duration of the generated podcast. Must be one of:
            short - produces podcasts shorter than 3 minutes.
            default - produces podcasts roughly between 3-7 minutes.
            long - prodces podcasts longer than 7 minutes.


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

        highlights : typing.Optional[typing.Sequence[str]]
            A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters.

        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

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

        Returns
        -------
        PodcastProjectResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import (
            ElevenLabs,
            PodcastConversationModeData,
            PodcastTextSource,
        )
        from elevenlabs.projects import (
            BodyCreatePodcastV1ProjectsPodcastCreatePostMode_Conversation,
        )

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.create_podcast(
            model_id="21m00Tcm4TlvDq8ikWAM",
            mode=BodyCreatePodcastV1ProjectsPodcastCreatePostMode_Conversation(
                conversation=PodcastConversationModeData(
                    host_voice_id="aw1NgEzBg83R7vgmiJt6",
                    guest_voice_id="aw1NgEzBg83R7vgmiJt7",
                ),
            ),
            source=PodcastTextSource(
                text="This is a test podcast.",
            ),
        )
        v1/projects/podcast/createPOSTwriteobject_
annotation	directionr8   r9   r:   r2   r3   r4   r5   r6   content-typeapplication/jsonmethodjsonheadersr7   omit   ,  type_rA     status_codebodyr*   httpx_clientrequestr   r   r   OMITrR   typingcastr   r   rI   r   r   r   r   textr,   r8   r9   r:   r2   r3   r4   r5   r6   r7   	_response_response_jsons               r-   create_podcastzProjectsClient.create_podcast8   sO   l ((55==($? -]ip B"/amt #1"0$( ,  2 ,+ > 
	.	Si++1c1{{/"9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD! +AD! !+Er7   c          
      :   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	a  
        Returns a list of your projects together and its 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.projects.get_projects()
        v1/projectsGETrH   r7   rL   rM   rN   rP   rQ   r*   rU   rV   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   r7   r\   r]   s       r-   get_projectszProjectsClient.get_projects   s    . ((55==+ > 
	
	Si++1c1{{'"1 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC/ 9AC/ /+Dfrom_urlfrom_documentr2   titleauthordescriptiongenrestarget_audiencer4   content_typeoriginal_publication_datemature_contentisbn_numberacx_volume_normalizationvolume_normalization!pronunciation_dictionary_locatorsfictionapply_text_normalizationauto_convertauto_assign_voicesr7   namedefault_title_voice_iddefault_paragraph_voice_iddefault_model_idrh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   c                   | j                   j                  j                  d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  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)aW  
        Creates a new 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[AddProjectV1ProjectsAddPostRequestTargetAudience]
            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.

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

        apply_text_normalization : typing.Optional[AddProjectV1ProjectsAddPostRequestApplyTextNormalization]

                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.

        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.projects.add_project(
            name="name",
            default_title_voice_id="default_title_voice_id",
            default_paragraph_voice_id="default_paragraph_voice_id",
            default_model_id="default_model_id",
        )
        v1/projects/addr>   rz   r{   r|   r}   rh   r2   rj   rk   rl   rm   rn   r4   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   ri   rH   datafilesr7   rK   rL   rM   rN   rP   rQ   r*   rU   rV   rW   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   rz   r{   r|   r}   rh   ri   r2   rj   rk   rl   rm   rn   r4   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   r7   r\   r]   s                               r-   add_projectzProjectsClient.add_project   s   T ((55==(*@ -.H #$4	
 H !.  & { & "? H  ,-F !.  {!" +,D#$ )=5V",D ,&8/4   ,A > !
	D	Si++1c1{{+"5 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   /AD4 >AD4 4+E
project_idc          
      R   | j                   j                  j                  dt        |       d|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	a  
        Returns information about a specific project. This endpoint returns more detailed information about a project than `GET /v1/projects`.

        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.projects.get_project_by_id(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        v1/projects/rb   rc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   r   r7   r\   r]   s        r-   get_project_by_idz ProjectsClient.get_project_by_id  s   < ((55==+J789+ > 
	
	Si++1c1{{0": ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AC; AC; ;+D&rj   rk   rr   rt   r7   c                t   | j                   j                  j                  dt        |       d|||||||dddi|	t              }
	 d|
j
                  cxk  rdk  r:n n7t        j                  t        t        t        |
j                         	            S |
j
                  d
k(  r@t        t        j                  t        t        t        |
j                         	                  |
j                         }t        |
j
                  |      # t        $ r" t        |
j
                  |
j                        w xY w)a  
        Edits basic project info.

        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.projects.edit_basic_project_info(
            project_id="21m00Tcm4TlvDq8ikWAM",
            name="Project 1",
            default_title_voice_id="21m00Tcm4TlvDq8ikWAM",
            default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r>   rz   r{   r|   rj   rk   rr   rt   rE   rF   rG   rL   rM   rN   rP   rQ   r*   rU   rV   r   rW   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   r   rz   r{   r|   rj   rk   rr   rt   r7   r\   r]   s               r-   edit_basic_project_infoz&ProjectsClient.edit_basic_project_info  s9   @ ((55==+J789*@.H *(<  2 ,! > 
	$	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD AD +D7c          
         | j                   j                  j                  dt        |       d|      }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	aT  
        Deletes a project.

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

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.delete_project(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   DELETErc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   OptionalAnyr   rI   r   r   r   r   rZ   r   s        r-   delete_projectzProjectsClient.delete_projectZ  s&   < ((55==+J789+ > 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   BD1 ;AD1 1+Erh   ri   rx   r7   c          
      l   | j                   j                  j                  dt        |       dd||dd|i|t              }	 d|j
                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j
                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t        |j
                  |      # t        $ r" t        |j
                  |j                        w xY w)aO  
        Edits 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.projects.edit_project_content(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   /contentr>   rh   rx   ri   r   rL   rM   rN   rP   rQ   r   r,   r   rh   ri   rx   r7   r\   r]   s           r-   edit_project_contentz#ProjectsClient.edit_project_content  s+   Z ((55==+J78A$ ,
   , > 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   AD AD +D3c          
         | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
az  
        Starts conversion of a 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
        -------
        typing.Optional[typing.Any]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.convert_project(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   /convertr>   rc   rL   rM   rN   rP   rQ   r   r   s        r-   convert_projectzProjectsClient.convert_project  s(   < ((55==+J78A+ > 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   BD2 <AD2 2+Ec          
      T   | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
af  
        Gets the snapshots of a 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.projects.get_project_snapshots(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   
/snapshotsrb   rc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r   s        r-   get_project_snapshotsz$ProjectsClient.get_project_snapshots"  s   < ((55==+J78
C+ > 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   AC< AC< <+D'convert_to_mpegr7   project_snapshot_idr   c             #     K   | j                   j                  j                  dt        |       dt        |       ddd|iddi|t              5 }	 d	|j
                  cxk  rd
k  r>n n;||j                  dd      nd}|j                  |      D ]  }|  	 ddd       y|j                          |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t!        |j
                  |      # t        $ r" t!        |j
                  |j"                        w xY w# 1 sw Y   yxY ww)a  
        Stream the audio from a 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. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Yields
        ------
        typing.Iterator[bytes]
            Successful Response
        r   /snapshots//streamr>   r   rE   rF   rG   rL   rM   N
chunk_size   r   rP   rN   rQ   )r*   rU   streamr   rW   rR   get
iter_bytesreadr   rX   rY   r   r   rI   r   r   rZ   	r,   r   r   r   r7   r\   _chunk_size_chunkr]   s	            r-   stream_project_audioz#ProjectsClient.stream_project_audio]  s~    < !!..55+J78DTUhDiCjjqr!?  2 , 6 
  	S W)//5#5M\Mh/"5"5lD"InrK"+"6"6+"6"N %$%# 	S  	S$  ((C/2/*&9(1(8  "+!1 y'<'<>RR # W9+@+@y~~VVW= 	S  	Ss>   AE$EA	D*	E$$A/D*E*+EEE!E$c          
         | j                   j                  j                  dt        |       dt        |       dd|      }	 d|j                  cxk  rdk  ry |j                  d	k(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)a  
        Streams archive with project 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.

        Returns
        -------
        None

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.streams_archive_with_project_audio(
            project_id="21m00Tcm4TlvDq8ikWAM",
            project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   /archiver>   rc   rL   rM   NrP   rN   rQ   r*   rU   rV   r   rR   r   rX   rY   r   r   rI   r   r   rZ   r,   r   r   r7   r\   r]   s         r-   "streams_archive_with_project_audioz1ProjectsClient.streams_archive_with_project_audio  s    B ((55==+J78DTUhDiCjjrs+ > 
	
	Si++1c1 2$$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   C A C +C;c          
      T   | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a  
        Returns a list of your chapters for a project together and its metadata.

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

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

        Returns
        -------
        GetChaptersResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.get_chapters(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   	/chaptersrb   rc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r   s        r-   get_chapterszProjectsClient.get_chapters  s   < ((55==+J78	B+ > 
	
	Si++1c1{{'"1 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   
chapter_idc          
      j   | j                   j                  j                  dt        |       dt        |       d|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a  
        Returns information about a specific chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        ChapterWithContentResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.get_chapter_by_id(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   
/chapters/rb   rc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   r   r   r7   r\   r]   s         r-   get_chapter_by_idz ProjectsClient.get_chapter_by_id  s   D ((55==+J78
CST^C_B`a+ > 
	
	Si++1c1{{3"= ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD AD +D2c          
         | j                   j                  j                  dt        |       dt        |       d|      }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      # t        $ r" t        |j                  |j                  	      w xY w)
a  
        Deletes a chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.delete_chapter(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   r   rc   rL   rM   rN   rP   rQ   r   r   s         r-   delete_chapterzProjectsClient.delete_chapterO  s5   D ((55==+J78
CST^C_B`a+ > 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   BD= AD= =+E(rz   contentr7   r   c          
         | j                   j                  j                  dt        |       dt        |       d|t	        |t
        d      dddi|t        	      }	 d
|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)a  
        Edits a chapter.

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

        chapter_id : str
            The ID of the chapter.

        name : typing.Optional[str]
            The name of the chapter, used for identification only.

        content : typing.Optional[ChapterContentInputModel]
            The chapter content to use.

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

        Returns
        -------
        EditChapterResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.edit_chapter(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   PATCHr?   r@   rz   r   rE   rF   rG   rL   rM   rN   rP   rQ   r*   rU   rV   r   r   r   rW   rR   rX   rY   r   r   rI   r   r   r   r   rZ   r,   r   r   rz   r   r7   r\   r]   s           r-   edit_chapterzProjectsClient.edit_chapter  sF   \ ((55==+J78
CST^C_B`aB#0HT[  2 , > 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   AD# -AD# #+Erh   r7   c          
      l   | j                   j                  j                  dt        |       dd||dddi|t              }	 d|j
                  cxk  rd	k  r:n n7t        j                  t        t        t        |j                         
            S |j
                  dk(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t        |j
                  |      # t        $ r" t        |j
                  |j                        w xY w)a
  
        Creates a new chapter either as blank or from a URL.

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

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

        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.

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

        Returns
        -------
        AddChapterResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.add_chapter_to_a_project(
            project_id="21m00Tcm4TlvDq8ikWAM",
            name="Chapter 1",
        )
        r   /chapters/addr>   rz   rh   rE   rF   rG   rL   rM   rN   rP   rQ   r*   rU   rV   r   rW   rR   rX   rY   r    r   rI   r   r   r   r   rZ   r,   r   rz   rh   r7   r\   r]   s          r-   add_chapter_to_a_projectz'ProjectsClient.add_chapter_to_a_project  s,   T ((55==+J78F$
  2 , > 
		Si++1c1{{+"5 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   c          
         | j                   j                  j                  dt        |       dt        |       dd|      }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      # t        $ r" t        |j                  |j                  
      w xY w)a  
        Starts conversion of a specific chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.convert_chapter(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   r   r>   rc   rL   rM   rN   rP   rQ   r   r   s         r-   convert_chapterzProjectsClient.convert_chapter2  s8   D ((55==+J78
CST^C_B``hi+ > 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   BD> AD> >+E)c          
      l   | j                   j                  j                  dt        |       dt        |       dd|      }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      # t        $ r" t        |j                  |j                  
      w xY w)a]  
        Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        ChapterSnapshotsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.list_chapter_snapshots(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   r   rb   rc   rL   rM   rN   rP   rQ   r*   rU   rV   r   rR   rX   rY   r!   r   rI   r   r   r   r   rZ   r   s         r-   list_chapter_snapshotsz%ProjectsClient.list_chapter_snapshotsq  s   D ((55==+J78
CST^C_B``jk+ > 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   chapter_snapshot_idc          
      *   | j                   j                  j                  dt        |       dt        |       dt        |       ddd|iddi|t        	      }	 d
|j
                  cxk  rdk  ry |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j
                  |      # t        $ r" t        |j
                  |j                        w xY w)a	  
        Stream the audio from a chapter snapshot. Use `GET /v1/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the chapter snapshots of a chapter.

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

        chapter_id : str
            The ID of the chapter.

        chapter_snapshot_id : str
            The ID of the chapter 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.projects.stream_chapter_audio(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
            chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   r   r   r>   r   rE   rF   rG   rL   rM   NrP   rN   rQ   r*   rU   rV   r   rW   rR   r   rX   rY   r   r   rI   r   r   rZ   r,   r   r   r   r   r7   r\   r]   s           r-   stream_chapter_audioz#ProjectsClient.stream_chapter_audio  s9   \ ((55==+J78
CST^C_B``kl|  ~Q  mR  lS  SZ  [!?  2 , > 
		Si++1c1 2$$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   C' 0A C' '+Dinvalidate_affected_textr7   r   c          
         | j                   j                  j                  dt        |       ddt	        |t
        j                  t           d      |dddi|t        	      }	 d
|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t         t        t         |j                                           |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)ay  
        Updates the 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
        -------
        typing.Optional[typing.Any]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.projects.update_pronunciation_dictionaries(
            project_id="21m00Tcm4TlvDq8ikWAM",
            pronunciation_dictionary_locators=[
                PronunciationDictionaryVersionLocator(
                    pronunciation_dictionary_id="pronunciation_dictionary_id",
                    version_id="version_id",
                )
            ],
        )
        r   "/update-pronunciation-dictionariesr>   r?   r@   ru   r   rE   rF   rG   rL   rM   rN   rP   rQ   r*   rU   rV   r   r   rX   Sequencer"   rW   rR   rY   r   r   r   rI   r   r   r   r   rZ   r,   r   ru   r   r7   r\   r]   s          r-   !update_pronunciation_dictionariesz0ProjectsClient.update_pronunciation_dictionaries  sb   ^ ((55==+J788Z[5\=%/TU%6
 -E  2 , > 
	"	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   $BE )AE +F
):__name__
__module____qualname__r   r.   rW   strr   r   rX   r   r   r	   r   r
   r   r^   r   rf   r   FileListr   boolr   r   r   r   r   r   r   r   r   r   r   r   r   r   Iteratorbytesr   r   r   r   r   r   r   r   r   r   r    r   r   r!   r   r   r"   r    r0   r-   r%   r%   4   s
	   .*; . fjei)-<@-1;?CO CO ?	CO
 CCO (abCO (abCO //#&CO OOFOOC$89CO ooc*CO  8CO 
%COJ RV 2Ov~/N 2OZm 2Ov *.48/3&*'+,048]a)--1:>04,0:>6:OSNRnr.248;?7BO BO !$	BO
 %(BO BO //#&BO tyy1BO ,BO s#BO $BO __S)BO C 01BO  )YZBO //#&BO  ooc*!BO" $*??3#7#BO$ -%BO& __S)'BO( #)//$"7)BO* %ood3+BO, ,2??6;;s;K+L-BO. !JK/BO0 #)//2j"k1BO2 ood+3BO4 #OOD15BO6  87BO8 
!9BOJ VZ9O9O39??>3R9O	%9OD '+'+,06:;?hOhO 	hO
 !$hO %(hO s#hO $hO __S)hO %ood3hO  8hO 
"hOV VZ9O9O39??>3R9O		$9O~ *.48.2;?POPO //#&	PO
 tyy1PO ood+PO  8PO 
"POf VZ9O9O39??>3R9O		$9Ox VZ9O9O39??>3R9O	!9O@ 26;?>S>S !>S
  .>S  8>S 
	>SB pt6O6O476OMS__]kMl6O	6Or VZ9O9O39??>3R9O	9Ox gk=O=O+.=ODJOOTbDc=O	(=O@ gk=O=O+.=ODJOOTbDc=O		$=OH &*=A;?SOSO SO
 ooc"SO !9:SO  8SO 
"SOt *.;?MOMO 	MO
 //#&MO  8MO 
!MO` gk=O=O+.=ODJOOTbDc=O		$=O@ gk=O=O+.=ODJOOTbDc=O	!=OJ 26;?JOJO JO !	JO  .JO  8JO 
JOb ;?;?VOVO ,2??;`+a	VO
 #)//$"7VO  8VO 
	$VOr0   r%   c            5       
   e Zd ZdefdZeeeeedddeded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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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f4d)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	j                  e	j@                     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d0Z"ddd*ede	j                  e   de	j                  e	j@                     fd1Z#ddd*ede	j                  e   de$fd2Z%edd3d*ed4ed5e	j                  e   de	j                  e   de	jL                  e'   f
d6Z(ddd*ed4ede	j                  e   ddfd7Z)ddd*ede	j                  e   de*fd8Z+ddd*ed9ede	j                  e   de,fd:Z-ddd*ed9ede	j                  e   de	j                  e	j@                     fd;Z.eedd<d*ed9ede	j                  e   d=e	j                  e/   de	j                  e   de0fd>Z1edd?d*edede	j                  e   de	j                  e   de2f
d@Z3ddd*ed9ede	j                  e   de	j                  e	j@                     fdAZ4ddd*ed9ede	j                  e   de5fdBZ6edd3d*ed9edCed5e	j                  e   de	j                  e   ddfdDZ7eddEd*ed$e	j                  e8   dFe	j                  e   de	j                  e   de	j                  e	j@                     f
dGZ9y)HAsyncProjectsClientr&   c                    || _         y r(   r)   r+   s     r-   r.   zAsyncProjectsClient.__init__V  r/   r0   Nr1   r8   r9   r:   r2   r3   r4   r5   r6   r7   r;   c       	           K   | j                   j                  j                  dd|t        |t        d      t        |t
        d      |||||dddi|	t               d	{   }
	 d
|
j                  cxk  rdk  r:n n7t        j                  t        t        t        |
j                                     S |
j                  dk(  r@t        t        j                  t        t        t        |
j                                           |
j                         }t!        |
j                  |      7 # t        $ r" t!        |
j                  |
j"                        w xY ww)aZ  
        Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs.

        Parameters
        ----------
        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.

        mode : BodyCreatePodcastV1ProjectsPodcastCreatePostMode
            The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue.

        source : BodyCreatePodcastV1ProjectsPodcastCreatePostSource
            The source content for the Podcast.

        quality_preset : typing.Optional[BodyCreatePodcastV1ProjectsPodcastCreatePostQualityPreset]
            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%.


        duration_scale : typing.Optional[BodyCreatePodcastV1ProjectsPodcastCreatePostDurationScale]
            Duration of the generated podcast. Must be one of:
            short - produces podcasts shorter than 3 minutes.
            default - produces podcasts roughly between 3-7 minutes.
            long - prodces podcasts longer than 7 minutes.


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

        highlights : typing.Optional[typing.Sequence[str]]
            A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters.

        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

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

        Returns
        -------
        PodcastProjectResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import (
            AsyncElevenLabs,
            PodcastConversationModeData,
            PodcastTextSource,
        )
        from elevenlabs.projects import (
            BodyCreatePodcastV1ProjectsPodcastCreatePostMode_Conversation,
        )

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.create_podcast(
                model_id="21m00Tcm4TlvDq8ikWAM",
                mode=BodyCreatePodcastV1ProjectsPodcastCreatePostMode_Conversation(
                    conversation=PodcastConversationModeData(
                        host_voice_id="aw1NgEzBg83R7vgmiJt6",
                        guest_voice_id="aw1NgEzBg83R7vgmiJt7",
                    ),
                ),
                source=PodcastTextSource(
                    text="This is a test podcast.",
                ),
            )


        asyncio.run(main())
        r=   r>   r?   r@   rD   rE   rF   rG   NrL   rM   rN   rP   rQ   rT   r[   s               r-   r^   z"AsyncProjectsClient.create_podcastY  s_    | ..;;CC($? -]ip B"/amt #1"0$( ,  2 ,+ D 
 
	.	Si++1c1{{/"9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN[
V  	Sy'<'<9>>RR	Ss8   AE D+!E&AD- 4E5AD- E-+EEr_   c          
      V  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
ad  
        Returns a list of your projects together and its 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.projects.get_projects()


        asyncio.run(main())
        ra   rb   rc   NrL   rM   rN   rP   rQ   rd   re   s       r-   rf   z AsyncProjectsClient.get_projects  s    > ..;;CC+ D 
 
	
	Si++1c1{{'"1 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss4   ,D)C9D)AC; D)AC; "D);+D&&D)rg   rz   r{   r|   r}   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   c                  K   | j                   j                  j                  ddi d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|||||||dd|i|t               d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)a  
        Creates a new 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[AddProjectV1ProjectsAddPostRequestTargetAudience]
            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.

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

        apply_text_normalization : typing.Optional[AddProjectV1ProjectsAddPostRequestApplyTextNormalization]

                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.

        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.projects.add_project(
                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   r>   rz   r{   r|   r}   rh   r2   rj   rk   rl   rm   rn   r4   ro   rp   rq   rr   rs   r   ri   r   NrL   rM   rN   rP   rQ   r   r   s                               r-   r   zAsyncProjectsClient.add_project"  s    d ..;;CC(*@ -.H #$4	
 H !.  & { & "? H  ,-F !.  {!" +,D#$ )=5V",D ,&8/4   ,A D !
 !
	D	Si++1c1{{+"5 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNq!
l  	Sy'<'<9>>RR	Ss8   A1E.3D>4E.9AE  E.AE  'E. +E++E.r   c          
      n  K   | j                   j                  j                  dt        |       d|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
aB  
        Returns information about a specific project. This endpoint returns more detailed information about a project than `GET /v1/projects`.

        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.projects.get_project_by_id(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   rb   rc   NrL   rM   rN   rP   rQ   r   r   s        r-   r   z%AsyncProjectsClient.get_project_by_id  s    L ..;;CC+J789+ D 
 
	
	Si++1c1{{0": ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss5   8D5DD5 AD D5AD .D5+D22D5r   c                  K   | j                   j                  j                  dt        |       d|||||||dddi|	t               d{   }
	 d|
j
                  cxk  rd	k  r:n n7t        j                  t        t        t        |
j                         
            S |
j
                  dk(  r@t        t        j                  t        t        t        |
j                         
                  |
j                         }t        |
j
                  |      7 # t        $ r" t        |
j
                  |
j                        w xY ww)a  
        Edits basic project info.

        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.projects.edit_basic_project_info(
                project_id="21m00Tcm4TlvDq8ikWAM",
                name="Project 1",
                default_title_voice_id="21m00Tcm4TlvDq8ikWAM",
                default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   r>   r   rE   rF   rG   NrL   rM   rN   rP   rQ   r   r   s               r-   r   z+AsyncProjectsClient.edit_basic_project_info1  sI    P ..;;CC+J789*@.H *(<  2 ,! D 
 
	$	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNQ
L  	Sy'<'<9>>RR	Ss8   A	EDEAD E AD ?E+EEc          
        K   | j                   j                  j                  dt        |       d|       d{   }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
a  
        Deletes a project.

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

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   rc   NrL   rM   rN   rP   rQ   r   r   s        r-   r   z"AsyncProjectsClient.delete_project  s5    L ..;;CC+J789+ D 
 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss5   8E,D;E, BD> E,AD> $E,>+E))E,r   c          
        K   | j                   j                  j                  dt        |       dd||dd|i|t               d{   }	 d|j
                  cxk  rd	k  r:n n7t        j                  t        t        t        |j                         
            S |j
                  dk(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t        |j
                  |      7 # t        $ r" t        |j
                  |j                        w xY ww)a  
        Edits 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.projects.edit_project_content(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   r   r>   r   ri   r   NrL   rM   rN   rP   rQ   r   r   s           r-   r   z(AsyncProjectsClient.edit_project_content  s;    j ..;;CC+J78A$ ,
   , D 
 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNG
B  	Sy'<'<9>>RR	S8   AEDEAD EAD ;E+D??Ec          
        K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Starts conversion of a 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
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r>   rc   NrL   rM   rN   rP   rQ   r   r   s        r-   r   z#AsyncProjectsClient.convert_project@	  s7    L ..;;CC+J78A+ D 
 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss5   9E-D<E-BD? E-AD? %E-?+E**E-c          
      p  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Gets the snapshots of a 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.projects.get_project_snapshots(
                project_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   r   rb   rc   NrL   rM   rN   rP   rQ   r   r   s        r-   r   z)AsyncProjectsClient.get_project_snapshots	  s    L ..;;CC+J78
C+ D 
 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	S5   9D6DD6AD D6AD /D6+D33D6r   r   r   c               *  K   | j                   j                  j                  dt        |       dt        |       ddd|iddi|t              4 d	{   }	 d
|j
                  cxk  rdk  r:n n7||j                  dd      nd}|j                  |      2 3 d	{   }| |j                          d	{    |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t!        |j
                  |      7 7 6 	 d	d	d	      d	{  7   y	7 # t        $ r" t!        |j
                  |j"                        w xY w# 1 d	{  7  sw Y   y	xY ww)a  
        Stream the audio from a 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. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Yields
        ------
        typing.AsyncIterator[bytes]
            Successful Response
        r   r   r   r>   r   rE   rF   rG   NrL   rM   r   r   r   rP   rN   rQ   )r*   rU   r   r   rW   rR   r   aiter_bytesareadr   rX   rY   r   r   rI   r   r   rZ   r   s	            r-   r   z(AsyncProjectsClient.stream_project_audio	  s    < ''44;;+J78DTUhDiCjjqr!?  2 , < 
  	S  	S W)//5#5M\Mh/"5"5lD"InrK(1(=(=(=(U % %f$oo'''((C/2/*&9(1(8  "+!1 y'<'<>RRA 	S%(U# 	S  	S  	S$ ( # W9+@+@y~~VVW= 	S  	S  	Ss   AFD6FE>A ED:D8D:!E;E<A#EE>6F8D::E<FE
FE+E;;E>>FFFFc          
        K   | j                   j                  j                  dt        |       dt        |       dd|       d{   }	 d|j                  cxk  rdk  ry |j                  d	k(  r@t        t        j                  t        t        t        |j                         
                  |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)aJ  
        Streams archive with project 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.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r   r>   rc   NrL   rM   rP   rN   rQ   r   r   s         r-   r   z6AsyncProjectsClient.streams_archive_with_project_audio
  s	    R ..;;CC+J78DTUhDiCjjrs+ D 
 
	
	Si++1c1 2$$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN+
&  	Sy'<'<9>>RR	Ss7   AD
CD
C "D
#A C D
+DD
c          
      p  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a  
        Returns a list of your chapters for a project together and its metadata.

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

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

        Returns
        -------
        GetChaptersResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   rb   rc   NrL   rM   rN   rP   rQ   r   r   s        r-   r   z AsyncProjectsClient.get_chaptersF
  s    L ..;;CC+J78	B+ D 
 
	
	Si++1c1{{'"1 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Sr  r   c          
        K   | j                   j                  j                  dt        |       dt        |       d|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a\  
        Returns information about a specific chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        ChapterWithContentResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   rb   rc   NrL   rM   rN   rP   rQ   r   r   s         r-   r   z%AsyncProjectsClient.get_chapter_by_id
  s)    T ..;;CC+J78
CST^C_B`a+ D 
 
	
	Si++1c1{{3"= ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss8   AEDEAD EAD :E+D>>Ec          
        K   | j                   j                  j                  dt        |       dt        |       d|       d{   }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  d	k(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j                  |
      7 # t        $ r" t        |j                  |j                  
      w xY ww)a:  
        Deletes a chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r   rc   NrL   rM   rN   rP   rQ   r   r   s         r-   r   z"AsyncProjectsClient.delete_chapter
  sC    T ..;;CC+J78
CST^C_B`a+ D 
 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss8   AE8EE8BE
 E8AE
 0E8
+E55E8r   r   c          
        K   | j                   j                  j                  dt        |       dt        |       d|t	        |t
        d      dddi|t        	       d
{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                                     S |j                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)a   
        Edits a chapter.

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

        chapter_id : str
            The ID of the chapter.

        name : typing.Optional[str]
            The name of the chapter, used for identification only.

        content : typing.Optional[ChapterContentInputModel]
            The chapter content to use.

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

        Returns
        -------
        EditChapterResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r   r?   r@   r   rE   rF   rG   NrL   rM   rN   rP   rQ   r   r   s           r-   r   z AsyncProjectsClient.edit_chapter  sV    l ..;;CC+J78
CST^C_B`aB#0HT[  2 , D 
 
		Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNK
F  	Sy'<'<9>>RR	Ss8   A E"D-#E(AD/ 6E7AD/ E/+EEr   c          
        K   | j                   j                  j                  dt        |       dd||dddi|t               d{   }	 d	|j
                  cxk  rd
k  r:n n7t        j                  t        t        t        |j                                     S |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j
                  |      7 # t        $ r" t        |j
                  |j                        w xY ww)a  
        Creates a new chapter either as blank or from a URL.

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

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

        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.

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

        Returns
        -------
        AddChapterResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.add_chapter_to_a_project(
                project_id="21m00Tcm4TlvDq8ikWAM",
                name="Chapter 1",
            )


        asyncio.run(main())
        r   r   r>   r   rE   rF   rG   NrL   rM   rN   rP   rQ   r   r   s          r-   r   z,AsyncProjectsClient.add_chapter_to_a_projectt  s<    d ..;;CC+J78F$
  2 , D 
 
		Si++1c1{{+"5 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNG
B  	Sy'<'<9>>RR	Sr   c          
        K   | j                   j                  j                  dt        |       dt        |       dd|       d{   }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                         	            S |j                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)aQ  
        Starts conversion of a specific chapter.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r   r>   rc   NrL   rM   rN   rP   rQ   r   r   s         r-   r   z#AsyncProjectsClient.convert_chapter  sF    T ..;;CC+J78
CST^C_B``hi+ D 
 
	
	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Ss8   AE9EE9BE E9AE 1E9+E66E9c          
        K   | j                   j                  j                  dt        |       dt        |       dd|       d{   }	 d|j                  cxk  rdk  r:n n7t        j                  t        t        t        |j                         	            S |j                  d
k(  r@t        t        j                  t        t        t        |j                         	                  |j                         }t        |j                  |      7 # t        $ r" t        |j                  |j                        w xY ww)a  
        Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created.

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

        chapter_id : str
            The ID of the chapter.

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

        Returns
        -------
        ChapterSnapshotsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r   rb   rc   NrL   rM   rN   rP   rQ   r   r   s         r-   r   z*AsyncProjectsClient.list_chapter_snapshots  s,    T ..;;CC+J78
CST^C_B``jk+ D 
 
	
	Si++1c1{{,"6 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	Sr   r   c          
      F  K   | j                   j                  j                  dt        |       dt        |       dt        |       ddd|iddi|t        	       d
{   }	 d|j
                  cxk  rdk  ry
 |j
                  dk(  r@t        t        j                  t        t        t        |j                                           |j                         }t        |j
                  |      7 # t        $ r" t        |j
                  |j                        w xY ww)a  
        Stream the audio from a chapter snapshot. Use `GET /v1/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the chapter snapshots of a chapter.

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

        chapter_id : str
            The ID of the chapter.

        chapter_snapshot_id : str
            The ID of the chapter 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.projects.stream_chapter_audio(
                project_id="21m00Tcm4TlvDq8ikWAM",
                chapter_id="21m00Tcm4TlvDq8ikWAM",
                chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   r   r   r   r>   r   rE   rF   rG   NrL   rM   rP   rN   rQ   r   r   s           r-   r   z(AsyncProjectsClient.stream_chapter_audioY  sG    l ..;;CC+J78
CST^C_B``kl|  ~Q  mR  lS  SZ  [!?  2 , D 
 
		Si++1c1 2$$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN9
4  	Sy'<'<9>>RR	Ss7   AD!C1D!$C3 9D!:A C3 D!3+DD!r   r   c          
      8  K   | j                   j                  j                  dt        |       ddt	        |t
        j                  t           d      |dddi|t        	       d
{   }	 d|j                  cxk  rdk  rpn nmt        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |j                                     S |j                  dk(  r@t        t        j                  t         t        t         |j                                           |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a	  
        Updates the 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
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, PronunciationDictionaryVersionLocator

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   r   r>   r?   r@   r   rE   rF   rG   NrL   rM   rN   rP   rQ   r   r   s          r-   r   z5AsyncProjectsClient.update_pronunciation_dictionaries  sr    n ..;;CC+J788Z[5\=%/TU%6
 -E  2 , D 
 
	"	Si++1c1{{OOFJJ/"$oofjj9 ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NNO
J  	Sy'<'<9>>RR	Ss8   A&F(E))F.BE, 2F3AE, F,+FF):r   r   r   r#   r.   rW   r   r   r   rX   r   r   r	   r   r
   r   r^   r   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   AsyncIteratorr   r   r   r   r   r   r   r   r   r   r   r    r   r   r!   r   r   r"   r   r   r0   r-   r   r   U  s4	   .*< . fjei)-<@-1;?KO KO ?	KO
 CKO (abKO (abKO //#&KO OOFOOC$89KO ooc*KO  8KO 
%KOZ X\ :OV__^5T :O`s :OF *.48/3&*'+,048]a)--1:>04,0:>6:OSNRnr.248;?7JO JO !$	JO
 %(JO JO //#&JO tyy1JO ,JO s#JO $JO __S)JO C 01JO  )YZJO //#&JO  ooc*!JO" $*??3#7#JO$ -%JO& __S)'JO( #)//$"7)JO* %ood3+JO, ,2??6;;s;K+L-JO. !JK/JO0 #)//2j"k1JO2 ood+3JO4 #OOD15JO6  87JO8 
!9JOZ VZAOAO39??>3RAO	%AOT '+'+,06:;?pOpO 	pO
 !$pO %(pO s#pO $pO __S)pO %ood3pO  8pO 
"pOf VZAOAO39??>3RAO		$AON *.48.2;?XOXO //#&	XO
 tyy1XO ood+XO  8XO 
"XOv VZAOAO39??>3RAO		$AOH VZAOAO39??>3RAO	!AOP 26;?>S>S !>S
  .>S  8>S 
		e	$>SB pt>O>O47>OMS__]kMl>O	>OB VZAOAO39??>3RAO	AOH gkEOEO+.EODJOOTbDcEO	(EOP gkEOEO+.EODJOOTbDcEO		$EOX &*=A;?[O[O [O
 ooc"[O !9:[O  8[O 
"[OD *.;?UOUO 	UO
 //#&UO  8UO 
!UOp gkEOEO+.EODJOOTbDcEO		$EOP gkEOEO+.EODJOOTbDcEO	!EOZ 26;?RORO RO !	RO  .RO  8RO 
ROr ;?;?^O^O ,2??;`+a	^O
 #)//$"7^O  8^O 
	$^Or0   r   )CrX   core.client_wrapperr   ?types.body_create_podcast_v_1_projects_podcast_create_post_moder   Atypes.body_create_podcast_v_1_projects_podcast_create_post_sourcer   Itypes.body_create_podcast_v_1_projects_podcast_create_post_quality_presetr   Itypes.body_create_podcast_v_1_projects_podcast_create_post_duration_scaler	   core.request_optionsr
   $types.podcast_project_response_modelr   core.serializationr   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.http_validation_errorr   json.decoderr   core.api_errorr   types.get_projects_responser    r   ?types.add_project_v_1_projects_add_post_request_target_audiencer   7types.add_project_v_1_projects_add_post_request_fictionr   Htypes.add_project_v_1_projects_add_post_request_apply_text_normalizationr    types.add_project_response_modelr   %types.project_extended_response_modelr   core.jsonable_encoderr   !types.edit_project_response_modelr    types.project_snapshots_responser   types.get_chapters_responser   )types.chapter_with_content_response_modelr   !types.chapter_content_input_modelr   !types.edit_chapter_response_modelr    types.add_chapter_response_modelr     types.chapter_snapshots_responser!   .types.pronunciation_dictionary_version_locatorr"   r#   rY   r   rW   r%   r   r   r0   r-   <module>r0     s     3 2 N H 6 H = ( % =  o G P 4 H G = W H H F G b 4 v{{6::s#^O ^OB1vO vOr0   