From 7c34aa0758bca9b9930162a72acbf3131e3122bc Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:21:31 +0000 Subject: [PATCH] SDK regeneration --- poetry.lock | 12 +- pyproject.toml | 2 +- reference.md | 1447 ++++++++++++++++- src/elevenlabs/__init__.py | 98 +- src/elevenlabs/audio_isolation/__init__.py | 3 + src/elevenlabs/audio_isolation/client.py | 38 +- .../audio_isolation/types/__init__.py | 8 + ...ion_audio_isolation_request_file_format.py | 5 + ...io_isolation_stream_request_file_format.py | 5 + src/elevenlabs/conversational_ai/client.py | 43 +- src/elevenlabs/core/client_wrapper.py | 2 +- src/elevenlabs/dubbing/client.py | 186 ++- src/elevenlabs/forced_alignment/client.py | 14 +- .../pronunciation_dictionary/client.py | 39 +- src/elevenlabs/speech_to_speech/__init__.py | 3 + src/elevenlabs/speech_to_speech/client.py | 26 + .../speech_to_speech/types/__init__.py | 6 + ...h_convert_as_stream_request_file_format.py | 5 + ...h_to_speech_convert_request_file_format.py | 5 + src/elevenlabs/speech_to_text/__init__.py | 4 +- src/elevenlabs/speech_to_text/client.py | 54 +- .../speech_to_text/types/__init__.py | 3 +- ...ech_to_text_convert_request_file_format.py | 5 + ...d_effects_convert_request_output_format.py | 1 + ...e_create_previews_request_output_format.py | 1 + src/elevenlabs/types/__init__.py | 102 +- ...pronunciation_dictionary_response_model.py | 10 + ...y_response_model_permission_on_resource.py | 7 + ..._native_project_settings_response_model.py | 8 + ..._project_settings_response_model_status.py | 5 + src/elevenlabs/types/authorization_method.py | 2 +- ...vc_voice_id_samples_sample_id_audio_get.py | 22 + src/elevenlabs/types/client_event.py | 2 +- .../types/client_tool_config_input.py | 1 + .../types/client_tool_config_output.py | 1 + .../conversation_charging_common_model.py | 1 + ...conversation_history_error_common_model.py | 20 + ...versation_history_metadata_common_model.py | 8 + ...ersation_history_rag_usage_common_model.py | 20 + ...ory_transcript_tool_call_client_details.py | 19 + ...story_transcript_tool_call_common_model.py | 4 + ...ipt_tool_call_common_model_tool_details.py | 51 + ...ry_transcript_tool_call_webhook_details.py | 24 + ...versation_summary_response_model_status.py | 4 +- .../types/delete_voice_response_model.py | 2 +- .../delete_voice_sample_response_model.py | 22 + .../delete_workspace_member_response_model.py | 22 + .../types/dubbing_render_response_model.py | 20 + src/elevenlabs/types/dubbing_resource.py | 3 + src/elevenlabs/types/end_call_tool_config.py | 17 + src/elevenlabs/types/export_options.py | 2 + .../types/get_conversation_response_model.py | 3 + .../get_conversation_response_model_status.py | 4 +- ...nunciation_dictionary_metadata_response.py | 10 + ...a_response_model_permission_on_resource.py | 7 + .../types/language_detection_tool_config.py | 17 + src/elevenlabs/types/llm.py | 3 + .../types/prompt_agent_input_tools_item.py | 5 + .../types/prompt_agent_output_tools_item.py | 5 + ...iation_dictionary_rules_response_model.py} | 2 +- ...ation_dictionary_version_response_model.py | 4 + ...n_response_model_permission_on_resource.py | 7 + src/elevenlabs/types/render.py | 27 + src/elevenlabs/types/render_status.py | 5 + src/elevenlabs/types/render_type.py | 8 + ..._pvc_manual_verification_response_model.py | 22 + src/elevenlabs/types/safety_response_model.py | 1 + .../types/segmented_json_export_options.py | 2 + ...del.py => speaker_audio_response_model.py} | 14 +- .../types/speaker_response_model.py | 19 +- .../speaker_separation_response_model.py | 31 +- .../types/speech_history_item_response.py | 2 +- ...eech_history_item_response_model_source.py | 4 +- ...start_pvc_voice_training_response_model.py | 22 + ...start_speaker_separation_response_model.py | 22 + ..._config.py => system_tool_config_input.py} | 7 +- .../types/system_tool_config_input_params.py | 60 + .../types/system_tool_config_output.py | 27 + .../types/system_tool_config_output_params.py | 60 + src/elevenlabs/types/transfer.py | 20 + .../types/transfer_to_agent_tool_config.py | 20 + src/elevenlabs/types/turn_config.py | 7 +- .../types/utterance_response_model.py | 13 +- ...verify_pvc_voice_captcha_response_model.py | 22 + src/elevenlabs/types/voice_sample.py | 2 + .../voice_sample_preview_response_model.py | 42 + ...e_sample_visual_waveform_response_model.py | 27 + .../types/webhook_tool_config_input.py | 3 +- .../types/webhook_tool_config_output.py | 3 +- .../types/workspace_resource_type.py | 2 + src/elevenlabs/voices/__init__.py | 3 +- src/elevenlabs/voices/client.py | 14 + src/elevenlabs/voices/pvc/__init__.py | 5 + src/elevenlabs/voices/pvc/client.py | 559 +++++++ src/elevenlabs/voices/pvc/samples/__init__.py | 5 + .../voices/pvc/samples/audio/__init__.py | 2 + .../voices/pvc/samples/audio/client.py | 169 ++ src/elevenlabs/voices/pvc/samples/client.py | 545 +++++++ .../voices/pvc/samples/speakers/__init__.py | 5 + .../pvc/samples/speakers/audio/__init__.py | 2 + .../pvc/samples/speakers/audio/client.py | 177 ++ .../voices/pvc/samples/speakers/client.py | 318 ++++ .../voices/pvc/samples/waveform/__init__.py | 2 + .../voices/pvc/samples/waveform/client.py | 169 ++ .../voices/pvc/verification/__init__.py | 5 + .../pvc/verification/captcha/__init__.py | 2 + .../voices/pvc/verification/captcha/client.py | 291 ++++ .../voices/pvc/verification/client.py | 197 +++ src/elevenlabs/workspace/client.py | 145 ++ 109 files changed, 5424 insertions(+), 166 deletions(-) create mode 100644 src/elevenlabs/audio_isolation/types/__init__.py create mode 100644 src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_request_file_format.py create mode 100644 src/elevenlabs/audio_isolation/types/audio_isolation_audio_isolation_stream_request_file_format.py create mode 100644 src/elevenlabs/speech_to_speech/types/__init__.py create mode 100644 src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_as_stream_request_file_format.py create mode 100644 src/elevenlabs/speech_to_speech/types/speech_to_speech_convert_request_file_format.py create mode 100644 src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_file_format.py create mode 100644 src/elevenlabs/types/add_pronunciation_dictionary_response_model_permission_on_resource.py create mode 100644 src/elevenlabs/types/audio_native_project_settings_response_model_status.py create mode 100644 src/elevenlabs/types/body_retrieve_voice_sample_audio_v_1_voices_pvc_voice_id_samples_sample_id_audio_get.py create mode 100644 src/elevenlabs/types/conversation_history_error_common_model.py create mode 100644 src/elevenlabs/types/conversation_history_rag_usage_common_model.py create mode 100644 src/elevenlabs/types/conversation_history_transcript_tool_call_client_details.py create mode 100644 src/elevenlabs/types/conversation_history_transcript_tool_call_common_model_tool_details.py create mode 100644 src/elevenlabs/types/conversation_history_transcript_tool_call_webhook_details.py create mode 100644 src/elevenlabs/types/delete_voice_sample_response_model.py create mode 100644 src/elevenlabs/types/delete_workspace_member_response_model.py create mode 100644 src/elevenlabs/types/dubbing_render_response_model.py create mode 100644 src/elevenlabs/types/end_call_tool_config.py create mode 100644 src/elevenlabs/types/get_pronunciation_dictionary_metadata_response_model_permission_on_resource.py create mode 100644 src/elevenlabs/types/language_detection_tool_config.py rename src/elevenlabs/types/{add_pronunciation_dictionary_rules_response_model.py => pronunciation_dictionary_rules_response_model.py} (92%) create mode 100644 src/elevenlabs/types/pronunciation_dictionary_version_response_model_permission_on_resource.py create mode 100644 src/elevenlabs/types/render.py create mode 100644 src/elevenlabs/types/render_status.py create mode 100644 src/elevenlabs/types/render_type.py create mode 100644 src/elevenlabs/types/request_pvc_manual_verification_response_model.py rename src/elevenlabs/types/{remove_pronunciation_dictionary_rules_response_model.py => speaker_audio_response_model.py} (60%) create mode 100644 src/elevenlabs/types/start_pvc_voice_training_response_model.py create mode 100644 src/elevenlabs/types/start_speaker_separation_response_model.py rename src/elevenlabs/types/{system_tool_config.py => system_tool_config_input.py} (76%) create mode 100644 src/elevenlabs/types/system_tool_config_input_params.py create mode 100644 src/elevenlabs/types/system_tool_config_output.py create mode 100644 src/elevenlabs/types/system_tool_config_output_params.py create mode 100644 src/elevenlabs/types/transfer.py create mode 100644 src/elevenlabs/types/transfer_to_agent_tool_config.py create mode 100644 src/elevenlabs/types/verify_pvc_voice_captcha_response_model.py create mode 100644 src/elevenlabs/types/voice_sample_preview_response_model.py create mode 100644 src/elevenlabs/types/voice_sample_visual_waveform_response_model.py create mode 100644 src/elevenlabs/voices/pvc/__init__.py create mode 100644 src/elevenlabs/voices/pvc/client.py create mode 100644 src/elevenlabs/voices/pvc/samples/__init__.py create mode 100644 src/elevenlabs/voices/pvc/samples/audio/__init__.py create mode 100644 src/elevenlabs/voices/pvc/samples/audio/client.py create mode 100644 src/elevenlabs/voices/pvc/samples/client.py create mode 100644 src/elevenlabs/voices/pvc/samples/speakers/__init__.py create mode 100644 src/elevenlabs/voices/pvc/samples/speakers/audio/__init__.py create mode 100644 src/elevenlabs/voices/pvc/samples/speakers/audio/client.py create mode 100644 src/elevenlabs/voices/pvc/samples/speakers/client.py create mode 100644 src/elevenlabs/voices/pvc/samples/waveform/__init__.py create mode 100644 src/elevenlabs/voices/pvc/samples/waveform/client.py create mode 100644 src/elevenlabs/voices/pvc/verification/__init__.py create mode 100644 src/elevenlabs/voices/pvc/verification/captcha/__init__.py create mode 100644 src/elevenlabs/voices/pvc/verification/captcha/client.py create mode 100644 src/elevenlabs/voices/pvc/verification/client.py 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..b0ad1570 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.
@@ -6302,6 +6326,94 @@ client.dubbing.dub_segments(
+ +
+ + +
client.dubbing.render_dub(...) +
+
+ +#### 📝 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.render_dub( + dubbing_id="dubbing_id", + language="language", + render_type="mp4", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ +
@@ -8296,6 +8408,76 @@ client.workspace.update_member(
+ + + + +
client.workspace.delete_member(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a workspace member. 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( + email="email", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**email:** `str` — Email of the target user. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -8645,7 +8827,7 @@ client.speech_to_text.convert(
-**model_id:** `str` — The ID of the model to use for transcription, currently only 'scribe_v1' is available. +**model_id:** `str` — The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available.
@@ -8653,9 +8835,7 @@ client.speech_to_text.convert(
-**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.
@@ -8663,7 +8843,7 @@ 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. +**file:** `typing.Optional[str]` — The file to transcribe. All major audio and video formats are supported. Exactly one of the file or cloud_storage_url parameters must be provided. The file size must be less than 1GB.
@@ -8719,6 +8899,22 @@ core.File` — See core.File for more documentation
+**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.
@@ -8792,7 +8988,15 @@ 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. +**text:** `str` — 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.
@@ -9037,14 +9241,6 @@ client.conversational_ai.create_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.
@@ -9271,14 +9467,6 @@ client.conversational_ai.update_agent(
-**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
@@ -10371,6 +10559,18 @@ client.conversational_ai.get_knowledge_base_list()
+**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).
@@ -13274,3 +13474,1206 @@ client.studio.chapters.get_chapter_snapshot(
+## Voices Pvc +
client.voices.pvc.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new PVC voice with metadata but no samples +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.create( + name="John Smith", + language="en", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Edit PVC voice metadata +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.update( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.train(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Start PVC training process for a voice. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.train( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Samples +
client.voices.pvc.samples.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add audio samples to a PVC voice +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.create( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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:** `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. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.samples.update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a PVC voice sample - apply noise removal, or select speaker. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.update( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.samples.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a sample from a PVC voice. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.delete( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Verification +
client.voices.pvc.verification.request(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Request manual verification for a PVC voice. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.verification.request( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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:** `from __future__ import annotations + +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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Samples Audio +
client.voices.pvc.samples.audio.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the first 30 seconds of voice sample audio with or without noise removal. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.audio.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Samples Waveform +
client.voices.pvc.samples.waveform.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the visual waveform of a voice sample. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.waveform.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Samples Speakers +
client.voices.pvc.samples.speakers.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the status of the speaker separation process and the list of detected speakers if complete. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.speakers.get( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.samples.speakers.separate(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Start speaker separation process for a sample +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.samples.speakers.separate( + voice_id="21m00Tcm4TlvDq8ikWAM", + sample_id="VW7YKqPnjY4h39yTbx2L", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Samples Speakers Audio +
client.voices.pvc.samples.speakers.audio.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the separated audio for a specific speaker. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +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", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +## Voices Pvc Verification Captcha +
client.voices.pvc.verification.captcha.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get captcha for PVC voice verification. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.verification.captcha.get( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
client.voices.pvc.verification.captcha.verify(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Submit captcha verification for PVC voice. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.voices.pvc.verification.captcha.verify( + voice_id="21m00Tcm4TlvDq8ikWAM", +) + +``` +
+
+
+
+ +#### ⚙️ 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:** `from __future__ import annotations + +core.File` — See core.File for more documentation + +
+
+ +
+
+ +**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..64f7858e 100644 --- a/src/elevenlabs/dubbing/client.py +++ b/src/elevenlabs/dubbing/client.py @@ -17,6 +17,8 @@ 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 ..types.do_dubbing_response import DoDubbingResponse from ..types.dubbing_metadata_response import DubbingMetadataResponse from ..types.delete_dubbing_response_model import DeleteDubbingResponseModel @@ -655,6 +657,86 @@ 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, *, @@ -1069,13 +1151,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,6 +1885,94 @@ 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, *, @@ -2255,13 +2419,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/pronunciation_dictionary/client.py b/src/elevenlabs/pronunciation_dictionary/client.py index c6b9b2f0..10856155 100644 --- a/src/elevenlabs/pronunciation_dictionary/client.py +++ b/src/elevenlabs/pronunciation_dictionary/client.py @@ -22,13 +22,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, ) @@ -241,7 +238,7 @@ def add_rules( *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, - ) -> AddPronunciationDictionaryRulesResponseModel: + ) -> PronunciationDictionaryRulesResponseModel: """ Add rules to the pronunciation dictionary @@ -260,7 +257,7 @@ def add_rules( Returns ------- - AddPronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -303,9 +300,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 +327,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 +344,7 @@ def remove_rules( Returns ------- - RemovePronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -378,9 +375,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(), ), ) @@ -809,7 +806,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 +825,7 @@ async def add_rules( Returns ------- - AddPronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -879,9 +876,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 +903,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 +920,7 @@ async def remove_rules( Returns ------- - RemovePronunciationDictionaryRulesResponseModel + PronunciationDictionaryRulesResponseModel Successful Response Examples @@ -962,9 +959,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..617099bb 100644 --- a/src/elevenlabs/speech_to_text/client.py +++ b/src/elevenlabs/speech_to_text/client.py @@ -2,11 +2,13 @@ import typing from ..core.client_wrapper import SyncClientWrapper -from .. import core from .types.speech_to_text_convert_request_timestamps_granularity import ( 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 +30,16 @@ def convert( self, *, model_id: str, - file: core.File, enable_logging: typing.Optional[bool] = None, + file: typing.Optional[str] = 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 +48,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[str] + The file to transcribe. All major audio and video formats are supported. Exactly one of the file or cloud_storage_url parameters must be provided. The file size must be less than 1GB. + 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 +74,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. @@ -98,16 +108,17 @@ def convert( }, data={ "model_id": model_id, + "file": file, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "additional_formats": additional_formats, + "file_format": file_format, + "cloud_storage_url": cloud_storage_url, }, - files={ - "file": file, - }, + files={}, request_options=request_options, omit=OMIT, ) @@ -144,14 +155,16 @@ async def convert( self, *, model_id: str, - file: core.File, enable_logging: typing.Optional[bool] = None, + file: typing.Optional[str] = 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 +173,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[str] + The file to transcribe. All major audio and video formats are supported. Exactly one of the file or cloud_storage_url parameters must be provided. The file size must be less than 1GB. + 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 +199,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. @@ -222,16 +241,17 @@ async def main() -> None: }, data={ "model_id": model_id, + "file": file, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "additional_formats": additional_formats, + "file_format": file_format, + "cloud_storage_url": cloud_storage_url, }, - files={ - "file": file, - }, + files={}, request_options=request_options, omit=OMIT, ) 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/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,