diff --git a/poetry.lock b/poetry.lock index 40eac025..e95daa8c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -186,13 +186,13 @@ files = [ [[package]] name = "httpcore" -version = "1.0.7" +version = "1.0.8" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, - {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, + {file = "httpcore-1.0.8-py3-none-any.whl", hash = "sha256:5254cf149bcb5f75e9d1b2b9f729ea4a4b883d1ad7379fc632b727cec23674be"}, + {file = "httpcore-1.0.8.tar.gz", hash = "sha256:86e94505ed24ea06514883fd44d2bc02d90e77e7979c8eb71b90f41d364a1bad"}, ] [package.dependencies] @@ -683,13 +683,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.13.0" +version = "4.13.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.13.0-py3-none-any.whl", hash = "sha256:c8dd92cc0d6425a97c18fbb9d1954e5ff92c1ca881a309c45f06ebc0b79058e5"}, - {file = "typing_extensions-4.13.0.tar.gz", hash = "sha256:0a4ac55a5820789d87e297727d229866c9650f6521b64206413c4fbada24d95b"}, + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 07adb9f4..223f664a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "elevenlabs" [tool.poetry] name = "elevenlabs" -version = "1.56.1" +version = "1.57.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 93e407aa..16d14a0a 100644 --- a/reference.md +++ b/reference.md @@ -1626,6 +1626,14 @@ Defaults to None.
+**file_format:** `typing.Optional[SpeechToSpeechConvertRequestFileFormat]` — The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + +
+
+ +
+
+ **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.
@@ -1773,6 +1781,14 @@ Defaults to None.
+**file_format:** `typing.Optional[SpeechToSpeechConvertAsStreamRequestFileFormat]` — The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + +
+
+ +
+
+ **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.
@@ -2591,6 +2607,14 @@ client.voices.search(
+**collection_id:** `typing.Optional[str]` — Collection ID to filter voices by. + +
+
+ +
+
+ **include_total_count:** `typing.Optional[bool]` — Whether to include the total count of voices found in the response. Incurs a performance cost.
@@ -2973,10304 +2997,3 @@ client.voices.edit_settings(
client.voices.add(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add a new voice to your collection of voices in VoiceLab. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.add( - name="Alex", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.List[core.File]` — See core.File for more documentation - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the voice. - -
-
- -
-
- -**labels:** `typing.Optional[str]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.edit(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edit a voice created by you. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.edit( - voice_id="VOICE_ID", - name="George", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.Optional[typing.List[core.File]]` — See core.File for more documentation - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the voice. - -
-
- -
-
- -**labels:** `typing.Optional[str]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.add_sharing_voice(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add a shared voice to your collection of voices. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.add_sharing_voice( - public_user_id="63e84100a6bf7874ba37a1bab9a31828a379ec94b891b401653b655c5110880f", - voice_id="sB1b5zUrxQVAFl2PhZFp", - new_name="Alita", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**public_user_id:** `str` — Public user ID used to publicly identify ElevenLabs users. - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**new_name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.get_shared(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a list of shared voices. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_shared( - page_size=1, - gender="female", - language="en", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many shared voices to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**category:** `typing.Optional[VoicesGetSharedRequestCategory]` — Voice category used for filtering - -
-
- -
-
- -**gender:** `typing.Optional[str]` — Gender used for filtering - -
-
- -
-
- -**age:** `typing.Optional[str]` — Age used for filtering - -
-
- -
-
- -**accent:** `typing.Optional[str]` — Accent used for filtering - -
-
- -
-
- -**language:** `typing.Optional[str]` — Language used for filtering - -
-
- -
-
- -**locale:** `typing.Optional[str]` — Locale used for filtering - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search term used for filtering - -
-
- -
-
- -**use_cases:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Use-case used for filtering - -
-
- -
-
- -**descriptives:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Search term used for filtering - -
-
- -
-
- -**featured:** `typing.Optional[bool]` — Filter featured voices - -
-
- -
-
- -**min_notice_period_days:** `typing.Optional[int]` — Filter voices with a minimum notice period of the given number of days. - -
-
- -
-
- -**reader_app_enabled:** `typing.Optional[bool]` — Filter voices that are enabled for the reader app - -
-
- -
-
- -**owner_id:** `typing.Optional[str]` — Filter voices by public owner ID - -
-
- -
-
- -**sort:** `typing.Optional[str]` — Sort criteria - -
-
- -
-
- -**page:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.get_similar_library_voices(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_similar_library_voices() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**audio_file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**similarity_threshold:** `typing.Optional[float]` — Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. - -
-
- -
-
- -**top_k:** `typing.Optional[int]` — Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.get_a_profile_page(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets a profile page based on a handle -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_a_profile_page( - handle="talexgeorge", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**handle:** `str` — Handle for a VA's profile page - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio -
client.studio.create_podcast(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ( - ElevenLabs, - PodcastConversationModeData, - PodcastTextSource, -) -from elevenlabs.studio import ( - BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.create_podcast( - model_id="21m00Tcm4TlvDq8ikWAM", - mode=BodyCreatePodcastV1StudioPodcastsPostMode_Conversation( - conversation=PodcastConversationModeData( - host_voice_id="aw1NgEzBg83R7vgmiJt6", - guest_voice_id="aw1NgEzBg83R7vgmiJt7", - ), - ), - source=PodcastTextSource( - text="This is a test podcast.", - ), -) - -``` -
-
-
-
- -#### ⚙️ 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:** `BodyCreatePodcastV1StudioPodcastsPostMode` — The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. - -
-
- -
-
- -**source:** `BodyCreatePodcastV1StudioPodcastsPostSource` — The source content for the Podcast. - -
-
- -
-
- -**quality_preset:** `typing.Optional[BodyCreatePodcastV1StudioPodcastsPostQualityPreset]` - -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[BodyCreatePodcastV1StudioPodcastsPostDurationScale]` - -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. - -
-
-
-
- - -
-
-
- -## projects -
client.projects.create_podcast(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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.", - ), -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.get_projects() -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your projects together and its metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.get_projects() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.add_project(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new project, it can be either initialized as blank, from a document or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### ⚙️ 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[str]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. - -
-
- -
-
- -**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. - -
-
- -
-
- -**source_type:** `typing.Optional[AddProjectV1ProjectsAddPostRequestSourceType]` — The type of Studio project to create. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.get_project_by_id(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific project. This endpoint returns more detailed information about a project than `GET /v1/projects`. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.get_project_by_id( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.edit_basic_project_info(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edits basic project info. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.delete_project(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.delete_project( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.edit_project_content(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edits project content. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.edit_project_content( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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[str]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.convert_project(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a project and all of its chapters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.convert_project( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.get_project_snapshots(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets the snapshots of a project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.get_project_snapshots( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.streams_archive_with_project_audio(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Streams archive with project audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.get_chapters(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your chapters for a project together and its metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.get_chapters( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.projects.get_chapter_by_id(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.get_chapter_by_id( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.delete_chapter(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.delete_chapter( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.edit_chapter(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edits a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.edit_chapter( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.add_chapter_to_a_project(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new chapter either as blank or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.add_chapter_to_a_project( - project_id="21m00Tcm4TlvDq8ikWAM", - name="Chapter 1", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.convert_chapter(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.convert_chapter( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.list_chapter_snapshots(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.projects.list_chapter_snapshots( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.stream_chapter_audio(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.projects.update_pronunciation_dictionaries(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -## Dubbing -
client.dubbing.get_dubbing_resource(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.get_dubbing_resource( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.add_language_to_resource(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.add_language_to_resource( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**language:** `typing.Optional[str]` — The Target language. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.create_segment_for_speaker(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.create_segment_for_speaker( - dubbing_id="dubbing_id", - speaker_id="speaker_id", - start_time=1.1, - end_time=1.1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**speaker_id:** `str` — ID of the speaker. - -
-
- -
-
- -**start_time:** `float` - -
-
- -
-
- -**end_time:** `float` - -
-
- -
-
- -**text:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.update_segment_language(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.update_segment_language( - dubbing_id="dubbing_id", - segment_id="segment_id", - language="language", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segment_id:** `str` — ID of the segment - -
-
- -
-
- -**language:** `str` — ID of the language. - -
-
- -
-
- -**start_time:** `typing.Optional[float]` - -
-
- -
-
- -**end_time:** `typing.Optional[float]` - -
-
- -
-
- -**text:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.delete_segment(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a single segment from the dubbing. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.delete_segment( - dubbing_id="dubbing_id", - segment_id="segment_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segment_id:** `str` — ID of the segment - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.transcribe_segments(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.transcribe_segments( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Transcribe this specific list of segments. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.translate_segments(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.translate_segments( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Translate only this list of segments. - -
-
- -
-
- -**languages:** `typing.Optional[typing.Sequence[str]]` — Translate only these languages for each segment. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.dub_segments(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the dubs for either the entire resource or the specified segments/languages. Will automatically transcribe and translate any missing transcriptions and translations. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.dub_segments( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Dub only this list of segments. - -
-
- -
-
- -**languages:** `typing.Optional[typing.Sequence[str]]` — Dub only these languages for each segment. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.dub_a_video_or_an_audio_file(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Dubs a provided audio or video file into given language. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.dub_a_video_or_an_audio_file() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `typing.Optional[str]` — A list of file paths to audio recordings intended for voice cloning - -
-
- -
-
- -**csv_file:** `typing.Optional[str]` — CSV file containing transcription/translation metadata - -
-
- -
-
- -**foreground_audio_file:** `typing.Optional[str]` — For use only with csv input - -
-
- -
-
- -**background_audio_file:** `typing.Optional[str]` — For use only with csv input - -
-
- -
-
- -**name:** `typing.Optional[str]` — Name of the dubbing project. - -
-
- -
-
- -**source_url:** `typing.Optional[str]` — URL of the source video/audio file. - -
-
- -
-
- -**source_lang:** `typing.Optional[str]` — Source language. - -
-
- -
-
- -**target_lang:** `typing.Optional[str]` — The Target language to dub the content into. - -
-
- -
-
- -**num_speakers:** `typing.Optional[int]` — Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers - -
-
- -
-
- -**watermark:** `typing.Optional[bool]` — Whether to apply watermark to the output video. - -
-
- -
-
- -**start_time:** `typing.Optional[int]` — Start time of the source video/audio file. - -
-
- -
-
- -**end_time:** `typing.Optional[int]` — End time of the source video/audio file. - -
-
- -
-
- -**highest_resolution:** `typing.Optional[bool]` — Whether to use the highest resolution available. - -
-
- -
-
- -**drop_background_audio:** `typing.Optional[bool]` — An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. - -
-
- -
-
- -**use_profanity_filter:** `typing.Optional[bool]` — [BETA] Whether transcripts should have profanities censored with the words '[censored]' - -
-
- -
-
- -**dubbing_studio:** `typing.Optional[bool]` — Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. - -
-
- -
-
- -**disable_voice_cloning:** `typing.Optional[bool]` — [BETA] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. - -
-
- -
-
- -**mode:** `typing.Optional[str]` — automatic or manual. Manual mode is only supported when creating a dubbing studio project - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.get_dubbing_project_metadata(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns metadata about a dubbing project, including whether it's still in progress or not -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.get_dubbing_project_metadata( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.delete_dubbing_project(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a dubbing project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.delete_dubbing_project( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.get_transcript_for_dub(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns transcript for the dub as an SRT or WEBVTT file. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.get_transcript_for_dub( - dubbing_id="dubbing_id", - language_code="language_code", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**language_code:** `str` — ID of the language. - -
-
- -
-
- -**format_type:** `typing.Optional[DubbingGetTranscriptForDubRequestFormatType]` — Format to use for the subtitle file, either 'srt' or 'webvtt' - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## models -
client.models.get_all() -
-
- -#### 📝 Description - -
-
- -
-
- -Gets a list of available models. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.models.get_all() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## AudioNative -
client.audio_native.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.create( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — Project name. - -
-
- -
-
- -**image:** `typing.Optional[str]` — (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. - -
-
- -
-
- -**author:** `typing.Optional[str]` — Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. - -
-
- -
-
- -**title:** `typing.Optional[str]` — Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. - -
-
- -
-
- -**small:** `typing.Optional[bool]` — (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. - -
-
- -
-
- -**text_color:** `typing.Optional[str]` — Text color used in the player. If not provided, default text color set in the Player settings is used. - -
-
- -
-
- -**background_color:** `typing.Optional[str]` — Background color used in the player. If not provided, default background color set in the Player settings is used. - -
-
- -
-
- -**sessionization:** `typing.Optional[int]` — (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. - -
-
- -
-
- -**voice_id:** `typing.Optional[str]` — Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.audio_native.get_settings(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get player settings for the specific project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.get_settings( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.audio_native.update_content(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates content for the specific AudioNative Project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.update_content( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not. - -
-
- -
-
- -**auto_publish:** `typing.Optional[bool]` — Whether to auto publish the new project snapshot after it's converted. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Usage -
client.usage.get_characters_usage_metrics(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the credit usage metrics for the current user or the entire workspace they are part of. The response will return a time axis with unix timestamps for each day and daily usage along that axis. The usage will be broken down by the specified breakdown type. For example, breakdown type "voice" will return the usage of each voice along the time axis. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.usage.get_characters_usage_metrics( - start_unix=1, - end_unix=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_unix:** `int` — UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. - -
-
- -
-
- -**end_unix:** `int` — UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. - -
-
- -
-
- -**include_workspace_metrics:** `typing.Optional[bool]` — Whether or not to include the statistics of the entire workspace. - -
-
- -
-
- -**breakdown_type:** `typing.Optional[BreakdownTypes]` — How to break down the information. Cannot be "user" if include_workspace_metrics is False. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## PronunciationDictionary -
client.pronunciation_dictionary.add_from_file(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new pronunciation dictionary from a lexicon .PLS file -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.add_from_file( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**file:** `typing.Optional[str]` — A lexicon .pls file which we will use to initialize the project with. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**workspace_access:** `typing.Optional[PronunciationDictionaryAddFromFileRequestWorkspaceAccess]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionary.add_from_rules(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new pronunciation dictionary from provided rules. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs -from elevenlabs.pronunciation_dictionary import ( - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.add_from_rules( - rules=[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias( - string_to_replace="Thailand", - alias="tie-land", - ) - ], - name="My Dictionary", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**rules:** `typing.Sequence[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem -]` - -List of pronunciation rules. Rule can be either: - an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } - or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } - -
-
- -
-
- -**name:** `str` — The name of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**workspace_access:** `typing.Optional[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess -]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionary.add_rules(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add rules to the pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs -from elevenlabs.pronunciation_dictionary import ( - PronunciationDictionaryRule_Alias, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.add_rules( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", - rules=[ - PronunciationDictionaryRule_Alias( - string_to_replace="Thailand", - alias="tie-land", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**rules:** `typing.Sequence[PronunciationDictionaryRule]` - -List of pronunciation rules. Rule can be either: - an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } - or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionary.remove_rules(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Remove rules from the pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.remove_rules( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", - rule_strings=["rule_strings"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**rule_strings:** `typing.Sequence[str]` — List of strings to remove from the pronunciation dictionary. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionary.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get metadata for a pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.get( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionary.get_all(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of the pronunciation dictionaries you have access to and their metadata -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionary.get_all() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**sort:** `typing.Optional[PronunciationDictionaryGetAllRequestSort]` — Which field to sort by, one of 'created_at_unix' or 'name'. - -
-
- -
-
- -**sort_direction:** `typing.Optional[str]` — Which direction to sort the voices in. 'ascending' or 'descending'. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workspace -
client.workspace.search_user_groups(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Searches for user groups in the workspace. Multiple or no groups may be returned. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.search_user_groups( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — Name of the target group. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.delete_member_from_user_group(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Removes a member from the specified group. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.delete_member_from_user_group( - group_id="group_id", - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**group_id:** `str` — The ID of the target group. - -
-
- -
-
- -**email:** `str` — The email of the target workspace member. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.add_member_to_user_group(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.add_member_to_user_group( - group_id="group_id", - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**group_id:** `str` — The ID of the target group. - -
-
- -
-
- -**email:** `str` — The email of the target workspace member. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.invite_user(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.invite_user( - email="john.doe@testmail.com", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — The email of the customer - -
-
- -
-
- -**group_ids:** `typing.Optional[typing.Sequence[str]]` — The group ids of the user - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.invite_multiple_users(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.invite_multiple_users( - emails=["emails"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**emails:** `typing.Sequence[str]` — The email of the customer - -
-
- -
-
- -**group_ids:** `typing.Optional[typing.Sequence[str]]` — The group ids of the user - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.delete_existing_invitation(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.delete_existing_invitation( - email="john.doe@testmail.com", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — The email of the customer - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.update_member(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.update_member( - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — Email of the target user. - -
-
- -
-
- -**is_locked:** `typing.Optional[bool]` — Whether to lock or unlock the user account. - -
-
- -
-
- -**workspace_role:** `typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]` — Role dictating permissions in the workspace. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.get_resource(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets the metadata of a resource by ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.get_resource( - resource_id="resource_id", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.share_workspace_resource(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/group/workspace api key has on the resource. To target a user, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. You must have admin access to the resource to share it. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.share_workspace_resource( - resource_id="resource_id", - role="admin", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**role:** `BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole` — Role to update the target principal with. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**user_email:** `typing.Optional[str]` — The email of the user - -
-
- -
-
- -**group_id:** `typing.Optional[str]` — The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'. - -
-
- -
-
- -**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.unshare_workspace_resource(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Removes any existing role on a workspace resource from a user or a group. To target a user, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.unshare_workspace_resource( - resource_id="resource_id", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**user_email:** `typing.Optional[str]` — The email of the user - -
-
- -
-
- -**group_id:** `typing.Optional[str]` — The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'. - -
-
- -
-
- -**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## SpeechToText -
client.speech_to_text.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Transcribe an audio or video file. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.speech_to_text.convert( - model_id="model_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**model_id:** `str` — The ID of the model to use for transcription, currently only 'scribe_v1' is available. - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. - -
-
- -
-
- -**tag_audio_events:** `typing.Optional[bool]` — Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. - -
-
- -
-
- -**num_speakers:** `typing.Optional[int]` — The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. - -
-
- -
-
- -**timestamps_granularity:** `typing.Optional[SpeechToTextConvertRequestTimestampsGranularity]` — The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. - -
-
- -
-
- -**diarize:** `typing.Optional[bool]` — Whether to annotate which speaker is currently talking in the uploaded file. - -
-
- -
-
- -**additional_formats:** `typing.Optional[AdditionalFormats]` — A list of additional formats to export the transcript to. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ForcedAlignment -
client.forced_alignment.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.forced_alignment.create( - text="text", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**text:** `str` — The text to align with the audio or video. The input text can be in any format, however diarization is not supported at this time. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi -
client.conversational_ai.get_signed_url(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a signed url to start a conversation with an agent with an agent that requires authorization -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_signed_url( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of the agent you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.twilio_outbound_call(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Handle an outbound call via Twilio -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.twilio_outbound_call( - agent_id="agent_id", - agent_phone_number_id="agent_phone_number_id", - to_number="to_number", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**agent_phone_number_id:** `str` - -
-
- -
-
- -**to_number:** `str` - -
-
- -
-
- -**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_agent(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create an agent from a config object -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ConversationalConfigApiModelInput, ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_agent( - conversation_config=ConversationalConfigApiModelInput(), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_config:** `ConversationalConfigApiModelInput` — Conversation configuration for an agent - -
-
- -
-
- -**use_tool_ids:** `typing.Optional[bool]` — Use tool ids instead of tools specs from request payload. - -
-
- -
-
- -**platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A name to make the agent easier to find - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_agent(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve config for an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_agent( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_agent(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_agent( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.update_agent(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Patches an Agent settings -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.update_agent( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**use_tool_ids:** `typing.Optional[bool]` — Use tool ids instead of tools specs from request payload. - -
-
- -
-
- -**conversation_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Conversation configuration for an agent - -
-
- -
-
- -**platform_settings:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A name to make the agent easier to find - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_agent_widget(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the widget configuration for an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_agent_widget( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**conversation_signature:** `typing.Optional[str]` — An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_agent_link(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the current link used to share the agent with others -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_agent_link( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.post_agent_avatar(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sets the avatar for an agent displayed in the widget -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.post_agent_avatar( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**avatar_file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_agents(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your agents and their metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_agents() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many Agents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search by agents name. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_conversations(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get all conversations of agents that user owns. With option to restrict to a specific agent. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_conversations() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**agent_id:** `typing.Optional[str]` — The id of the agent you're taking the action on. - -
-
- -
-
- -**call_successful:** `typing.Optional[EvaluationSuccessResult]` — The result of the success evaluation - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many conversations to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_conversation(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the details of a particular conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_conversation( - conversation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_conversation(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a particular conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_conversation( - conversation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.post_conversation_feedback(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Send the feedback for the given conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.post_conversation_feedback( - conversation_id="21m00Tcm4TlvDq8ikWAM", - feedback="like", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**feedback:** `UserFeedbackScore` — Either 'like' or 'dislike' to indicate the feedback for the conversation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_phone_number(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Import Phone Number from provider configuration (Twilio or SIP trunk) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import CreateTwilioPhoneNumberRequest, ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_phone_number( - request=CreateTwilioPhoneNumberRequest( - phone_number="phone_number", - label="label", - sid="sid", - token="token", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `ConversationalAiCreatePhoneNumberRequestBody` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_phone_number(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve Phone Number details by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_phone_number( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_phone_number(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete Phone Number by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_phone_number( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.update_phone_number(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update Phone Number details by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.update_phone_number( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**agent_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_phone_numbers() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve all Phone Numbers -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_phone_numbers() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_knowledge_base_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of available knowledge base documents -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_knowledge_base_list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**search:** `typing.Optional[str]` — If specified, the endpoint returns only such knowledge base documents whose names start with this string. - -
-
- -
-
- -**show_only_owned_documents:** `typing.Optional[bool]` — If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). - -
-
- -
-
- -**use_typesense:** `typing.Optional[bool]` — If set to true, the endpoint will use typesense DB to search for the documents). - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.add_to_knowledge_base(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Uploads a file or reference a webpage to use as part of the shared knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.add_to_knowledge_base() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**url:** `typing.Optional[str]` — URL to a page of documentation that the agent will have access to in order to interact with users. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_knowledge_base_url_document(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document generated by scraping the given webpage. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_knowledge_base_url_document( - url="url", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**url:** `str` — URL to a page of documentation that the agent will have access to in order to interact with users. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_knowledge_base_file_document(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document generated form the uploaded file. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_knowledge_base_file_document() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_knowledge_base_text_document(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document containing the provided text. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_knowledge_base_text_document( - text="text", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**text:** `str` — Text content to be added to the knowledge base. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.rag_index_status(...) -
-
- -#### 📝 Description - -
-
- -
-
- -In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.rag_index_status( - documentation_id="21m00Tcm4TlvDq8ikWAM", - model="e5_mistral_7b_instruct", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**model:** `EmbeddingModelEnum` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_knowledge_base_document_by_id(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get details about a specific documentation making up the agent's knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_knowledge_base_document_by_id( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_knowledge_base_document(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a document from the knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_knowledge_base_document( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_dependent_agents(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of agents depending on this knowledge base document -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_dependent_agents( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_knowledge_base_document_content(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the entire content of a document from the knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_knowledge_base_document_content( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_knowledge_base_document_part_by_id(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get details about a specific documentation part used by RAG. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_knowledge_base_document_part_by_id( - documentation_id="21m00Tcm4TlvDq8ikWAM", - chunk_id="chunk_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**chunk_id:** `str` — The id of a document RAG chunk from the knowledge base. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_settings() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve Convai settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_settings() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.update_settings(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update Convai settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.update_settings() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_initiation_client_data_webhook:** `typing.Optional[ConversationInitiationClientDataWebhook]` - -
-
- -
-
- -**webhooks:** `typing.Optional[ConvAiWebhooks]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_secrets() -
-
- -#### 📝 Description - -
-
- -
-
- -Get all workspace secrets for the user -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_secrets() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.create_secret(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new secret for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.create_secret( - name="name", - value="value", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**value:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_secret(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a workspace secret if it's not in use -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_secret( - secret_id="secret_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**secret_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects -
client.studio.projects.get_all() -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your Studio projects with metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.get_all() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.add(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.add( - name="name", - default_title_voice_id="default_title_voice_id", - default_paragraph_voice_id="default_paragraph_voice_id", - default_model_id="default_model_id", -) - -``` -
-
-
-
- -#### ⚙️ 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[str]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. - -
-
- -
-
- -**quality_preset:** `typing.Optional[str]` - -Output quality of the generated audio. Must be one of: -standard - standard output format, 128kbps with 44.1kHz sample rate. -high - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. Using this setting increases the credit cost by 20%. -ultra - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. Using this setting increases the credit cost by 50%. -ultra lossless - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. Using this setting increases the credit cost by 100%. - -
-
- -
-
- -**title:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**author:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**description:** `typing.Optional[str]` — An optional description of the Studio project. - -
-
- -
-
- -**genres:** `typing.Optional[typing.List[str]]` — An optional list of genres associated with the Studio project. - -
-
- -
-
- -**target_audience:** `typing.Optional[ProjectsAddRequestTargetAudience]` — An optional target audience of the Studio project. - -
-
- -
-
- -**language:** `typing.Optional[str]` — An optional language of the Studio project. Two-letter language code (ISO 639-1). - -
-
- -
-
- -**content_type:** `typing.Optional[str]` — An optional content type of the Studio project. - -
-
- -
-
- -**original_publication_date:** `typing.Optional[str]` — An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. - -
-
- -
-
- -**mature_content:** `typing.Optional[bool]` — An optional specification of whether this Studio project contains mature content. - -
-
- -
-
- -**isbn_number:** `typing.Optional[str]` — An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**acx_volume_normalization:** `typing.Optional[bool]` — [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements - -
-
- -
-
- -**volume_normalization:** `typing.Optional[bool]` — When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.List[str]]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first. - -
-
- -
-
- -**callback_url:** `typing.Optional[str]` — A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion - -
-
- -
-
- -**fiction:** `typing.Optional[ProjectsAddRequestFiction]` — An optional specification of whether the content of this Studio project is fiction. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[ProjectsAddRequestApplyTextNormalization]` - - - This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. - When set to 'auto', the system will automatically decide whether to apply text normalization - (e.g., spelling out numbers). With 'on', text normalization will always be applied, while - with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. - - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not. - -
-
- -
-
- -**auto_assign_voices:** `typing.Optional[bool]` — [Alpha Feature] Whether automatically assign voices to phrases in the create Project. - -
-
- -
-
- -**source_type:** `typing.Optional[ProjectsAddRequestSourceType]` — The type of Studio project to create. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.get( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.update_metadata(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates the specified Studio project by setting the values of the parameters passed. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.update_metadata( - project_id="21m00Tcm4TlvDq8ikWAM", - name="Project 1", - default_title_voice_id="21m00Tcm4TlvDq8ikWAM", - default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.projects.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a Studio project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.delete( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.update_content(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates Studio project content. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.update_content( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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[str]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a Studio project and all of its chapters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.convert( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.get_snapshots(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a list of snapshots for a Studio project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.get_snapshots( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.get_project_snapshot(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the project snapshot. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.get_project_snapshot( - project_id="21m00Tcm4TlvDq8ikWAM", - project_snapshot_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.projects.stream_audio(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Stream the audio from a Studio project snapshot. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.stream_audio( - project_id="21m00Tcm4TlvDq8ikWAM", - project_snapshot_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.projects.update_pronunciation_dictionaries(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs, PronunciationDictionaryVersionLocator - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.update_pronunciation_dictionaries( - project_id="21m00Tcm4TlvDq8ikWAM", - pronunciation_dictionary_locators=[ - PronunciationDictionaryVersionLocator( - pronunciation_dictionary_id="pronunciation_dictionary_id", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -## Studio Chapters -
client.studio.chapters.get_all(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of a Studio project's chapters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.get_all( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new chapter either as blank or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.create( - project_id="21m00Tcm4TlvDq8ikWAM", - name="Chapter 1", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.get( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.edit(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.edit( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.delete( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.convert( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.get_all_snapshots(...) -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.get_all_snapshots( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
-
-
- - -
-
-
- -
client.studio.chapters.get_chapter_snapshot(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the chapter snapshot. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.chapters.get_chapter_snapshot( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", - chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ 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. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py index a2791dc8..a8ba4aef 100644 --- a/src/elevenlabs/__init__.py +++ b/src/elevenlabs/__init__.py @@ -6,7 +6,7 @@ AddKnowledgeBaseResponseModel, AddProjectResponseModel, AddPronunciationDictionaryResponseModel, - AddPronunciationDictionaryRulesResponseModel, + AddPronunciationDictionaryResponseModelPermissionOnResource, AddSharingVoiceRequest, AddVoiceIvcResponseModel, AddVoiceResponseModel, @@ -39,6 +39,7 @@ AudioNativeCreateProjectResponseModel, AudioNativeEditContentResponseModel, AudioNativeProjectSettingsResponseModel, + AudioNativeProjectSettingsResponseModelStatus, AudioOutput, AudioWithTimestampsResponseModel, AuthSettings, @@ -46,6 +47,7 @@ BanReasonType, BodyAddToKnowledgeBaseV1ConvaiAddToKnowledgeBasePost, BodyAddToKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost, + BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet, BreakdownTypes, ChapterContentBlockExtendableNodeResponseModel, ChapterContentBlockInputModel, @@ -89,14 +91,21 @@ ConversationConfigClientOverrideOutput, ConversationDeletionSettings, ConversationHistoryAnalysisCommonModel, + ConversationHistoryErrorCommonModel, ConversationHistoryEvaluationCriteriaResultCommonModel, ConversationHistoryFeedbackCommonModel, ConversationHistoryMetadataCommonModel, ConversationHistoryMetadataCommonModelPhoneCall, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, + ConversationHistoryRagUsageCommonModel, ConversationHistoryTranscriptCommonModel, ConversationHistoryTranscriptCommonModelRole, + ConversationHistoryTranscriptToolCallClientDetails, ConversationHistoryTranscriptToolCallCommonModel, + ConversationHistoryTranscriptToolCallCommonModelToolDetails, + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client, + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook, + ConversationHistoryTranscriptToolCallWebhookDetails, ConversationHistoryTranscriptToolResultCommonModel, ConversationHistoryTwilioPhoneCallModel, ConversationHistoryTwilioPhoneCallModelDirection, @@ -133,8 +142,10 @@ DeleteProjectResponseModel, DeleteSampleResponseModel, DeleteVoiceResponseModel, + DeleteVoiceSampleResponseModel, DeleteWorkspaceGroupMemberResponseModel, DeleteWorkspaceInviteResponseModel, + DeleteWorkspaceMemberResponseModel, DependentAvailableAgentIdentifier, DependentAvailableAgentIdentifierAccessLevel, DependentAvailableAgentToolIdentifier, @@ -152,6 +163,7 @@ DubbingMediaMetadata, DubbingMediaReference, DubbingMetadataResponse, + DubbingRenderResponseModel, DubbingResource, DynamicVariablesConfig, DynamicVariablesConfigDynamicVariablePlaceholdersValue, @@ -161,6 +173,7 @@ EditVoiceSettingsResponseModel, EmbedVariant, EmbeddingModelEnum, + EndCallToolConfig, EvaluationSettings, EvaluationSuccessResult, ExportOptions, @@ -220,6 +233,7 @@ GetProjectsResponse, GetPronunciationDictionariesMetadataResponseModel, GetPronunciationDictionaryMetadataResponse, + GetPronunciationDictionaryMetadataResponseModelPermissionOnResource, GetSpeechHistoryResponse, GetVoicesResponse, GetVoicesV2ResponseModel, @@ -237,6 +251,7 @@ KnowledgeBaseDocumentType, KnowledgeBaseLocator, LanguageAddedResponse, + LanguageDetectionToolConfig, LanguagePresetInput, LanguagePresetOutput, LanguagePresetTranslation, @@ -310,8 +325,10 @@ PromptEvaluationCriteria, PronunciationDictionaryAliasRuleRequestModel, PronunciationDictionaryPhonemeRuleRequestModel, + PronunciationDictionaryRulesResponseModel, PronunciationDictionaryVersionLocator, PronunciationDictionaryVersionResponseModel, + PronunciationDictionaryVersionResponseModelPermissionOnResource, PydanticPronunciationDictionaryVersionLocator, QueryParamsJsonSchema, RagChunkMetadata, @@ -323,7 +340,10 @@ ReaderResourceResponseModelResourceType, RealtimeVoiceSettings, RecordingResponse, - RemovePronunciationDictionaryRulesResponseModel, + Render, + RenderStatus, + RenderType, + RequestPvcManualVerificationResponseModel, ResourceAccessInfo, ResourceAccessInfoRole, ResourceMetadataResponseModel, @@ -344,6 +364,7 @@ ShareOptionResponseModel, ShareOptionResponseModelType, SipTrunkCredentials, + SpeakerAudioResponseModel, SpeakerResponseModel, SpeakerSegment, SpeakerSeparationResponseModel, @@ -357,6 +378,8 @@ SpeechToTextWordResponseModel, SpeechToTextWordResponseModelType, SrtExportOptions, + StartPvcVoiceTrainingResponseModel, + StartSpeakerSeparationResponseModel, StreamingAudioChunkWithTimestampsResponseModel, Subscription, SubscriptionResponse, @@ -365,9 +388,20 @@ SubscriptionResponseModelCurrency, SubscriptionStatus, SubscriptionUsageResponseModel, - SystemToolConfig, + SystemToolConfigInput, + SystemToolConfigInputParams, + SystemToolConfigInputParams_EndCall, + SystemToolConfigInputParams_LanguageDetection, + SystemToolConfigInputParams_TransferToAgent, + SystemToolConfigOutput, + SystemToolConfigOutputParams, + SystemToolConfigOutputParams_EndCall, + SystemToolConfigOutputParams_LanguageDetection, + SystemToolConfigOutputParams_TransferToAgent, TelephonyProvider, TextToSpeechAsStreamRequest, + Transfer, + TransferToAgentToolConfig, TtsConversationalConfig, TtsConversationalConfigOverride, TtsConversationalConfigOverrideConfig, @@ -389,6 +423,7 @@ ValidationErrorLocItem, VerificationAttemptResponse, VerifiedVoiceLanguageResponseModel, + VerifyPvcVoiceCaptchaResponseModel, Voice, VoiceGenerationParameterOptionResponse, VoiceGenerationParameterResponse, @@ -397,6 +432,8 @@ VoiceResponseModelCategory, VoiceResponseModelSafetyControl, VoiceSample, + VoiceSamplePreviewResponseModel, + VoiceSampleVisualWaveformResponseModel, VoiceSettings, VoiceSharingModerationCheckResponseModel, VoiceSharingResponse, @@ -451,6 +488,10 @@ voices, workspace, ) +from .audio_isolation import ( + AudioIsolationAudioIsolationRequestFileFormat, + AudioIsolationAudioIsolationStreamRequestFileFormat, +) from .client import AsyncElevenLabs, ElevenLabs from .conversational_ai import ( ConversationalAiCreatePhoneNumberRequestBody, @@ -489,7 +530,8 @@ PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme, ) -from .speech_to_text import SpeechToTextConvertRequestTimestampsGranularity +from .speech_to_speech import SpeechToSpeechConvertAsStreamRequestFileFormat, SpeechToSpeechConvertRequestFileFormat +from .speech_to_text import SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestTimestampsGranularity from .studio import ( BodyCreatePodcastV1StudioPodcastsPostDurationScale, BodyCreatePodcastV1StudioPodcastsPostMode, @@ -527,7 +569,7 @@ "AddProjectV1ProjectsAddPostRequestSourceType", "AddProjectV1ProjectsAddPostRequestTargetAudience", "AddPronunciationDictionaryResponseModel", - "AddPronunciationDictionaryRulesResponseModel", + "AddPronunciationDictionaryResponseModelPermissionOnResource", "AddSharingVoiceRequest", "AddVoiceIvcResponseModel", "AddVoiceResponseModel", @@ -558,9 +600,12 @@ "AsrProvider", "AsrQuality", "AsyncElevenLabs", + "AudioIsolationAudioIsolationRequestFileFormat", + "AudioIsolationAudioIsolationStreamRequestFileFormat", "AudioNativeCreateProjectResponseModel", "AudioNativeEditContentResponseModel", "AudioNativeProjectSettingsResponseModel", + "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", "AudioWithTimestampsResponseModel", "AuthSettings", @@ -591,6 +636,7 @@ "BodyCreatePodcastV1StudioPodcastsPostSourceItem", "BodyCreatePodcastV1StudioPodcastsPostSourceItem_Text", "BodyCreatePodcastV1StudioPodcastsPostSourceItem_Url", + "BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet", "BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole", "BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization", "BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization", @@ -640,14 +686,21 @@ "ConversationConfigClientOverrideOutput", "ConversationDeletionSettings", "ConversationHistoryAnalysisCommonModel", + "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", + "ConversationHistoryRagUsageCommonModel", "ConversationHistoryTranscriptCommonModel", "ConversationHistoryTranscriptCommonModelRole", + "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModel", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook", + "ConversationHistoryTranscriptToolCallWebhookDetails", "ConversationHistoryTranscriptToolResultCommonModel", "ConversationHistoryTwilioPhoneCallModel", "ConversationHistoryTwilioPhoneCallModelDirection", @@ -689,8 +742,10 @@ "DeleteProjectResponseModel", "DeleteSampleResponseModel", "DeleteVoiceResponseModel", + "DeleteVoiceSampleResponseModel", "DeleteWorkspaceGroupMemberResponseModel", "DeleteWorkspaceInviteResponseModel", + "DeleteWorkspaceMemberResponseModel", "DependentAvailableAgentIdentifier", "DependentAvailableAgentIdentifierAccessLevel", "DependentAvailableAgentToolIdentifier", @@ -709,6 +764,7 @@ "DubbingMediaMetadata", "DubbingMediaReference", "DubbingMetadataResponse", + "DubbingRenderResponseModel", "DubbingResource", "DynamicVariablesConfig", "DynamicVariablesConfigDynamicVariablePlaceholdersValue", @@ -720,6 +776,7 @@ "ElevenLabsEnvironment", "EmbedVariant", "EmbeddingModelEnum", + "EndCallToolConfig", "EvaluationSettings", "EvaluationSuccessResult", "ExportOptions", @@ -780,6 +837,7 @@ "GetProjectsResponse", "GetPronunciationDictionariesMetadataResponseModel", "GetPronunciationDictionaryMetadataResponse", + "GetPronunciationDictionaryMetadataResponseModelPermissionOnResource", "GetSpeechHistoryResponse", "GetVoicesResponse", "GetVoicesV2ResponseModel", @@ -798,6 +856,7 @@ "KnowledgeBaseDocumentType", "KnowledgeBaseLocator", "LanguageAddedResponse", + "LanguageDetectionToolConfig", "LanguagePresetInput", "LanguagePresetOutput", "LanguagePresetTranslation", @@ -877,8 +936,10 @@ "PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme", + "PronunciationDictionaryRulesResponseModel", "PronunciationDictionaryVersionLocator", "PronunciationDictionaryVersionResponseModel", + "PronunciationDictionaryVersionResponseModelPermissionOnResource", "PydanticPronunciationDictionaryVersionLocator", "QueryParamsJsonSchema", "RagChunkMetadata", @@ -890,7 +951,10 @@ "ReaderResourceResponseModelResourceType", "RealtimeVoiceSettings", "RecordingResponse", - "RemovePronunciationDictionaryRulesResponseModel", + "Render", + "RenderStatus", + "RenderType", + "RequestPvcManualVerificationResponseModel", "ResourceAccessInfo", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", @@ -912,6 +976,7 @@ "ShareOptionResponseModel", "ShareOptionResponseModelType", "SipTrunkCredentials", + "SpeakerAudioResponseModel", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", @@ -920,12 +985,17 @@ "SpeechHistoryItemResponse", "SpeechHistoryItemResponseModelSource", "SpeechHistoryItemResponseModelVoiceCategory", + "SpeechToSpeechConvertAsStreamRequestFileFormat", + "SpeechToSpeechConvertRequestFileFormat", "SpeechToTextCharacterResponseModel", "SpeechToTextChunkResponseModel", + "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextWordResponseModel", "SpeechToTextWordResponseModelType", "SrtExportOptions", + "StartPvcVoiceTrainingResponseModel", + "StartSpeakerSeparationResponseModel", "StreamingAudioChunkWithTimestampsResponseModel", "Subscription", "SubscriptionResponse", @@ -934,12 +1004,23 @@ "SubscriptionResponseModelCurrency", "SubscriptionStatus", "SubscriptionUsageResponseModel", - "SystemToolConfig", + "SystemToolConfigInput", + "SystemToolConfigInputParams", + "SystemToolConfigInputParams_EndCall", + "SystemToolConfigInputParams_LanguageDetection", + "SystemToolConfigInputParams_TransferToAgent", + "SystemToolConfigOutput", + "SystemToolConfigOutputParams", + "SystemToolConfigOutputParams_EndCall", + "SystemToolConfigOutputParams_LanguageDetection", + "SystemToolConfigOutputParams_TransferToAgent", "TelephonyProvider", "TextToSoundEffectsConvertRequestOutputFormat", "TextToSpeechAsStreamRequest", "TextToVoiceCreatePreviewsRequestOutputFormat", "TooEarlyError", + "Transfer", + "TransferToAgentToolConfig", "TtsConversationalConfig", "TtsConversationalConfigOverride", "TtsConversationalConfigOverrideConfig", @@ -962,6 +1043,7 @@ "ValidationErrorLocItem", "VerificationAttemptResponse", "VerifiedVoiceLanguageResponseModel", + "VerifyPvcVoiceCaptchaResponseModel", "Voice", "VoiceGenerationParameterOptionResponse", "VoiceGenerationParameterResponse", @@ -970,6 +1052,8 @@ "VoiceResponseModelCategory", "VoiceResponseModelSafetyControl", "VoiceSample", + "VoiceSamplePreviewResponseModel", + "VoiceSampleVisualWaveformResponseModel", "VoiceSettings", "VoiceSharingModerationCheckResponseModel", "VoiceSharingResponse", diff --git a/src/elevenlabs/audio_isolation/__init__.py b/src/elevenlabs/audio_isolation/__init__.py index f3ea2659..817dc5b3 100644 --- a/src/elevenlabs/audio_isolation/__init__.py +++ b/src/elevenlabs/audio_isolation/__init__.py @@ -1,2 +1,5 @@ # This file was auto-generated by Fern from our API Definition. +from .types import AudioIsolationAudioIsolationRequestFileFormat, AudioIsolationAudioIsolationStreamRequestFileFormat + +__all__ = ["AudioIsolationAudioIsolationRequestFileFormat", "AudioIsolationAudioIsolationStreamRequestFileFormat"] diff --git a/src/elevenlabs/audio_isolation/client.py b/src/elevenlabs/audio_isolation/client.py index 98401904..c3e32ec7 100644 --- a/src/elevenlabs/audio_isolation/client.py +++ b/src/elevenlabs/audio_isolation/client.py @@ -3,12 +3,18 @@ import typing from ..core.client_wrapper import SyncClientWrapper from .. import core +from .types.audio_isolation_audio_isolation_request_file_format import ( + AudioIsolationAudioIsolationRequestFileFormat, +) from ..core.request_options import RequestOptions from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.http_validation_error import HttpValidationError from ..core.unchecked_base_model import construct_type from json.decoder import JSONDecodeError from ..core.api_error import ApiError +from .types.audio_isolation_audio_isolation_stream_request_file_format import ( + AudioIsolationAudioIsolationStreamRequestFileFormat, +) from ..core.client_wrapper import AsyncClientWrapper # this is used as the default value for optional parameters @@ -23,6 +29,7 @@ def audio_isolation( self, *, audio: core.File, + file_format: typing.Optional[AudioIsolationAudioIsolationRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ @@ -33,6 +40,9 @@ def audio_isolation( audio : core.File See core.File for more documentation + file_format : typing.Optional[AudioIsolationAudioIsolationRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -45,7 +55,9 @@ def audio_isolation( "v1/audio-isolation", base_url=self._client_wrapper.get_environment().base, method="POST", - data={}, + data={ + "file_format": file_format, + }, files={ "audio": audio, }, @@ -78,6 +90,7 @@ def audio_isolation_stream( self, *, audio: core.File, + file_format: typing.Optional[AudioIsolationAudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ @@ -88,6 +101,9 @@ def audio_isolation_stream( audio : core.File See core.File for more documentation + file_format : typing.Optional[AudioIsolationAudioIsolationStreamRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -100,7 +116,9 @@ def audio_isolation_stream( "v1/audio-isolation/stream", base_url=self._client_wrapper.get_environment().base, method="POST", - data={}, + data={ + "file_format": file_format, + }, files={ "audio": audio, }, @@ -138,6 +156,7 @@ async def audio_isolation( self, *, audio: core.File, + file_format: typing.Optional[AudioIsolationAudioIsolationRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ @@ -148,6 +167,9 @@ async def audio_isolation( audio : core.File See core.File for more documentation + file_format : typing.Optional[AudioIsolationAudioIsolationRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -160,7 +182,9 @@ async def audio_isolation( "v1/audio-isolation", base_url=self._client_wrapper.get_environment().base, method="POST", - data={}, + data={ + "file_format": file_format, + }, files={ "audio": audio, }, @@ -193,6 +217,7 @@ async def audio_isolation_stream( self, *, audio: core.File, + file_format: typing.Optional[AudioIsolationAudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ @@ -203,6 +228,9 @@ async def audio_isolation_stream( audio : core.File See core.File for more documentation + file_format : typing.Optional[AudioIsolationAudioIsolationStreamRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -215,7 +243,9 @@ async def audio_isolation_stream( "v1/audio-isolation/stream", base_url=self._client_wrapper.get_environment().base, method="POST", - data={}, + data={ + "file_format": file_format, + }, files={ "audio": audio, }, diff --git a/src/elevenlabs/audio_isolation/types/__init__.py b/src/elevenlabs/audio_isolation/types/__init__.py new file mode 100644 index 00000000..9d2b6440 --- /dev/null +++ b/src/elevenlabs/audio_isolation/types/__init__.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +from .audio_isolation_audio_isolation_request_file_format import AudioIsolationAudioIsolationRequestFileFormat +from .audio_isolation_audio_isolation_stream_request_file_format import ( + AudioIsolationAudioIsolationStreamRequestFileFormat, +) + +__all__ = ["AudioIsolationAudioIsolationRequestFileFormat", "AudioIsolationAudioIsolationStreamRequestFileFormat"] diff --git a/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_request_file_format.py b/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_request_file_format.py new file mode 100644 index 00000000..2aa55c29 --- /dev/null +++ b/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_request_file_format.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AudioIsolationAudioIsolationRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] diff --git a/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_stream_request_file_format.py b/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_stream_request_file_format.py new file mode 100644 index 00000000..c09bafec --- /dev/null +++ b/src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_stream_request_file_format.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AudioIsolationAudioIsolationStreamRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] diff --git a/src/elevenlabs/conversational_ai/client.py b/src/elevenlabs/conversational_ai/client.py index 3f575f6e..2940b127 100644 --- a/src/elevenlabs/conversational_ai/client.py +++ b/src/elevenlabs/conversational_ai/client.py @@ -41,6 +41,7 @@ ) from ..types.create_phone_number_response_model import CreatePhoneNumberResponseModel from ..types.get_phone_number_response_model import GetPhoneNumberResponseModel +from ..types.knowledge_base_document_type import KnowledgeBaseDocumentType from ..types.get_knowledge_base_list_response_model import ( GetKnowledgeBaseListResponseModel, ) @@ -231,7 +232,6 @@ def create_agent( self, *, conversation_config: ConversationalConfigApiModelInput, - use_tool_ids: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -244,9 +244,6 @@ def create_agent( conversation_config : ConversationalConfigApiModelInput Conversation configuration for an agent - use_tool_ids : typing.Optional[bool] - Use tool ids instead of tools specs from request payload. - platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -276,9 +273,6 @@ def create_agent( "v1/convai/agents/create", base_url=self._client_wrapper.get_environment().base, method="POST", - params={ - "use_tool_ids": use_tool_ids, - }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, @@ -437,7 +431,6 @@ def update_agent( self, agent_id: str, *, - use_tool_ids: typing.Optional[bool] = None, conversation_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, name: typing.Optional[str] = OMIT, @@ -451,9 +444,6 @@ def update_agent( agent_id : str The id of an agent. This is returned on agent creation. - use_tool_ids : typing.Optional[bool] - Use tool ids instead of tools specs from request payload. - conversation_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] Conversation configuration for an agent @@ -486,9 +476,6 @@ def update_agent( f"v1/convai/agents/{jsonable_encoder(agent_id)}", base_url=self._client_wrapper.get_environment().base, method="PATCH", - params={ - "use_tool_ids": use_tool_ids, - }, json={ "conversation_config": conversation_config, "platform_settings": platform_settings, @@ -1464,6 +1451,9 @@ def get_knowledge_base_list( page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, + types: typing.Optional[ + typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] + ] = None, use_typesense: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: @@ -1484,6 +1474,9 @@ def get_knowledge_base_list( show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). + types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] + If present, the endpoint will return only documents of the given types. + use_typesense : typing.Optional[bool] If set to true, the endpoint will use typesense DB to search for the documents). @@ -1513,6 +1506,7 @@ def get_knowledge_base_list( "page_size": page_size, "search": search, "show_only_owned_documents": show_only_owned_documents, + "types": types, "use_typesense": use_typesense, }, request_options=request_options, @@ -2726,7 +2720,6 @@ async def create_agent( self, *, conversation_config: ConversationalConfigApiModelInput, - use_tool_ids: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -2739,9 +2732,6 @@ async def create_agent( conversation_config : ConversationalConfigApiModelInput Conversation configuration for an agent - use_tool_ids : typing.Optional[bool] - Use tool ids instead of tools specs from request payload. - platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -2779,9 +2769,6 @@ async def main() -> None: "v1/convai/agents/create", base_url=self._client_wrapper.get_environment().base, method="POST", - params={ - "use_tool_ids": use_tool_ids, - }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, @@ -2956,7 +2943,6 @@ async def update_agent( self, agent_id: str, *, - use_tool_ids: typing.Optional[bool] = None, conversation_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, name: typing.Optional[str] = OMIT, @@ -2970,9 +2956,6 @@ async def update_agent( agent_id : str The id of an agent. This is returned on agent creation. - use_tool_ids : typing.Optional[bool] - Use tool ids instead of tools specs from request payload. - conversation_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] Conversation configuration for an agent @@ -3013,9 +2996,6 @@ async def main() -> None: f"v1/convai/agents/{jsonable_encoder(agent_id)}", base_url=self._client_wrapper.get_environment().base, method="PATCH", - params={ - "use_tool_ids": use_tool_ids, - }, json={ "conversation_config": conversation_config, "platform_settings": platform_settings, @@ -4095,6 +4075,9 @@ async def get_knowledge_base_list( page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, + types: typing.Optional[ + typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] + ] = None, use_typesense: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: @@ -4115,6 +4098,9 @@ async def get_knowledge_base_list( show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). + types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] + If present, the endpoint will return only documents of the given types. + use_typesense : typing.Optional[bool] If set to true, the endpoint will use typesense DB to search for the documents). @@ -4152,6 +4138,7 @@ async def main() -> None: "page_size": page_size, "search": search, "show_only_owned_documents": show_only_owned_documents, + "types": types, "use_typesense": use_typesense, }, request_options=request_options, diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index 01e20b01..5038bfb9 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -23,7 +23,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "1.56.0", + "X-Fern-SDK-Version": "1.57.0", } if self._api_key is not None: headers["xi-api-key"] = self._api_key diff --git a/src/elevenlabs/dubbing/client.py b/src/elevenlabs/dubbing/client.py index 17df81f6..2c2501ad 100644 --- a/src/elevenlabs/dubbing/client.py +++ b/src/elevenlabs/dubbing/client.py @@ -17,6 +17,9 @@ from ..types.segment_transcription_response import SegmentTranscriptionResponse from ..types.segment_translation_response import SegmentTranslationResponse from ..types.segment_dub_response import SegmentDubResponse +from ..types.render_type import RenderType +from ..types.dubbing_render_response_model import DubbingRenderResponseModel +from .. import core from ..types.do_dubbing_response import DoDubbingResponse from ..types.dubbing_metadata_response import DubbingMetadataResponse from ..types.delete_dubbing_response_model import DeleteDubbingResponseModel @@ -655,13 +658,93 @@ def dub_segments( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def render_dub( + self, + dubbing_id: str, + language: str, + *, + render_type: RenderType, + request_options: typing.Optional[RequestOptions] = None, + ) -> DubbingRenderResponseModel: + """ + Regenerate the dubs for either the entire resource or the specified segments/languages. Will automatically transcribe and translate any missing transcriptions and translations. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + language : str + Render this language + + render_type : RenderType + The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DubbingRenderResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.dubbing.render_dub( + dubbing_id="dubbing_id", + language="language", + render_type="mp4", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/render/{jsonable_encoder(language)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "render_type": render_type, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DubbingRenderResponseModel, + construct_type( + type_=DubbingRenderResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def dub_a_video_or_an_audio_file( self, *, - file: typing.Optional[str] = OMIT, - csv_file: typing.Optional[str] = OMIT, - foreground_audio_file: typing.Optional[str] = OMIT, - background_audio_file: typing.Optional[str] = OMIT, + file: typing.Optional[core.File] = OMIT, + csv_file: typing.Optional[core.File] = OMIT, + foreground_audio_file: typing.Optional[core.File] = OMIT, + background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, @@ -683,17 +766,17 @@ def dub_a_video_or_an_audio_file( Parameters ---------- - file : typing.Optional[str] - A list of file paths to audio recordings intended for voice cloning + file : typing.Optional[core.File] + See core.File for more documentation - csv_file : typing.Optional[str] - CSV file containing transcription/translation metadata + csv_file : typing.Optional[core.File] + See core.File for more documentation - foreground_audio_file : typing.Optional[str] - For use only with csv input + foreground_audio_file : typing.Optional[core.File] + See core.File for more documentation - background_audio_file : typing.Optional[str] - For use only with csv input + background_audio_file : typing.Optional[core.File] + See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. @@ -759,10 +842,6 @@ def dub_a_video_or_an_audio_file( base_url=self._client_wrapper.get_environment().base, method="POST", data={ - "file": file, - "csv_file": csv_file, - "foreground_audio_file": foreground_audio_file, - "background_audio_file": background_audio_file, "name": name, "source_url": source_url, "source_lang": source_lang, @@ -778,7 +857,12 @@ def dub_a_video_or_an_audio_file( "disable_voice_cloning": disable_voice_cloning, "mode": mode, }, - files={}, + files={ + "file": file, + "csv_file": csv_file, + "foreground_audio_file": foreground_audio_file, + "background_audio_file": background_audio_file, + }, request_options=request_options, omit=OMIT, ) @@ -1069,13 +1153,7 @@ def get_transcript_for_dub( ) try: if 200 <= _response.status_code < 300: - return typing.cast( - str, - construct_type( - type_=str, # type: ignore - object_=_response.json(), - ), - ) + return _response.text # type: ignore if _response.status_code == 403: raise ForbiddenError( typing.cast( @@ -1809,13 +1887,101 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + async def render_dub( + self, + dubbing_id: str, + language: str, + *, + render_type: RenderType, + request_options: typing.Optional[RequestOptions] = None, + ) -> DubbingRenderResponseModel: + """ + Regenerate the dubs for either the entire resource or the specified segments/languages. Will automatically transcribe and translate any missing transcriptions and translations. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + language : str + Render this language + + render_type : RenderType + The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DubbingRenderResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.dubbing.render_dub( + dubbing_id="dubbing_id", + language="language", + render_type="mp4", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/render/{jsonable_encoder(language)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "render_type": render_type, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DubbingRenderResponseModel, + construct_type( + type_=DubbingRenderResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + async def dub_a_video_or_an_audio_file( self, *, - file: typing.Optional[str] = OMIT, - csv_file: typing.Optional[str] = OMIT, - foreground_audio_file: typing.Optional[str] = OMIT, - background_audio_file: typing.Optional[str] = OMIT, + file: typing.Optional[core.File] = OMIT, + csv_file: typing.Optional[core.File] = OMIT, + foreground_audio_file: typing.Optional[core.File] = OMIT, + background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, @@ -1837,17 +2003,17 @@ async def dub_a_video_or_an_audio_file( Parameters ---------- - file : typing.Optional[str] - A list of file paths to audio recordings intended for voice cloning + file : typing.Optional[core.File] + See core.File for more documentation - csv_file : typing.Optional[str] - CSV file containing transcription/translation metadata + csv_file : typing.Optional[core.File] + See core.File for more documentation - foreground_audio_file : typing.Optional[str] - For use only with csv input + foreground_audio_file : typing.Optional[core.File] + See core.File for more documentation - background_audio_file : typing.Optional[str] - For use only with csv input + background_audio_file : typing.Optional[core.File] + See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. @@ -1921,10 +2087,6 @@ async def main() -> None: base_url=self._client_wrapper.get_environment().base, method="POST", data={ - "file": file, - "csv_file": csv_file, - "foreground_audio_file": foreground_audio_file, - "background_audio_file": background_audio_file, "name": name, "source_url": source_url, "source_lang": source_lang, @@ -1940,7 +2102,12 @@ async def main() -> None: "disable_voice_cloning": disable_voice_cloning, "mode": mode, }, - files={}, + files={ + "file": file, + "csv_file": csv_file, + "foreground_audio_file": foreground_audio_file, + "background_audio_file": background_audio_file, + }, request_options=request_options, omit=OMIT, ) @@ -2255,13 +2422,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return typing.cast( - str, - construct_type( - type_=str, # type: ignore - object_=_response.json(), - ), - ) + return _response.text # type: ignore if _response.status_code == 403: raise ForbiddenError( typing.cast( diff --git a/src/elevenlabs/forced_alignment/client.py b/src/elevenlabs/forced_alignment/client.py index 720edb51..6d995e95 100644 --- a/src/elevenlabs/forced_alignment/client.py +++ b/src/elevenlabs/forced_alignment/client.py @@ -25,6 +25,7 @@ def create( *, file: core.File, text: str, + enabled_spooled_file: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ForcedAlignmentResponseModel: """ @@ -36,7 +37,10 @@ def create( See core.File for more documentation text : str - The text to align with the audio or video. The input text can be in any format, however diarization is not supported at this time. + The text to align with the audio. The input text can be in any format, however diarization is not supported at this time. + + enabled_spooled_file : typing.Optional[bool] + If true, the file will be streamed to the server and processed in chunks. This is useful for large files that cannot be loaded into memory. The default is false. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -63,6 +67,7 @@ def create( method="POST", data={ "text": text, + "enabled_spooled_file": enabled_spooled_file, }, files={ "file": file, @@ -104,6 +109,7 @@ async def create( *, file: core.File, text: str, + enabled_spooled_file: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ForcedAlignmentResponseModel: """ @@ -115,7 +121,10 @@ async def create( See core.File for more documentation text : str - The text to align with the audio or video. The input text can be in any format, however diarization is not supported at this time. + The text to align with the audio. The input text can be in any format, however diarization is not supported at this time. + + enabled_spooled_file : typing.Optional[bool] + If true, the file will be streamed to the server and processed in chunks. This is useful for large files that cannot be loaded into memory. The default is false. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -150,6 +159,7 @@ async def main() -> None: method="POST", data={ "text": text, + "enabled_spooled_file": enabled_spooled_file, }, files={ "file": file, diff --git a/src/elevenlabs/projects/client.py b/src/elevenlabs/projects/client.py index b4c167ab..30985446 100644 --- a/src/elevenlabs/projects/client.py +++ b/src/elevenlabs/projects/client.py @@ -23,6 +23,7 @@ from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..types.get_projects_response import GetProjectsResponse +from .. import core from .types.add_project_v_1_projects_add_post_request_target_audience import ( AddProjectV1ProjectsAddPostRequestTargetAudience, ) @@ -256,7 +257,7 @@ def add_project( default_paragraph_voice_id: str, default_model_id: str, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, quality_preset: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, @@ -298,8 +299,8 @@ def add_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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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: @@ -399,7 +400,6 @@ def add_project( "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, - "from_document": from_document, "quality_preset": quality_preset, "title": title, "author": author, @@ -420,7 +420,9 @@ def add_project( "auto_assign_voices": auto_assign_voices, "source_type": source_type, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -686,7 +688,7 @@ def edit_project_content( project_id: str, *, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: @@ -701,8 +703,8 @@ def edit_project_content( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. @@ -732,10 +734,11 @@ def edit_project_content( method="POST", data={ "from_url": from_url, - "from_document": from_document, "auto_convert": auto_convert, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -1901,7 +1904,7 @@ async def add_project( default_paragraph_voice_id: str, default_model_id: str, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, quality_preset: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, @@ -1943,8 +1946,8 @@ async def add_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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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: @@ -2052,7 +2055,6 @@ async def main() -> None: "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, - "from_document": from_document, "quality_preset": quality_preset, "title": title, "author": author, @@ -2073,7 +2075,9 @@ async def main() -> None: "auto_assign_voices": auto_assign_voices, "source_type": source_type, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -2363,7 +2367,7 @@ async def edit_project_content( project_id: str, *, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: @@ -2378,8 +2382,8 @@ async def edit_project_content( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. @@ -2417,10 +2421,11 @@ async def main() -> None: method="POST", data={ "from_url": from_url, - "from_document": from_document, "auto_convert": auto_convert, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) diff --git a/src/elevenlabs/pronunciation_dictionary/client.py b/src/elevenlabs/pronunciation_dictionary/client.py index c6b9b2f0..8a333bfe 100644 --- a/src/elevenlabs/pronunciation_dictionary/client.py +++ b/src/elevenlabs/pronunciation_dictionary/client.py @@ -2,6 +2,7 @@ import typing from ..core.client_wrapper import SyncClientWrapper +from .. import core from .types.pronunciation_dictionary_add_from_file_request_workspace_access import ( PronunciationDictionaryAddFromFileRequestWorkspaceAccess, ) @@ -22,13 +23,10 @@ ) from ..core.serialization import convert_and_respect_annotation_metadata from .types.pronunciation_dictionary_rule import PronunciationDictionaryRule -from ..types.add_pronunciation_dictionary_rules_response_model import ( - AddPronunciationDictionaryRulesResponseModel, +from ..types.pronunciation_dictionary_rules_response_model import ( + PronunciationDictionaryRulesResponseModel, ) from ..core.jsonable_encoder import jsonable_encoder -from ..types.remove_pronunciation_dictionary_rules_response_model import ( - RemovePronunciationDictionaryRulesResponseModel, -) from ..types.get_pronunciation_dictionary_metadata_response import ( GetPronunciationDictionaryMetadataResponse, ) @@ -52,7 +50,7 @@ def add_from_file( self, *, name: str, - file: typing.Optional[str] = OMIT, + file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[PronunciationDictionaryAddFromFileRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -65,8 +63,8 @@ def add_from_file( name : str The name of the pronunciation dictionary, used for identification only. - file : typing.Optional[str] - A lexicon .pls file which we will use to initialize the project with. + file : typing.Optional[core.File] + See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. @@ -99,11 +97,12 @@ def add_from_file( method="POST", data={ "name": name, - "file": file, "description": description, "workspace_access": workspace_access, }, - files={}, + files={ + "file": file, + }, request_options=request_options, omit=OMIT, ) @@ -241,7 +240,7 @@ def add_rules( *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, - ) -> AddPronunciationDictionaryRulesResponseModel: + ) -> PronunciationDictionaryRulesResponseModel: """ Add rules to the pronunciation dictionary @@ -260,7 +259,7 @@ def add_rules( Returns ------- - AddPronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -303,9 +302,9 @@ def add_rules( try: if 200 <= _response.status_code < 300: return typing.cast( - AddPronunciationDictionaryRulesResponseModel, + PronunciationDictionaryRulesResponseModel, construct_type( - type_=AddPronunciationDictionaryRulesResponseModel, # type: ignore + type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) @@ -330,7 +329,7 @@ def remove_rules( *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, - ) -> RemovePronunciationDictionaryRulesResponseModel: + ) -> PronunciationDictionaryRulesResponseModel: """ Remove rules from the pronunciation dictionary @@ -347,7 +346,7 @@ def remove_rules( Returns ------- - RemovePronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -378,9 +377,9 @@ def remove_rules( try: if 200 <= _response.status_code < 300: return typing.cast( - RemovePronunciationDictionaryRulesResponseModel, + PronunciationDictionaryRulesResponseModel, construct_type( - type_=RemovePronunciationDictionaryRulesResponseModel, # type: ignore + type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) @@ -604,7 +603,7 @@ async def add_from_file( self, *, name: str, - file: typing.Optional[str] = OMIT, + file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[PronunciationDictionaryAddFromFileRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -617,8 +616,8 @@ async def add_from_file( name : str The name of the pronunciation dictionary, used for identification only. - file : typing.Optional[str] - A lexicon .pls file which we will use to initialize the project with. + file : typing.Optional[core.File] + See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. @@ -659,11 +658,12 @@ async def main() -> None: method="POST", data={ "name": name, - "file": file, "description": description, "workspace_access": workspace_access, }, - files={}, + files={ + "file": file, + }, request_options=request_options, omit=OMIT, ) @@ -809,7 +809,7 @@ async def add_rules( *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, - ) -> AddPronunciationDictionaryRulesResponseModel: + ) -> PronunciationDictionaryRulesResponseModel: """ Add rules to the pronunciation dictionary @@ -828,7 +828,7 @@ async def add_rules( Returns ------- - AddPronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -879,9 +879,9 @@ async def main() -> None: try: if 200 <= _response.status_code < 300: return typing.cast( - AddPronunciationDictionaryRulesResponseModel, + PronunciationDictionaryRulesResponseModel, construct_type( - type_=AddPronunciationDictionaryRulesResponseModel, # type: ignore + type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) @@ -906,7 +906,7 @@ async def remove_rules( *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, - ) -> RemovePronunciationDictionaryRulesResponseModel: + ) -> PronunciationDictionaryRulesResponseModel: """ Remove rules from the pronunciation dictionary @@ -923,7 +923,7 @@ async def remove_rules( Returns ------- - RemovePronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -962,9 +962,9 @@ async def main() -> None: try: if 200 <= _response.status_code < 300: return typing.cast( - RemovePronunciationDictionaryRulesResponseModel, + PronunciationDictionaryRulesResponseModel, construct_type( - type_=RemovePronunciationDictionaryRulesResponseModel, # type: ignore + type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) diff --git a/src/elevenlabs/speech_to_speech/__init__.py b/src/elevenlabs/speech_to_speech/__init__.py index f3ea2659..d120b92b 100644 --- a/src/elevenlabs/speech_to_speech/__init__.py +++ b/src/elevenlabs/speech_to_speech/__init__.py @@ -1,2 +1,5 @@ # This file was auto-generated by Fern from our API Definition. +from .types import SpeechToSpeechConvertAsStreamRequestFileFormat, SpeechToSpeechConvertRequestFileFormat + +__all__ = ["SpeechToSpeechConvertAsStreamRequestFileFormat", "SpeechToSpeechConvertRequestFileFormat"] diff --git a/src/elevenlabs/speech_to_speech/client.py b/src/elevenlabs/speech_to_speech/client.py index f9a96c1c..f36e3ed3 100644 --- a/src/elevenlabs/speech_to_speech/client.py +++ b/src/elevenlabs/speech_to_speech/client.py @@ -4,6 +4,9 @@ from ..core.client_wrapper import SyncClientWrapper from .. import core from ..types.output_format import OutputFormat +from .types.speech_to_speech_convert_request_file_format import ( + SpeechToSpeechConvertRequestFileFormat, +) from ..core.request_options import RequestOptions from ..core.jsonable_encoder import jsonable_encoder from ..errors.unprocessable_entity_error import UnprocessableEntityError @@ -11,6 +14,9 @@ from ..core.unchecked_base_model import construct_type from json.decoder import JSONDecodeError from ..core.api_error import ApiError +from .types.speech_to_speech_convert_as_stream_request_file_format import ( + SpeechToSpeechConvertAsStreamRequestFileFormat, +) from ..core.client_wrapper import AsyncClientWrapper # this is used as the default value for optional parameters @@ -33,6 +39,7 @@ def convert( voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, + file_format: typing.Optional[SpeechToSpeechConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ @@ -74,6 +81,9 @@ def convert( remove_background_noise : typing.Optional[bool] If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. + file_format : typing.Optional[SpeechToSpeechConvertRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -109,6 +119,7 @@ def convert( "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, + "file_format": file_format, }, files={ "audio": audio, @@ -150,6 +161,7 @@ def convert_as_stream( voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, + file_format: typing.Optional[SpeechToSpeechConvertAsStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ @@ -191,6 +203,9 @@ def convert_as_stream( remove_background_noise : typing.Optional[bool] If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. + file_format : typing.Optional[SpeechToSpeechConvertAsStreamRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -226,6 +241,7 @@ def convert_as_stream( "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, + "file_format": file_format, }, files={ "audio": audio, @@ -272,6 +288,7 @@ async def convert( voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, + file_format: typing.Optional[SpeechToSpeechConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ @@ -313,6 +330,9 @@ async def convert( remove_background_noise : typing.Optional[bool] If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. + file_format : typing.Optional[SpeechToSpeechConvertRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -356,6 +376,7 @@ async def main() -> None: "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, + "file_format": file_format, }, files={ "audio": audio, @@ -397,6 +418,7 @@ async def convert_as_stream( voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, + file_format: typing.Optional[SpeechToSpeechConvertAsStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ @@ -438,6 +460,9 @@ async def convert_as_stream( remove_background_noise : typing.Optional[bool] If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. + file_format : typing.Optional[SpeechToSpeechConvertAsStreamRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + 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. @@ -481,6 +506,7 @@ async def main() -> None: "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, + "file_format": file_format, }, files={ "audio": audio, diff --git a/src/elevenlabs/speech_to_speech/types/__init__.py b/src/elevenlabs/speech_to_speech/types/__init__.py new file mode 100644 index 00000000..b7b2b3a5 --- /dev/null +++ b/src/elevenlabs/speech_to_speech/types/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .speech_to_speech_convert_as_stream_request_file_format import SpeechToSpeechConvertAsStreamRequestFileFormat +from .speech_to_speech_convert_request_file_format import SpeechToSpeechConvertRequestFileFormat + +__all__ = ["SpeechToSpeechConvertAsStreamRequestFileFormat", "SpeechToSpeechConvertRequestFileFormat"] diff --git a/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_as_stream_request_file_format.py b/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_as_stream_request_file_format.py new file mode 100644 index 00000000..7af219f2 --- /dev/null +++ b/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_as_stream_request_file_format.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SpeechToSpeechConvertAsStreamRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] diff --git a/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_request_file_format.py b/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_request_file_format.py new file mode 100644 index 00000000..bd34f38f --- /dev/null +++ b/src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_request_file_format.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SpeechToSpeechConvertRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] diff --git a/src/elevenlabs/speech_to_text/__init__.py b/src/elevenlabs/speech_to_text/__init__.py index 8439be26..00dba750 100644 --- a/src/elevenlabs/speech_to_text/__init__.py +++ b/src/elevenlabs/speech_to_text/__init__.py @@ -1,5 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .types import SpeechToTextConvertRequestTimestampsGranularity +from .types import SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestTimestampsGranularity -__all__ = ["SpeechToTextConvertRequestTimestampsGranularity"] +__all__ = ["SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity"] diff --git a/src/elevenlabs/speech_to_text/client.py b/src/elevenlabs/speech_to_text/client.py index 4f5af6f4..b2907c46 100644 --- a/src/elevenlabs/speech_to_text/client.py +++ b/src/elevenlabs/speech_to_text/client.py @@ -7,6 +7,9 @@ SpeechToTextConvertRequestTimestampsGranularity, ) from ..types.additional_formats import AdditionalFormats +from .types.speech_to_text_convert_request_file_format import ( + SpeechToTextConvertRequestFileFormat, +) from ..core.request_options import RequestOptions from ..types.speech_to_text_chunk_response_model import SpeechToTextChunkResponseModel from ..core.unchecked_base_model import construct_type @@ -28,14 +31,16 @@ def convert( self, *, model_id: str, - file: core.File, enable_logging: typing.Optional[bool] = None, + file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, + file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, + cloud_storage_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextChunkResponseModel: """ @@ -44,14 +49,14 @@ def convert( Parameters ---------- model_id : str - The ID of the model to use for transcription, currently only 'scribe_v1' is available. - - file : core.File - See core.File for more documentation + The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. + file : typing.Optional[core.File] + See core.File for more documentation + language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. @@ -70,6 +75,12 @@ def convert( additional_formats : typing.Optional[AdditionalFormats] A list of additional formats to export the transcript to. + file_format : typing.Optional[SpeechToTextConvertRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + + cloud_storage_url : typing.Optional[str] + The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -104,6 +115,8 @@ def convert( "timestamps_granularity": timestamps_granularity, "diarize": diarize, "additional_formats": additional_formats, + "file_format": file_format, + "cloud_storage_url": cloud_storage_url, }, files={ "file": file, @@ -144,14 +157,16 @@ async def convert( self, *, model_id: str, - file: core.File, enable_logging: typing.Optional[bool] = None, + file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, + file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, + cloud_storage_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextChunkResponseModel: """ @@ -160,14 +175,14 @@ async def convert( Parameters ---------- model_id : str - The ID of the model to use for transcription, currently only 'scribe_v1' is available. - - file : core.File - See core.File for more documentation + The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. + file : typing.Optional[core.File] + See core.File for more documentation + language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. @@ -186,6 +201,12 @@ async def convert( additional_formats : typing.Optional[AdditionalFormats] A list of additional formats to export the transcript to. + file_format : typing.Optional[SpeechToTextConvertRequestFileFormat] + The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. + + cloud_storage_url : typing.Optional[str] + The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -228,6 +249,8 @@ async def main() -> None: "timestamps_granularity": timestamps_granularity, "diarize": diarize, "additional_formats": additional_formats, + "file_format": file_format, + "cloud_storage_url": cloud_storage_url, }, files={ "file": file, diff --git a/src/elevenlabs/speech_to_text/types/__init__.py b/src/elevenlabs/speech_to_text/types/__init__.py index 56a43da3..ddb777a1 100644 --- a/src/elevenlabs/speech_to_text/types/__init__.py +++ b/src/elevenlabs/speech_to_text/types/__init__.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +from .speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity -__all__ = ["SpeechToTextConvertRequestTimestampsGranularity"] +__all__ = ["SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity"] diff --git a/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_file_format.py b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_file_format.py new file mode 100644 index 00000000..2dc6c670 --- /dev/null +++ b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_file_format.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SpeechToTextConvertRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] diff --git a/src/elevenlabs/studio/projects/client.py b/src/elevenlabs/studio/projects/client.py index 796dbf5f..41f5aaf9 100644 --- a/src/elevenlabs/studio/projects/client.py +++ b/src/elevenlabs/studio/projects/client.py @@ -9,6 +9,7 @@ from ...types.http_validation_error import HttpValidationError from json.decoder import JSONDecodeError from ...core.api_error import ApiError +from ... import core from .types.projects_add_request_target_audience import ProjectsAddRequestTargetAudience from .types.projects_add_request_fiction import ProjectsAddRequestFiction from .types.projects_add_request_apply_text_normalization import ( @@ -103,7 +104,7 @@ def add( default_paragraph_voice_id: str, default_model_id: str, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, quality_preset: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, @@ -146,8 +147,8 @@ def add( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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: @@ -250,7 +251,6 @@ def add( "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, - "from_document": from_document, "quality_preset": quality_preset, "title": title, "author": author, @@ -272,7 +272,9 @@ def add( "auto_assign_voices": auto_assign_voices, "source_type": source_type, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -538,7 +540,7 @@ def update_content( project_id: str, *, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: @@ -553,8 +555,8 @@ def update_content( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. @@ -584,10 +586,11 @@ def update_content( method="POST", data={ "from_url": from_url, - "from_document": from_document, "auto_convert": auto_convert, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -1097,7 +1100,7 @@ async def add( default_paragraph_voice_id: str, default_model_id: str, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, quality_preset: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, @@ -1140,8 +1143,8 @@ async def add( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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: @@ -1252,7 +1255,6 @@ async def main() -> None: "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, - "from_document": from_document, "quality_preset": quality_preset, "title": title, "author": author, @@ -1274,7 +1276,9 @@ async def main() -> None: "auto_assign_voices": auto_assign_voices, "source_type": source_type, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) @@ -1564,7 +1568,7 @@ async def update_content( project_id: str, *, from_url: typing.Optional[str] = OMIT, - from_document: typing.Optional[str] = OMIT, + from_document: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: @@ -1579,8 +1583,8 @@ async def update_content( 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[str] - An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. 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. @@ -1618,10 +1622,11 @@ async def main() -> None: method="POST", data={ "from_url": from_url, - "from_document": from_document, "auto_convert": auto_convert, }, - files={}, + files={ + "from_document": from_document, + }, request_options=request_options, omit=OMIT, ) diff --git a/src/elevenlabs/text_to_sound_effects/types/text_to_sound_effects_convert_request_output_format.py b/src/elevenlabs/text_to_sound_effects/types/text_to_sound_effects_convert_request_output_format.py index 96fa5d0a..8a3c9905 100644 --- a/src/elevenlabs/text_to_sound_effects/types/text_to_sound_effects_convert_request_output_format.py +++ b/src/elevenlabs/text_to_sound_effects/types/text_to_sound_effects_convert_request_output_format.py @@ -16,6 +16,7 @@ "pcm_24000", "pcm_44100", "ulaw_8000", + "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", diff --git a/src/elevenlabs/text_to_voice/types/text_to_voice_create_previews_request_output_format.py b/src/elevenlabs/text_to_voice/types/text_to_voice_create_previews_request_output_format.py index 20e1c82a..cdf6ef0b 100644 --- a/src/elevenlabs/text_to_voice/types/text_to_voice_create_previews_request_output_format.py +++ b/src/elevenlabs/text_to_voice/types/text_to_voice_create_previews_request_output_format.py @@ -16,6 +16,7 @@ "pcm_24000", "pcm_44100", "ulaw_8000", + "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py index 2873a9e0..c97e76e7 100644 --- a/src/elevenlabs/types/__init__.py +++ b/src/elevenlabs/types/__init__.py @@ -5,7 +5,9 @@ from .add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from .add_project_response_model import AddProjectResponseModel from .add_pronunciation_dictionary_response_model import AddPronunciationDictionaryResponseModel -from .add_pronunciation_dictionary_rules_response_model import AddPronunciationDictionaryRulesResponseModel +from .add_pronunciation_dictionary_response_model_permission_on_resource import ( + AddPronunciationDictionaryResponseModelPermissionOnResource, +) from .add_sharing_voice_request import AddSharingVoiceRequest from .add_voice_ivc_response_model import AddVoiceIvcResponseModel from .add_voice_response_model import AddVoiceResponseModel @@ -38,6 +40,7 @@ from .audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel from .audio_native_edit_content_response_model import AudioNativeEditContentResponseModel from .audio_native_project_settings_response_model import AudioNativeProjectSettingsResponseModel +from .audio_native_project_settings_response_model_status import AudioNativeProjectSettingsResponseModelStatus from .audio_output import AudioOutput from .audio_with_timestamps_response_model import AudioWithTimestampsResponseModel from .auth_settings import AuthSettings @@ -49,6 +52,9 @@ from .body_add_to_knowledge_base_v_1_convai_agents_agent_id_add_to_knowledge_base_post import ( BodyAddToKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost, ) +from .body_retrieve_voice_sample_audio_v_1_voices_pvc_voice_id_samples_sample_id_audio_get import ( + BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet, +) from .breakdown_types import BreakdownTypes from .chapter_content_block_extendable_node_response_model import ChapterContentBlockExtendableNodeResponseModel from .chapter_content_block_input_model import ChapterContentBlockInputModel @@ -98,6 +104,7 @@ from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .conversation_deletion_settings import ConversationDeletionSettings from .conversation_history_analysis_common_model import ConversationHistoryAnalysisCommonModel +from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel from .conversation_history_evaluation_criteria_result_common_model import ( ConversationHistoryEvaluationCriteriaResultCommonModel, ) @@ -107,9 +114,19 @@ ConversationHistoryMetadataCommonModelPhoneCall, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ) +from .conversation_history_rag_usage_common_model import ConversationHistoryRagUsageCommonModel from .conversation_history_transcript_common_model import ConversationHistoryTranscriptCommonModel from .conversation_history_transcript_common_model_role import ConversationHistoryTranscriptCommonModelRole +from .conversation_history_transcript_tool_call_client_details import ConversationHistoryTranscriptToolCallClientDetails from .conversation_history_transcript_tool_call_common_model import ConversationHistoryTranscriptToolCallCommonModel +from .conversation_history_transcript_tool_call_common_model_tool_details import ( + ConversationHistoryTranscriptToolCallCommonModelToolDetails, + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client, + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook, +) +from .conversation_history_transcript_tool_call_webhook_details import ( + ConversationHistoryTranscriptToolCallWebhookDetails, +) from .conversation_history_transcript_tool_result_common_model import ConversationHistoryTranscriptToolResultCommonModel from .conversation_history_twilio_phone_call_model import ConversationHistoryTwilioPhoneCallModel from .conversation_history_twilio_phone_call_model_direction import ConversationHistoryTwilioPhoneCallModelDirection @@ -152,8 +169,10 @@ from .delete_project_response_model import DeleteProjectResponseModel from .delete_sample_response_model import DeleteSampleResponseModel from .delete_voice_response_model import DeleteVoiceResponseModel +from .delete_voice_sample_response_model import DeleteVoiceSampleResponseModel from .delete_workspace_group_member_response_model import DeleteWorkspaceGroupMemberResponseModel from .delete_workspace_invite_response_model import DeleteWorkspaceInviteResponseModel +from .delete_workspace_member_response_model import DeleteWorkspaceMemberResponseModel from .dependent_available_agent_identifier import DependentAvailableAgentIdentifier from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel from .dependent_available_agent_tool_identifier import DependentAvailableAgentToolIdentifier @@ -171,6 +190,7 @@ from .dubbing_media_metadata import DubbingMediaMetadata from .dubbing_media_reference import DubbingMediaReference from .dubbing_metadata_response import DubbingMetadataResponse +from .dubbing_render_response_model import DubbingRenderResponseModel from .dubbing_resource import DubbingResource from .dynamic_variables_config import DynamicVariablesConfig from .dynamic_variables_config_dynamic_variable_placeholders_value import ( @@ -182,6 +202,7 @@ from .edit_voice_settings_response_model import EditVoiceSettingsResponseModel from .embed_variant import EmbedVariant from .embedding_model_enum import EmbeddingModelEnum +from .end_call_tool_config import EndCallToolConfig from .evaluation_settings import EvaluationSettings from .evaluation_success_result import EvaluationSuccessResult from .export_options import ( @@ -255,6 +276,9 @@ from .get_projects_response import GetProjectsResponse from .get_pronunciation_dictionaries_metadata_response_model import GetPronunciationDictionariesMetadataResponseModel from .get_pronunciation_dictionary_metadata_response import GetPronunciationDictionaryMetadataResponse +from .get_pronunciation_dictionary_metadata_response_model_permission_on_resource import ( + GetPronunciationDictionaryMetadataResponseModelPermissionOnResource, +) from .get_speech_history_response import GetSpeechHistoryResponse from .get_voices_response import GetVoicesResponse from .get_voices_v_2_response_model import GetVoicesV2ResponseModel @@ -272,6 +296,7 @@ from .knowledge_base_document_type import KnowledgeBaseDocumentType from .knowledge_base_locator import KnowledgeBaseLocator from .language_added_response import LanguageAddedResponse +from .language_detection_tool_config import LanguageDetectionToolConfig from .language_preset_input import LanguagePresetInput from .language_preset_output import LanguagePresetOutput from .language_preset_translation import LanguagePresetTranslation @@ -349,8 +374,12 @@ from .prompt_evaluation_criteria import PromptEvaluationCriteria from .pronunciation_dictionary_alias_rule_request_model import PronunciationDictionaryAliasRuleRequestModel from .pronunciation_dictionary_phoneme_rule_request_model import PronunciationDictionaryPhonemeRuleRequestModel +from .pronunciation_dictionary_rules_response_model import PronunciationDictionaryRulesResponseModel from .pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from .pronunciation_dictionary_version_response_model import PronunciationDictionaryVersionResponseModel +from .pronunciation_dictionary_version_response_model_permission_on_resource import ( + PronunciationDictionaryVersionResponseModelPermissionOnResource, +) from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .query_params_json_schema import QueryParamsJsonSchema from .rag_chunk_metadata import RagChunkMetadata @@ -362,7 +391,10 @@ from .reader_resource_response_model_resource_type import ReaderResourceResponseModelResourceType from .realtime_voice_settings import RealtimeVoiceSettings from .recording_response import RecordingResponse -from .remove_pronunciation_dictionary_rules_response_model import RemovePronunciationDictionaryRulesResponseModel +from .render import Render +from .render_status import RenderStatus +from .render_type import RenderType +from .request_pvc_manual_verification_response_model import RequestPvcManualVerificationResponseModel from .resource_access_info import ResourceAccessInfo from .resource_access_info_role import ResourceAccessInfoRole from .resource_metadata_response_model import ResourceMetadataResponseModel @@ -383,6 +415,7 @@ from .share_option_response_model import ShareOptionResponseModel from .share_option_response_model_type import ShareOptionResponseModelType from .sip_trunk_credentials import SipTrunkCredentials +from .speaker_audio_response_model import SpeakerAudioResponseModel from .speaker_response_model import SpeakerResponseModel from .speaker_segment import SpeakerSegment from .speaker_separation_response_model import SpeakerSeparationResponseModel @@ -396,6 +429,8 @@ from .speech_to_text_word_response_model import SpeechToTextWordResponseModel from .speech_to_text_word_response_model_type import SpeechToTextWordResponseModelType from .srt_export_options import SrtExportOptions +from .start_pvc_voice_training_response_model import StartPvcVoiceTrainingResponseModel +from .start_speaker_separation_response_model import StartSpeakerSeparationResponseModel from .streaming_audio_chunk_with_timestamps_response_model import StreamingAudioChunkWithTimestampsResponseModel from .subscription import Subscription from .subscription_response import SubscriptionResponse @@ -404,9 +439,24 @@ from .subscription_response_model_currency import SubscriptionResponseModelCurrency from .subscription_status import SubscriptionStatus from .subscription_usage_response_model import SubscriptionUsageResponseModel -from .system_tool_config import SystemToolConfig +from .system_tool_config_input import SystemToolConfigInput +from .system_tool_config_input_params import ( + SystemToolConfigInputParams, + SystemToolConfigInputParams_EndCall, + SystemToolConfigInputParams_LanguageDetection, + SystemToolConfigInputParams_TransferToAgent, +) +from .system_tool_config_output import SystemToolConfigOutput +from .system_tool_config_output_params import ( + SystemToolConfigOutputParams, + SystemToolConfigOutputParams_EndCall, + SystemToolConfigOutputParams_LanguageDetection, + SystemToolConfigOutputParams_TransferToAgent, +) from .telephony_provider import TelephonyProvider from .text_to_speech_as_stream_request import TextToSpeechAsStreamRequest +from .transfer import Transfer +from .transfer_to_agent_tool_config import TransferToAgentToolConfig from .tts_conversational_config import TtsConversationalConfig from .tts_conversational_config_override import TtsConversationalConfigOverride from .tts_conversational_config_override_config import TtsConversationalConfigOverrideConfig @@ -428,6 +478,7 @@ from .validation_error_loc_item import ValidationErrorLocItem from .verification_attempt_response import VerificationAttemptResponse from .verified_voice_language_response_model import VerifiedVoiceLanguageResponseModel +from .verify_pvc_voice_captcha_response_model import VerifyPvcVoiceCaptchaResponseModel from .voice import Voice from .voice_generation_parameter_option_response import VoiceGenerationParameterOptionResponse from .voice_generation_parameter_response import VoiceGenerationParameterResponse @@ -436,6 +487,8 @@ from .voice_response_model_category import VoiceResponseModelCategory from .voice_response_model_safety_control import VoiceResponseModelSafetyControl from .voice_sample import VoiceSample +from .voice_sample_preview_response_model import VoiceSamplePreviewResponseModel +from .voice_sample_visual_waveform_response_model import VoiceSampleVisualWaveformResponseModel from .voice_settings import VoiceSettings from .voice_sharing_moderation_check_response_model import VoiceSharingModerationCheckResponseModel from .voice_sharing_response import VoiceSharingResponse @@ -479,7 +532,7 @@ "AddKnowledgeBaseResponseModel", "AddProjectResponseModel", "AddPronunciationDictionaryResponseModel", - "AddPronunciationDictionaryRulesResponseModel", + "AddPronunciationDictionaryResponseModelPermissionOnResource", "AddSharingVoiceRequest", "AddVoiceIvcResponseModel", "AddVoiceResponseModel", @@ -512,6 +565,7 @@ "AudioNativeCreateProjectResponseModel", "AudioNativeEditContentResponseModel", "AudioNativeProjectSettingsResponseModel", + "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", "AudioWithTimestampsResponseModel", "AuthSettings", @@ -519,6 +573,7 @@ "BanReasonType", "BodyAddToKnowledgeBaseV1ConvaiAddToKnowledgeBasePost", "BodyAddToKnowledgeBaseV1ConvaiAgentsAgentIdAddToKnowledgeBasePost", + "BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet", "BreakdownTypes", "ChapterContentBlockExtendableNodeResponseModel", "ChapterContentBlockInputModel", @@ -562,14 +617,21 @@ "ConversationConfigClientOverrideOutput", "ConversationDeletionSettings", "ConversationHistoryAnalysisCommonModel", + "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", + "ConversationHistoryRagUsageCommonModel", "ConversationHistoryTranscriptCommonModel", "ConversationHistoryTranscriptCommonModelRole", + "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModel", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client", + "ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook", + "ConversationHistoryTranscriptToolCallWebhookDetails", "ConversationHistoryTranscriptToolResultCommonModel", "ConversationHistoryTwilioPhoneCallModel", "ConversationHistoryTwilioPhoneCallModelDirection", @@ -606,8 +668,10 @@ "DeleteProjectResponseModel", "DeleteSampleResponseModel", "DeleteVoiceResponseModel", + "DeleteVoiceSampleResponseModel", "DeleteWorkspaceGroupMemberResponseModel", "DeleteWorkspaceInviteResponseModel", + "DeleteWorkspaceMemberResponseModel", "DependentAvailableAgentIdentifier", "DependentAvailableAgentIdentifierAccessLevel", "DependentAvailableAgentToolIdentifier", @@ -625,6 +689,7 @@ "DubbingMediaMetadata", "DubbingMediaReference", "DubbingMetadataResponse", + "DubbingRenderResponseModel", "DubbingResource", "DynamicVariablesConfig", "DynamicVariablesConfigDynamicVariablePlaceholdersValue", @@ -634,6 +699,7 @@ "EditVoiceSettingsResponseModel", "EmbedVariant", "EmbeddingModelEnum", + "EndCallToolConfig", "EvaluationSettings", "EvaluationSuccessResult", "ExportOptions", @@ -693,6 +759,7 @@ "GetProjectsResponse", "GetPronunciationDictionariesMetadataResponseModel", "GetPronunciationDictionaryMetadataResponse", + "GetPronunciationDictionaryMetadataResponseModelPermissionOnResource", "GetSpeechHistoryResponse", "GetVoicesResponse", "GetVoicesV2ResponseModel", @@ -710,6 +777,7 @@ "KnowledgeBaseDocumentType", "KnowledgeBaseLocator", "LanguageAddedResponse", + "LanguageDetectionToolConfig", "LanguagePresetInput", "LanguagePresetOutput", "LanguagePresetTranslation", @@ -783,8 +851,10 @@ "PromptEvaluationCriteria", "PronunciationDictionaryAliasRuleRequestModel", "PronunciationDictionaryPhonemeRuleRequestModel", + "PronunciationDictionaryRulesResponseModel", "PronunciationDictionaryVersionLocator", "PronunciationDictionaryVersionResponseModel", + "PronunciationDictionaryVersionResponseModelPermissionOnResource", "PydanticPronunciationDictionaryVersionLocator", "QueryParamsJsonSchema", "RagChunkMetadata", @@ -796,7 +866,10 @@ "ReaderResourceResponseModelResourceType", "RealtimeVoiceSettings", "RecordingResponse", - "RemovePronunciationDictionaryRulesResponseModel", + "Render", + "RenderStatus", + "RenderType", + "RequestPvcManualVerificationResponseModel", "ResourceAccessInfo", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", @@ -817,6 +890,7 @@ "ShareOptionResponseModel", "ShareOptionResponseModelType", "SipTrunkCredentials", + "SpeakerAudioResponseModel", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", @@ -830,6 +904,8 @@ "SpeechToTextWordResponseModel", "SpeechToTextWordResponseModelType", "SrtExportOptions", + "StartPvcVoiceTrainingResponseModel", + "StartSpeakerSeparationResponseModel", "StreamingAudioChunkWithTimestampsResponseModel", "Subscription", "SubscriptionResponse", @@ -838,9 +914,20 @@ "SubscriptionResponseModelCurrency", "SubscriptionStatus", "SubscriptionUsageResponseModel", - "SystemToolConfig", + "SystemToolConfigInput", + "SystemToolConfigInputParams", + "SystemToolConfigInputParams_EndCall", + "SystemToolConfigInputParams_LanguageDetection", + "SystemToolConfigInputParams_TransferToAgent", + "SystemToolConfigOutput", + "SystemToolConfigOutputParams", + "SystemToolConfigOutputParams_EndCall", + "SystemToolConfigOutputParams_LanguageDetection", + "SystemToolConfigOutputParams_TransferToAgent", "TelephonyProvider", "TextToSpeechAsStreamRequest", + "Transfer", + "TransferToAgentToolConfig", "TtsConversationalConfig", "TtsConversationalConfigOverride", "TtsConversationalConfigOverrideConfig", @@ -862,6 +949,7 @@ "ValidationErrorLocItem", "VerificationAttemptResponse", "VerifiedVoiceLanguageResponseModel", + "VerifyPvcVoiceCaptchaResponseModel", "Voice", "VoiceGenerationParameterOptionResponse", "VoiceGenerationParameterResponse", @@ -870,6 +958,8 @@ "VoiceResponseModelCategory", "VoiceResponseModelSafetyControl", "VoiceSample", + "VoiceSamplePreviewResponseModel", + "VoiceSampleVisualWaveformResponseModel", "VoiceSettings", "VoiceSharingModerationCheckResponseModel", "VoiceSharingResponse", diff --git a/src/elevenlabs/types/add_pronunciation_dictionary_response_model.py b/src/elevenlabs/types/add_pronunciation_dictionary_response_model.py index 5afe1f3c..4498ce65 100644 --- a/src/elevenlabs/types/add_pronunciation_dictionary_response_model.py +++ b/src/elevenlabs/types/add_pronunciation_dictionary_response_model.py @@ -3,6 +3,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic import typing +from .add_pronunciation_dictionary_response_model_permission_on_resource import ( + AddPronunciationDictionaryResponseModelPermissionOnResource, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -42,6 +45,13 @@ class AddPronunciationDictionaryResponseModel(UncheckedBaseModel): The description of the pronunciation dictionary. """ + permission_on_resource: typing.Optional[AddPronunciationDictionaryResponseModelPermissionOnResource] = ( + pydantic.Field(default=None) + ) + """ + The permission on the resource of the pronunciation dictionary. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/add_pronunciation_dictionary_response_model_permission_on_resource.py b/src/elevenlabs/types/add_pronunciation_dictionary_response_model_permission_on_resource.py new file mode 100644 index 00000000..d3f06f0e --- /dev/null +++ b/src/elevenlabs/types/add_pronunciation_dictionary_response_model_permission_on_resource.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AddPronunciationDictionaryResponseModelPermissionOnResource = typing.Union[ + typing.Literal["admin", "editor", "viewer"], typing.Any +] diff --git a/src/elevenlabs/types/audio_native_project_settings_response_model.py b/src/elevenlabs/types/audio_native_project_settings_response_model.py index e805ca9c..3b79f2ad 100644 --- a/src/elevenlabs/types/audio_native_project_settings_response_model.py +++ b/src/elevenlabs/types/audio_native_project_settings_response_model.py @@ -3,6 +3,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic import typing +from .audio_native_project_settings_response_model_status import ( + AudioNativeProjectSettingsResponseModelStatus, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -52,6 +55,11 @@ class AudioNativeProjectSettingsResponseModel(UncheckedBaseModel): The URL of the audio file. """ + status: typing.Optional[AudioNativeProjectSettingsResponseModelStatus] = pydantic.Field(default=None) + """ + Current state of the project + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/audio_native_project_settings_response_model_status.py b/src/elevenlabs/types/audio_native_project_settings_response_model_status.py new file mode 100644 index 00000000..edbf92f6 --- /dev/null +++ b/src/elevenlabs/types/audio_native_project_settings_response_model_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AudioNativeProjectSettingsResponseModelStatus = typing.Union[typing.Literal["processing", "ready"], typing.Any] diff --git a/src/elevenlabs/types/authorization_method.py b/src/elevenlabs/types/authorization_method.py index f56ee52c..0446c46a 100644 --- a/src/elevenlabs/types/authorization_method.py +++ b/src/elevenlabs/types/authorization_method.py @@ -3,6 +3,6 @@ import typing AuthorizationMethod = typing.Union[ - typing.Literal["public", "authorization_header", "signed_url", "shareable_link"], + typing.Literal["invalid", "public", "authorization_header", "signed_url", "shareable_link"], typing.Any, ] diff --git a/src/elevenlabs/types/body_retrieve_voice_sample_audio_v_1_voices_pvc_voice_id_samples_sample_id_audio_get.py b/src/elevenlabs/types/body_retrieve_voice_sample_audio_v_1_voices_pvc_voice_id_samples_sample_id_audio_get.py new file mode 100644 index 00000000..889dc788 --- /dev/null +++ b/src/elevenlabs/types/body_retrieve_voice_sample_audio_v_1_voices_pvc_voice_id_samples_sample_id_audio_get.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet(UncheckedBaseModel): + remove_background_noise: typing.Optional[bool] = pydantic.Field(default=None) + """ + If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/client_event.py b/src/elevenlabs/types/client_event.py index 5152c634..154970b7 100644 --- a/src/elevenlabs/types/client_event.py +++ b/src/elevenlabs/types/client_event.py @@ -13,7 +13,7 @@ "agent_response", "agent_response_correction", "client_tool_call", - "internal_vad_score", + "vad_score", "internal_turn_probability", "internal_tentative_agent_response", ], diff --git a/src/elevenlabs/types/client_tool_config_input.py b/src/elevenlabs/types/client_tool_config_input.py index 79aa7b0e..28f5b724 100644 --- a/src/elevenlabs/types/client_tool_config_input.py +++ b/src/elevenlabs/types/client_tool_config_input.py @@ -14,6 +14,7 @@ class ClientToolConfigInput(UncheckedBaseModel): A client tool is one that sends an event to the user's client to trigger something client side """ + id: typing.Optional[str] = None name: str description: str parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/client_tool_config_output.py b/src/elevenlabs/types/client_tool_config_output.py index 59e7121a..8525744b 100644 --- a/src/elevenlabs/types/client_tool_config_output.py +++ b/src/elevenlabs/types/client_tool_config_output.py @@ -14,6 +14,7 @@ class ClientToolConfigOutput(UncheckedBaseModel): A client tool is one that sends an event to the user's client to trigger something client side """ + id: typing.Optional[str] = None name: str description: str parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/conversation_charging_common_model.py b/src/elevenlabs/types/conversation_charging_common_model.py index cfbf5468..8526473e 100644 --- a/src/elevenlabs/types/conversation_charging_common_model.py +++ b/src/elevenlabs/types/conversation_charging_common_model.py @@ -8,6 +8,7 @@ class ConversationChargingCommonModel(UncheckedBaseModel): dev_discount: typing.Optional[bool] = None + tier: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/conversation_history_error_common_model.py b/src/elevenlabs/types/conversation_history_error_common_model.py new file mode 100644 index 00000000..1e1ba57a --- /dev/null +++ b/src/elevenlabs/types/conversation_history_error_common_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ConversationHistoryErrorCommonModel(UncheckedBaseModel): + code: int + reason: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_history_metadata_common_model.py b/src/elevenlabs/types/conversation_history_metadata_common_model.py index 2a56b1da..fbef35ab 100644 --- a/src/elevenlabs/types/conversation_history_metadata_common_model.py +++ b/src/elevenlabs/types/conversation_history_metadata_common_model.py @@ -11,12 +11,17 @@ from .conversation_history_metadata_common_model_phone_call import ( ConversationHistoryMetadataCommonModelPhoneCall, ) +from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel +from .conversation_history_rag_usage_common_model import ( + ConversationHistoryRagUsageCommonModel, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic class ConversationHistoryMetadataCommonModel(UncheckedBaseModel): start_time_unix_secs: int + accepted_time_unix_secs: typing.Optional[int] = None call_duration_secs: int cost: typing.Optional[int] = None deletion_settings: typing.Optional[ConversationDeletionSettings] = None @@ -25,6 +30,9 @@ class ConversationHistoryMetadataCommonModel(UncheckedBaseModel): charging: typing.Optional[ConversationChargingCommonModel] = None phone_call: typing.Optional[ConversationHistoryMetadataCommonModelPhoneCall] = None termination_reason: typing.Optional[str] = None + error: typing.Optional[ConversationHistoryErrorCommonModel] = None + main_language: typing.Optional[str] = None + rag_usage: typing.Optional[ConversationHistoryRagUsageCommonModel] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/conversation_history_rag_usage_common_model.py b/src/elevenlabs/types/conversation_history_rag_usage_common_model.py new file mode 100644 index 00000000..c2df23ee --- /dev/null +++ b/src/elevenlabs/types/conversation_history_rag_usage_common_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class ConversationHistoryRagUsageCommonModel(UncheckedBaseModel): + usage_count: int + embedding_model: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_history_transcript_tool_call_client_details.py b/src/elevenlabs/types/conversation_history_transcript_tool_call_client_details.py new file mode 100644 index 00000000..9f84fddf --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_tool_call_client_details.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class ConversationHistoryTranscriptToolCallClientDetails(UncheckedBaseModel): + parameters: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model.py b/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model.py index 07b65881..0ead68fb 100644 --- a/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model.py +++ b/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model.py @@ -2,6 +2,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing +from .conversation_history_transcript_tool_call_common_model_tool_details import ( + ConversationHistoryTranscriptToolCallCommonModelToolDetails, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -12,6 +15,7 @@ class ConversationHistoryTranscriptToolCallCommonModel(UncheckedBaseModel): tool_name: str params_as_json: str tool_has_been_called: bool + tool_details: typing.Optional[ConversationHistoryTranscriptToolCallCommonModelToolDetails] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model_tool_details.py b/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model_tool_details.py new file mode 100644 index 00000000..ca860d50 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_tool_call_common_model_tool_details.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +import typing_extensions +from ..core.unchecked_base_model import UnionMetadata + + +class ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client(UncheckedBaseModel): + type: typing.Literal["client"] = "client" + parameters: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook(UncheckedBaseModel): + type: typing.Literal["webhook"] = "webhook" + method: str + url: str + headers: typing.Optional[typing.Dict[str, str]] = None + path_params: typing.Optional[typing.Dict[str, str]] = None + query_params: typing.Optional[typing.Dict[str, str]] = None + body: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationHistoryTranscriptToolCallCommonModelToolDetails = typing_extensions.Annotated[ + typing.Union[ + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Client, + ConversationHistoryTranscriptToolCallCommonModelToolDetails_Webhook, + ], + UnionMetadata(discriminant="type"), +] diff --git a/src/elevenlabs/types/conversation_history_transcript_tool_call_webhook_details.py b/src/elevenlabs/types/conversation_history_transcript_tool_call_webhook_details.py new file mode 100644 index 00000000..c5787ce6 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_tool_call_webhook_details.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ConversationHistoryTranscriptToolCallWebhookDetails(UncheckedBaseModel): + method: str + url: str + headers: typing.Optional[typing.Dict[str, str]] = None + path_params: typing.Optional[typing.Dict[str, str]] = None + query_params: typing.Optional[typing.Dict[str, str]] = None + body: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_summary_response_model_status.py b/src/elevenlabs/types/conversation_summary_response_model_status.py index cab76a0e..08b073c3 100644 --- a/src/elevenlabs/types/conversation_summary_response_model_status.py +++ b/src/elevenlabs/types/conversation_summary_response_model_status.py @@ -2,4 +2,6 @@ import typing -ConversationSummaryResponseModelStatus = typing.Union[typing.Literal["processing", "done", "failed"], typing.Any] +ConversationSummaryResponseModelStatus = typing.Union[ + typing.Literal["in-progress", "processing", "done", "failed"], typing.Any +] diff --git a/src/elevenlabs/types/delete_voice_response_model.py b/src/elevenlabs/types/delete_voice_response_model.py index d81e628b..6464ca65 100644 --- a/src/elevenlabs/types/delete_voice_response_model.py +++ b/src/elevenlabs/types/delete_voice_response_model.py @@ -9,7 +9,7 @@ class DeleteVoiceResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ - The status of the voice deletion. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + The status of the voice deletion request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/delete_voice_sample_response_model.py b/src/elevenlabs/types/delete_voice_sample_response_model.py new file mode 100644 index 00000000..75a72505 --- /dev/null +++ b/src/elevenlabs/types/delete_voice_sample_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class DeleteVoiceSampleResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the voice sample deletion request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/delete_workspace_member_response_model.py b/src/elevenlabs/types/delete_workspace_member_response_model.py new file mode 100644 index 00000000..05515c9d --- /dev/null +++ b/src/elevenlabs/types/delete_workspace_member_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class DeleteWorkspaceMemberResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the workspace member deletion request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/dubbing_render_response_model.py b/src/elevenlabs/types/dubbing_render_response_model.py new file mode 100644 index 00000000..e0cd09fd --- /dev/null +++ b/src/elevenlabs/types/dubbing_render_response_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class DubbingRenderResponseModel(UncheckedBaseModel): + version: int + render_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/dubbing_resource.py b/src/elevenlabs/types/dubbing_resource.py index e3f168f7..e1d17a44 100644 --- a/src/elevenlabs/types/dubbing_resource.py +++ b/src/elevenlabs/types/dubbing_resource.py @@ -5,6 +5,7 @@ from .dubbing_media_reference import DubbingMediaReference from .speaker_track import SpeakerTrack from .speaker_segment import SpeakerSegment +from .render import Render from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -14,10 +15,12 @@ class DubbingResource(UncheckedBaseModel): version: int source_language: str target_languages: typing.List[str] + input: DubbingMediaReference background: DubbingMediaReference foreground: DubbingMediaReference speaker_tracks: typing.Dict[str, SpeakerTrack] speaker_segments: typing.Dict[str, SpeakerSegment] + renders: typing.Dict[str, Render] if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/end_call_tool_config.py b/src/elevenlabs/types/end_call_tool_config.py new file mode 100644 index 00000000..e48f5398 --- /dev/null +++ b/src/elevenlabs/types/end_call_tool_config.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class EndCallToolConfig(UncheckedBaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/export_options.py b/src/elevenlabs/types/export_options.py index e1ec2707..7d59978e 100644 --- a/src/elevenlabs/types/export_options.py +++ b/src/elevenlabs/types/export_options.py @@ -65,6 +65,8 @@ class Config: class ExportOptions_SegmentedJson(UncheckedBaseModel): format: typing.Literal["segmented_json"] = "segmented_json" + include_speakers: typing.Optional[bool] = None + include_timestamps: typing.Optional[bool] = None segment_on_silence_longer_than_s: typing.Optional[float] = None max_segment_duration_s: typing.Optional[float] = None max_segment_chars: typing.Optional[int] = None diff --git a/src/elevenlabs/types/get_conversation_response_model.py b/src/elevenlabs/types/get_conversation_response_model.py index a0f422f3..a049f515 100644 --- a/src/elevenlabs/types/get_conversation_response_model.py +++ b/src/elevenlabs/types/get_conversation_response_model.py @@ -27,6 +27,9 @@ class GetConversationResponseModel(UncheckedBaseModel): metadata: ConversationHistoryMetadataCommonModel analysis: typing.Optional[ConversationHistoryAnalysisCommonModel] = None conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestOutput] = None + has_audio: bool + has_user_audio: bool + has_response_audio: bool if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/get_conversation_response_model_status.py b/src/elevenlabs/types/get_conversation_response_model_status.py index 1d3731a7..a379e672 100644 --- a/src/elevenlabs/types/get_conversation_response_model_status.py +++ b/src/elevenlabs/types/get_conversation_response_model_status.py @@ -2,4 +2,6 @@ import typing -GetConversationResponseModelStatus = typing.Union[typing.Literal["processing", "done", "failed"], typing.Any] +GetConversationResponseModelStatus = typing.Union[ + typing.Literal["in-progress", "processing", "done", "failed"], typing.Any +] diff --git a/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response.py b/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response.py index 743f5ecf..e4dc7c4f 100644 --- a/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response.py +++ b/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response.py @@ -3,6 +3,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic import typing +from .get_pronunciation_dictionary_metadata_response_model_permission_on_resource import ( + GetPronunciationDictionaryMetadataResponseModelPermissionOnResource, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -27,6 +30,13 @@ class GetPronunciationDictionaryMetadataResponse(UncheckedBaseModel): The name of the pronunciation dictionary. """ + permission_on_resource: typing.Optional[GetPronunciationDictionaryMetadataResponseModelPermissionOnResource] = ( + pydantic.Field(default=None) + ) + """ + The permission on the resource of the pronunciation dictionary. + """ + created_by: str = pydantic.Field() """ The user ID of the creator of the pronunciation dictionary. diff --git a/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response_model_permission_on_resource.py b/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response_model_permission_on_resource.py new file mode 100644 index 00000000..9535f1d2 --- /dev/null +++ b/src/elevenlabs/types/get_pronunciation_dictionary_metadata_response_model_permission_on_resource.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetPronunciationDictionaryMetadataResponseModelPermissionOnResource = typing.Union[ + typing.Literal["admin", "editor", "viewer"], typing.Any +] diff --git a/src/elevenlabs/types/language_detection_tool_config.py b/src/elevenlabs/types/language_detection_tool_config.py new file mode 100644 index 00000000..248c0084 --- /dev/null +++ b/src/elevenlabs/types/language_detection_tool_config.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class LanguageDetectionToolConfig(UncheckedBaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/llm.py b/src/elevenlabs/types/llm.py index df8b0f03..79096990 100644 --- a/src/elevenlabs/types/llm.py +++ b/src/elevenlabs/types/llm.py @@ -8,6 +8,9 @@ "gpt-4o", "gpt-4", "gpt-4-turbo", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", "gpt-3.5-turbo", "gemini-1.5-pro", "gemini-1.5-flash", diff --git a/src/elevenlabs/types/prompt_agent_input_tools_item.py b/src/elevenlabs/types/prompt_agent_input_tools_item.py index dd32d21d..5b188dc7 100644 --- a/src/elevenlabs/types/prompt_agent_input_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_input_tools_item.py @@ -8,6 +8,7 @@ from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +from .system_tool_config_input_params import SystemToolConfigInputParams from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput import typing_extensions from ..core.unchecked_base_model import UnionMetadata @@ -19,6 +20,7 @@ class PromptAgentInputToolsItem_Client(UncheckedBaseModel): """ type: typing.Literal["client"] = "client" + id: typing.Optional[str] = None name: str description: str parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = None @@ -42,8 +44,10 @@ class PromptAgentInputToolsItem_System(UncheckedBaseModel): """ type: typing.Literal["system"] = "system" + id: typing.Optional[str] = None name: str description: str + params: SystemToolConfigInputParams if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -61,6 +65,7 @@ class PromptAgentInputToolsItem_Webhook(UncheckedBaseModel): """ type: typing.Literal["webhook"] = "webhook" + id: typing.Optional[str] = None name: str description: str api_schema: WebhookToolApiSchemaConfigInput diff --git a/src/elevenlabs/types/prompt_agent_output_tools_item.py b/src/elevenlabs/types/prompt_agent_output_tools_item.py index b7c619ff..3995827b 100644 --- a/src/elevenlabs/types/prompt_agent_output_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_output_tools_item.py @@ -8,6 +8,7 @@ from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +from .system_tool_config_output_params import SystemToolConfigOutputParams from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput import typing_extensions from ..core.unchecked_base_model import UnionMetadata @@ -19,6 +20,7 @@ class PromptAgentOutputToolsItem_Client(UncheckedBaseModel): """ type: typing.Literal["client"] = "client" + id: typing.Optional[str] = None name: str description: str parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = None @@ -42,8 +44,10 @@ class PromptAgentOutputToolsItem_System(UncheckedBaseModel): """ type: typing.Literal["system"] = "system" + id: typing.Optional[str] = None name: str description: str + params: SystemToolConfigOutputParams if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -61,6 +65,7 @@ class PromptAgentOutputToolsItem_Webhook(UncheckedBaseModel): """ type: typing.Literal["webhook"] = "webhook" + id: typing.Optional[str] = None name: str description: str api_schema: WebhookToolApiSchemaConfigOutput diff --git a/src/elevenlabs/types/add_pronunciation_dictionary_rules_response_model.py b/src/elevenlabs/types/pronunciation_dictionary_rules_response_model.py similarity index 92% rename from src/elevenlabs/types/add_pronunciation_dictionary_rules_response_model.py rename to src/elevenlabs/types/pronunciation_dictionary_rules_response_model.py index 258e1469..59b7a5c6 100644 --- a/src/elevenlabs/types/add_pronunciation_dictionary_rules_response_model.py +++ b/src/elevenlabs/types/pronunciation_dictionary_rules_response_model.py @@ -6,7 +6,7 @@ import typing -class AddPronunciationDictionaryRulesResponseModel(UncheckedBaseModel): +class PronunciationDictionaryRulesResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the pronunciation dictionary. diff --git a/src/elevenlabs/types/pronunciation_dictionary_version_response_model.py b/src/elevenlabs/types/pronunciation_dictionary_version_response_model.py index 584ee4a9..4d6a9fc4 100644 --- a/src/elevenlabs/types/pronunciation_dictionary_version_response_model.py +++ b/src/elevenlabs/types/pronunciation_dictionary_version_response_model.py @@ -2,6 +2,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing +from .pronunciation_dictionary_version_response_model_permission_on_resource import ( + PronunciationDictionaryVersionResponseModelPermissionOnResource, +) from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -12,6 +15,7 @@ class PronunciationDictionaryVersionResponseModel(UncheckedBaseModel): pronunciation_dictionary_id: str dictionary_name: str version_name: str + permission_on_resource: typing.Optional[PronunciationDictionaryVersionResponseModelPermissionOnResource] = None created_by: str creation_time_unix: int archived_time_unix: typing.Optional[int] = None diff --git a/src/elevenlabs/types/pronunciation_dictionary_version_response_model_permission_on_resource.py b/src/elevenlabs/types/pronunciation_dictionary_version_response_model_permission_on_resource.py new file mode 100644 index 00000000..ad649727 --- /dev/null +++ b/src/elevenlabs/types/pronunciation_dictionary_version_response_model_permission_on_resource.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PronunciationDictionaryVersionResponseModelPermissionOnResource = typing.Union[ + typing.Literal["admin", "editor", "viewer"], typing.Any +] diff --git a/src/elevenlabs/types/render.py b/src/elevenlabs/types/render.py new file mode 100644 index 00000000..993f7c9c --- /dev/null +++ b/src/elevenlabs/types/render.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .render_type import RenderType +from .dubbing_media_reference import DubbingMediaReference +from .render_status import RenderStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class Render(UncheckedBaseModel): + id: str + version: int + language: typing.Optional[str] = None + type: typing.Optional[RenderType] = None + media_ref: typing.Optional[DubbingMediaReference] = None + status: RenderStatus + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/render_status.py b/src/elevenlabs/types/render_status.py new file mode 100644 index 00000000..2f65782f --- /dev/null +++ b/src/elevenlabs/types/render_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RenderStatus = typing.Union[typing.Literal["complete", "processing", "failed"], typing.Any] diff --git a/src/elevenlabs/types/render_type.py b/src/elevenlabs/types/render_type.py new file mode 100644 index 00000000..c83bdbc6 --- /dev/null +++ b/src/elevenlabs/types/render_type.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RenderType = typing.Union[ + typing.Literal["mp4", "aac", "mp3", "wav", "aaf", "tracks_zip", "clips_zip"], + typing.Any, +] diff --git a/src/elevenlabs/types/request_pvc_manual_verification_response_model.py b/src/elevenlabs/types/request_pvc_manual_verification_response_model.py new file mode 100644 index 00000000..5a2c45c9 --- /dev/null +++ b/src/elevenlabs/types/request_pvc_manual_verification_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class RequestPvcManualVerificationResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the request PVC manual verification request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/safety_response_model.py b/src/elevenlabs/types/safety_response_model.py index ca09058e..97847ffd 100644 --- a/src/elevenlabs/types/safety_response_model.py +++ b/src/elevenlabs/types/safety_response_model.py @@ -9,6 +9,7 @@ class SafetyResponseModel(UncheckedBaseModel): is_blocked_ivc: typing.Optional[bool] = None is_blocked_non_ivc: typing.Optional[bool] = None + ignore_safety_evaluation: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/segmented_json_export_options.py b/src/elevenlabs/types/segmented_json_export_options.py index b5e2969a..711b3531 100644 --- a/src/elevenlabs/types/segmented_json_export_options.py +++ b/src/elevenlabs/types/segmented_json_export_options.py @@ -7,6 +7,8 @@ class SegmentedJsonExportOptions(UncheckedBaseModel): + include_speakers: typing.Optional[bool] = None + include_timestamps: typing.Optional[bool] = None segment_on_silence_longer_than_s: typing.Optional[float] = None max_segment_duration_s: typing.Optional[float] = None max_segment_chars: typing.Optional[int] = None diff --git a/src/elevenlabs/types/remove_pronunciation_dictionary_rules_response_model.py b/src/elevenlabs/types/speaker_audio_response_model.py similarity index 60% rename from src/elevenlabs/types/remove_pronunciation_dictionary_rules_response_model.py rename to src/elevenlabs/types/speaker_audio_response_model.py index 71f91ec0..81987a95 100644 --- a/src/elevenlabs/types/remove_pronunciation_dictionary_rules_response_model.py +++ b/src/elevenlabs/types/speaker_audio_response_model.py @@ -6,20 +6,20 @@ import typing -class RemovePronunciationDictionaryRulesResponseModel(UncheckedBaseModel): - id: str = pydantic.Field() +class SpeakerAudioResponseModel(UncheckedBaseModel): + audio_base_64: str = pydantic.Field() """ - The ID of the pronunciation dictionary. + The base64 encoded audio. """ - version_id: str = pydantic.Field() + media_type: str = pydantic.Field() """ - The version ID of the pronunciation dictionary. + The media type of the audio. """ - version_rules_num: int = pydantic.Field() + duration_secs: float = pydantic.Field() """ - The number of rules in the version of the pronunciation dictionary. + The duration of the audio in seconds. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/speaker_response_model.py b/src/elevenlabs/types/speaker_response_model.py index c819bab6..bcb858cb 100644 --- a/src/elevenlabs/types/speaker_response_model.py +++ b/src/elevenlabs/types/speaker_response_model.py @@ -1,16 +1,27 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic import typing from .utterance_response_model import UtteranceResponseModel from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class SpeakerResponseModel(UncheckedBaseModel): - speaker_id: str - duration_secs: float - utterances: typing.Optional[typing.List[UtteranceResponseModel]] = None + speaker_id: str = pydantic.Field() + """ + The ID of the speaker. + """ + + duration_secs: float = pydantic.Field() + """ + The duration of the speaker segment in seconds. + """ + + utterances: typing.Optional[typing.List[UtteranceResponseModel]] = pydantic.Field(default=None) + """ + The utterances of the speaker. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/speaker_separation_response_model.py b/src/elevenlabs/types/speaker_separation_response_model.py index 002e5c4e..ebc8d7cf 100644 --- a/src/elevenlabs/types/speaker_separation_response_model.py +++ b/src/elevenlabs/types/speaker_separation_response_model.py @@ -1,21 +1,40 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .speaker_separation_response_model_status import ( SpeakerSeparationResponseModelStatus, ) import typing from .speaker_response_model import SpeakerResponseModel from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class SpeakerSeparationResponseModel(UncheckedBaseModel): - voice_id: str - sample_id: str - status: SpeakerSeparationResponseModelStatus - speakers: typing.Optional[typing.Dict[str, typing.Optional[SpeakerResponseModel]]] = None - selected_speaker_ids: typing.Optional[typing.List[str]] = None + voice_id: str = pydantic.Field() + """ + The ID of the voice. + """ + + sample_id: str = pydantic.Field() + """ + The ID of the sample. + """ + + status: SpeakerSeparationResponseModelStatus = pydantic.Field() + """ + The status of the speaker separation. + """ + + speakers: typing.Optional[typing.Dict[str, typing.Optional[SpeakerResponseModel]]] = pydantic.Field(default=None) + """ + The speakers of the sample. + """ + + selected_speaker_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + The IDs of the selected speakers. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/speech_history_item_response.py b/src/elevenlabs/types/speech_history_item_response.py index 4ac53771..e47999cc 100644 --- a/src/elevenlabs/types/speech_history_item_response.py +++ b/src/elevenlabs/types/speech_history_item_response.py @@ -88,7 +88,7 @@ class SpeechHistoryItemResponse(UncheckedBaseModel): source: typing.Optional[SpeechHistoryItemResponseModelSource] = pydantic.Field(default=None) """ - The source of the history item. Either TTS (text to speech), STS (speech to text) or STT (speech to text). + The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing or PlayAPI. """ alignments: typing.Optional[HistoryAlignmentsResponseModel] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/speech_history_item_response_model_source.py b/src/elevenlabs/types/speech_history_item_response_model_source.py index 75c87a2c..e65d114d 100644 --- a/src/elevenlabs/types/speech_history_item_response_model_source.py +++ b/src/elevenlabs/types/speech_history_item_response_model_source.py @@ -2,4 +2,6 @@ import typing -SpeechHistoryItemResponseModelSource = typing.Union[typing.Literal["TTS", "STS", "STT"], typing.Any] +SpeechHistoryItemResponseModelSource = typing.Union[ + typing.Literal["TTS", "STS", "Projects", "AN", "Dubbing", "PlayAPI"], typing.Any +] diff --git a/src/elevenlabs/types/start_pvc_voice_training_response_model.py b/src/elevenlabs/types/start_pvc_voice_training_response_model.py new file mode 100644 index 00000000..34d2d854 --- /dev/null +++ b/src/elevenlabs/types/start_pvc_voice_training_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class StartPvcVoiceTrainingResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the start PVC voice training request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/start_speaker_separation_response_model.py b/src/elevenlabs/types/start_speaker_separation_response_model.py new file mode 100644 index 00000000..9e8c118f --- /dev/null +++ b/src/elevenlabs/types/start_speaker_separation_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class StartSpeakerSeparationResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the start speaker seperation request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/system_tool_config.py b/src/elevenlabs/types/system_tool_config_input.py similarity index 76% rename from src/elevenlabs/types/system_tool_config.py rename to src/elevenlabs/types/system_tool_config_input.py index c381b954..5247d35c 100644 --- a/src/elevenlabs/types/system_tool_config.py +++ b/src/elevenlabs/types/system_tool_config_input.py @@ -1,18 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel -from ..core.pydantic_utilities import IS_PYDANTIC_V2 import typing +from .system_tool_config_input_params import SystemToolConfigInputParams +from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -class SystemToolConfig(UncheckedBaseModel): +class SystemToolConfigInput(UncheckedBaseModel): """ A system tool is a tool that is used to call a system method in the server """ + id: typing.Optional[str] = None name: str description: str + params: SystemToolConfigInputParams if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/system_tool_config_input_params.py b/src/elevenlabs/types/system_tool_config_input_params.py new file mode 100644 index 00000000..69fcad33 --- /dev/null +++ b/src/elevenlabs/types/system_tool_config_input_params.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .transfer import Transfer +import typing_extensions +from ..core.unchecked_base_model import UnionMetadata + + +class SystemToolConfigInputParams_EndCall(UncheckedBaseModel): + system_tool_type: typing.Literal["end_call"] = "end_call" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SystemToolConfigInputParams_LanguageDetection(UncheckedBaseModel): + system_tool_type: typing.Literal["language_detection"] = "language_detection" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SystemToolConfigInputParams_TransferToAgent(UncheckedBaseModel): + system_tool_type: typing.Literal["transfer_to_agent"] = "transfer_to_agent" + transfers: typing.List[Transfer] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +SystemToolConfigInputParams = typing_extensions.Annotated[ + typing.Union[ + SystemToolConfigInputParams_EndCall, + SystemToolConfigInputParams_LanguageDetection, + SystemToolConfigInputParams_TransferToAgent, + ], + UnionMetadata(discriminant="system_tool_type"), +] diff --git a/src/elevenlabs/types/system_tool_config_output.py b/src/elevenlabs/types/system_tool_config_output.py new file mode 100644 index 00000000..50a0244f --- /dev/null +++ b/src/elevenlabs/types/system_tool_config_output.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .system_tool_config_output_params import SystemToolConfigOutputParams +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class SystemToolConfigOutput(UncheckedBaseModel): + """ + A system tool is a tool that is used to call a system method in the server + """ + + id: typing.Optional[str] = None + name: str + description: str + params: SystemToolConfigOutputParams + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/system_tool_config_output_params.py b/src/elevenlabs/types/system_tool_config_output_params.py new file mode 100644 index 00000000..6550623c --- /dev/null +++ b/src/elevenlabs/types/system_tool_config_output_params.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .transfer import Transfer +import typing_extensions +from ..core.unchecked_base_model import UnionMetadata + + +class SystemToolConfigOutputParams_EndCall(UncheckedBaseModel): + system_tool_type: typing.Literal["end_call"] = "end_call" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SystemToolConfigOutputParams_LanguageDetection(UncheckedBaseModel): + system_tool_type: typing.Literal["language_detection"] = "language_detection" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SystemToolConfigOutputParams_TransferToAgent(UncheckedBaseModel): + system_tool_type: typing.Literal["transfer_to_agent"] = "transfer_to_agent" + transfers: typing.List[Transfer] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +SystemToolConfigOutputParams = typing_extensions.Annotated[ + typing.Union[ + SystemToolConfigOutputParams_EndCall, + SystemToolConfigOutputParams_LanguageDetection, + SystemToolConfigOutputParams_TransferToAgent, + ], + UnionMetadata(discriminant="system_tool_type"), +] diff --git a/src/elevenlabs/types/transfer.py b/src/elevenlabs/types/transfer.py new file mode 100644 index 00000000..7bdc80f0 --- /dev/null +++ b/src/elevenlabs/types/transfer.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class Transfer(UncheckedBaseModel): + agent_id: str + condition: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/transfer_to_agent_tool_config.py b/src/elevenlabs/types/transfer_to_agent_tool_config.py new file mode 100644 index 00000000..ff04e6f4 --- /dev/null +++ b/src/elevenlabs/types/transfer_to_agent_tool_config.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .transfer import Transfer +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class TransferToAgentToolConfig(UncheckedBaseModel): + transfers: typing.List[Transfer] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/turn_config.py b/src/elevenlabs/types/turn_config.py index 3fc1a53d..1ad712d9 100644 --- a/src/elevenlabs/types/turn_config.py +++ b/src/elevenlabs/types/turn_config.py @@ -10,7 +10,12 @@ class TurnConfig(UncheckedBaseModel): turn_timeout: typing.Optional[float] = pydantic.Field(default=None) """ - Maximum wait time for the user’s reply before re-engaging the user + Maximum wait time for the user's reply before re-engaging the user + """ + + silence_end_call_timeout: typing.Optional[float] = pydantic.Field(default=None) + """ + Maximum wait time since the user last spoke before terminating the call """ mode: typing.Optional[TurnMode] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/utterance_response_model.py b/src/elevenlabs/types/utterance_response_model.py index 87ad30a7..5c10cb78 100644 --- a/src/elevenlabs/types/utterance_response_model.py +++ b/src/elevenlabs/types/utterance_response_model.py @@ -1,14 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 import typing -import pydantic class UtteranceResponseModel(UncheckedBaseModel): - start: float - end: float + start: float = pydantic.Field() + """ + The start time of the utterance in seconds. + """ + + end: float = pydantic.Field() + """ + The end time of the utterance in seconds. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/verify_pvc_voice_captcha_response_model.py b/src/elevenlabs/types/verify_pvc_voice_captcha_response_model.py new file mode 100644 index 00000000..00a49009 --- /dev/null +++ b/src/elevenlabs/types/verify_pvc_voice_captcha_response_model.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class VerifyPvcVoiceCaptchaResponseModel(UncheckedBaseModel): + status: str = pydantic.Field() + """ + The status of the verify PVC captcha request. If the request was successful, the status will be 'ok'. Otherwise an error message with status 500 will be returned. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/voice_sample.py b/src/elevenlabs/types/voice_sample.py index b1fd20e2..e8dc42bf 100644 --- a/src/elevenlabs/types/voice_sample.py +++ b/src/elevenlabs/types/voice_sample.py @@ -38,6 +38,8 @@ class VoiceSample(UncheckedBaseModel): has_isolated_audio: typing.Optional[bool] = None has_isolated_audio_preview: typing.Optional[bool] = None speaker_separation: typing.Optional[SpeakerSeparationResponseModel] = None + trim_start: typing.Optional[int] = None + trim_end: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/voice_sample_preview_response_model.py b/src/elevenlabs/types/voice_sample_preview_response_model.py new file mode 100644 index 00000000..90b30702 --- /dev/null +++ b/src/elevenlabs/types/voice_sample_preview_response_model.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VoiceSamplePreviewResponseModel(UncheckedBaseModel): + audio_base_64: str = pydantic.Field() + """ + The base64 encoded audio. + """ + + voice_id: str = pydantic.Field() + """ + The ID of the voice. + """ + + sample_id: str = pydantic.Field() + """ + The ID of the sample. + """ + + media_type: str = pydantic.Field() + """ + The media type of the audio. + """ + + duration_secs: typing.Optional[float] = pydantic.Field(default=None) + """ + The duration of the audio in seconds. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/voice_sample_visual_waveform_response_model.py b/src/elevenlabs/types/voice_sample_visual_waveform_response_model.py new file mode 100644 index 00000000..9ed45fdf --- /dev/null +++ b/src/elevenlabs/types/voice_sample_visual_waveform_response_model.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VoiceSampleVisualWaveformResponseModel(UncheckedBaseModel): + sample_id: str = pydantic.Field() + """ + The ID of the sample. + """ + + visual_waveform: typing.List[float] = pydantic.Field() + """ + The visual waveform of the sample, represented as a list of floats. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/webhook_tool_config_input.py b/src/elevenlabs/types/webhook_tool_config_input.py index 900dabf9..ed38d3c5 100644 --- a/src/elevenlabs/types/webhook_tool_config_input.py +++ b/src/elevenlabs/types/webhook_tool_config_input.py @@ -3,9 +3,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +import typing from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput import pydantic -import typing from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -15,6 +15,7 @@ class WebhookToolConfigInput(UncheckedBaseModel): A webhook tool is a tool that calls an external webhook from our server """ + id: typing.Optional[str] = None name: str description: str api_schema: WebhookToolApiSchemaConfigInput = pydantic.Field() diff --git a/src/elevenlabs/types/webhook_tool_config_output.py b/src/elevenlabs/types/webhook_tool_config_output.py index 74e0f326..4b92b33c 100644 --- a/src/elevenlabs/types/webhook_tool_config_output.py +++ b/src/elevenlabs/types/webhook_tool_config_output.py @@ -3,9 +3,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput +import typing from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput import pydantic -import typing from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -15,6 +15,7 @@ class WebhookToolConfigOutput(UncheckedBaseModel): A webhook tool is a tool that calls an external webhook from our server """ + id: typing.Optional[str] = None name: str description: str api_schema: WebhookToolApiSchemaConfigOutput = pydantic.Field() diff --git a/src/elevenlabs/types/workspace_resource_type.py b/src/elevenlabs/types/workspace_resource_type.py index 2a265dc9..bae79063 100644 --- a/src/elevenlabs/types/workspace_resource_type.py +++ b/src/elevenlabs/types/workspace_resource_type.py @@ -5,6 +5,7 @@ WorkspaceResourceType = typing.Union[ typing.Literal[ "voice", + "voice_collection", "pronunciation_dictionary", "dubbing", "project", @@ -15,6 +16,7 @@ "convai_secrets", "music_latent", "convai_phone_numbers", + "convai_batch_calls", ], typing.Any, ] diff --git a/src/elevenlabs/voices/__init__.py b/src/elevenlabs/voices/__init__.py index 74b259cc..b4422bc9 100644 --- a/src/elevenlabs/voices/__init__.py +++ b/src/elevenlabs/voices/__init__.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. from .types import VoicesGetSharedRequestCategory +from . import pvc -__all__ = ["VoicesGetSharedRequestCategory"] +__all__ = ["VoicesGetSharedRequestCategory", "pvc"] diff --git a/src/elevenlabs/voices/client.py b/src/elevenlabs/voices/client.py index e0e6c3d3..30234473 100644 --- a/src/elevenlabs/voices/client.py +++ b/src/elevenlabs/voices/client.py @@ -2,6 +2,7 @@ import typing from ..core.client_wrapper import SyncClientWrapper +from .pvc.client import PvcClient from ..core.request_options import RequestOptions from ..types.get_voices_response import GetVoicesResponse from ..core.unchecked_base_model import construct_type @@ -24,6 +25,7 @@ from ..types.get_library_voices_response import GetLibraryVoicesResponse from ..types.profile_page_response_model import ProfilePageResponseModel from ..core.client_wrapper import AsyncClientWrapper +from .pvc.client import AsyncPvcClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -32,6 +34,7 @@ class VoicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + self.pvc = PvcClient(client_wrapper=self._client_wrapper) def get_all( self, @@ -108,6 +111,7 @@ def search( voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, + collection_id: typing.Optional[str] = None, include_total_count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoicesV2ResponseModel: @@ -140,6 +144,9 @@ def search( fine_tuning_state : typing.Optional[str] State of the voice's fine tuning to filter by. Applicable only to professional voices clones. One of 'draft', 'not_verified', 'not_started', 'queued', 'fine_tuning', 'fine_tuned', 'failed', 'delayed' + collection_id : typing.Optional[str] + Collection ID to filter voices by. + include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. Incurs a performance cost. @@ -175,6 +182,7 @@ def search( "voice_type": voice_type, "category": category, "fine_tuning_state": fine_tuning_state, + "collection_id": collection_id, "include_total_count": include_total_count, }, request_options=request_options, @@ -1053,6 +1061,7 @@ def get_a_profile_page( class AsyncVoicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + self.pvc = AsyncPvcClient(client_wrapper=self._client_wrapper) async def get_all( self, @@ -1137,6 +1146,7 @@ async def search( voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, + collection_id: typing.Optional[str] = None, include_total_count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoicesV2ResponseModel: @@ -1169,6 +1179,9 @@ async def search( fine_tuning_state : typing.Optional[str] State of the voice's fine tuning to filter by. Applicable only to professional voices clones. One of 'draft', 'not_verified', 'not_started', 'queued', 'fine_tuning', 'fine_tuned', 'failed', 'delayed' + collection_id : typing.Optional[str] + Collection ID to filter voices by. + include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. Incurs a performance cost. @@ -1212,6 +1225,7 @@ async def main() -> None: "voice_type": voice_type, "category": category, "fine_tuning_state": fine_tuning_state, + "collection_id": collection_id, "include_total_count": include_total_count, }, request_options=request_options, diff --git a/src/elevenlabs/voices/pvc/__init__.py b/src/elevenlabs/voices/pvc/__init__.py new file mode 100644 index 00000000..2adb2771 --- /dev/null +++ b/src/elevenlabs/voices/pvc/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import samples, verification + +__all__ = ["samples", "verification"] diff --git a/src/elevenlabs/voices/pvc/client.py b/src/elevenlabs/voices/pvc/client.py new file mode 100644 index 00000000..076482da --- /dev/null +++ b/src/elevenlabs/voices/pvc/client.py @@ -0,0 +1,559 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from .samples.client import SamplesClient +from .verification.client import VerificationClient +from ...core.request_options import RequestOptions +from ...types.add_voice_response_model import AddVoiceResponseModel +from ...core.unchecked_base_model import construct_type +from ...errors.unprocessable_entity_error import UnprocessableEntityError +from ...types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.jsonable_encoder import jsonable_encoder +from ...types.start_pvc_voice_training_response_model import ( + StartPvcVoiceTrainingResponseModel, +) +from ...core.client_wrapper import AsyncClientWrapper +from .samples.client import AsyncSamplesClient +from .verification.client import AsyncVerificationClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PvcClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.samples = SamplesClient(client_wrapper=self._client_wrapper) + self.verification = VerificationClient(client_wrapper=self._client_wrapper) + + def create( + self, + *, + name: str, + language: str, + description: typing.Optional[str] = OMIT, + labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Creates a new PVC voice with metadata but no samples + + Parameters + ---------- + name : str + The name that identifies this voice. This will be displayed in the dropdown of the website. + + language : str + Language used in the samples. + + description : typing.Optional[str] + Description to use for the created voice. + + labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Serialized labels dictionary for the voice. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.create( + name="John Smith", + language="en", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "v1/voices/pvc", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "name": name, + "language": language, + "description": description, + "labels": labels, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + voice_id: str, + *, + name: typing.Optional[str] = OMIT, + language: typing.Optional[str] = OMIT, + description: typing.Optional[str] = OMIT, + labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Edit PVC voice metadata + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + name : typing.Optional[str] + The name that identifies this voice. This will be displayed in the dropdown of the website. + + language : typing.Optional[str] + Language used in the samples. + + description : typing.Optional[str] + Description to use for the created voice. + + labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Serialized labels dictionary for the voice. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.update( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "name": name, + "language": language, + "description": description, + "labels": labels, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def train( + self, + voice_id: str, + *, + model_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartPvcVoiceTrainingResponseModel: + """ + Start PVC training process for a voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + model_id : typing.Optional[str] + The model ID to use for the conversion. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartPvcVoiceTrainingResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.train( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/train", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "model_id": model_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + StartPvcVoiceTrainingResponseModel, + construct_type( + type_=StartPvcVoiceTrainingResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncPvcClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.samples = AsyncSamplesClient(client_wrapper=self._client_wrapper) + self.verification = AsyncVerificationClient(client_wrapper=self._client_wrapper) + + async def create( + self, + *, + name: str, + language: str, + description: typing.Optional[str] = OMIT, + labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Creates a new PVC voice with metadata but no samples + + Parameters + ---------- + name : str + The name that identifies this voice. This will be displayed in the dropdown of the website. + + language : str + Language used in the samples. + + description : typing.Optional[str] + Description to use for the created voice. + + labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Serialized labels dictionary for the voice. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.create( + name="John Smith", + language="en", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/voices/pvc", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "name": name, + "language": language, + "description": description, + "labels": labels, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + voice_id: str, + *, + name: typing.Optional[str] = OMIT, + language: typing.Optional[str] = OMIT, + description: typing.Optional[str] = OMIT, + labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Edit PVC voice metadata + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + name : typing.Optional[str] + The name that identifies this voice. This will be displayed in the dropdown of the website. + + language : typing.Optional[str] + Language used in the samples. + + description : typing.Optional[str] + Description to use for the created voice. + + labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Serialized labels dictionary for the voice. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.update( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "name": name, + "language": language, + "description": description, + "labels": labels, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def train( + self, + voice_id: str, + *, + model_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartPvcVoiceTrainingResponseModel: + """ + Start PVC training process for a voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + model_id : typing.Optional[str] + The model ID to use for the conversion. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartPvcVoiceTrainingResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.train( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/train", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "model_id": model_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + StartPvcVoiceTrainingResponseModel, + construct_type( + type_=StartPvcVoiceTrainingResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/samples/__init__.py b/src/elevenlabs/voices/pvc/samples/__init__.py new file mode 100644 index 00000000..cb8d7557 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import audio, speakers, waveform + +__all__ = ["audio", "speakers", "waveform"] diff --git a/src/elevenlabs/voices/pvc/samples/audio/__init__.py b/src/elevenlabs/voices/pvc/samples/audio/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/audio/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/voices/pvc/samples/audio/client.py b/src/elevenlabs/voices/pvc/samples/audio/client.py new file mode 100644 index 00000000..5957d28b --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/audio/client.py @@ -0,0 +1,169 @@ +# This file was auto-generated by Fern from our API Definition. + +from .....core.client_wrapper import SyncClientWrapper +import typing +from .....core.request_options import RequestOptions +from .....types.voice_sample_preview_response_model import ( + VoiceSamplePreviewResponseModel, +) +from .....core.jsonable_encoder import jsonable_encoder +from .....core.unchecked_base_model import construct_type +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper + + +class AudioClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> VoiceSamplePreviewResponseModel: + """ + Retrieve the first 30 seconds of voice sample audio with or without noise removal. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VoiceSamplePreviewResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.audio.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VoiceSamplePreviewResponseModel, + construct_type( + type_=VoiceSamplePreviewResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncAudioClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> VoiceSamplePreviewResponseModel: + """ + Retrieve the first 30 seconds of voice sample audio with or without noise removal. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VoiceSamplePreviewResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.audio.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VoiceSamplePreviewResponseModel, + construct_type( + type_=VoiceSamplePreviewResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/samples/client.py b/src/elevenlabs/voices/pvc/samples/client.py new file mode 100644 index 00000000..c60ad420 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/client.py @@ -0,0 +1,545 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ....core.client_wrapper import SyncClientWrapper +from .audio.client import AudioClient +from .waveform.client import WaveformClient +from .speakers.client import SpeakersClient +from .... import core +from ....core.request_options import RequestOptions +from ....types.voice_sample import VoiceSample +from ....core.jsonable_encoder import jsonable_encoder +from ....core.unchecked_base_model import construct_type +from ....errors.unprocessable_entity_error import UnprocessableEntityError +from ....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError +from ....types.add_voice_response_model import AddVoiceResponseModel +from ....types.delete_voice_sample_response_model import DeleteVoiceSampleResponseModel +from ....core.client_wrapper import AsyncClientWrapper +from .audio.client import AsyncAudioClient +from .waveform.client import AsyncWaveformClient +from .speakers.client import AsyncSpeakersClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class SamplesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.audio = AudioClient(client_wrapper=self._client_wrapper) + self.waveform = WaveformClient(client_wrapper=self._client_wrapper) + self.speakers = SpeakersClient(client_wrapper=self._client_wrapper) + + def create( + self, + voice_id: str, + *, + files: typing.List[core.File], + remove_background_noise: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[VoiceSample]: + """ + Add audio samples to a PVC voice + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + files : typing.List[core.File] + See core.File for more documentation + + remove_background_noise : typing.Optional[bool] + If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[VoiceSample] + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.create( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={ + "remove_background_noise": remove_background_noise, + }, + files={ + "files": files, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[VoiceSample], + construct_type( + type_=typing.List[VoiceSample], # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + voice_id: str, + sample_id: str, + *, + remove_background_noise: typing.Optional[bool] = OMIT, + selected_speaker_ids: typing.Optional[typing.Sequence[str]] = OMIT, + trim_start_time: typing.Optional[int] = OMIT, + trim_end_time: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Update a PVC voice sample - apply noise removal, or select speaker. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + remove_background_noise : typing.Optional[bool] + If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. + + selected_speaker_ids : typing.Optional[typing.Sequence[str]] + Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones. + + trim_start_time : typing.Optional[int] + The start time of the audio to be used for PVC training. Time should be in milliseconds + + trim_end_time : typing.Optional[int] + The end time of the audio to be used for PVC training. Time should be in milliseconds + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.update( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "remove_background_noise": remove_background_noise, + "selected_speaker_ids": selected_speaker_ids, + "trim_start_time": trim_start_time, + "trim_end_time": trim_end_time, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> DeleteVoiceSampleResponseModel: + """ + Delete a sample from a PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeleteVoiceSampleResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.delete( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DeleteVoiceSampleResponseModel, + construct_type( + type_=DeleteVoiceSampleResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSamplesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.audio = AsyncAudioClient(client_wrapper=self._client_wrapper) + self.waveform = AsyncWaveformClient(client_wrapper=self._client_wrapper) + self.speakers = AsyncSpeakersClient(client_wrapper=self._client_wrapper) + + async def create( + self, + voice_id: str, + *, + files: typing.List[core.File], + remove_background_noise: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[VoiceSample]: + """ + Add audio samples to a PVC voice + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + files : typing.List[core.File] + See core.File for more documentation + + remove_background_noise : typing.Optional[bool] + If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[VoiceSample] + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.create( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={ + "remove_background_noise": remove_background_noise, + }, + files={ + "files": files, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[VoiceSample], + construct_type( + type_=typing.List[VoiceSample], # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + voice_id: str, + sample_id: str, + *, + remove_background_noise: typing.Optional[bool] = OMIT, + selected_speaker_ids: typing.Optional[typing.Sequence[str]] = OMIT, + trim_start_time: typing.Optional[int] = OMIT, + trim_end_time: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AddVoiceResponseModel: + """ + Update a PVC voice sample - apply noise removal, or select speaker. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + remove_background_noise : typing.Optional[bool] + If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. + + selected_speaker_ids : typing.Optional[typing.Sequence[str]] + Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones. + + trim_start_time : typing.Optional[int] + The start time of the audio to be used for PVC training. Time should be in milliseconds + + trim_end_time : typing.Optional[int] + The end time of the audio to be used for PVC training. Time should be in milliseconds + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddVoiceResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.update( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "remove_background_noise": remove_background_noise, + "selected_speaker_ids": selected_speaker_ids, + "trim_start_time": trim_start_time, + "trim_end_time": trim_end_time, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AddVoiceResponseModel, + construct_type( + type_=AddVoiceResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> DeleteVoiceSampleResponseModel: + """ + Delete a sample from a PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeleteVoiceSampleResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.delete( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DeleteVoiceSampleResponseModel, + construct_type( + type_=DeleteVoiceSampleResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/samples/speakers/__init__.py b/src/elevenlabs/voices/pvc/samples/speakers/__init__.py new file mode 100644 index 00000000..012a17ea --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/speakers/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import audio + +__all__ = ["audio"] diff --git a/src/elevenlabs/voices/pvc/samples/speakers/audio/__init__.py b/src/elevenlabs/voices/pvc/samples/speakers/audio/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/speakers/audio/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py b/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py new file mode 100644 index 00000000..c656fc00 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py @@ -0,0 +1,177 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.client_wrapper import SyncClientWrapper +import typing +from ......core.request_options import RequestOptions +from ......types.speaker_audio_response_model import SpeakerAudioResponseModel +from ......core.jsonable_encoder import jsonable_encoder +from ......core.unchecked_base_model import construct_type +from ......errors.unprocessable_entity_error import UnprocessableEntityError +from ......types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ......core.api_error import ApiError +from ......core.client_wrapper import AsyncClientWrapper + + +class AudioClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, + voice_id: str, + sample_id: str, + speaker_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerAudioResponseModel: + """ + Retrieve the separated audio for a specific speaker. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + speaker_id : str + Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerAudioResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.speakers.audio.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + speaker_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers/{jsonable_encoder(speaker_id)}/audio", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerAudioResponseModel, + construct_type( + type_=SpeakerAudioResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncAudioClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, + voice_id: str, + sample_id: str, + speaker_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerAudioResponseModel: + """ + Retrieve the separated audio for a specific speaker. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + speaker_id : str + Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerAudioResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.speakers.audio.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + speaker_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers/{jsonable_encoder(speaker_id)}/audio", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerAudioResponseModel, + construct_type( + type_=SpeakerAudioResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/samples/speakers/client.py b/src/elevenlabs/voices/pvc/samples/speakers/client.py new file mode 100644 index 00000000..a5d43fbb --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/speakers/client.py @@ -0,0 +1,318 @@ +# This file was auto-generated by Fern from our API Definition. + +from .....core.client_wrapper import SyncClientWrapper +from .audio.client import AudioClient +import typing +from .....core.request_options import RequestOptions +from .....types.speaker_separation_response_model import SpeakerSeparationResponseModel +from .....core.jsonable_encoder import jsonable_encoder +from .....core.unchecked_base_model import construct_type +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from .....core.api_error import ApiError +from .....types.start_speaker_separation_response_model import ( + StartSpeakerSeparationResponseModel, +) +from .....core.client_wrapper import AsyncClientWrapper +from .audio.client import AsyncAudioClient + + +class SpeakersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.audio = AudioClient(client_wrapper=self._client_wrapper) + + def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerSeparationResponseModel: + """ + Retrieve the status of the speaker separation process and the list of detected speakers if complete. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerSeparationResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.speakers.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerSeparationResponseModel, + construct_type( + type_=SpeakerSeparationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def separate( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartSpeakerSeparationResponseModel: + """ + Start speaker separation process for a sample + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartSpeakerSeparationResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.speakers.separate( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers", + base_url=self._client_wrapper.get_environment().base, + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + StartSpeakerSeparationResponseModel, + construct_type( + type_=StartSpeakerSeparationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSpeakersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.audio = AsyncAudioClient(client_wrapper=self._client_wrapper) + + async def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerSeparationResponseModel: + """ + Retrieve the status of the speaker separation process and the list of detected speakers if complete. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerSeparationResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.speakers.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerSeparationResponseModel, + construct_type( + type_=SpeakerSeparationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def separate( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartSpeakerSeparationResponseModel: + """ + Start speaker separation process for a sample + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartSpeakerSeparationResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.speakers.separate( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers", + base_url=self._client_wrapper.get_environment().base, + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + StartSpeakerSeparationResponseModel, + construct_type( + type_=StartSpeakerSeparationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/samples/waveform/__init__.py b/src/elevenlabs/voices/pvc/samples/waveform/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/waveform/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/voices/pvc/samples/waveform/client.py b/src/elevenlabs/voices/pvc/samples/waveform/client.py new file mode 100644 index 00000000..beb96132 --- /dev/null +++ b/src/elevenlabs/voices/pvc/samples/waveform/client.py @@ -0,0 +1,169 @@ +# This file was auto-generated by Fern from our API Definition. + +from .....core.client_wrapper import SyncClientWrapper +import typing +from .....core.request_options import RequestOptions +from .....types.voice_sample_visual_waveform_response_model import ( + VoiceSampleVisualWaveformResponseModel, +) +from .....core.jsonable_encoder import jsonable_encoder +from .....core.unchecked_base_model import construct_type +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper + + +class WaveformClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> VoiceSampleVisualWaveformResponseModel: + """ + Retrieve the visual waveform of a voice sample. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VoiceSampleVisualWaveformResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.samples.waveform.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VoiceSampleVisualWaveformResponseModel, + construct_type( + type_=VoiceSampleVisualWaveformResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncWaveformClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, + voice_id: str, + sample_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> VoiceSampleVisualWaveformResponseModel: + """ + Retrieve the visual waveform of a voice sample. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + sample_id : str + Sample ID to be used + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VoiceSampleVisualWaveformResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.samples.waveform.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VoiceSampleVisualWaveformResponseModel, + construct_type( + type_=VoiceSampleVisualWaveformResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/verification/__init__.py b/src/elevenlabs/voices/pvc/verification/__init__.py new file mode 100644 index 00000000..3daecd34 --- /dev/null +++ b/src/elevenlabs/voices/pvc/verification/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import captcha + +__all__ = ["captcha"] diff --git a/src/elevenlabs/voices/pvc/verification/captcha/__init__.py b/src/elevenlabs/voices/pvc/verification/captcha/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/voices/pvc/verification/captcha/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/voices/pvc/verification/captcha/client.py b/src/elevenlabs/voices/pvc/verification/captcha/client.py new file mode 100644 index 00000000..295aaec0 --- /dev/null +++ b/src/elevenlabs/voices/pvc/verification/captcha/client.py @@ -0,0 +1,291 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .....core.client_wrapper import SyncClientWrapper +from .....core.request_options import RequestOptions +from .....core.jsonable_encoder import jsonable_encoder +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....types.http_validation_error import HttpValidationError +from .....core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from .....core.api_error import ApiError +from ..... import core +from .....types.verify_pvc_voice_captcha_response_model import ( + VerifyPvcVoiceCaptchaResponseModel, +) +from .....core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class CaptchaClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Get captcha for PVC voice verification. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.verification.captcha.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def verify( + self, + voice_id: str, + *, + recording: core.File, + request_options: typing.Optional[RequestOptions] = None, + ) -> VerifyPvcVoiceCaptchaResponseModel: + """ + Submit captcha verification for PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + recording : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VerifyPvcVoiceCaptchaResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.verification.captcha.verify( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={}, + files={ + "recording": recording, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VerifyPvcVoiceCaptchaResponseModel, + construct_type( + type_=VerifyPvcVoiceCaptchaResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncCaptchaClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Get captcha for PVC voice verification. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + 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.voices.pvc.verification.captcha.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def verify( + self, + voice_id: str, + *, + recording: core.File, + request_options: typing.Optional[RequestOptions] = None, + ) -> VerifyPvcVoiceCaptchaResponseModel: + """ + Submit captcha verification for PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + recording : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + VerifyPvcVoiceCaptchaResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.verification.captcha.verify( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={}, + files={ + "recording": recording, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + VerifyPvcVoiceCaptchaResponseModel, + construct_type( + type_=VerifyPvcVoiceCaptchaResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/voices/pvc/verification/client.py b/src/elevenlabs/voices/pvc/verification/client.py new file mode 100644 index 00000000..56438b47 --- /dev/null +++ b/src/elevenlabs/voices/pvc/verification/client.py @@ -0,0 +1,197 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ....core.client_wrapper import SyncClientWrapper +from .captcha.client import CaptchaClient +from .... import core +from ....core.request_options import RequestOptions +from ....types.request_pvc_manual_verification_response_model import ( + RequestPvcManualVerificationResponseModel, +) +from ....core.jsonable_encoder import jsonable_encoder +from ....core.unchecked_base_model import construct_type +from ....errors.unprocessable_entity_error import UnprocessableEntityError +from ....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError +from ....core.client_wrapper import AsyncClientWrapper +from .captcha.client import AsyncCaptchaClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class VerificationClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.captcha = CaptchaClient(client_wrapper=self._client_wrapper) + + def request( + self, + voice_id: str, + *, + files: typing.List[core.File], + extra_text: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> RequestPvcManualVerificationResponseModel: + """ + Request manual verification for a PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + files : typing.List[core.File] + See core.File for more documentation + + extra_text : typing.Optional[str] + Extra text to be used in the manual verification process. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RequestPvcManualVerificationResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.voices.pvc.verification.request( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={ + "extra_text": extra_text, + }, + files={ + "files": files, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + RequestPvcManualVerificationResponseModel, + construct_type( + type_=RequestPvcManualVerificationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncVerificationClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.captcha = AsyncCaptchaClient(client_wrapper=self._client_wrapper) + + async def request( + self, + voice_id: str, + *, + files: typing.List[core.File], + extra_text: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> RequestPvcManualVerificationResponseModel: + """ + Request manual verification for a PVC voice. + + Parameters + ---------- + voice_id : str + Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. + + files : typing.List[core.File] + See core.File for more documentation + + extra_text : typing.Optional[str] + Extra text to be used in the manual verification process. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RequestPvcManualVerificationResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.voices.pvc.verification.request( + voice_id="21m00Tcm4TlvDq8ikWAM", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification", + base_url=self._client_wrapper.get_environment().base, + method="POST", + data={ + "extra_text": extra_text, + }, + files={ + "files": files, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + RequestPvcManualVerificationResponseModel, + construct_type( + type_=RequestPvcManualVerificationResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/workspace/client.py b/src/elevenlabs/workspace/client.py index e5a118db..7d1ced95 100644 --- a/src/elevenlabs/workspace/client.py +++ b/src/elevenlabs/workspace/client.py @@ -28,6 +28,9 @@ from ..types.update_workspace_member_response_model import ( UpdateWorkspaceMemberResponseModel, ) +from ..types.delete_workspace_member_response_model import ( + DeleteWorkspaceMemberResponseModel, +) from ..types.workspace_resource_type import WorkspaceResourceType from ..types.resource_metadata_response_model import ResourceMetadataResponseModel from .types.body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role import ( @@ -553,6 +556,73 @@ def update_member( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def delete_member( + self, *, email: str, request_options: typing.Optional[RequestOptions] = None + ) -> DeleteWorkspaceMemberResponseModel: + """ + Deletes a workspace member. This endpoint may only be called by workspace administrators. + + Parameters + ---------- + email : str + Email of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeleteWorkspaceMemberResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.workspace.delete_member( + email="email", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "v1/workspace/members", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + json={ + "email": email, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DeleteWorkspaceMemberResponseModel, + construct_type( + type_=DeleteWorkspaceMemberResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def get_resource( self, resource_id: str, @@ -1381,6 +1451,81 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + async def delete_member( + self, *, email: str, request_options: typing.Optional[RequestOptions] = None + ) -> DeleteWorkspaceMemberResponseModel: + """ + Deletes a workspace member. This endpoint may only be called by workspace administrators. + + Parameters + ---------- + email : str + Email of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeleteWorkspaceMemberResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.workspace.delete_member( + email="email", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/workspace/members", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + json={ + "email": email, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + DeleteWorkspaceMemberResponseModel, + construct_type( + type_=DeleteWorkspaceMemberResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + async def get_resource( self, resource_id: str,