pax_global_header00006660000000000000000000000064152366024340014517gustar00rootroot0000000000000052 comment=b6e5614d69abebf679b6776e3d2c2eddb72d02fa elevenlabs-elevenlabs-python-b6e5614/000077500000000000000000000000001523660243400176325ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/.fern/000077500000000000000000000000001523660243400206425ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/.fern/metadata.json000066400000000000000000000025611523660243400233210ustar00rootroot00000000000000{ "cliVersion": "5.75.4", "generatorName": "fernapi/fern-python-sdk", "generatorVersion": "4.64.1", "generatorConfig": { "timeout_in_seconds": 240, "default_bytes_stream_chunk_size": 1024, "inline_request_params": false, "follow_redirects_by_default": true, "recursion_limit": 10000, "pydantic_config": { "skip_validation": true }, "client": { "class_name": "BaseElevenLabs", "filename": "base_client.py", "exported_class_name": "ElevenLabs", "exported_filename": "client.py" }, "extra_dependencies": { "requests": ">=2.20", "websockets": ">=13.0", "pyaudio": { "version": ">=0.2.14", "optional": true } }, "extra_dev_dependencies": { "types-pyaudio": "^0.2.16.20240516" }, "extras": { "pyaudio": [ "pyaudio" ] }, "additional_init_exports": [ { "from": "play", "imports": [ "play", "save", "stream" ] }, { "from": "realtime", "imports": [ "RealtimeEvents", "RealtimeAudioOptions", "RealtimeUrlOptions", "AudioFormat", "CommitStrategy", "RealtimeConnection" ] } ] }, "originGitCommit": "e52cb61dee8174e6229f2ee96f674b2b2e032212", "sdkVersion": "2.63.0" }elevenlabs-elevenlabs-python-b6e5614/.fern/replay.lock000066400000000000000000011765151523660243400230300ustar00rootroot00000000000000# DO NOT EDIT MANUALLY - Managed by Fern Replay version: "1.0" generations: - commit_sha: 6cdc807dbce06ea8b7e9037f018adb6816f39236 tree_hash: 86240007aae7bfde82f6e453828a4b21974b8d3b timestamp: 2026-05-20T07:38:29.115Z cli_version: unknown generator_versions: {} - commit_sha: f6162d3b9e7ae2eb506569dc34938d5bd5f7d427 tree_hash: 11577f041e5c4d0ef52d53130c965cee5722b53b timestamp: 2026-05-26T13:58:19.631Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.42.0 - commit_sha: 53ea245de6f5ee2ce3e44ee1adc2914eed606dd7 tree_hash: 55def33f6d7c9729ab626faaa28674aa9060930b timestamp: 2026-07-07T10:01:45.138Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.42.0 - commit_sha: 9a1aed5baf8ba11a6319713529deadb212aa38de tree_hash: 24f65efbf6ded828b8e933d54ab259dd6048ccfe timestamp: 2026-07-09T07:38:14.043Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.42.0 - commit_sha: 50965d3c84d178394d7276feaf440e1180077570 tree_hash: 80f079181bbb8c25740527893363c3c3365293e5 timestamp: 2026-07-13T08:25:02.899Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.42.0 - commit_sha: 5f9dcf2dc2258622575d790bbfe7d9e724e8a2e4 tree_hash: 2526662c1102613c7326d7ccd97b621f40ac8150 timestamp: 2026-07-22T08:20:47.677Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.64.1 - commit_sha: a7ccd7a4629a1173eafd554dc3f3505eb1ef105d tree_hash: f9c8ba2cb39bdccb64f84b4046ca4485d1cbf6b9 timestamp: 2026-07-30T10:04:22.461Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.64.1 - commit_sha: cf7b4949242b5023487088ffa5a2ed6e82ba362a tree_hash: 93090600cf9b23cb9aa71e64b5e97a5ed8f5167f timestamp: 2026-08-05T09:53:37.453Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.64.1 - commit_sha: 2c23274cf1033c8274ba000f5c707f4d55699167 tree_hash: 3a5bf7eae106e53866ff9a129f0243536d035e7c timestamp: 2026-08-06T15:18:53.471Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.64.1 - commit_sha: 1e5d4021226cde19f15c23561bdb4b2ba765989e tree_hash: bf7c69be78a0d4728acae1b0621eaad6b1fdf67b timestamp: 2026-08-11T10:18:57.895Z cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.64.1 current_generation: 1e5d4021226cde19f15c23561bdb4b2ba765989e patches: - id: patch-560b8934 content_hash: sha256:7cc64e2c0e717976480e69331fa8402968c0ed67dc8d7dd94b304a0ad98e606a original_commit: 560b89344199f0abe20d36f6963565818b3df6dd original_message: "fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)" original_author: Kræn Hansen base_generation: cf7b4949242b5023487088ffa5a2ed6e82ba362a files: - src/elevenlabs/audio_native/raw_client.py - src/elevenlabs/dubbing/project/raw_client.py - src/elevenlabs/music/finetunes/raw_client.py - src/elevenlabs/music/raw_client.py - src/elevenlabs/speech_to_text/raw_client.py - src/elevenlabs/studio/projects/raw_client.py patch_content: | diff --git a/src/elevenlabs/audio_native/raw_client.py b/src/elevenlabs/audio_native/raw_client.py index 85caf294..8b6c0fe3 100644 --- a/src/elevenlabs/audio_native/raw_client.py +++ b/src/elevenlabs/audio_native/raw_client.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing from json.decoder import JSONDecodeError @@ -122,7 +121,7 @@ class RawAudioNativeClient: "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, - "pronunciation_dictionary_locators": json.dumps(jsonable_encoder(pronunciation_dictionary_locators)), + "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), @@ -467,7 +466,7 @@ class AsyncRawAudioNativeClient: "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, - "pronunciation_dictionary_locators": json.dumps(jsonable_encoder(pronunciation_dictionary_locators)), + "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), diff --git a/src/elevenlabs/dubbing/project/raw_client.py b/src/elevenlabs/dubbing/project/raw_client.py index 83a1e459..dadb8747 100644 --- a/src/elevenlabs/dubbing/project/raw_client.py +++ b/src/elevenlabs/dubbing/project/raw_client.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing from json.decoder import JSONDecodeError @@ -159,7 +158,7 @@ class RawProjectClient: "reference": reference, "source_language": source_language, "model_id": model_id, - "keyterms": json.dumps(jsonable_encoder(keyterms)), + "keyterms": keyterms, "target_language": target_language, }, files={ @@ -436,7 +435,7 @@ class AsyncRawProjectClient: "reference": reference, "source_language": source_language, "model_id": model_id, - "keyterms": json.dumps(jsonable_encoder(keyterms)), + "keyterms": keyterms, "target_language": target_language, }, files={ diff --git a/src/elevenlabs/music/finetunes/raw_client.py b/src/elevenlabs/music/finetunes/raw_client.py index e4de27f0..dc8c71e3 100644 --- a/src/elevenlabs/music/finetunes/raw_client.py +++ b/src/elevenlabs/music/finetunes/raw_client.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing from json.decoder import JSONDecodeError @@ -167,7 +166,7 @@ class RawFinetunesClient: data={ "name": name, "primary_genre": primary_genre, - "tags": json.dumps(jsonable_encoder(tags)), + "tags": tags, "visibility": visibility, "model_id": model_id, }, @@ -622,7 +621,7 @@ class AsyncRawFinetunesClient: data={ "name": name, "primary_genre": primary_genre, - "tags": json.dumps(jsonable_encoder(tags)), + "tags": tags, "visibility": visibility, "model_id": model_id, }, diff --git a/src/elevenlabs/music/raw_client.py b/src/elevenlabs/music/raw_client.py index bce5d86d..4a526987 100644 --- a/src/elevenlabs/music/raw_client.py +++ b/src/elevenlabs/music/raw_client.py @@ -9,7 +9,6 @@ from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata @@ -105,7 +104,7 @@ class RawMusicClient: }, data={ "description": description, - "tags": json.dumps(jsonable_encoder(tags)), + "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, @@ -895,7 +894,7 @@ class AsyncRawMusicClient: }, data={ "description": description, - "tags": json.dumps(jsonable_encoder(tags)), + "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, diff --git a/src/elevenlabs/speech_to_text/raw_client.py b/src/elevenlabs/speech_to_text/raw_client.py index d1c62835..877dae07 100644 --- a/src/elevenlabs/speech_to_text/raw_client.py +++ b/src/elevenlabs/speech_to_text/raw_client.py @@ -195,7 +195,7 @@ class RawSpeechToTextClient: "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, - "keyterms": json.dumps(jsonable_encoder(keyterms)), + "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), @@ -405,7 +405,7 @@ class AsyncRawSpeechToTextClient: "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, - "keyterms": json.dumps(jsonable_encoder(keyterms)), + "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), diff --git a/src/elevenlabs/studio/projects/raw_client.py b/src/elevenlabs/studio/projects/raw_client.py index bccd5df9..28f79edc 100644 --- a/src/elevenlabs/studio/projects/raw_client.py +++ b/src/elevenlabs/studio/projects/raw_client.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing from json.decoder import JSONDecodeError @@ -304,7 +303,7 @@ class RawProjectsClient: "title": title, "author": author, "description": description, - "genres": json.dumps(jsonable_encoder(genres)), + "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, @@ -313,14 +312,14 @@ class RawProjectsClient: "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, - "pronunciation_dictionary_locators": json.dumps(jsonable_encoder(pronunciation_dictionary_locators)), + "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, - "voice_settings": json.dumps(jsonable_encoder(voice_settings)), + "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ @@ -960,7 +959,7 @@ class AsyncRawProjectsClient: "title": title, "author": author, "description": description, - "genres": json.dumps(jsonable_encoder(genres)), + "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, @@ -969,14 +968,14 @@ class AsyncRawProjectsClient: "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, - "pronunciation_dictionary_locators": json.dumps(jsonable_encoder(pronunciation_dictionary_locators)), + "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, - "voice_settings": json.dumps(jsonable_encoder(voice_settings)), + "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ theirs_snapshot: src/elevenlabs/audio_native/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel from ..types.audio_native_edit_content_response_model import AudioNativeEditContentResponseModel from ..types.get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel from .types.audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAudioNativeClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeCreateProjectResponseModel]: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeCreateProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/audio-native", method="POST", data={ "name": name, "image": image, "author": author, "title": title, "small": small, "text_color": text_color, "background_color": background_color, "sessionization": sessionization, "voice_id": voice_id, "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeCreateProjectResponseModel, construct_type( type_=AudioNativeCreateProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAudioNativeProjectSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioNativeProjectSettingsResponseModel, construct_type( type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeEditContentResponseModel]: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/content", method="POST", data={ "auto_convert": auto_convert, "auto_publish": auto_publish, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeEditContentResponseModel]: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/audio-native/content", method="POST", json={ "url": url, "author": author, "title": title, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAudioNativeClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeCreateProjectResponseModel]: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeCreateProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/audio-native", method="POST", data={ "name": name, "image": image, "author": author, "title": title, "small": small, "text_color": text_color, "background_color": background_color, "sessionization": sessionization, "voice_id": voice_id, "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeCreateProjectResponseModel, construct_type( type_=AudioNativeCreateProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioNativeProjectSettingsResponseModel, construct_type( type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/content", method="POST", data={ "auto_convert": auto_convert, "auto_publish": auto_publish, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/audio-native/content", method="POST", json={ "url": url, "author": author, "title": title, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) src/elevenlabs/dubbing/project/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.dubbing_project_list_response import DubbingProjectListResponse from ...types.dubbing_project_response import DubbingProjectResponse from .types.project_list_request_sort_direction import ProjectListRequestSortDirection from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawProjectClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingProjectListResponse]: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectListResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectListResponse, construct_type( type_=DubbingProjectListResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[typing.Literal["dubbing_v2"]] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingProjectResponse]: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[typing.Literal["dubbing_v2"]] Default dubbing model id for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="POST", data={ "source_url": source_url, "reference": reference, "source_language": source_language, "model_id": model_id, "keyterms": keyterms, "target_language": target_language, }, files={ **({"file": file} if file is not None else {}), **({"transcript": transcript} if transcript is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingProjectResponse]: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawProjectClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingProjectListResponse]: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectListResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectListResponse, construct_type( type_=DubbingProjectListResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[typing.Literal["dubbing_v2"]] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingProjectResponse]: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[typing.Literal["dubbing_v2"]] Default dubbing model id for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="POST", data={ "source_url": source_url, "reference": reference, "source_language": source_language, "model_id": model_id, "keyterms": keyterms, "target_language": target_language, }, files={ **({"file": file} if file is not None else {}), **({"transcript": transcript} if transcript is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingProjectResponse]: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) src/elevenlabs/music/finetunes/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.finetune_created_by import FinetuneCreatedBy from ...types.finetune_visibility import FinetuneVisibility from ...types.music_finetune_page_response_model import MusicFinetunePageResponseModel from ...types.music_finetune_response_model import MusicFinetuneResponseModel from .types.finetunes_create_request_model_id import FinetunesCreateRequestModelId from .types.finetunes_create_request_visibility import FinetunesCreateRequestVisibility from .types.finetunes_list_request_sort import FinetunesListRequestSort from .types.finetunes_list_request_sort_direction import FinetunesListRequestSortDirection from .types.update_music_finetune_request_model_visibility import UpdateMusicFinetuneRequestModelVisibility from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawFinetunesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetunePageResponseModel]: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetunePageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="GET", params={ "cursor": cursor, "page_size": page_size, "visibility": visibility, "created_by": created_by, "sort": sort, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetunePageResponseModel, construct_type( type_=MusicFinetunePageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetuneResponseModel]: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="POST", data={ "name": name, "primary_genre": primary_genre, "tags": tags, "visibility": visibility, "model_id": model_id, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[MusicFinetuneResponseModel]: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[MusicFinetuneResponseModel]: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetuneResponseModel]: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="PATCH", json={ "name": name, "tags": tags, "primary_genre": primary_genre, "visibility": visibility, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawFinetunesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetunePageResponseModel]: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetunePageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="GET", params={ "cursor": cursor, "page_size": page_size, "visibility": visibility, "created_by": created_by, "sort": sort, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetunePageResponseModel, construct_type( type_=MusicFinetunePageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="POST", data={ "name": name, "primary_genre": primary_genre, "tags": tags, "visibility": visibility, "model_id": model_id, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="PATCH", json={ "name": name, "tags": tags, "primary_genre": primary_genre, "visibility": visibility, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) src/elevenlabs/music/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import contextlib import json import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.forbidden_error import ForbiddenError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.allowed_output_formats import AllowedOutputFormats from ..types.music_upload_response import MusicUploadResponse from .types.body_compose_music_v_1_music_post_composition_plan import BodyComposeMusicV1MusicPostCompositionPlan from .types.body_compose_music_v_1_music_post_model_id import BodyComposeMusicV1MusicPostModelId from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, ) from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, ) from .types.body_stream_composed_music_v_1_music_stream_post_composition_plan import ( BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, ) from .types.body_stream_composed_music_v_1_music_stream_post_model_id import ( BodyStreamComposedMusicV1MusicStreamPostModelId, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, ) from .types.music_compose_detailed_request_output_format import MusicComposeDetailedRequestOutputFormat from .types.music_compose_detailed_stream_request_output_format import MusicComposeDetailedStreamRequestOutputFormat from .types.music_compose_request_output_format import MusicComposeRequestOutputFormat from .types.music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId from .types.music_stream_request_output_format import MusicStreamRequestOutputFormat from .types.music_video_to_music_request_model_id import MusicVideoToMusicRequestModelId from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMusicClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ with self._client_wrapper.httpx_client.stream( "v1/music/video-to-music", method="POST", params={ "output_format": output_format, }, data={ "description": description, "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "videos": videos, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated audio file in the format specified """ with self._client_wrapper.httpx_client.stream( "v1/music", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicV1MusicPostCompositionPlan, direction="write" ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Multipart/mixed response with JSON metadata and binary audio file """ with self._client_wrapper.httpx_client.stream( "v1/music/detailed", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[str]]]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[HttpResponse[typing.Iterator[str]]] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. """ with self._client_wrapper.httpx_client.stream( "v1/music/detailed/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[str]]: try: if 200 <= _response.status_code < 300: def _iter(): for _text in _response.iter_lines(): try: if len(_text) == 0: continue yield typing.cast( str, construct_type( type_=str, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return HttpResponse(response=_response, data=_iter()) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data in the format specified """ with self._client_wrapper.httpx_client.stream( "v1/music/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicUploadResponse]: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicUploadResponse] Successfully uploaded music file with optional composition plan """ _response = self._client_wrapper.httpx_client.request( "v1/music/upload", method="POST", data={ "extract_composition_plan": extract_composition_plan, "with_timestamps": with_timestamps, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicUploadResponse, construct_type( type_=MusicUploadResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ with self._client_wrapper.httpx_client.stream( "v1/music/stem-separation", method="POST", params={ "output_format": output_format, }, data={ "stem_variation_id": stem_variation_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawMusicClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ async with self._client_wrapper.httpx_client.stream( "v1/music/video-to-music", method="POST", params={ "output_format": output_format, }, data={ "description": description, "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "videos": videos, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated audio file in the format specified """ async with self._client_wrapper.httpx_client.stream( "v1/music", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicV1MusicPostCompositionPlan, direction="write" ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Multipart/mixed response with JSON metadata and binary audio file """ async with self._client_wrapper.httpx_client.stream( "v1/music/detailed", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. """ async with self._client_wrapper.httpx_client.stream( "v1/music/detailed/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[str]]: try: if 200 <= _response.status_code < 300: async def _iter(): async for _text in _response.aiter_lines(): try: if len(_text) == 0: continue yield typing.cast( str, construct_type( type_=str, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return AsyncHttpResponse(response=_response, data=_iter()) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data in the format specified """ async with self._client_wrapper.httpx_client.stream( "v1/music/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicUploadResponse]: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicUploadResponse] Successfully uploaded music file with optional composition plan """ _response = await self._client_wrapper.httpx_client.request( "v1/music/upload", method="POST", data={ "extract_composition_plan": extract_composition_plan, "with_timestamps": with_timestamps, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicUploadResponse, construct_type( type_=MusicUploadResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ async with self._client_wrapper.httpx_client.stream( "v1/music/stem-separation", method="POST", params={ "output_format": output_format, }, data={ "stem_variation_id": stem_variation_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() src/elevenlabs/speech_to_text/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import json import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.additional_formats import AdditionalFormats from .types.speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .types.speech_to_text_convert_request_entity_redaction import SpeechToTextConvertRequestEntityRedaction from .types.speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .types.speech_to_text_convert_request_model_id import SpeechToTextConvertRequestModelId from .types.speech_to_text_convert_request_multichannel_output_style import ( SpeechToTextConvertRequestMultichannelOutputStyle, ) from .types.speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .types.speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata from .types.speech_to_text_convert_response import SpeechToTextConvertResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSpeechToTextClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechToTextConvertResponse]: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechToTextConvertResponse] Synchronous transcription result """ _response = self._client_wrapper.httpx_client.request( "v1/speech-to-text", method="POST", params={ "token": token, "enable_logging": enable_logging, }, data={ "model_id": model_id, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "diarization_threshold": diarization_threshold, "file_format": file_format, "cloud_storage_url": cloud_storage_url, "source_url": source_url, "webhook": webhook, "webhook_id": webhook_id, "temperature": temperature, "seed": seed, "use_multi_channel": use_multi_channel, "multichannel_output_style": multichannel_output_style, "webhook_metadata": json.dumps(jsonable_encoder(webhook_metadata)), "entity_detection": json.dumps(jsonable_encoder(entity_detection)), "no_verbatim": no_verbatim, "use_speaker_library": use_speaker_library, "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), **( {"additional_formats": (None, json.dumps(jsonable_encoder(additional_formats)), "application/json")} if additional_formats is not OMIT else {} ), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechToTextConvertResponse, construct_type( type_=SpeechToTextConvertResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSpeechToTextClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechToTextConvertResponse]: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechToTextConvertResponse] Synchronous transcription result """ _response = await self._client_wrapper.httpx_client.request( "v1/speech-to-text", method="POST", params={ "token": token, "enable_logging": enable_logging, }, data={ "model_id": model_id, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "diarization_threshold": diarization_threshold, "file_format": file_format, "cloud_storage_url": cloud_storage_url, "source_url": source_url, "webhook": webhook, "webhook_id": webhook_id, "temperature": temperature, "seed": seed, "use_multi_channel": use_multi_channel, "multichannel_output_style": multichannel_output_style, "webhook_metadata": json.dumps(jsonable_encoder(webhook_metadata)), "entity_detection": json.dumps(jsonable_encoder(entity_detection)), "no_verbatim": no_verbatim, "use_speaker_library": use_speaker_library, "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), **( {"additional_formats": (None, json.dumps(jsonable_encoder(additional_formats)), "application/json")} if additional_formats is not OMIT else {} ), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechToTextConvertResponse, construct_type( type_=SpeechToTextConvertResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) src/elevenlabs/studio/projects/raw_client.py: | # This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.add_project_response_model import AddProjectResponseModel from ...types.convert_project_response_model import ConvertProjectResponseModel from ...types.delete_project_response_model import DeleteProjectResponseModel from ...types.edit_project_response_model import EditProjectResponseModel from ...types.get_projects_response import GetProjectsResponse from ...types.project_extended_response import ProjectExtendedResponse from ...types.project_muted_tracks_response_model import ProjectMutedTracksResponseModel from ...types.quality_preset_type import QualityPresetType from .types.projects_create_request_apply_text_normalization import ProjectsCreateRequestApplyTextNormalization from .types.projects_create_request_fiction import ProjectsCreateRequestFiction from .types.projects_create_request_source_type import ProjectsCreateRequestSourceType from .types.projects_create_request_target_audience import ProjectsCreateRequestTargetAudience from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawProjectsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[GetProjectsResponse]: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetProjectsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/studio/projects", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetProjectsResponse, construct_type( type_=GetProjectsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddProjectResponseModel]: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/studio/projects", method="POST", data={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, "from_content_json": from_content_json, "quality_preset": quality_preset, "title": title, "author": author, "description": description, "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, "original_publication_date": original_publication_date, "mature_content": mature_content, "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddProjectResponseModel, construct_type( type_=AddProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ProjectExtendedResponse]: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectExtendedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="GET", params={ "share_id": share_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectExtendedResponse, construct_type( type_=ProjectExtendedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EditProjectResponseModel]: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="POST", json={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "title": title, "author": author, "isbn_number": isbn_number, "volume_normalization": volume_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteProjectResponseModel]: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteProjectResponseModel, construct_type( type_=DeleteProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvertProjectResponseModel]: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvertProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertProjectResponseModel, construct_type( type_=ConvertProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ProjectMutedTracksResponseModel]: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectMutedTracksResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/muted-tracks", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectMutedTracksResponseModel, construct_type( type_=ProjectMutedTracksResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawProjectsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetProjectsResponse]: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetProjectsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/studio/projects", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetProjectsResponse, construct_type( type_=GetProjectsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddProjectResponseModel]: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/studio/projects", method="POST", data={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, "from_content_json": from_content_json, "quality_preset": quality_preset, "title": title, "author": author, "description": description, "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, "original_publication_date": original_publication_date, "mature_content": mature_content, "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddProjectResponseModel, construct_type( type_=AddProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ProjectExtendedResponse]: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectExtendedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="GET", params={ "share_id": share_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectExtendedResponse, construct_type( type_=ProjectExtendedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EditProjectResponseModel]: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="POST", json={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "title": title, "author": author, "isbn_number": isbn_number, "volume_normalization": volume_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteProjectResponseModel]: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteProjectResponseModel, construct_type( type_=DeleteProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvertProjectResponseModel]: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvertProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertProjectResponseModel, construct_type( type_=ConvertProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ProjectMutedTracksResponseModel]: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectMutedTracksResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/muted-tracks", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectMutedTracksResponseModel, construct_type( type_=ProjectMutedTracksResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) user_owned: true status: unresolved dismissals: - patch_id: patch-1b45413e original_commit: 1b45413e916fda868341ad48225c4b7211017849 original_message: "[Speech Engine] Add disable_auth parameter (#806)" content_hashes: - sha256:39ab43ecd30a8791dc5eef09812657f167c0c1dfe33609c89795b12015738682 dismissed_at: 2026-07-30T10:30:38.774Z via: forget forgotten_hashes: - sha256:39ab43ecd30a8791dc5eef09812657f167c0c1dfe33609c89795b12015738682 elevenlabs-elevenlabs-python-b6e5614/.fernignore000066400000000000000000000012031523660243400217650ustar00rootroot00000000000000# Specify files that shouldn't be modified by Fern # Ignore manually created SDK wrappers src/elevenlabs/client.py src/elevenlabs/conversational_ai/conversation.py src/elevenlabs/conversational_ai/default_audio_interface.py src/elevenlabs/realtime_tts.py src/elevenlabs/play.py src/elevenlabs/webhooks_custom.py src/elevenlabs/music_custom.py src/elevenlabs/speech_to_text_custom.py src/elevenlabs/url_utils.py src/elevenlabs/realtime/ src/elevenlabs/speech_engine/ src/elevenlabs/speech_engine_custom.py # Ignore CI files .github/ README.md AGENTS.md assets/ # Ignore custom tests tests/ .fern/replay.lock .fern/replay.yml .gitattributes elevenlabs-elevenlabs-python-b6e5614/.gitattributes000066400000000000000000000000521523660243400225220ustar00rootroot00000000000000.fern/replay.lock linguist-generated=true elevenlabs-elevenlabs-python-b6e5614/.github/000077500000000000000000000000001523660243400211725ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/.github/ISSUE_TEMPLATE/000077500000000000000000000000001523660243400233555ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/.github/ISSUE_TEMPLATE/1-bug_report.yml000066400000000000000000000031341523660243400264070ustar00rootroot00000000000000name: Bug report description: Create a bug report for the ElevenLabs Python SDK labels: [bug] body: - type: markdown attributes: value: | Thank you for reporting a bug with the **ElevenLabs Python SDK**. Please fill out the sections below to help us understand and resolve the issue. **Note:** The ElevenLabs Python SDK is **auto-generated from [Fern](https://www.buildwithfern.com/)** and is a wrapper around our OpenAPI specification. Direct modifications to the SDK code may be overwritten in future releases. - type: textarea attributes: label: Description description: | **Describe the bug in detail and provide clear steps to reproduce it.** Include information such as: - What you were trying to achieve. - What happened instead. - Any relevant parameters or configurations. placeholder: | **Steps to reproduce:** 1. ... 2. ... **Expected behavior:** **Actual behavior:** validations: required: true - type: textarea attributes: label: Code example description: Provide an example code snippet that has the problem (Make sure to **NOT** upload or expose your API key). placeholder: | ```python from elevenlabs import generate, play # Your code here ``` - type: textarea attributes: label: Additional context description: | Add any other context or screenshots about the problem here. placeholder: | - Related issues: - Possible workaround: - Logs - ... elevenlabs-elevenlabs-python-b6e5614/.github/ISSUE_TEMPLATE/2-feature_request.yml000066400000000000000000000040751523660243400274500ustar00rootroot00000000000000name: Feature Request description: Propose a new feature for the ElevenLabs Python SDK labels: [enhancement] body: - type: markdown attributes: value: | Thank you for taking the time to propose a new feature for the **ElevenLabs Python SDK**. Please provide detailed information below to help us understand your proposal. **Note:** The ElevenLabs Python SDK is **auto-generated from [Fern](https://fern.dev)** and is a wrapper around our OpenAPI specification. Additions made directly to the SDK code may be overwritten in future releases. We recommend opening an issue to discuss your feature request so we can explore how it fits into our API. - type: textarea attributes: label: Feature Description description: A detailed description of the feature you are proposing for the SDK. Include information such as the problem it solves, how it would work, and any relevant APIs or modules it would involve. placeholder: | **Feature description:** - What is the feature? - What problem does it solve? - How do you envision it working? validations: required: false - type: textarea attributes: label: Use Case description: Provide one or more use cases where this feature would be beneficial. placeholder: | **Use case:** - Describe a scenario where this feature would be useful. - type: textarea attributes: label: Alternatives Considered description: Describe any alternative solutions or features you've considered. placeholder: | **Alternatives considered:** - Other ways to solve the problem? - Why do these alternatives fall short? validations: required: false - type: textarea attributes: label: Additional Context description: Any extra information, references, or screenshots that might help us understand your feature request. placeholder: | - Related issues or discussions: - Relevant links: - Screenshots or mockups: validations: required: false elevenlabs-elevenlabs-python-b6e5614/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000002661523660243400253510ustar00rootroot00000000000000blank_issues_enabled: true contact_links: - name: Ask a question (Discord) url: https://discord.com/invite/elevenlabs about: Please ask questions in our discussions forum. elevenlabs-elevenlabs-python-b6e5614/.github/SECURITY.md000066400000000000000000000005271523660243400227670ustar00rootroot00000000000000# Reporting Security Issues If you believe you have found a security vulnerability, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem. ## Bug Bounty Program Please note that ElevenLabs does not offer cash-based rewards for vulnerability reports at this time. elevenlabs-elevenlabs-python-b6e5614/.github/workflows/000077500000000000000000000000001523660243400232275ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/.github/workflows/ci.yml000066400000000000000000000035121523660243400243460ustar00rootroot00000000000000name: ci on: [push] jobs: compile: runs-on: ubuntu-24.04 steps: - name: Checkout repo uses: actions/checkout@v6 - name: Set up python uses: actions/setup-python@v6 with: python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - name: Install dependencies run: poetry install - name: Compile run: poetry run mypy . test: runs-on: ubuntu-24.04 steps: - name: Checkout repo uses: actions/checkout@v6 - name: Set up python uses: actions/setup-python@v6 with: python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - name: Install dependencies run: | poetry install - name: Verify types run: poetry run python tests/verify_types.py - name: Test run: poetry run pytest . env: ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }} publish: needs: [compile, test] if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-24.04 environment: pypi-publish permissions: id-token: write contents: read steps: - name: Checkout repo uses: actions/checkout@v6 - name: Set up python uses: actions/setup-python@v6 with: python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - name: Install dependencies run: poetry install - name: Build package run: poetry build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 elevenlabs-elevenlabs-python-b6e5614/.gitignore000066400000000000000000000000711523660243400216200ustar00rootroot00000000000000.mypy_cache/ .ruff_cache/ __pycache__/ dist/ poetry.toml elevenlabs-elevenlabs-python-b6e5614/AGENTS.md000066400000000000000000000010541523660243400211350ustar00rootroot00000000000000# Agent Instructions ## Fern-generated code Most of the source code in this repository is auto-generated by [Fern](https://buildwithfern.com/). Only files listed in `.fernignore` are hand-maintained and safe to edit. **Do not modify files outside of `.fernignore`** — they will be overwritten on the next regeneration. Always check `.fernignore` before editing any file. When fixing build issues caused by Fern regeneration, always fix the hand-maintained wrapper files to adapt to the new generated code — never patch the generated files directly. elevenlabs-elevenlabs-python-b6e5614/LICENSE000066400000000000000000000020531523660243400206370ustar00rootroot00000000000000MIT License Copyright (c) 2026 Elevenlabs. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.elevenlabs-elevenlabs-python-b6e5614/README.md000066400000000000000000000331361523660243400211170ustar00rootroot00000000000000# ElevenLabs Python Library ![LOGO](https://github.com/elevenlabs/elevenlabs-python/assets/12028621/21267d89-5e82-4e7e-9c81-caf30b237683) [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/?utm_source=fern-elevenlabs/elevenlabs-python/readme) [![Discord](https://badgen.net/badge/black/ElevenLabs/icon?icon=discord&label)](https://discord.gg/elevenlabs) [![Twitter](https://badgen.net/badge/black/elevenlabsio/icon?icon=twitter&label)](https://twitter.com/elevenlabsio) [![PyPI - Python Version](https://img.shields.io/pypi/v/elevenlabs?style=flat&colorA=black&colorB=black)](https://pypi.org/project/elevenlabs/) [![Downloads](https://static.pepy.tech/personalized-badge/elevenlabs?period=total&units=international_system&left_color=black&right_color=black&left_text=Downloads)](https://pepy.tech/project/elevenlabs) The official Python SDK for [ElevenLabs](https://elevenlabs.io/). ElevenLabs brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code. ## 📖 API & Docs Check out the [HTTP API documentation](https://elevenlabs.io/docs/api-reference). ## Install ```bash pip install elevenlabs ``` ## Usage ### Main Models 1. **Eleven v3** (`eleven_v3`) - Dramatic delivery and performances - 70+ languages supported - Supported for natural multi-speaker dialogue 2. **Eleven Multilingual v2** (`eleven_multilingual_v2`) - Excels in stability, language diversity, and accent accuracy - Supports 29 languages - Recommended for most use cases 3. **Eleven Flash v2.5** (`eleven_flash_v2_5`) - Ultra-low latency - Supports 32 languages - Faster model, 50% lower price per character 4. **Eleven Turbo v2.5** (`eleven_turbo_v2_5`) - Good balance of quality and latency - Ideal for developer use cases where speed is crucial - Supports 32 languages For more detailed information about these models and others, visit the [ElevenLabs Models documentation](https://elevenlabs.io/docs/models). ```py from dotenv import load_dotenv from elevenlabs.client import ElevenLabs from elevenlabs.play import play load_dotenv() elevenlabs = ElevenLabs() audio = elevenlabs.text_to_speech.convert( text="The first move is what sets everything in motion.", voice_id="JBFqnCBsd6RMkjVDRZzb", model_id="eleven_v3", output_format="mp3_44100_128", ) play(audio) ```
Play 🎧 **Try it out!** Want to hear our voices in action? Visit the [ElevenLabs Voice Lab](https://elevenlabs.io/voice-lab) to experiment with different voices, languages, and settings.
## Voices List all your available voices with `search()`. ```py from elevenlabs.client import ElevenLabs elevenlabs = ElevenLabs( api_key="YOUR_API_KEY", ) response = elevenlabs.voices.search() print(response.voices) ``` For information about the structure of the voices output, please refer to the [official ElevenLabs API documentation for Get Voices](https://elevenlabs.io/docs/api-reference/get-voices). Build a voice object with custom settings to personalize the voice style, or call `elevenlabs.voices.settings.get("your-voice-id")` to get the default settings for the voice. ## Clone Voice Clone your voice in an instant. Note that voice cloning requires an API key, see below. ```py from elevenlabs.client import ElevenLabs from elevenlabs.play import play elevenlabs = ElevenLabs( api_key="YOUR_API_KEY", ) voice = elevenlabs.voices.ivc.create( name="Alex", description="An old American male voice with a slight hoarseness in his throat. Perfect for news", # Optional files=["./sample_0.mp3", "./sample_1.mp3", "./sample_2.mp3"], ) ``` ## Streaming Stream audio in real-time, as it's being generated. ```py from elevenlabs import stream from elevenlabs.client import ElevenLabs elevenlabs = ElevenLabs( api_key="YOUR_API_KEY", ) audio_stream = elevenlabs.text_to_speech.stream( text="This is a test", voice_id="JBFqnCBsd6RMkjVDRZzb", model_id="eleven_multilingual_v2" ) # option 1: play the streamed audio locally stream(audio_stream) # option 2: process the audio bytes manually for chunk in audio_stream: if isinstance(chunk, bytes): print(chunk) ``` ## Async Client Use `AsyncElevenLabs` if you want to make API calls asynchronously. ```python import asyncio from elevenlabs.client import AsyncElevenLabs elevenlabs = AsyncElevenLabs( api_key="MY_API_KEY" ) async def print_models() -> None: models = await elevenlabs.models.list() print(models) asyncio.run(print_models()) ``` ## ElevenAgents Build interactive AI agents with real-time audio capabilities using ElevenAgents. ### Basic Usage ```python from elevenlabs.client import ElevenLabs from elevenlabs.conversational_ai.conversation import Conversation, ClientTools from elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterface elevenlabs = ElevenLabs( api_key="YOUR_API_KEY", ) # Create audio interface for real-time audio input/output audio_interface = DefaultAudioInterface() # Create conversation conversation = Conversation( client=elevenlabs, agent_id="your-agent-id", requires_auth=True, audio_interface=audio_interface, ) # Start the conversation conversation.start_session() # The conversation runs in background until you call: conversation.end_session() ``` ### Custom Event Loop Support For advanced use cases involving context propagation, resource reuse, or specific event loop management, `ClientTools` supports custom asyncio event loops: ```python import asyncio from elevenlabs.conversational_ai.conversation import ClientTools elevenlabs = ElevenLabs( api_key="YOUR_API_KEY", ) async def main(): # Get the current event loop custom_loop = asyncio.get_running_loop() # Create ClientTools with custom loop to prevent "different event loop" errors client_tools = ClientTools(loop=custom_loop) # Register your tools async def get_weather(params): location = params.get("location", "Unknown") # Your async logic here return f"Weather in {location}: Sunny, 72°F" client_tools.register("get_weather", get_weather, is_async=True) # Use with conversation conversation = Conversation( client=elevenlabs, agent_id="your-agent-id", requires_auth=True, audio_interface=audio_interface, client_tools=client_tools ) asyncio.run(main()) ``` **Benefits of Custom Event Loop:** - **Context Propagation**: Maintain request-scoped state across async operations - **Resource Reuse**: Share existing async resources like HTTP sessions or database pools - **Loop Management**: Prevent "Task got Future attached to a different event loop" errors - **Performance**: Better control over async task scheduling and execution **Important:** When using a custom loop, you're responsible for its lifecycle Don't close the loop while ClientTools are still using it. ### Tool Registration Register custom tools that the AI agent can call during conversations: ```python client_tools = ClientTools() # Sync tool def calculate_sum(params): numbers = params.get("numbers", []) return sum(numbers) # Async tool async def fetch_data(params): url = params.get("url") # Your async HTTP request logic return {"data": "fetched"} client_tools.register("calculate_sum", calculate_sum, is_async=False) client_tools.register("fetch_data", fetch_data, is_async=True) ``` ## Speech Engine Speech Engine lets you build server-side voice agents that receive real-time transcripts from the ElevenLabs API and stream LLM responses back for text-to-speech synthesis. Your server acts as a WebSocket endpoint — ElevenLabs connects to it, sends user transcripts, and your code decides how to respond. Speech Engine is async-only and available on `AsyncElevenLabs`. ### Quick Start ```python import asyncio from openai import AsyncOpenAI from elevenlabs import AsyncElevenLabs openai_client = AsyncOpenAI() elevenlabs = AsyncElevenLabs() async def main(): engine = await elevenlabs.speech_engine.get("seng_123") async def on_transcript(transcript, session): stream = await openai_client.responses.create( model="gpt-4o", input=[ {"role": "assistant" if m.role == "agent" else m.role, "content": m.content} for m in transcript ], stream=True, ) await session.send_response(stream) async def on_init(conversation_id, session): print(f"Session started: {conversation_id}") async def on_close(session): print(f"Session ended: {session.conversation_id}") async def on_error(err, session): print(f"Error: {err}") await engine.serve( port=3001, debug=True, on_init=on_init, on_transcript=on_transcript, on_close=on_close, on_error=on_error, ) asyncio.run(main()) ``` ### How It Works When `engine.serve()` starts, it opens a WebSocket server on the specified port. For each incoming connection from the ElevenLabs API: 1. An `init` message arrives with a `conversation_id` 2. As the user speaks, `user_transcript` messages arrive with the full conversation history 3. Your `on_transcript` handler generates a response (using any LLM) and calls `session.send_response()` 4. If the user interrupts (speaks again mid-response), the previous handler is automatically cancelled ### Sending Responses `send_response()` accepts strings or async iterators. LLM stream formats from OpenAI, Anthropic, and Google Gemini are auto-detected: ```python # Plain string await session.send_response("Hello world") # OpenAI stream (auto-parsed) stream = await openai_client.responses.create(model="gpt-4o", ..., stream=True) await session.send_response(stream) # Anthropic stream (auto-parsed) stream = anthropic_client.messages.stream(model="claude-sonnet-4-20250514", ...) await session.send_response(stream) # Any async iterator of strings async def my_generator(): yield "Hello " yield "world" await session.send_response(my_generator()) ``` ### Interruption Handling When a new transcript arrives while a previous response is still streaming, the previous handler's `asyncio.Task` is cancelled automatically. Any `await` in your handler (including LLM SDK calls) will raise `asyncio.CancelledError`, which cleanly aborts the in-flight request. No manual signal handling needed. ### Custom Server Integration (FastAPI, Starlette) For integrating with an existing web server, use `create_session()` instead of `serve()`: ```python from fastapi import FastAPI, WebSocket app = FastAPI() engine = ... # SpeechEngineResource from await client.speech_engine.get(...) @app.websocket("/api/speech-engine/ws") async def speech_engine_ws(ws: WebSocket): await ws.accept() session = engine.create_session(ws, debug=True) session.on("user_transcript", handle_transcript) await session.run() ``` When using `session.on()` directly, handlers receive just the event data (no `session` argument, since you already have the reference): | Event | Handler signature | |---|---| | `"init"` | `async (conversation_id: str) -> None` | | `"user_transcript"` | `async (transcript: list[ConversationMessage]) -> None` | | `"close"` | `async () -> None` | | `"disconnected"` | `async () -> None` | | `"error"` | `async (error: Exception) -> None` | ### Standalone Server For full control over the server lifecycle, use `SpeechEngineServer` directly: ```python from elevenlabs.speech_engine import SpeechEngineServer server = SpeechEngineServer( port=3001, debug=True, on_transcript=handle_transcript, ) # In one task: await server.serve() # In another task (e.g. signal handler): await server.stop() ``` ### Authentication Both `engine.serve()` and `SpeechEngineServer` automatically verify the `X-Elevenlabs-Speech-Engine-Authorization` header on every incoming connection, rejecting any requests that were not signed by ElevenLabs. The API key is read from the `AsyncElevenLabs` client (or `api_key=` on `SpeechEngineServer`), falling back to the `ELEVENLABS_API_KEY` environment variable. #### Disabling authentication If your server sits behind an infrastructure layer that already restricts incoming traffic to ElevenLabs (typically an IP allowlist scoped to [ElevenLabs' egress ranges](https://elevenlabs.io/docs/overview/capabilities/speech-engine#ip-allowlisting)), you can skip JWT verification by passing `disable_auth=True`: ```python # Via engine.serve() — no api_key required when disable_auth is True await engine.serve(port=3001, disable_auth=True, on_transcript=on_transcript) # Or directly on SpeechEngineServer server = SpeechEngineServer(port=3001, disable_auth=True, on_transcript=on_transcript) await server.serve() ``` When auth is disabled the server accepts any client that can reach it and emits a `UserWarning` on startup. **Only use this if you have an IP allowlist or equivalent network-level restriction in front of the server** — without one, anyone on the internet can open a session and consume your compute and downstream LLM quota. ## Languages Supported Explore [all models & languages](https://elevenlabs.io/docs/models). ## Contributing While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us! On the other hand, contributions to the README are always very welcome! elevenlabs-elevenlabs-python-b6e5614/poetry.lock000066400000000000000000002315001523660243400220270ustar00rootroot00000000000000# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "annotated-types" version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] [package.dependencies] typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} [[package]] name = "anyio" version = "4.5.2" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" files = [ {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, ] [package.dependencies] exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} idna = ">=2.8" sniffio = ">=1.1" typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" version = "2026.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ {file = "certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775"}, {file = "certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55"}, ] [[package]] name = "charset-normalizer" version = "3.4.9" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" files = [ {file = "charset_normalizer-3.4.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd6280cf040f233bd7d3407b743b4b4c74f70e8e1c4199cb112a62c941c0772a"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa99adc8f081b475a12843953db36831eaf83ec33eb46a90629ca6a5de45a616"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c1225416b463483160e4af85d5fc3a9690ccb53fd4b1865a6437825f5ede3209"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:16d10d789dd9bcca1173c95af82c58433122564b7bc39385124be735a35cbe99"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9bb41182d93ea91f60b4bc8fbf4c820c69ef8a12ab2d917f3f1834f1acad07e8"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux_2_31_armv7l.whl", hash = "sha256:bcf74c1df76758a395bf0af608c04c82257523f55c9868b334f06270d0f2112b"}, {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b5314963fce9b0b12743891de876e724997864ee22aa496f903f426c7e2fa5b2"}, {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e9701d0049d92c16703a42771b98d560b95248949f23f8cf7b4eddd201814fb9"}, {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:65a7ff3f705e57d392f7261b6d0550fe137c3019477431f1c355e0db0a7d3e15"}, {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79580094b00d1789d1f93ea55bc43cb2f611910c72235b7657f3482ddcc1b22d"}, {file = "charset_normalizer-3.4.9-cp310-cp310-win32.whl", hash = "sha256:432786d3561e69aeeae6c7e8648964ce0ad05736120135601f87ac26b9c83381"}, {file = "charset_normalizer-3.4.9-cp310-cp310-win_amd64.whl", hash = "sha256:8c041122946b7ba21bb32c45b1aa57b1be35527690aeb3c5c234521085632eee"}, {file = "charset_normalizer-3.4.9-cp310-cp310-win_arm64.whl", hash = "sha256:375b83ed0aecfce76c16d198fbc21f3b11b337d68662bea0a995046682a11419"}, {file = "charset_normalizer-3.4.9-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0e94703ec9684807f20cfb5eed95c70f67f2a8f21ad620146d7b5a13677b93e5"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a441ea71902098ffe78c5abe6c494f44160b4af614ed16c3d9a3b1d17fd8ee2"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:304b13570067b2547562e308af560b3963857b1fa90bd6afd978130130fe2d6a"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4773092f8019072343a7447203308b176e10199920eb02d6195e81bbb3274c29"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:04ce310cb89c15df659582aee80a0603788732a5e017d5bd5c81158106ce249c"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux_2_31_armv7l.whl", hash = "sha256:c0323c9daef75ef2e5083624b4585018a0c9d5e3b40f607eed81a311270b934b"}, {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:871ff67ea1aad4dfd91736464934d56b32dac49f9fbe16cddba36198a7b3a0db"}, {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:67830fc78e67501f47bb950471b2dcb9b35b140084429318e862895a8e89c993"}, {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:3d92613ec25e43b05f042302531ec0f00b8445190e43325880cbd6ab7c2581da"}, {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:280081916dc341820640489a66e4696049401ef1cf6dd672f672e70ad915aca3"}, {file = "charset_normalizer-3.4.9-cp311-cp311-win32.whl", hash = "sha256:ac351b3b8014eead140e77e9717e2992c6bbe30b63bc3422422eb84865412e3d"}, {file = "charset_normalizer-3.4.9-cp311-cp311-win_amd64.whl", hash = "sha256:6366a16e1a25018694d6a5d784d09b046edc9eac40ea2b54065c3052672516a1"}, {file = "charset_normalizer-3.4.9-cp311-cp311-win_arm64.whl", hash = "sha256:1d22856ffbe153a602df38e4a5464f0b748a54002e0d69ac6d2ad0a197cc99ec"}, {file = "charset_normalizer-3.4.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:45b0cc4e3556cd875e09102988d1ab8356c998b596c9fced84547c8138b487a0"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9b2aff1c7b3884512b9512c3eaadd9bab39fb45042ffaaa1dd08ff2b9f8109d9"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9104ed0bd76a429d46f9ec0dbc9b08ad1d2dcdf2b00a5a0daa1c145329b35b44"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b86a2b16095d250c6f58b3d9b2eee6f4147754344f3dab0922f7c9bf7d226c9"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e226f6218febc71f6c1fc2fafb91c226f75bdc1d8fb12d66823716e891608fd"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:90c44bc373b7687f6948b693cceaea1348ae0975d7474746559494468e3c1d84"}, {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cdef90ae47919cae358d8ab15797a800ed41da7aba5d72419fb510729e2ed4b"}, {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:60f44ade2cf573dad7a277e6f8ca9a51a21dda572b13bd7d8539bb3cd5dbedde"}, {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a1786910334ed46ab1dd73222f2cd1e05c2c3bb39f6dddb4f8b36fc382058a39"}, {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:03d07803992c6c7bbc976327f34b18b6160327fc81cb82c9d504720ac0be3b62"}, {file = "charset_normalizer-3.4.9-cp312-cp312-win32.whl", hash = "sha256:78841cccf1af7b40f6f716338d50c0902dbe88d9f800b3c973b7a9a0a693a642"}, {file = "charset_normalizer-3.4.9-cp312-cp312-win_amd64.whl", hash = "sha256:4b3dac63058cc36820b0dd072f89898604e2d39686fe05321729d00d8ac185a0"}, {file = "charset_normalizer-3.4.9-cp312-cp312-win_arm64.whl", hash = "sha256:78fa18e436a1a0e58dbd7e02fc4473f3f32cceb12df9dfca542d075961c307d2"}, {file = "charset_normalizer-3.4.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:440eede837960000d74978f0eba527be106b5b9aee0daf779d395276ed0b0614"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21e764fd1e70b6a3e205a0e46f3051701f98a8cb3fad66eeb80e48bb502f8698"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e4fd89cc178bced6ad29cb3e6dd4aa63fa5017c3524dbd0b25998fb64a87cc8b"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bd47ba7fc3ca94896759ea0109775132d3e7ab921fbf54038e1bab2e46c313c9"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84fd18bcc17526fc2b3c1af7d2b9217d32c9c04448c16ec693b9b4f1985c3d33"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:5b10cd92fc5c498b35a8635df6d5a100207f88b63a4dc1de7ef9a548e1e2cd63"}, {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a4fbdde9dd4a9ce5fd52c2b3a347bb50cc89483ef783f1cb00d408c13f7a96c0"}, {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:416c229f77e5ea25b3dfd4b582f8d73d7e43c22320302b9ab128a2d3a0b38efe"}, {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:75286256590a6320cf106a0d28970d3560aad9ee09aa7b34fb40524792436d35"}, {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69b157c5d3292bcd443faca052f3096f637f1e074b98212a933c074ae23dc3b8"}, {file = "charset_normalizer-3.4.9-cp313-cp313-win32.whl", hash = "sha256:51307f5c71007673a2bf8232ad973483d281e74cb99c8c5a990af1eefa6277d9"}, {file = "charset_normalizer-3.4.9-cp313-cp313-win_amd64.whl", hash = "sha256:fe2c7201c642b7c308f1675355ad7ff7b66acfe3541625efe5a3ad38f29d6115"}, {file = "charset_normalizer-3.4.9-cp313-cp313-win_arm64.whl", hash = "sha256:611057cc5d5c0afc743ba8be6bd828c17e0aaa8643f9d0a9b9bb7dea80eb8012"}, {file = "charset_normalizer-3.4.9-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:0327fcd59a935777d83410750c50600ee9571af2846f71ce40f25b13da1ef380"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8a79d9f4d8001473a30c163556b3c3bfebec837495a412dde78b51672f6134f9"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33bdcc2a32c0a0e861f60841a512c8acc658c87c2ac59d89e3a46dacf7d866e4"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f840ed6d8ecba8255df8c42b87fadeda98ddfc6eeec05e2dc66e26d46dd6f58a"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c25fe15c70c59eb7c5ce8c06a1f3fa1da0ecc5ea1e7a5922c40fd2fa9b0d5046"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:f7fb7d750cfa0a070d2c24e831fd3481019a60dd317ea2b39acbcebc08b6ed81"}, {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d1c96a7a18b9690a4d46df09e3e3382406ae3213727cd1019ebade1c4a81917"}, {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a4cfde78a9f2880208d16a93b795726a3017d5977e08d1e162a7a31322479c41"}, {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d4d6fcde76f94f5cb9e43e9e9a61f16dacefd228cbbf6f1a09bd9b219a92f1a1"}, {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:898f0e9068ca27d37f8e83a5b962821df851532e6c4a7d615c1c033f9da6eedf"}, {file = "charset_normalizer-3.4.9-cp314-cp314-win32.whl", hash = "sha256:c1c948747b03be832dceed96ca815cef7360de9aa19d37c730f8e3f6101aca48"}, {file = "charset_normalizer-3.4.9-cp314-cp314-win_amd64.whl", hash = "sha256:16b65ea0f2465b6fb52aa22de5eca612aa964ddfec00a912e26f4656cbef890b"}, {file = "charset_normalizer-3.4.9-cp314-cp314-win_arm64.whl", hash = "sha256:40a126142a56b2dfc0aacbad1de8310cbf60da7656db0e6b16eebd48e3e93519"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:609b3ba8fcc0fb5ab7af00719d0fb6ad0cb518e48e7712d12fd68f1327951198"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51447e9aa2684679af07ca5021c3db526e0284347ebf4ffcec1154c3350cfe32"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cc1b0fff8ead343dae06305f954eb8468ba0ec1a97881f42489d198e4ce3c632"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa36ec09ef71d158186bc79e359ff5fdd6e7996fe8ab638f00d6b93139ba4fcf"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:df115d4d83168fdf2cae48ef1ff6d1cb4c466364e30861b37121de0f3bf1b990"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:f86c6358749bd4fda175388691e3ba8c46e24c5347d0afd20f9b7edfc9faf07d"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:32286a2c8d167e897177b673176c1e3e00d4057caf5d2b64eef9a3666b03018e"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:83aed2c10721ddd90f68140685391b50811a880af20654c59af6b6c66c40513c"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cd6c3d4b783c556fa00bf540854e42f135e2f256abd29669fcd0da0f2dec79c2"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ee2f2a527e3c1a6e6411eb4209642e138b544a2d72fe5d0d76daf77b24063534"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-win32.whl", hash = "sha256:0d861473f743244d349b50f850d10eb87aeb22bbdcc8e64f79273c94af5a8226"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-win_amd64.whl", hash = "sha256:9b8e0f3107e2200b76f6054de99016eac3ee6762713587b36baaa7e4bd2ae177"}, {file = "charset_normalizer-3.4.9-cp314-cp314t-win_arm64.whl", hash = "sha256:19ac87f93086ce37b86e098888555c4b4bc48102279bae3350098c0ed664b501"}, {file = "charset_normalizer-3.4.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:253a4a220747e8b5faf57ec320c4f5efb0cef05f647420bf267143ec15dba10a"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:68ce9f4d6b26d5ccbf7fd4459bf75f74a0a146677ebba80597df60cbdb20e6f4"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:58150c9f9b9a552505912d182ccdf26f6396fb6094816ceebcbb20eecabaed94"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:df7276909358e5635ae203673ab7e509ddd224225a8d6b0790bf13eb2bde1cc5"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3c09a49d6cde137258beb3d551994a2927fd35ad5cf96aed573f61bbd67c5f84"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux_2_31_armv7l.whl", hash = "sha256:231ddcbb35e2ff8973e1365db41fe0572662893b99a05deb183b68ad4c0c8bd4"}, {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:920079c3f7456fa213e0829ed2073aaa727fd39d889ead5b4f35d0de5460d04f"}, {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0fa1aec2d32bcc03c8fa0f6f1712caad1adc38509f31142112e5c9daf5b9c833"}, {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:ad41ba96094304aa090f5a30cb6e4fb3b3f1c264c523394b4c39bbacc4dc92ba"}, {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:43b9e366a31fdd1c87d0eb08f579b4a82b723ea54338f040d6b4e518a026ea29"}, {file = "charset_normalizer-3.4.9-cp39-cp39-win32.whl", hash = "sha256:93d59d504b230e83c7a843251681959a0b6a9cd76f6e146ce1b8a80eb8739af9"}, {file = "charset_normalizer-3.4.9-cp39-cp39-win_amd64.whl", hash = "sha256:ddf4af30b417d9fe16481e9b81c27ab2a7cde1ff7ba3e85653b02db7d145dc7b"}, {file = "charset_normalizer-3.4.9-cp39-cp39-win_arm64.whl", hash = "sha256:476743fe6dfe14a2da12e3ac79125dc84a3b2cf8094369a47a1529b0cd8549fe"}, {file = "charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5"}, {file = "charset_normalizer-3.4.9.tar.gz", hash = "sha256:673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b"}, ] [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] [[package]] name = "exceptiongroup" version = "1.3.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, ] [package.dependencies] typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} [package.extras] test = ["pytest (>=6)"] [[package]] name = "execnet" version = "2.1.2" description = "execnet: rapid multi-Python deployment" optional = false python-versions = ">=3.8" files = [ {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, ] [package.extras] testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] name = "h11" version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.8" files = [ {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, ] [[package]] name = "httpcore" version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, ] [package.dependencies] certifi = "*" h11 = ">=0.16" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, ] [package.dependencies] anyio = "*" certifi = "*" httpcore = "==1.*" idna = "*" [package.extras] brotli = ["brotli", "brotlicffi"] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" version = "3.15" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.8" files = [ {file = "idna-3.15-py3-none-any.whl", hash = "sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8"}, {file = "idna-3.15.tar.gz", hash = "sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc"}, ] [package.extras] all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] [[package]] name = "iniconfig" version = "2.1.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.8" files = [ {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, ] [[package]] name = "mypy" version = "1.13.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, ] [package.dependencies] mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} typing-extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] faster-cache = ["orjson"] install-types = ["pip"] mypyc = ["setuptools (>=50)"] reports = ["lxml"] [[package]] name = "mypy-extensions" version = "1.1.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.8" files = [ {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, ] [[package]] name = "packaging" version = "26.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ {file = "packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"}, {file = "packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"}, ] [[package]] name = "pluggy" version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] [[package]] name = "pyaudio" version = "0.2.14" description = "Cross-platform audio I/O with PortAudio" optional = true python-versions = "*" files = [ {file = "PyAudio-0.2.14-cp310-cp310-win32.whl", hash = "sha256:126065b5e82a1c03ba16e7c0404d8f54e17368836e7d2d92427358ad44fefe61"}, {file = "PyAudio-0.2.14-cp310-cp310-win_amd64.whl", hash = "sha256:2a166fc88d435a2779810dd2678354adc33499e9d4d7f937f28b20cc55893e83"}, {file = "PyAudio-0.2.14-cp311-cp311-win32.whl", hash = "sha256:506b32a595f8693811682ab4b127602d404df7dfc453b499c91a80d0f7bad289"}, {file = "PyAudio-0.2.14-cp311-cp311-win_amd64.whl", hash = "sha256:bbeb01d36a2f472ae5ee5e1451cacc42112986abe622f735bb870a5db77cf903"}, {file = "PyAudio-0.2.14-cp312-cp312-win32.whl", hash = "sha256:5fce4bcdd2e0e8c063d835dbe2860dac46437506af509353c7f8114d4bacbd5b"}, {file = "PyAudio-0.2.14-cp312-cp312-win_amd64.whl", hash = "sha256:12f2f1ba04e06ff95d80700a78967897a489c05e093e3bffa05a84ed9c0a7fa3"}, {file = "PyAudio-0.2.14-cp313-cp313-win32.whl", hash = "sha256:95328285b4dab57ea8c52a4a996cb52be6d629353315be5bfda403d15932a497"}, {file = "PyAudio-0.2.14-cp313-cp313-win_amd64.whl", hash = "sha256:692d8c1446f52ed2662120bcd9ddcb5aa2b71f38bda31e58b19fb4672fffba69"}, {file = "PyAudio-0.2.14-cp38-cp38-win32.whl", hash = "sha256:858caf35b05c26d8fc62f1efa2e8f53d5fa1a01164842bd622f70ddc41f55000"}, {file = "PyAudio-0.2.14-cp38-cp38-win_amd64.whl", hash = "sha256:2dac0d6d675fe7e181ba88f2de88d321059b69abd52e3f4934a8878e03a7a074"}, {file = "PyAudio-0.2.14-cp39-cp39-win32.whl", hash = "sha256:f745109634a7c19fa4d6b8b7d6967c3123d988c9ade0cd35d4295ee1acdb53e9"}, {file = "PyAudio-0.2.14-cp39-cp39-win_amd64.whl", hash = "sha256:009f357ee5aa6bc8eb19d69921cd30e98c42cddd34210615d592a71d09c4bd57"}, {file = "PyAudio-0.2.14.tar.gz", hash = "sha256:78dfff3879b4994d1f4fc6485646a57755c6ee3c19647a491f790a0895bd2f87"}, ] [package.extras] test = ["numpy"] [[package]] name = "pydantic" version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, ] [package.dependencies] annotated-types = ">=0.6.0" pydantic-core = "2.27.2" typing-extensions = ">=4.12.2" [package.extras] email = ["email-validator (>=2.0.0)"] timezone = ["tzdata"] [[package]] name = "pydantic-core" version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, ] [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pytest" version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-asyncio" version = "0.23.8" description = "Pytest support for asyncio" optional = false python-versions = ">=3.8" files = [ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, ] [package.dependencies] pytest = ">=7.0.0,<9" [package.extras] docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] [[package]] name = "pytest-xdist" version = "3.6.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.8" files = [ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, ] [package.dependencies] execnet = ">=2.1" pytest = ">=7.0.0" [package.extras] psutil = ["psutil (>=3.0)"] setproctitle = ["setproctitle"] testing = ["filelock"] [[package]] name = "python-dateutil" version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, ] [package.dependencies] six = ">=1.5" [[package]] name = "requests" version = "2.32.4" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" files = [ {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, ] [package.dependencies] certifi = ">=2017.4.17" charset_normalizer = ">=2,<4" idna = ">=2.5,<4" urllib3 = ">=1.21.1,<3" [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" version = "0.11.5" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, ] [[package]] name = "six" version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] [[package]] name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] [[package]] name = "tomli" version = "2.4.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ {file = "tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30"}, {file = "tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a"}, {file = "tomli-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076"}, {file = "tomli-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9"}, {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c"}, {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc"}, {file = "tomli-2.4.1-cp311-cp311-win32.whl", hash = "sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049"}, {file = "tomli-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e"}, {file = "tomli-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece"}, {file = "tomli-2.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a"}, {file = "tomli-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085"}, {file = "tomli-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9"}, {file = "tomli-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5"}, {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585"}, {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1"}, {file = "tomli-2.4.1-cp312-cp312-win32.whl", hash = "sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917"}, {file = "tomli-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9"}, {file = "tomli-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257"}, {file = "tomli-2.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54"}, {file = "tomli-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a"}, {file = "tomli-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897"}, {file = "tomli-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f"}, {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d"}, {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5"}, {file = "tomli-2.4.1-cp313-cp313-win32.whl", hash = "sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd"}, {file = "tomli-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36"}, {file = "tomli-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd"}, {file = "tomli-2.4.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf"}, {file = "tomli-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac"}, {file = "tomli-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662"}, {file = "tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853"}, {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15"}, {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba"}, {file = "tomli-2.4.1-cp314-cp314-win32.whl", hash = "sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6"}, {file = "tomli-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7"}, {file = "tomli-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232"}, {file = "tomli-2.4.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4"}, {file = "tomli-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c"}, {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d"}, {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41"}, {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c"}, {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f"}, {file = "tomli-2.4.1-cp314-cp314t-win32.whl", hash = "sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8"}, {file = "tomli-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26"}, {file = "tomli-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396"}, {file = "tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe"}, {file = "tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f"}, ] [[package]] name = "types-pyaudio" version = "0.2.16.20240516" description = "Typing stubs for pyaudio" optional = false python-versions = ">=3.8" files = [ {file = "types-pyaudio-0.2.16.20240516.tar.gz", hash = "sha256:f1c419ccc78b00d26c6c1ae4fcb17f7e4f08af2c2b9b73b12fcbc4a4ffa3a2c7"}, {file = "types_pyaudio-0.2.16.20240516-py3-none-any.whl", hash = "sha256:40063f13ae15a422cbd4a2a783653eb3e1091bdd23fc7ab8ca3abc21ad0d13f8"}, ] [[package]] name = "types-python-dateutil" version = "2.9.0.20241206" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" files = [ {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, ] [[package]] name = "typing-extensions" 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.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, ] [[package]] name = "urllib3" version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "websockets" version = "13.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = false python-versions = ">=3.8" files = [ {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, {file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"}, {file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"}, {file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"}, {file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"}, {file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"}, {file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"}, {file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"}, {file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"}, {file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"}, {file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"}, {file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"}, {file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"}, {file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"}, {file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"}, {file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"}, {file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"}, {file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"}, {file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"}, {file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"}, {file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"}, {file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"}, {file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"}, {file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"}, {file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"}, {file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"}, {file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"}, {file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"}, {file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"}, {file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"}, {file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"}, {file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"}, {file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"}, {file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"}, {file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"}, {file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"}, {file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"}, {file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"}, {file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"}, {file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"}, {file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"}, {file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"}, {file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"}, {file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"}, {file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"}, {file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"}, {file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"}, {file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"}, {file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"}, {file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"}, {file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"}, {file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"}, {file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"}, {file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"}, {file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"}, {file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"}, {file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"}, {file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"}, {file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"}, {file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"}, {file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"}, {file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"}, {file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"}, {file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"}, {file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"}, {file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"}, {file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"}, {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"}, {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"}, {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"}, {file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"}, {file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"}, {file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"}, {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"}, {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"}, {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"}, {file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"}, {file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"}, {file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"}, {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"}, {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"}, {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"}, {file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"}, {file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"}, {file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"}, ] [extras] pyaudio = ["pyaudio"] [metadata] lock-version = "2.0" python-versions = "^3.8" content-hash = "88b375777d2a14ecbfbce27674ed77a8264c175d514119b668caaf4f911ba2c7" elevenlabs-elevenlabs-python-b6e5614/pyproject.toml000066400000000000000000000051411523660243400225470ustar00rootroot00000000000000[project] name = "elevenlabs" dynamic = ["version"] [tool.poetry] name = "elevenlabs" version = "2.63.0" description = "" readme = "README.md" authors = [] keywords = [] license = "MIT" classifiers = [ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", "License :: OSI Approved :: MIT License" ] packages = [ { include = "elevenlabs", from = "src"} ] [tool.poetry.urls] Repository = 'https://github.com/elevenlabs/elevenlabs-python' [tool.poetry.dependencies] python = "^3.8" httpx = ">=0.21.2" pyaudio = { version = ">=0.2.14", optional = true} pydantic = ">= 1.9.2" pydantic-core = ">=2.18.2" requests = ">=2.20" typing_extensions = ">= 4.0.0" websockets = ">=13.0" [tool.poetry.group.dev.dependencies] mypy = "==1.13.0" pytest = "^7.4.0" pytest-asyncio = "^0.23.5" pytest-xdist = "^3.6.1" python-dateutil = "^2.9.0" types-python-dateutil = "^2.9.0.20240316" ruff = "==0.11.5" types-pyaudio = "^0.2.16.20240516" [tool.pytest.ini_options] testpaths = [ "tests" ] asyncio_mode = "auto" [tool.mypy] plugins = ["pydantic.mypy"] [tool.ruff] line-length = 120 [tool.ruff.lint] select = [ "E", # pycodestyle errors "F", # pyflakes "I", # isort ] ignore = [ "E402", # Module level import not at top of file "E501", # Line too long "E711", # Comparison to `None` should be `cond is not None` "E712", # Avoid equality comparisons to `True`; use `if ...:` checks "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks "E722", # Do not use bare `except` "E731", # Do not assign a `lambda` expression, use a `def` "F821", # Undefined name "F841" # Local variable ... is assigned to but never used ] [tool.ruff.lint.isort] section-order = ["future", "standard-library", "third-party", "first-party"] [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry.extras] pyaudio=["pyaudio"] elevenlabs-elevenlabs-python-b6e5614/reference.md000066400000000000000000022056471523660243400221320ustar00rootroot00000000000000# Reference ## History
client.history.list(...) -> GetSpeechHistoryResponse
#### � Description
Returns a list of your generated audio (e.g. text to speech, speech to speech, Studio, dubbing). Music and SFX generations are not included and cannot currently be retrieved via the API.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.history.list( page_size=1, start_after_history_item_id="start_after_history_item_id", voice_id="voice_id", model_id="model_id", date_before_unix=1, date_after_unix=1, sort_direction="asc", search="search", source="TTS", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many history items to return at maximum. Can not exceed 1000, defaults to 100.
**start_after_history_item_id:** `typing.Optional[str]` — After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date.
**voice_id:** `typing.Optional[str]` — ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**model_id:** `typing.Optional[str]` — Search term used for filtering history items. If provided, source becomes required.
**date_before_unix:** `typing.Optional[int]` — Unix timestamp to filter history items before this date (exclusive).
**date_after_unix:** `typing.Optional[int]` — Unix timestamp to filter history items after this date (inclusive).
**sort_direction:** `typing.Optional[HistoryListRequestSortDirection]` — Sort direction for the results.
**search:** `typing.Optional[str]` — search term used for filtering
**source:** `typing.Optional[HistoryListRequestSource]` — Source of the generated history item
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.history.get(...) -> SpeechHistoryItemResponse
#### � Description
Retrieves a history item.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.history.get( history_item_id="VW7YKqPnjY4h39yTbx2L", ) ```
#### ⚙� Parameters
**history_item_id:** `str` — ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.history.delete(...) -> DeleteHistoryItemResponse
#### � Description
Delete a history item by its ID
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.history.delete( history_item_id="VW7YKqPnjY4h39yTbx2L", ) ```
#### ⚙� Parameters
**history_item_id:** `str` — ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.history.get_audio(...) -> typing.Iterator[bytes]
#### � Description
Returns the audio of an history item.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.history.get_audio( history_item_id="history_item_id", ) ```
#### ⚙� Parameters
**history_item_id:** `str` — ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.history.download(...) -> typing.Iterator[bytes]
#### � Description
Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.history.download( history_item_ids=[ "history_item_ids", "history_item_ids" ], ) ```
#### ⚙� Parameters
**history_item_ids:** `typing.List[str]` — A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint.
**output_format:** `typing.Optional[str]` — Output format to transcode the audio file, can be wav or default.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## TextToSoundEffects
client.text_to_sound_effects.convert(...) -> typing.Iterator[bytes]
#### � Description
Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects models in the world.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_sound_effects.convert( text="Spacious braam suitable for high-impact movie trailer moments", ) ```
#### ⚙� Parameters
**text:** `str` — The text that will get converted into a sound effect.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**loop:** `typing.Optional[bool]` — Whether to create a sound effect that loops smoothly. Only available for the 'eleven_text_to_sound_v2 model'.
**duration_seconds:** `typing.Optional[float]` — The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 30. If set to None we will guess the optimal duration using the prompt. Defaults to None.
**prompt_influence:** `typing.Optional[float]` — A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3.
**model_id:** `typing.Optional[SfxModelId]` — The model ID to use for the sound generation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## AudioIsolation
client.audio_isolation.convert(...) -> typing.Iterator[bytes]
#### � Description
Removes background noise from audio.
#### 🔌 Usage
```python client.audio_isolation.convert(...) ```
#### ⚙� Parameters
**audio:** `core.File` — The audio file from which vocals/speech will be isolated from.
**file_format:** `typing.Optional[AudioIsolationRequestFileFormat]` — 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.
**preview_b_64:** `typing.Optional[str]` — Optional preview image base64 for tracking this generation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_isolation.list(...) -> GetAudioIsolationHistoryResponseModel
#### � Description
Returns a list of all your audio isolation generations.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_isolation.list( page_size=1, page=1, search="search", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many history items to return at maximum. Defaults to 100.
**page:** `typing.Optional[int]` — Page number for search pagination (1-based). Only used when search is provided.
**search:** `typing.Optional[str]` — Optional search term used for filtering audio isolation history (title/text).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_isolation.delete(...)
#### � Description
Deletes a specific audio isolation history item and the associated media files.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_isolation.delete( history_item_id="history_item_id", ) ```
#### ⚙� Parameters
**history_item_id:** `str` — Identifier of the audio isolation history item.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_isolation.stream(...) -> typing.Iterator[bytes]
#### � Description
Removes background noise from audio.
#### 🔌 Usage
```python client.audio_isolation.stream(...) ```
#### ⚙� Parameters
**audio:** `core.File` — The audio file from which vocals/speech will be isolated from.
**file_format:** `typing.Optional[AudioIsolationStreamRequestFileFormat]` — 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.
## Samples
client.samples.delete(...) -> DeleteSampleResponse
#### � Description
Removes a sample by its ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.samples.delete( voice_id="21m00Tcm4TlvDq8ikWAM", sample_id="VW7YKqPnjY4h39yTbx2L", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**sample_id:** `str` — ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## TextToSpeech
client.text_to_speech.convert(...) -> typing.Iterator[bytes]
#### � Description
Converts text into speech using a voice of your choice and returns audio.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**text:** `str` — The text that will get converted into speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[TextToSpeechConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**previous_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send.
**next_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions.
**apply_text_normalization:** `typing.Optional[BodyTextToSpeechFullApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_speech.convert_with_timestamps(...) -> AudioWithTimestampsResponse
#### � Description
Generate speech from text with precise character-level timing information for audio-text synchronization.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_speech.convert_with_timestamps( voice_id="21m00Tcm4TlvDq8ikWAM", enable_logging=True, optimize_streaming_latency=1, output_format="alaw_8000", text="This is a test for the API of ElevenLabs.", ) ```
#### ⚙� Parameters
**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
**text:** `str` — The text that will get converted into speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**previous_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send.
**next_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions.
**apply_text_normalization:** `typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_speech.stream(...) -> typing.Iterator[bytes]
#### � Description
Converts text into speech using a voice of your choice and returns audio as an audio stream.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**text:** `str` — The text that will get converted into speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[TextToSpeechStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**previous_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send.
**next_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions.
**apply_text_normalization:** `typing.Optional[BodyTextToSpeechStreamApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_speech.stream_with_timestamps(...) -> typing.Iterator[bytes]
#### � Description
Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_speech.stream_with_timestamps( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**text:** `str` — The text that will get converted into speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation.
**previous_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send.
**next_request_ids:** `typing.Optional[typing.List[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions.
**apply_text_normalization:** `typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## TextToDialogue
client.text_to_dialogue.convert(...) -> typing.Iterator[bytes]
#### � Description
Converts a list of text and voice ID pairs into speech (dialogue) and returns audio.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DialogueInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_dialogue.convert( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ) ], ) ```
#### ⚙� Parameters
**inputs:** `typing.List[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error.
**output_format:** `typing.Optional[TextToDialogueConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**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.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**apply_text_normalization:** `typing.Optional[BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_dialogue.stream(...) -> typing.Iterator[bytes]
#### � Description
Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DialogueInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_dialogue.stream( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ) ], ) ```
#### ⚙� Parameters
**inputs:** `typing.List[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**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.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**apply_text_normalization:** `typing.Optional[BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_dialogue.stream_with_timestamps(...) -> typing.Iterator[bytes]
#### � Description
Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DialogueInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_dialogue.stream_with_timestamps( output_format="mp3_22050_32", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I\'m doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ) ], ) ```
#### ⚙� Parameters
**inputs:** `typing.List[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**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.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**apply_text_normalization:** `typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_dialogue.convert_with_timestamps(...) -> AudioWithTimestampsAndVoiceSegmentsResponseModel
#### � Description
Generate dialogue from text with precise character-level timing information for audio-text synchronization.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DialogueInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_dialogue.convert_with_timestamps( output_format="alaw_8000", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I\'m doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ) ], ) ```
#### ⚙� Parameters
**inputs:** `typing.List[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error.
**output_format:** `typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**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.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**apply_text_normalization:** `typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## SpeechToSpeech
client.speech_to_speech.convert(...) -> typing.Iterator[bytes]
#### � Description
Transform audio from one voice to another. Maintain full control over emotion, timing and delivery.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", audio="example_audio", model_id="eleven_multilingual_sts_v2", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**audio:** `core.File` — The audio file which holds the content and emotion that will control the generated speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[SpeechToSpeechConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property.
**voice_settings:** `typing.Optional[str]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string.
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**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[SpeechToSpeechRequestFileFormat]` — 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.
client.speech_to_speech.stream(...) -> typing.Iterator[bytes]
#### � Description
Stream audio from one voice to another. Maintain full control over emotion, timing and delivery.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", audio="example_audio", model_id="eleven_multilingual_sts_v2", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**audio:** `core.File` — The audio file which holds the content and emotion that will control the generated speech.
**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.
**optimize_streaming_latency:** `typing.Optional[int]` You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None.
**output_format:** `typing.Optional[SpeechToSpeechStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property.
**voice_settings:** `typing.Optional[str]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string.
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
**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[SpeechToSpeechStreamRequestFileFormat]` — 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.
## TextToVoice
client.text_to_voice.create_previews(...) -> VoiceDesignPreviewResponse
#### � Description
Create a voice from a text prompt.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_voice.create_previews( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) ```
#### ⚙� Parameters
**voice_description:** `str` — Description to use for the created voice.
**output_format:** `typing.Optional[AllowedOutputFormats]` — The output format of the generated audio.
**text:** `typing.Optional[str]` — Text to generate, text length has to be between 100 and 1000.
**auto_generate_text:** `typing.Optional[bool]` — Whether to automatically generate a text suitable for the voice description.
**loudness:** `typing.Optional[float]` — Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
**quality:** `typing.Optional[float]` — Higher quality results in better voice output but less variety.
**seed:** `typing.Optional[int]` — Random number that controls the voice generation. Same seed with same inputs produces same voice.
**guidance_scale:** `typing.Optional[float]` — Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
**should_enhance:** `typing.Optional[bool]` — Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_voice.create(...) -> Voice
#### � Description
Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_voice.create( voice_name="Sassy squeaky mouse", voice_description="A sassy squeaky mouse", generated_voice_id="37HceQefKmEi3bGovXjL", ) ```
#### ⚙� Parameters
**voice_name:** `str` — Name to use for the created voice.
**voice_description:** `str` — Description to use for the created voice.
**generated_voice_id:** `str` — The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews.
**labels:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Optional, metadata to add to the created voice. Defaults to None.
**played_not_selected_voice_ids:** `typing.Optional[typing.List[str]]` — List of voice ids that the user has played but not selected. Used for RLHF.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_voice.design(...) -> VoiceDesignPreviewResponse
#### � Description
Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_voice.design( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) ```
#### ⚙� Parameters
**voice_description:** `str` — Description to use for the created voice.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**model_id:** `typing.Optional[VoiceDesignRequestModelModelId]` — Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
**text:** `typing.Optional[str]` — Text to generate, text length has to be between 100 and 1000.
**auto_generate_text:** `typing.Optional[bool]` — Whether to automatically generate a text suitable for the voice description.
**loudness:** `typing.Optional[float]` — Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
**seed:** `typing.Optional[int]` — Random number that controls the voice generation. Same seed with same inputs produces same voice.
**guidance_scale:** `typing.Optional[float]` — Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
**stream_previews:** `typing.Optional[bool]` — Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint.
**should_enhance:** `typing.Optional[bool]` — Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False
**remixing_session_id:** `typing.Optional[str]` — The remixing session id.
**remixing_session_iteration_id:** `typing.Optional[str]` — The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created.
**quality:** `typing.Optional[float]` — Higher quality results in better voice output but less variety.
**reference_audio_base_64:** `typing.Optional[str]` — Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
**prompt_strength:** `typing.Optional[float]` — Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.text_to_voice.remix(...) -> VoiceDesignPreviewResponse
#### � Description
Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_voice.remix( voice_id="21m00Tcm4TlvDq8ikWAM", output_format="mp3_22050_32", voice_description="Make the voice have a higher pitch.", ) ```
#### ⚙� Parameters
**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
**voice_description:** `str` — Description of the changes to make to the voice.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**text:** `typing.Optional[str]` — Text to generate, text length has to be between 100 and 1000.
**auto_generate_text:** `typing.Optional[bool]` — Whether to automatically generate a text suitable for the voice description.
**loudness:** `typing.Optional[float]` — Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
**seed:** `typing.Optional[int]` — Random number that controls the voice generation. Same seed with same inputs produces same voice.
**guidance_scale:** `typing.Optional[float]` — Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
**stream_previews:** `typing.Optional[bool]` — Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint.
**remixing_session_id:** `typing.Optional[str]` — The remixing session id.
**remixing_session_iteration_id:** `typing.Optional[str]` — The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created.
**prompt_strength:** `typing.Optional[float]` — Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## User
client.user.get() -> User
#### � Description
Gets information about the user
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.user.get() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices
client.voices.get_all(...) -> GetVoicesResponse
#### � Description
Returns a list of all available voices for a user. Stops working once the user's workspace exceeds 500 voices.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.get_all( show_legacy=True, ) ```
#### ⚙� Parameters
**show_legacy:** `typing.Optional[bool]` — If set to true, legacy premade voices will be included in responses from /v1/voices
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.get(...) -> Voice
#### � Description
Returns metadata about a specific voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.get( voice_id="21m00Tcm4TlvDq8ikWAM", with_settings=True, ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**with_settings:** `typing.Optional[bool]` — This parameter is now deprecated. It is ignored and will be removed in a future version.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.delete(...) -> DeleteVoiceResponseModel
#### � Description
Deletes a voice by its ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.delete( voice_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.update(...) -> EditVoiceResponseModel
#### � Description
Edit a voice created by you.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.update( voice_id="21m00Tcm4TlvDq8ikWAM", files=["example_files"], name="name", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website.
**files:** `typing.Optional[typing.List[core.File]]` — Audio files to add to the voice
**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
**description:** `typing.Optional[str]` — A description of the voice.
**labels:** `typing.Optional[EditVoiceRequestLabels]` — Labels for the voice. Keys can be language, accent, gender, or age.
**moderate_metadata:** `typing.Optional[bool]` — Run synchronous LLM moderation over the voice name and description when they change. Has no effect unless the voice_library_metadata_moderation feature flag is enabled for the user.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.search(...) -> GetVoicesV2Response
#### � Description
Gets a list of all available voices for a user with search, filtering and pagination.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.search( next_page_token="next_page_token", page_size=1, search="search", sort="sort", sort_direction="sort_direction", voice_type="voice_type", category="category", fine_tuning_state="fine_tuning_state", collection_id="collection_id", gender="gender", age="age", language=[ "language" ], accent="accent", use_cases=[ "use_cases" ], min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, high_quality=True, include_total_count=True, voice_ids=[ "voice_ids" ], ) ```
#### ⚙� Parameters
**next_page_token:** `typing.Optional[str]` — The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination.
**page_size:** `typing.Optional[int]` — How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included.
**search:** `typing.Optional[str]` — Search term to filter voices by. Searches in name, description, labels, category.
**sort:** `typing.Optional[str]` — Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices.
**sort_direction:** `typing.Optional[str]` — Which direction to sort the voices in. 'asc' or 'desc'.
**voice_type:** `typing.Optional[str]` — Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default', 'non-community', 'saved'. 'non-default' is equal to all but 'default'. 'non-community' is equal to 'personal' and 'workspace' combined (excludes library copies). 'saved' is equal to non-default, but includes default voices if they have been added to a collection.
**category:** `typing.Optional[str]` — Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional'
**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.
**gender:** `typing.Optional[str]` — Gender used for filtering, based on the voice's 'gender' label.
**age:** `typing.Optional[str]` — Age used for filtering, based on the voice's 'age' label.
**language:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Languages used for filtering, based on the voice's 'language' label. Voices matching any of the given languages are returned.
**accent:** `typing.Optional[str]` — Accent used for filtering, based on the voice's 'accent' label.
**use_cases:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Use cases used for filtering, based on the voice's 'use_case' label. Voices matching any of the given use cases are returned.
**min_notice_period_days:** `typing.Optional[int]` — Filter to voices whose sharing notice period is at least the given number of days.
**include_custom_rates:** `typing.Optional[bool]` — Whether to include voices that have a custom sharing rate. Defaults to including them.
**include_live_moderated:** `typing.Optional[bool]` — Whether to include voices that have live moderation enabled. Defaults to including them.
**high_quality:** `typing.Optional[bool]` — When true, only return studio-quality voices (those whose category is 'high_quality').
**include_total_count:** `typing.Optional[bool]` — Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost.
**voice_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Voice IDs to lookup by. Maximum 100 voice IDs.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.replicate_to_isolated_environment(...) -> ReplicateVoiceToIsolatedEnvironmentResponseModel
#### � Description
Replicates an Instant Voice Clone or Voice Design voice to a workspace in a different data residency. The target workspace must belong to the same consolidated billing group. The user must have VOICES_WRITE in the source workspace, and be an admin on the source voice. Human users (i.e. not service accounts) must also have VOICES_WRITE in the target workspace. This endpoint is available on the central environment only.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.replicate_to_isolated_environment( voice_id="21m00Tcm4TlvDq8ikWAM", target_workspace_id="target_workspace_id", ) ```
#### ⚙� Parameters
**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
**target_workspace_id:** `str` — ID of the workspace to replicate the voice into. It must belong to the same consolidated billing group as the calling workspace; the target's data residency is derived from that link.
**preserve_voice_id:** `typing.Optional[bool]` — When true (default) the replicated voice keeps the same voice ID in the target residency; set to false to assign a new voice ID.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.share(...) -> AddVoiceResponseModel
#### � Description
Add a shared voice to your collection of Voices
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.share( public_user_id="63e06b7e7cafdc46be4d2e0b3f045940231ae058d508589653d74d1265a574ca", voice_id="21m00Tcm4TlvDq8ikWAM", new_name="John Smith", ) ```
#### ⚙� Parameters
**public_user_id:** `str` — Public user ID used to publicly identify ElevenLabs users.
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**new_name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website.
**bookmarked:** `typing.Optional[bool]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.get_shared(...) -> GetLibraryVoicesResponse
#### � Description
Retrieves a list of shared voices.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.get_shared( page_size=1, category="professional", gender="gender", age="age", accent="accent", language="language", locale="locale", search="search", use_cases=[ "use_cases" ], descriptives=[ "descriptives" ], featured=True, min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, reader_app_enabled=True, owner_id="owner_id", sort="created_date", page=1, ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many shared voices to return at maximum. Can not exceed 100, defaults to 30.
**category:** `typing.Optional[VoicesGetSharedRequestCategory]` — Voice category used for filtering
**gender:** `typing.Optional[str]` — Gender used for filtering
**age:** `typing.Optional[str]` — Age used for filtering
**accent:** `typing.Optional[str]` — Accent used for filtering
**language:** `typing.Optional[str]` — Language used for filtering
**locale:** `typing.Optional[str]` — Locale used for filtering
**search:** `typing.Optional[str]` — Search term used for filtering
**use_cases:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Use-case used for filtering
**descriptives:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Search term used for filtering
**featured:** `typing.Optional[bool]` — Filter featured voices
**min_notice_period_days:** `typing.Optional[int]` — Filter voices with a minimum notice period of the given number of days.
**include_custom_rates:** `typing.Optional[bool]` — Include/exclude voices with custom rates
**include_live_moderated:** `typing.Optional[bool]` — Include/exclude voices that are live moderated
**reader_app_enabled:** `typing.Optional[bool]` — Filter voices that are enabled for the reader app
**owner_id:** `typing.Optional[str]` — Filter voices by public owner ID
**sort:** `typing.Optional[VoicesGetSharedRequestSort]` — Sort criteria. Must be one of: created_date, usage_character_count_1y, trending, cloned_by_count.
**page:** `typing.Optional[int]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.find_similar_voices(...) -> GetLibraryVoicesResponse
#### � Description
Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.find_similar_voices( audio_file="example_audio_file", ) ```
#### ⚙� Parameters
**audio_file:** `typing.Optional[core.File]`
**similarity_threshold:** `typing.Optional[float]` — Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned.
**top_k:** `typing.Optional[int]` — Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio
client.studio.create_podcast(...) -> PodcastProjectResponseModel
#### � Description
Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, PodcastConversationModeData, PodcastTextSource from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.create_podcast( model_id="eleven_multilingual_v2", mode={ "type": "conversation", "conversation": PodcastConversationModeData( host_voice_id="aw1NgEzBg83R7vgmiJt6", guest_voice_id="aw1NgEzBg83R7vgmiJt7", ) }, source=PodcastTextSource( type="text", text="This is a test podcast.", ), ) ```
#### ⚙� Parameters
**model_id:** `str` — The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models.
**mode:** `BodyCreatePodcastV1StudioPodcastsPostMode` — The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue.
**source:** `BodyCreatePodcastV1StudioPodcastsPostSource` — The source content for the Podcast.
**safety_identifier:** `typing.Optional[str]` — Used for moderation. Your workspace must be allowlisted to use this feature.
**quality_preset:** `typing.Optional[QualityPresetType]` Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format.
**duration_scale:** `typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale]` Duration of the generated podcast. Must be one of: short - produces podcasts shorter than 3 minutes. default - produces podcasts roughly between 3-7 minutes. long - produces podcasts longer than 7 minutes.
**language:** `typing.Optional[str]` — An optional language of the Studio project. Two-letter language code (ISO 639-1).
**intro:** `typing.Optional[str]` — The intro text that will always be added to the beginning of the podcast.
**outro:** `typing.Optional[str]` — The outro text that will always be added to the end of the podcast.
**instructions_prompt:** `typing.Optional[str]` — Additional instructions prompt for the podcast generation used to adjust the podcast's style and tone.
**highlights:** `typing.Optional[typing.List[str]]` — A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters.
**callback_url:** `typing.Optional[str]` A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } }
**apply_text_normalization:** `typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization]` This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## dubbing
client.dubbing.list(...) -> DubbingMetadataPageResponseModel
#### � Description
List the dubs you have access to.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.list( cursor="cursor", page_size=1, dubbing_status="dubbing", dubbing_statuses=[ "queued" ], dubbing_models=[ "dubbing_v1" ], target_language_codes=[ "target_language_codes" ], creation_sources=[ "flow_node" ], filter_by_creator="personal", order_by="created_at", order_direction="DESCENDING", ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many dubs to return at maximum. Can not exceed 200, defaults to 100.
**dubbing_status:** `typing.Optional[DubbingListRequestDubbingStatus]` — What state the dub is currently in.
**dubbing_statuses:** `typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]]` — Filter by dubbing status.
**dubbing_models:** `typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]]` — Filter by dubbing model generation.
**target_language_codes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter by target language code.
**creation_sources:** `typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]]` — Filter by dubbing creation source.
**filter_by_creator:** `typing.Optional[DubbingListRequestFilterByCreator]` — Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them.
**order_by:** `typing.Optional[DubbingListRequestOrderBy]` — The field to use for ordering results from this query.
**order_direction:** `typing.Optional[DubbingListRequestOrderDirection]` — The order direction to use for results from this query.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.create(...) -> DoDubbingResponse
#### � Description
Dubs a provided audio or video file into given language.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.create( file="example_file", csv_file="example_csv_file", foreground_audio_file="example_foreground_audio_file", background_audio_file="example_background_audio_file", ) ```
#### ⚙� Parameters
**file:** `typing.Optional[core.File]` — A list of file paths to audio recordings intended for voice cloning
**csv_file:** `typing.Optional[core.File]` — CSV file containing transcription/translation metadata
**foreground_audio_file:** `typing.Optional[core.File]` — For use only with csv input
**background_audio_file:** `typing.Optional[core.File]` — For use only with csv input
**name:** `typing.Optional[str]` — Name of the dubbing project.
**source_url:** `typing.Optional[str]` — URL of the source video/audio file.
**source_lang:** `typing.Optional[str]` — Source language. Expects a valid iso639-1 or iso639-3 language code.
**target_lang:** `typing.Optional[str]` — The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code.
**target_accent:** `typing.Optional[str]` — [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer.
**num_speakers:** `typing.Optional[int]` — Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers
**watermark:** `typing.Optional[bool]` — Whether to apply watermark to the output video.
**start_time:** `typing.Optional[int]` — Start time of the source video/audio file.
**end_time:** `typing.Optional[int]` — End time of the source video/audio file.
**highest_resolution:** `typing.Optional[bool]` — Whether to use the highest resolution available.
**drop_background_audio:** `typing.Optional[bool]` — An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues.
**use_profanity_filter:** `typing.Optional[bool]` — [BETA] Whether transcripts should have profanities censored with the words '[censored]'
**dubbing_studio:** `typing.Optional[bool]` — Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource.
**disable_voice_cloning:** `typing.Optional[bool]` — Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices.
**mode:** `typing.Optional[DubRequestMode]` — The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged.
**csv_fps:** `typing.Optional[float]` — Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.get(...) -> DubbingMetadataResponse
#### � Description
Returns metadata about a dubbing project, including whether it's still in progress or not
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.get( dubbing_id="dubbing_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.delete(...) -> DeleteDubbingResponseModel
#### � Description
Deletes a dubbing project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.delete( dubbing_id="dubbing_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Models
client.models.list() -> typing.List[Model]
#### � Description
Gets a list of available models.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.models.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## AudioNative
client.audio_native.create(...) -> AudioNativeCreateProjectResponseModel
#### � Description
Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_native.create( file="example_file", name="name", ) ```
#### ⚙� Parameters
**name:** `str` — Project name.
**image:** `typing.Optional[str]` — (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used.
**author:** `typing.Optional[str]` — Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
**title:** `typing.Optional[str]` — Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
**small:** `typing.Optional[bool]` — (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used.
**text_color:** `typing.Optional[str]` — Text color used in the player. If not provided, default text color set in the Player settings is used.
**background_color:** `typing.Optional[str]` — Background color used in the player. If not provided, default background color set in the Player settings is used.
**sessionization:** `typing.Optional[int]` — (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used.
**voice_id:** `typing.Optional[str]` — Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used.
**model_id:** `typing.Optional[str]` — TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
**file:** `typing.Optional[core.File]` — Either txt or HTML input file containing the article content. HTML should be formatted as follows '<html><body><div><p>Your content</p><h3>More of your content</h3><p>Some more of your content</p></div></body></html>'
**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not.
**apply_text_normalization:** `typing.Optional[AudioNativeCreateRequestApplyTextNormalization]` This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[str]]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_native.get_settings(...) -> GetAudioNativeProjectSettingsResponseModel
#### � Description
Get player settings for the specific project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_native.get_settings( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_native.update(...) -> AudioNativeEditContentResponseModel
#### � Description
Updates content for the specific AudioNative Project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_native.update( project_id="21m00Tcm4TlvDq8ikWAM", file="example_file", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**file:** `typing.Optional[core.File]` — Either txt or HTML input file containing the article content. HTML should be formatted as follows '<html><body><div><p>Your content</p><h5>More of your content</h5><p>Some more of your content</p></div></body></html>'
**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not.
**auto_publish:** `typing.Optional[bool]` — Whether to auto publish the new project snapshot after it's converted.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.audio_native.update_content_from_url(...) -> AudioNativeEditContentResponseModel
#### � Description
Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.audio_native.update_content_from_url( url="https://elevenlabs.io/blog/the_first_ai_that_can_laugh/", ) ```
#### ⚙� Parameters
**url:** `str` — URL of the page to extract content from.
**author:** `typing.Optional[str]` — Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
**title:** `typing.Optional[str]` — Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Usage
client.usage.get(...) -> UsageCharactersResponseModel
#### � Description
(Deprecated) This endpoint is deprecated. Use /v1/workspace/analytics/query/usage-by-product-over-time instead, which exposes the bucket size as `interval_seconds` (an integer in seconds) rather than `aggregation_interval`. Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.usage.get( start_unix=1, end_unix=1, include_workspace_metrics=True, breakdown_type="none", aggregation_interval="hour", aggregation_bucket_size=1, metric="credits", ) ```
#### ⚙� Parameters
**start_unix:** `int` — UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day.
**end_unix:** `int` — UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day.
**include_workspace_metrics:** `typing.Optional[bool]` — Whether or not to include the statistics of the entire workspace.
**breakdown_type:** `typing.Optional[BreakdownTypes]` — How to break down the information. Cannot be "user" if include_workspace_metrics is False.
**aggregation_interval:** `typing.Optional[UsageAggregationInterval]` — How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative".
**aggregation_bucket_size:** `typing.Optional[int]` — Aggregation bucket size in seconds. Overrides the aggregation interval.
**metric:** `typing.Optional[MetricType]` — Which metric to aggregate.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## PronunciationDictionaries
client.pronunciation_dictionaries.create_from_file(...) -> AddPronunciationDictionaryResponseModel
#### � Description
Creates a new pronunciation dictionary from a lexicon .PLS file
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.create_from_file( file="example_file", name="name", ) ```
#### ⚙� Parameters
**name:** `str` — The name of the pronunciation dictionary, used for identification only.
**file:** `typing.Optional[core.File]` — A lexicon .pls file which we will use to initialize the project with.
**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only.
**workspace_access:** `typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.create_from_rules(...) -> AddPronunciationDictionaryResponseModel
#### � Description
Creates a new pronunciation dictionary from provided rules.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.create_from_rules( rules=[ { "type": "alias", "string_to_replace": "Thailand", "case_sensitive": True, "word_boundaries": True, "alias": "tie-land" } ], name="My Dictionary", ) ```
#### ⚙� Parameters
**rules:** `typing.List[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem]` List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }
**name:** `str` — The name of the pronunciation dictionary, used for identification only.
**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only.
**workspace_access:** `typing.Optional[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.get(...) -> GetPronunciationDictionaryWithRulesResponseModel
#### � Description
Get metadata for a pronunciation dictionary
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.get( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.update(...) -> GetPronunciationDictionaryMetadataResponse
#### � Description
Partially update the pronunciation dictionary without changing the version
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.update( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary
**archived:** `typing.Optional[bool]` — Whether to archive the pronunciation dictionary.
**name:** `typing.Optional[str]` — The name of the pronunciation dictionary, used for identification only.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.download(...) -> typing.Iterator[bytes]
#### � Description
Get a PLS file with a pronunciation dictionary version rules
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.download( dictionary_id="dictionary_id", version_id="version_id", ) ```
#### ⚙� Parameters
**dictionary_id:** `str` — The id of the pronunciation dictionary
**version_id:** `str` — The id of the pronunciation dictionary version
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.list(...) -> GetPronunciationDictionariesMetadataResponseModel
#### � Description
Get a list of the pronunciation dictionaries you have access to and their metadata
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.list( cursor="cursor", page_size=1, sort="creation_time_unix", sort_direction="sort_direction", include_archived=False, ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30.
**sort:** `typing.Optional[PronunciationDictionariesListRequestSort]` — Which field to sort by, one of 'created_at_unix' or 'name'.
**sort_direction:** `typing.Optional[str]` — Which direction to sort the voices in. 'ascending' or 'descending'.
**include_archived:** `typing.Optional[bool]` — Whether to include archived pronunciation dictionaries in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace
client.workspace.set_third_party_disabling_policy(...) -> typing.Any
#### � Description
Set the workspace-wide Third-Party Disabling policy. When set, it forces, for every API key in the workspace, whether the holder of a key (potentially a third party who found it) may disable it via the self-disable endpoint or when it leaks publicly — overriding each key's own setting. Pass `true` to allow it for all keys, `false` to forbid it for all keys, or `null` to clear the override so per-key values and the plan default apply again. Workspace admins only.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.set_third_party_disabling_policy() ```
#### ⚙� Parameters
**third_party_disable_allowed:** `typing.Optional[bool]` — `true` forces every key in the workspace to be disable-able by its holder; `false` forbids it for every key; `null` clears the override (per-key values and the plan default apply).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ServiceAccounts
client.service_accounts.list() -> WorkspaceServiceAccountListResponseModel
#### � Description
List all service accounts in the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.service_accounts.create(...) -> WorkspaceCreateServiceAccountResponseModel
#### � Description
Create a new service account in the workspace. By default, a workspace can have up to 20 service accounts. Enterprise customers may request an increase to this limit, up to 100.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.create( name="name", ) ```
#### ⚙� Parameters
**name:** `str`
**default_sharing_groups:** `typing.Optional[typing.List[DefaultSharingGroupConfig]]` — List of groups with their permission levels to share with by default. Each entry should specify a group_id and a permission_level (admin, editor, or viewer).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Webhooks
client.webhooks.list(...) -> WorkspaceWebhookListResponseModel
#### � Description
List all webhooks for a workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.webhooks.list( include_usages=False, ) ```
#### ⚙� Parameters
**include_usages:** `typing.Optional[bool]` — Whether to include active usages of the webhook, only usable by admins
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.webhooks.create(...) -> WorkspaceCreateWebhookResponseModel
#### � Description
Create a new webhook for the workspace with the specified authentication type.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, WebhookHmacSettings from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.webhooks.create( settings=WebhookHmacSettings( auth_type="hmac", name="name", webhook_url="webhook_url", ), ) ```
#### ⚙� Parameters
**settings:** `WebhookHmacSettings` — Webhook settings object containing auth_type and corresponding configuration
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.webhooks.delete(...) -> DeleteWorkspaceWebhookResponseModel
#### � Description
Delete the specified workspace webhook
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.webhooks.delete( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", ) ```
#### ⚙� Parameters
**webhook_id:** `str` — The unique ID for the webhook
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.webhooks.update(...) -> PatchWorkspaceWebhookResponseModel
#### � Description
Update the specified workspace webhook
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.webhooks.update( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", is_disabled=True, name="My Callback Webhook", ) ```
#### ⚙� Parameters
**webhook_id:** `str` — The unique ID for the webhook
**is_disabled:** `bool` — Whether to disable or enable the webhook
**name:** `str` — The display name of the webhook (used for display purposes only).
**retry_enabled:** `typing.Optional[bool]` — Whether to enable automatic retries for transient failures (5xx, 429, timeout)
**request_headers:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — A list of request headers to include with the webhook delivery (optional)
**events:** `typing.Optional[typing.List[WorkspaceWebhookEventType]]` — The complete set of workspace-level events this webhook should be subscribed to. The webhook is added to the events in the list and removed from any not in the list. Omit to leave the current event subscriptions unchanged.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Music
client.music.video_to_music(...) -> typing.Iterator[bytes]
#### � Description
Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music.
#### 🔌 Usage
```python client.music.video_to_music(...) ```
#### ⚙� Parameters
**videos:** `typing.List[core.File]` One or more video files sent via FormData array (multipart/form-data). They will be combined into one codec in order. A maximum of 10 videos is allowed, where the total size of the combined video is limited to 200MB. In total, the video can be up to 600 seconds long. Note that combining multiple videos may increase the request duration significantly. If possible, combine the videos beforehand.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**description:** `typing.Optional[str]` — Optional text description of the music you want. A maximum of 1000 characters is allowed.
**tags:** `typing.Optional[typing.List[str]]` — Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed.
**model_id:** `typing.Optional[MusicVideoToMusicRequestModelId]` — The model to use for the generation.
**sign_with_c_2_pa:** `typing.Optional[bool]` — Whether to sign the generated song with C2PA. Applicable only for mp3 files.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.compose(...) -> typing.Iterator[bytes]
#### � Description
Compose a song from a prompt or a composition plan.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.compose() ```
#### ⚙� Parameters
**output_format:** `typing.Optional[MusicComposeRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models.
**prompt:** `typing.Optional[str]` — A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
**composition_plan:** `typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan]` — A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
**music_length_ms:** `typing.Optional[int]` — The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
**model_id:** `typing.Optional[BodyComposeMusicV1MusicPostModelId]` — The model to use for the generation.
**seed:** `typing.Optional[int]` — Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt.
**force_instrumental:** `typing.Optional[bool]` — If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`.
**finetune_id:** `typing.Optional[str]` — The ID of the finetune to use for the generation
**respect_sections_durations:** `typing.Optional[bool]` — Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan.
**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting.
**sign_with_c_2_pa:** `typing.Optional[bool]` — Whether to sign the generated song with C2PA. Applicable only for mp3 files.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.compose_detailed(...) -> typing.Iterator[bytes]
#### � Description
Compose a song from a prompt or a composition plan.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.compose_detailed() ```
#### ⚙� Parameters
**output_format:** `typing.Optional[MusicComposeDetailedRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models.
**prompt:** `typing.Optional[str]` — A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
**composition_plan:** `typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan]` — A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
**music_length_ms:** `typing.Optional[int]` — The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
**model_id:** `typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId]` — The model to use for the generation.
**seed:** `typing.Optional[int]` — Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt.
**force_instrumental:** `typing.Optional[bool]` — If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`.
**finetune_id:** `typing.Optional[str]` — The ID of the finetune to use for the generation
**respect_sections_durations:** `typing.Optional[bool]` — Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan.
**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting.
**with_timestamps:** `typing.Optional[bool]` — Whether to return the timestamps of the words in the generated song.
**sign_with_c_2_pa:** `typing.Optional[bool]` — Whether to sign the generated song with C2PA. Applicable only for mp3 files.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.compose_detailed_stream(...) -> typing.Iterator[bytes]
#### � Description
Stream a song and its detailed metadata using Server-Sent Events (SSE).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.compose_detailed_stream( output_format="auto", ) ```
#### ⚙� Parameters
**output_format:** `typing.Optional[MusicComposeDetailedStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models.
**prompt:** `typing.Optional[str]` — A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
**composition_plan:** `typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan]` — A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
**music_length_ms:** `typing.Optional[int]` — The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
**model_id:** `typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId]` — The model to use for the generation.
**seed:** `typing.Optional[int]` — Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt.
**force_instrumental:** `typing.Optional[bool]` — If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`.
**finetune_id:** `typing.Optional[str]` — The ID of the finetune to use for the generation
**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting.
**with_timestamps:** `typing.Optional[bool]` — Whether to return the timestamps of the words in the generated song.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.stream(...) -> typing.Iterator[bytes]
#### � Description
Stream a composed song from a prompt or a composition plan.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.stream() ```
#### ⚙� Parameters
**output_format:** `typing.Optional[MusicStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models.
**prompt:** `typing.Optional[str]` — A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
**composition_plan:** `typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan]` — A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
**music_length_ms:** `typing.Optional[int]` — The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
**model_id:** `typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId]` — The model to use for the generation.
**seed:** `typing.Optional[int]` — Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt.
**force_instrumental:** `typing.Optional[bool]` — If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`.
**finetune_id:** `typing.Optional[str]` — The ID of the finetune to use for the generation
**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.upload(...) -> MusicUploadResponse
#### � Description
Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.upload( file="example_file", ) ```
#### ⚙� Parameters
**file:** `core.File` — The audio file to upload.
**extract_composition_plan:** `typing.Optional[str]` — Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency.
**with_timestamps:** `typing.Optional[bool]` — Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.separate_stems(...) -> typing.Iterator[bytes]
#### � Description
Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file.
#### 🔌 Usage
```python client.music.separate_stems(...) ```
#### ⚙� Parameters
**file:** `core.File` — The audio file to separate into stems.
**output_format:** `typing.Optional[AllowedOutputFormats]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
**stem_variation_id:** `typing.Optional[MusicSeparateStemsRequestStemVariationId]` — The id of the stem variation to use.
**sign_with_c_2_pa:** `typing.Optional[bool]` — Whether to sign the generated song with C2PA. Applicable only for mp3 files.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## SpeechToText
client.speech_to_text.convert(...) -> SpeechToTextConvertResponse
#### � Description
Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_to_text.convert( token="token", enable_logging=True, file="example_file", model_id="scribe_v2", ) ```
#### ⚙� Parameters
**model_id:** `SpeechToTextConvertRequestModelId` — The ID of the model to use for transcription.
**token:** `typing.Optional[str]` — A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients.
**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers.
**file:** `typing.Optional[core.File]` — The file to transcribe (100ms minimum audio length). 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 5.0GB.
**language_code:** `typing.Optional[str]` — An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically.
**tag_audio_events:** `typing.Optional[bool]` — Whether to tag audio events like (laughter), (footsteps), etc. in the transcription.
**num_speakers:** `typing.Optional[int]` — The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports.
**timestamps_granularity:** `typing.Optional[SpeechToTextConvertRequestTimestampsGranularity]` — The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word.
**diarize:** `typing.Optional[bool]` — Whether to annotate which speaker is currently talking in the uploaded file.
**diarization_threshold:** `typing.Optional[float]` — Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually).
**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]` — [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters.
**source_url:** `typing.Optional[str]` — The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services.
**webhook:** `typing.Optional[bool]` — Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook.
**webhook_id:** `typing.Optional[str]` — Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks.
**temperature:** `typing.Optional[float]` — Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0.
**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647.
**use_multi_channel:** `typing.Optional[bool]` — Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels.
**multichannel_output_style:** `typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle]` — Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction.
**webhook_metadata:** `typing.Optional[SpeechToTextConvertRequestWebhookMetadata]` — Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information.
**entity_detection:** `typing.Optional[SpeechToTextConvertRequestEntityDetection]` — Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost.
**no_verbatim:** `typing.Optional[bool]` — If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model.
**use_speaker_library:** `typing.Optional[bool]` — Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library.
**detect_speaker_roles:** `typing.Optional[bool]` — Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost.
**entity_redaction:** `typing.Optional[SpeechToTextConvertRequestEntityRedaction]` — Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost.
**entity_redaction_mode:** `typing.Optional[str]` — How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set.
**keyterms:** `typing.Optional[typing.List[str]]` — A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ForcedAlignment
client.forced_alignment.create(...) -> ForcedAlignmentResponseModel
#### � Description
Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.forced_alignment.create( file="example_file", text="text", ) ```
#### ⚙� Parameters
**file:** `core.File` — The file to align. All major audio formats are supported. The file size must be less than 1GB.
**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.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi
client.conversational_ai.add_to_knowledge_base(...) -> AddKnowledgeBaseResponseModel
#### � Description
Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.add_to_knowledge_base( agent_id="agent_id", file="example_file", ) ```
#### ⚙� Parameters
**agent_id:** `typing.Optional[str]`
**name:** `typing.Optional[str]` — A custom, human-readable name for the document.
**url:** `typing.Optional[str]` — URL to a page of documentation that the agent will have access to in order to interact with users.
**file:** `typing.Optional[core.File]` — Documentation that the agent will have access to in order to interact with users.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.rag_index_overview() -> RagIndexOverviewResponseModel
#### � Description
Provides total size and other information of RAG indexes used by knowledgebase documents
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.rag_index_overview() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.get_document_rag_indexes(...) -> RagDocumentIndexesResponseModel
#### � Description
Provides information about all RAG indexes of the specified knowledgebase document.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.get_document_rag_indexes( documentation_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.delete_document_rag_index(...) -> RagDocumentIndexResponseModel
#### � Description
Delete RAG index for the knowledgebase document.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.delete_document_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", rag_index_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**rag_index_id:** `str` — The id of RAG index of document from the knowledge base.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Speech Engine
client.speech_engine.list(...) -> ListSpeechEnginesResponse
#### � Description
Returns a paginated list of Speech Engine resources.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_engine.list( page_size=1, search="search", sort_direction="asc", sort_by="name", cursor="cursor", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many Speech Engines to return at maximum. Can not exceed 100, defaults to 30.
**search:** `typing.Optional[str]` — Search term to filter Speech Engines by name
**sort_direction:** `typing.Optional[SortDirection]` — The direction to sort the results
**sort_by:** `typing.Optional[AgentSortBy]` — The field to sort the results by
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.speech_engine.create(...) -> SpeechEngineResponse
#### � Description
Create a new Speech Engine resource
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, SpeechEngineConfig from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_engine.create( speech_engine=SpeechEngineConfig( ws_url="ws_url", ), ) ```
#### ⚙� Parameters
**speech_engine:** `SpeechEngineConfig` — Speech engine WebSocket configuration
**name:** `typing.Optional[str]` — Name of the speech engine
**asr:** `typing.Optional[AsrConversationalConfig]` — ASR configuration
**tts:** `typing.Optional[TtsConversationalConfigInput]` — TTS configuration
**turn:** `typing.Optional[BaseTurnConfig]` — Turn detection configuration
**vad:** `typing.Optional[VadConfig]` — Configuration for voice activity detection
**conversation:** `typing.Optional[ConversationConfigInput]` — Conversation configuration (client events, etc.)
**privacy:** `typing.Optional[PrivacyConfigInput]` — Privacy settings (recording, retention, zero retention mode)
**call_limits:** `typing.Optional[AgentCallLimits]` — Concurrency and daily conversation limits for this speech engine
**language:** `typing.Optional[str]` — Language for the speech engine
**tags:** `typing.Optional[typing.List[str]]` — Tags for categorization
**overrides:** `typing.Optional[SpeechEngineConversationInitiationClientDataConfig]` — Override settings the client may set during conversation initiation
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.speech_engine.get(...) -> SpeechEngineResponse
#### � Description
Retrieve a Speech Engine resource
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_engine.get( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**speech_engine_id:** `str` — The speech engine ID (accepts seng_ or agent_ prefix)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.speech_engine.delete(...)
#### � Description
Delete a Speech Engine resource
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_engine.delete( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**speech_engine_id:** `str` — The speech engine ID (accepts seng_ or agent_ prefix)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.speech_engine.update(...) -> SpeechEngineResponse
#### � Description
Update a Speech Engine resource (partial update)
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_engine.update( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**speech_engine_id:** `str` — The speech engine ID (accepts seng_ or agent_ prefix)
**name:** `typing.Optional[str]`
**speech_engine:** `typing.Optional[SpeechEngineConfig]`
**asr:** `typing.Optional[AsrConversationalConfig]`
**tts:** `typing.Optional[TtsConversationalConfigInput]`
**turn:** `typing.Optional[BaseTurnConfig]`
**vad:** `typing.Optional[VadConfig]`
**conversation:** `typing.Optional[ConversationConfigInput]`
**privacy:** `typing.Optional[PrivacyConfigInput]`
**call_limits:** `typing.Optional[AgentCallLimits]`
**language:** `typing.Optional[str]`
**tags:** `typing.Optional[typing.List[str]]`
**overrides:** `typing.Optional[SpeechEngineConversationInitiationClientDataConfig]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## EnvironmentVariables
client.environment_variables.list(...) -> EnvironmentVariablesListResponse
#### � Description
List all environment variables for the workspace with optional filtering
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.environment_variables.list( cursor="cursor", page_size=1, label="label", environment="environment", type="string", ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Pagination cursor from previous response
**page_size:** `typing.Optional[int]` — Number of items to return (1-100)
**label:** `typing.Optional[str]` — Filter by exact label match
**environment:** `typing.Optional[str]` — Filter to only return variables that have this environment. When specified, the values dict in the response will only contain this environment.
**type:** `typing.Optional[EnvironmentVariablesListRequestType]` — Filter by variable type
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.environment_variables.create(...) -> EnvironmentVariableResponse
#### � Description
Create a new environment variable for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.environment_variables.create( request={ "type": "string", "label": "label", "values": { "key": "value" } }, ) ```
#### ⚙� Parameters
**request:** `EnvironmentVariablesCreateRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.environment_variables.get(...) -> EnvironmentVariableResponse
#### � Description
Get a specific environment variable by ID
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.environment_variables.get( env_var_id="env_var_id", ) ```
#### ⚙� Parameters
**env_var_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.environment_variables.update(...) -> EnvironmentVariableResponse
#### � Description
Replace an environment variable's values. Use null to remove an environment (except production).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.environment_variables.update( env_var_id="env_var_id", values={}, ) ```
#### ⚙� Parameters
**env_var_id:** `str`
**values:** `typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]]` — Values to replace. Set to null to remove an environment (except 'production').
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations
client.conversational_ai.conversations.get_signed_url(...) -> ConversationSignedUrlResponseModel
#### � Description
Get a signed url to start a conversation with an agent with an agent that requires authorization
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.get_signed_url( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_conversation_id=True, branch_id="branch_id", environment="environment", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**include_conversation_id:** `typing.Optional[bool]` — Whether to include a conversation_id with the response. If included, the conversation_signature cannot be used again.
**branch_id:** `typing.Optional[str]` — The ID of the branch to use
**environment:** `typing.Optional[str]` — The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.get_webrtc_token(...) -> TokenResponseModel
#### � Description
Get a WebRTC session token for real-time communication.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.get_webrtc_token( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", participant_name="participant_name", branch_id="branch_id", environment="environment", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**participant_name:** `typing.Optional[str]` — Optional custom participant name. If not provided, user ID will be used
**branch_id:** `typing.Optional[str]` — The ID of the branch to use
**environment:** `typing.Optional[str]` — The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.list(...) -> GetConversationsPageResponseModel
#### � Description
Get all conversations of agents that user owns. With option to restrict to a specific agent.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.list( cursor="cursor", agent_id="agent_id", visited_agent_ids=[ "visited_agent_ids" ], visited_agent_branch_ids=[ "visited_agent_branch_ids" ], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=[ "evaluation_params" ], data_collection_params=[ "data_collection_params" ], data_collection_ids=[ "data_collection_ids" ], evaluation_criteria_ids=[ "evaluation_criteria_ids" ], tool_names=[ "tool_names" ], tool_names_successful=[ "tool_names_successful" ], tool_names_errored=[ "tool_names_errored" ], main_languages=[ "main_languages" ], page_size=1, summary_mode="exclude", search="search", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", parent_conversation_id="parent_conversation_id", topic_ids=[ "topic_ids" ], exclude_statuses=[ "initiated" ], tag_ids=[ "tag_ids" ], workflow_node_entered_id="workflow_node_entered_id", termination_reasons=[ "termination_reasons" ], guardrail_types=[ "custom" ], custom_guardrail_names=[ "custom_guardrail_names" ], ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**agent_id:** `typing.Optional[str]` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**visited_agent_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations where any of these agents participated. Can not exceed 50 values.
**visited_agent_branch_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations where any of these agent branches participated. Can not exceed 50 values.
**call_successful:** `typing.Optional[EvaluationSuccessResult]` — The result of the success evaluation
**call_start_before_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations up to this start date.
**call_start_after_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations after to this start date.
**call_duration_min_secs:** `typing.Optional[int]` — Minimum call duration in seconds.
**call_duration_max_secs:** `typing.Optional[int]` — Maximum call duration in seconds.
**rating_max:** `typing.Optional[int]` — Maximum overall rating (1-5).
**rating_min:** `typing.Optional[int]` — Minimum overall rating (1-5).
**has_feedback_comment:** `typing.Optional[bool]` — Filter conversations with user feedback comments.
**user_id:** `typing.Optional[str]` — Filter conversations by the user ID who initiated them.
**evaluation_params:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success
**data_collection_params:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values.
**data_collection_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Data collection field IDs to include in each conversation summary. Repeat param. When omitted, data_collection_results is not returned.
**evaluation_criteria_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Evaluation criteria IDs to include in each conversation summary. Repeat param. When omitted, evaluation_criteria_results is not returned.
**tool_names:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names used during the call.
**tool_names_successful:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names that had successful calls.
**tool_names_errored:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names that had errored calls.
**main_languages:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by detected main language (language code).
**page_size:** `typing.Optional[int]` — How many conversations to return at maximum. Can not exceed 100, defaults to 30.
**summary_mode:** `typing.Optional[ConversationsListRequestSummaryMode]` — Whether to include transcript summaries in the response.
**search:** `typing.Optional[str]` — Full-text or fuzzy search over transcript messages
**conversation_initiation_source:** `typing.Optional[ConversationInitiationSource]`
**text_only:** `typing.Optional[bool]`
**conversation_product_type:** `typing.Optional[ConversationProduct]` — Restrict results to a single conversation product surface.
**branch_id:** `typing.Optional[str]` — Filter conversations by branch ID.
**version_id:** `typing.Optional[str]` — Filter conversations by version ID.
**parent_conversation_id:** `typing.Optional[str]` — Filter conversations by parent conversation ID for subagent conversations.
**topic_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by topic IDs assigned during topic discovery.
**exclude_statuses:** `typing.Optional[typing.Union[ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem]]]` — Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views.
**tag_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by conversation tag IDs assigned via the conversation-tags endpoints.
**workflow_node_entered_id:** `typing.Optional[str]` — Filter conversations to only those that entered the given node.
**termination_reasons:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several.
**guardrail_types:** `typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]]` — Filter to conversations where a guardrail of any of these types triggered (metadata.triggered_guardrails.guardrail_type). Repeat param to match any of several.
**custom_guardrail_names:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter to conversations where a custom guardrail with any of these names triggered (metadata.triggered_guardrails.guardrail_name). Only custom guardrails carry a name. Repeat param to match any of several.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.resolve(...) -> GetConversationResponseModel
#### � Description
Resolve a conversation URL (a Slack message URL or a Zendesk ticket URL) to the deterministic conversation ID for the given agent, then confirm the conversation exists.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.resolve( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", reference="https://your-domain.zendesk.com/agent/tickets/12345", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**reference:** `str` — A Slack message URL or a Zendesk ticket URL.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.get(...) -> GetConversationResponseModel
#### � Description
Get the details of a particular conversation
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.get( conversation_id="21m00Tcm4TlvDq8ikWAM", format="json", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — The id of the conversation you're taking the action on.
**format:** `typing.Optional[ConversationsGetRequestFormat]` — Response format. Defaults to 'json'. Set to 'opentelemetry' for an OTLP-compatible trace payload using the same structure as the post-call webhook.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.delete(...) -> typing.Any
#### � Description
Delete a particular conversation
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.delete( conversation_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — The id of the conversation you're taking the action on.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.get_sip_messages(...) -> GetSipLogMessagesResponse
#### � Description
Get SIP messages associated with a conversation's phone call
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.get_sip_messages( conversation_id="21m00Tcm4TlvDq8ikWAM", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — The id of the conversation you're taking the action on.
**page_size:** `typing.Optional[int]`
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Twilio
client.conversational_ai.twilio.outbound_call(...) -> TwilioOutboundCallResponse
#### � Description
Handle an outbound call via Twilio
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.twilio.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**agent_phone_number_id:** `str`
**to_number:** `str`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**call_recording_enabled:** `typing.Optional[bool]` — Whether let Twilio record the call.
**telephony_call_config:** `typing.Optional[TelephonyCallConfig]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.twilio.register_call(...) -> str
#### � Description
Register a Twilio call and return TwiML to connect the call
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.twilio.register_call( agent_id="agent_id", from_number="from_number", to_number="to_number", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**from_number:** `str`
**to_number:** `str`
**direction:** `typing.Optional[TelephonyDirection]`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Exotel
client.conversational_ai.exotel.outbound_call(...) -> ExotelOutboundCallResponse
#### � Description
Handle an outbound call via Exotel Connect API
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.exotel.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**agent_phone_number_id:** `str`
**to_number:** `str`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**telephony_call_config:** `typing.Optional[TelephonyCallConfig]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Whatsapp
client.conversational_ai.whatsapp.outbound_call(...) -> WhatsAppOutboundCallResponse
#### � Description
Make an outbound call via WhatsApp
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp.outbound_call( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", whatsapp_call_permission_request_template_name="whatsapp_call_permission_request_template_name", whatsapp_call_permission_request_template_language_code="whatsapp_call_permission_request_template_language_code", agent_id="agent_id", ) ```
#### ⚙� Parameters
**whatsapp_phone_number_id:** `str`
**whatsapp_user_id:** `str`
**whatsapp_call_permission_request_template_name:** `str`
**whatsapp_call_permission_request_template_language_code:** `str`
**agent_id:** `str`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.whatsapp.outbound_message(...) -> WhatsAppOutboundMessageResponse
#### � Description
Send an outbound message via WhatsApp
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, WhatsAppTemplateTextParam from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp.outbound_message( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", template_name="template_name", template_language_code="template_language_code", template_params=[ { "type": "body", "parameters": [ WhatsAppTemplateTextParam( text="text", ) ] } ], agent_id="agent_id", ) ```
#### ⚙� Parameters
**whatsapp_phone_number_id:** `str`
**whatsapp_user_id:** `str`
**template_name:** `str`
**template_language_code:** `str`
**template_params:** `typing.List[BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem]`
**agent_id:** `str`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents
client.conversational_ai.agents.create(...) -> CreateAgentResponseModel
#### � Description
Create an agent from a config object
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, ConversationalConfig from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.create( enable_versioning=True, conversation_config=ConversationalConfig(), ) ```
#### ⚙� Parameters
**conversation_config:** `ConversationalConfig` — Conversation configuration for an agent
**enable_versioning:** `typing.Optional[bool]` — Deprecated: all agents are versioned. This parameter is ignored.
**platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
**workflow:** `typing.Optional[AgentWorkflowRequestModel]` — Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
**name:** `typing.Optional[str]` — A name to make the agent easier to find
**tags:** `typing.Optional[typing.List[str]]` — Tags to help classify and filter the agent
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.get(...) -> GetAgentResponseModel
#### � Description
Retrieve config for an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="version_id", branch_id="branch_id", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**version_id:** `typing.Optional[str]` — The ID of the agent version to use
**branch_id:** `typing.Optional[str]` — The ID of the branch to use
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.delete(...)
#### � Description
Delete an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.update(...) -> GetAgentResponseModel
#### � Description
Patches an Agent settings
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", enable_versioning_if_not_enabled=True, branch_id="branch_id", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**enable_versioning_if_not_enabled:** `typing.Optional[bool]` — Deprecated: all agents are versioned. This parameter is ignored.
**branch_id:** `typing.Optional[str]` — The ID of the branch to use
**conversation_config:** `typing.Optional[ConversationalConfig]` — Conversation configuration for an agent
**platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
**workflow:** `typing.Optional[AgentWorkflowRequestModel]` — Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
**name:** `typing.Optional[str]` — A name to make the agent easier to find
**tags:** `typing.Optional[typing.List[str]]` — Tags to help classify and filter the agent
**version_description:** `typing.Optional[str]` — Description for this version when publishing changes (only applicable for versioned agents)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.list(...) -> GetAgentsPageResponseModel
#### � Description
Returns a list of your agents and their metadata.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.list( page_size=1, search="search", archived=True, show_only_owned_agents=True, created_by_user_id="created_by_user_id", sort_direction="asc", sort_by="name", cursor="cursor", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many Agents to return at maximum. Can not exceed 100, defaults to 30.
**search:** `typing.Optional[str]` — Search by agents name.
**archived:** `typing.Optional[bool]` — Filter agents by archived status
**show_only_owned_agents:** `typing.Optional[bool]` — If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead.
**created_by_user_id:** `typing.Optional[str]` — Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user.
**sort_direction:** `typing.Optional[SortDirection]` — The direction to sort the results
**sort_by:** `typing.Optional[AgentSortBy]` — The field to sort the results by
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.duplicate(...) -> CreateAgentResponseModel
#### � Description
Create a new agent by duplicating an existing one
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.duplicate( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**name:** `typing.Optional[str]` — A name to make the agent easier to find
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.simulate_conversation(...) -> AgentSimulatedChatTestResponseModel
#### � Description
Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, ConversationSimulationSpecification, AgentConfig from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.simulate_conversation( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated
**extra_evaluation_criteria:** `typing.Optional[typing.List[PromptEvaluationCriteria]]` — A list of evaluation criteria to test
**new_turns_limit:** `typing.Optional[int]` — Maximum number of new turns to generate in the conversation simulation
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.simulate_conversation_stream(...)
#### � Description
Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, ConversationSimulationSpecification, AgentConfig from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.simulate_conversation_stream( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated
**extra_evaluation_criteria:** `typing.Optional[typing.List[PromptEvaluationCriteria]]` — A list of evaluation criteria to test
**new_turns_limit:** `typing.Optional[int]` — Maximum number of new turns to generate in the conversation simulation
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.run_tests(...) -> GetTestSuiteInvocationResponseModel
#### � Description
Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, SingleTestRunRequestModel from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.run_tests( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", tests=[ SingleTestRunRequestModel( test_id="test_id", ) ], ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**tests:** `typing.List[SingleTestRunRequestModel]` — List of tests to run on the agent
**agent_config_override:** `typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]` — Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.
**branch_id:** `typing.Optional[str]` — ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch.
**repeat_count:** `typing.Optional[int]` — Number of times to run each test. When greater than 1, results are grouped and summarized.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Tests
client.conversational_ai.tests.create(...) -> CreateAgentTestResponseModel
#### � Description
Creates a new agent response test.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.create( request={ "type": "llm", "name": "name" }, ) ```
#### ⚙� Parameters
**request:** `TestsCreateRequestBody` — Create Chat Response Test Request Information
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.move(...) -> typing.Any
#### � Description
Moves multiple tests or folders from one folder to another.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.move( entity_ids=[ "entity_ids" ], ) ```
#### ⚙� Parameters
**entity_ids:** `typing.List[str]` — The IDs of tests or folders to move.
**move_to:** `typing.Optional[str]` — The folder to move the entities to. If not set, the entities will be moved to the root folder.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.get(...) -> TestsGetResponse
#### � Description
Gets an agent response test by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.get( test_id="TeaqRRdTcIfIu2i7BYfT", ) ```
#### ⚙� Parameters
**test_id:** `str` — The id of a chat response test. This is returned on test creation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.update(...) -> TestsUpdateResponse
#### � Description
Updates an agent response test by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.update( test_id="TeaqRRdTcIfIu2i7BYfT", request={ "type": "llm", "name": "name" }, ) ```
#### ⚙� Parameters
**test_id:** `str` — The id of a chat response test. This is returned on test creation.
**request:** `TestsUpdateRequestBody` — Agent test to update
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.delete(...) -> typing.Any
#### � Description
Deletes an agent response test by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.delete( test_id="TeaqRRdTcIfIu2i7BYfT", ) ```
#### ⚙� Parameters
**test_id:** `str` — The id of a chat response test. This is returned on test creation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.summaries(...) -> GetTestsSummariesByIdsResponseModel
#### � Description
Gets agent response test summaries for the requested test IDs.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.summaries( test_ids=[ "test_id_1", "test_id_2" ], ) ```
#### ⚙� Parameters
**test_ids:** `typing.List[str]` — List of test IDs to fetch. No duplicates allowed. Prefer at most 1000 IDs per request.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.list(...) -> GetTestsPageResponseModel
#### � Description
Lists all agent response tests with pagination support and optional search filtering.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.list( cursor="cursor", page_size=1, search="search", parent_folder_id="parent_folder_id", types=[ "llm" ], include_folders=True, sort_mode="default", sharing_mode="all", ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many Tests to return at maximum. Can not exceed 100, defaults to 30.
**search:** `typing.Optional[str]` — Search query to filter tests by name.
**parent_folder_id:** `typing.Optional[str]` — Filter by parent folder ID. Use 'root' to get items in the root folder.
**types:** `typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]]` — If present, the endpoint will return only tests/folders of the given types.
**include_folders:** `typing.Optional[bool]` — Deprecated. Use the `types` query param and include `folder` instead.
**sort_mode:** `typing.Optional[TestsListRequestSortMode]` — Sort mode for listing tests. Use 'folders_first' to place folders before tests.
**sharing_mode:** `typing.Optional[TestSharingMode]` — Filter test visibility. Use `shared_with_me` to return only tests/folders shared with the current user that they did not create.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Users
client.conversational_ai.users.list(...) -> GetConversationUsersPageResponseModel
#### � Description
Get distinct users from conversations with pagination.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.users.list( agent_id="agent_id", branch_id="branch_id", call_start_before_unix=1, call_start_after_unix=1, search="search", page_size=1, sort_by="last_contact_unix_secs", sort_direction="asc", cursor="cursor", ) ```
#### ⚙� Parameters
**agent_id:** `typing.Optional[str]` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**branch_id:** `typing.Optional[str]` — Filter conversations by branch ID.
**call_start_before_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations up to this start date.
**call_start_after_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations after to this start date.
**search:** `typing.Optional[str]` — Search/filter by user ID (exact match).
**page_size:** `typing.Optional[int]` — How many users to return at maximum. Defaults to 30.
**sort_by:** `typing.Optional[UsersSortBy]` — The field to sort the results by. Defaults to last_contact_unix_secs.
**sort_direction:** `typing.Optional[SortDirection]` — The direction to sort the results
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi PhoneNumbers
client.conversational_ai.phone_numbers.list(...) -> typing.List[PhoneNumbersListResponseItem]
#### � Description
Retrieve all Phone Numbers
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.list( provider="twilio", agent_id="agent_id", branch_id="branch_id", ) ```
#### ⚙� Parameters
**provider:** `typing.Optional[TelephonyProvider]` — Filter by telephony provider
**agent_id:** `typing.Optional[str]` — Filter by assigned agent ID
**branch_id:** `typing.Optional[str]` — Filter by assigned branch ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.phone_numbers.create(...) -> CreatePhoneNumberResponseModel
#### � Description
Import Phone Number from provider configuration (Twilio, Exotel, or SIP trunk)
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.create( request={ "provider": "twilio", "phone_number": "phone_number", "label": "label", "sid": "sid", "token": "token" }, ) ```
#### ⚙� Parameters
**request:** `PhoneNumbersCreateRequestBody` — Create Phone Request Information
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.phone_numbers.get(...) -> PhoneNumbersGetResponse
#### � Description
Retrieve Phone Number details by ID
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.get( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) ```
#### ⚙� Parameters
**phone_number_id:** `str` — The phone number ID. This is returned when a phone number is imported.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.phone_numbers.delete(...) -> typing.Any
#### � Description
Delete Phone Number by ID
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.delete( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) ```
#### ⚙� Parameters
**phone_number_id:** `str` — The phone number ID. This is returned when a phone number is imported.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.phone_numbers.update(...) -> PhoneNumbersUpdateResponse
#### � Description
Update assigned agent of a phone number
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.update( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) ```
#### ⚙� Parameters
**phone_number_id:** `str` — The phone number ID. This is returned when a phone number is imported.
**agent_id:** `typing.Optional[str]`
**label:** `typing.Optional[str]`
**inbound_trunk_config:** `typing.Optional[InboundSipTrunkConfigRequestModel]`
**outbound_trunk_config:** `typing.Optional[OutboundSipTrunkConfigRequestModel]`
**livekit_stack:** `typing.Optional[LivekitStackType]`
**store_sip_messages:** `typing.Optional[bool]`
**environment:** `typing.Optional[str]` — Environment to use for resolving environment variables on calls to this number.
**branch_id:** `typing.Optional[str]` — Agent branch to use for calls to this number.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.phone_numbers.get_sip_messages(...) -> GetSipLogMessagesResponse
#### � Description
Get SIP messages for a phone number
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.phone_numbers.get_sip_messages( phone_number_id="TeaqRRdTcIfIu2i7BYfT", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**phone_number_id:** `str` — The phone number ID. This is returned when a phone number is imported.
**page_size:** `typing.Optional[int]`
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi LlmUsage
client.conversational_ai.llm_usage.calculate(...) -> LlmUsageCalculatorResponseModel
#### � Description
Returns a list of LLM models and the expected cost for using them based on the provided values.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.llm_usage.calculate( prompt_length=1, number_of_pages=1, rag_enabled=True, ) ```
#### ⚙� Parameters
**prompt_length:** `int` — Length of the prompt in characters.
**number_of_pages:** `int` — Pages of content in PDF documents or URLs in the agent's knowledge base.
**rag_enabled:** `bool` — Whether RAG is enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Llm
client.conversational_ai.llm.list() -> LlmListResponseModelInput
#### � Description
Returns a list of available LLM models that can be used with agents, including their capabilities and any deprecation status. The response is filtered based on the data residency of the deployment and any compliance requirements (e.g. HIPAA) of the workspace subscription.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.llm.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase
client.conversational_ai.knowledge_base.list(...) -> GetKnowledgeBaseListResponseModel
#### � Description
Get a list of available knowledge base documents
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.list( page_size=1, search="search", show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=[ "file" ], parent_folder_id="parent_folder_id", ancestor_folder_id="ancestor_folder_id", folders_first=True, sort_direction="asc", sort_by="name", cursor="cursor", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**search:** `typing.Optional[str]` — If specified, the endpoint returns only such knowledge base documents whose names start with this string.
**show_only_owned_documents:** `typing.Optional[bool]` — If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead.
**created_by_user_id:** `typing.Optional[str]` — Filter documents by creator user ID. When set, only documents created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user.
**types:** `typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]]` — If present, the endpoint will return only documents of the given types.
**parent_folder_id:** `typing.Optional[str]` — If set, the endpoint will return only documents that are direct children of the given folder.
**ancestor_folder_id:** `typing.Optional[str]` — If set, the endpoint will return only documents that are descendants of the given folder.
**folders_first:** `typing.Optional[bool]` — Whether folders should be returned first in the list of documents.
**sort_direction:** `typing.Optional[SortDirection]` — The direction to sort the results
**sort_by:** `typing.Optional[KnowledgeBaseSortBy]` — The field to sort the results by
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.get_or_create_rag_indexes(...) -> typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]
#### � Description
Retrieves and/or creates RAG indexes for multiple knowledge base documents in a single request. Maximum 100 items per request.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, GetOrCreateRagIndexRequestModel from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.get_or_create_rag_indexes( items=[ GetOrCreateRagIndexRequestModel( document_id="document_id", create_if_missing=True, model="e5_mistral_7b_instruct", ) ], ) ```
#### ⚙� Parameters
**items:** `typing.List[GetOrCreateRagIndexRequestModel]` — List of requested RAG indexes. Minimum 1, maximum 100 items.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.search(...) -> KnowledgeBaseContentSearchResponseModel
#### � Description
Fuzzy text search over knowledge base document content
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.search( query="query", page_size=1, types=[ "file" ], cursor="cursor", ) ```
#### ⚙� Parameters
**query:** `str` — The search query text
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**types:** `typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]]` — If present, the endpoint will return only documents of the given types.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Tools
client.conversational_ai.tools.list(...) -> ToolsResponseModel
#### � Description
Get all available tools in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.list( search="search", page_size=1, show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=[ "webhook" ], sort_direction="asc", sort_by="name", cursor="cursor", ) ```
#### ⚙� Parameters
**search:** `typing.Optional[str]` — If specified, the endpoint returns only tools whose names start with this string.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**show_only_owned_documents:** `typing.Optional[bool]` — If set to true, the endpoint will return only tools owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead.
**created_by_user_id:** `typing.Optional[str]` — Filter tools by creator user ID. When set, only tools created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user.
**types:** `typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]]` — If present, the endpoint will return only tools of the given types.
**sort_direction:** `typing.Optional[SortDirection]` — The direction to sort the results
**sort_by:** `typing.Optional[ToolSortBy]` — The field to sort the results by
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tools.create(...) -> ToolResponseModel
#### � Description
Add a new tool to the available tools in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, ToolRequestModel from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.create( request=ToolRequestModel( tool_config={ "type": "client", "name": "name", "description": "description", "expects_response": False }, ), ) ```
#### ⚙� Parameters
**request:** `ToolRequestModel` — A tool that an agent can provide to LLM.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tools.get(...) -> ToolResponseModel
#### � Description
Get tool that is available in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.get( tool_id="tool_id", environment="environment", ) ```
#### ⚙� Parameters
**tool_id:** `str` — ID of the requested tool.
**environment:** `typing.Optional[str]` — Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tools.delete(...) -> typing.Any
#### � Description
Delete tool from the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.delete( tool_id="tool_id", force=True, ) ```
#### ⚙� Parameters
**tool_id:** `str` — ID of the requested tool.
**force:** `typing.Optional[bool]` — If set to true, the tool will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents and branches.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tools.update(...) -> ToolResponseModel
#### � Description
Update tool that is available in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, ToolRequestModel from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.update( tool_id="tool_id", request=ToolRequestModel( tool_config={ "type": "client", "name": "name", "description": "description", "expects_response": False }, ), ) ```
#### ⚙� Parameters
**tool_id:** `str` — ID of the requested tool.
**request:** `ToolRequestModel` — A tool that an agent can provide to LLM.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tools.get_dependent_agents(...) -> GetToolDependentAgentsResponseModel
#### � Description
Get a list of agents depending on this tool
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.get_dependent_agents( tool_id="tool_id", cursor="cursor", page_size=1, ) ```
#### ⚙� Parameters
**tool_id:** `str` — ID of the requested tool.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Settings
client.conversational_ai.settings.get() -> GetConvAiSettingsResponseModel
#### � Description
Retrieve Convai settings for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.settings.get() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.settings.update(...) -> GetConvAiSettingsResponseModel
#### � Description
Update Convai settings for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.settings.update() ```
#### ⚙� Parameters
**conversation_initiation_client_data_webhook:** `typing.Optional[ConversationInitiationClientDataWebhook]`
**webhooks:** `typing.Optional[ConvAiWebhooks]`
**can_use_mcp_servers:** `typing.Optional[bool]` — Whether the workspace can use MCP servers
**rag_retention_period_days:** `typing.Optional[int]`
**conversation_embedding_retention_days:** `typing.Optional[int]` — Days to retain conversation embeddings. None means use the system default (30 days).
**default_livekit_stack:** `typing.Optional[LivekitStackType]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Secrets
client.conversational_ai.secrets.list(...) -> GetWorkspaceSecretsResponseModel
#### � Description
Get all workspace secrets for the user
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.list( page_size=1, dependency_limit=1, search="search", cursor="cursor", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets.
**dependency_limit:** `typing.Optional[int]` — Maximum number of dependent resources (tools, agents, phone numbers) to return per secret. Can not exceed 100.
**search:** `typing.Optional[str]` — If specified, returns only secrets whose names start with this string.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.secrets.create(...) -> PostWorkspaceSecretResponseModel
#### � Description
Create a new secret for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.create( name="name", value="value", ) ```
#### ⚙� Parameters
**type:** `typing.Literal`
**name:** `str`
**value:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.secrets.get(...) -> ConvAiWorkspaceStoredSecretConfig
#### � Description
Get a workspace secret by ID
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.get( secret_id="secret_id", ) ```
#### ⚙� Parameters
**secret_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.secrets.delete(...)
#### � Description
Delete a workspace secret if it's not in use
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.delete( secret_id="secret_id", ) ```
#### ⚙� Parameters
**secret_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.secrets.update(...) -> PostWorkspaceSecretResponseModel
#### � Description
Update an existing secret for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.update( secret_id="secret_id", name="name", value="value", ) ```
#### ⚙� Parameters
**secret_id:** `str`
**type:** `typing.Literal`
**name:** `str`
**value:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.secrets.get_dependencies(...) -> GetSecretDependenciesResponseModel
#### � Description
Get paginated list of resources that depend on a specific secret, filtered by resource type.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.secrets.get_dependencies( secret_id="secret_id", resource_type="tools", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**secret_id:** `str`
**resource_type:** `SecretDependencyResourceType`
**page_size:** `typing.Optional[int]` — How many dependency items to return per page.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi BatchCalls
client.conversational_ai.batch_calls.create(...) -> BatchCallResponse
#### � Description
Submit a batch call request to schedule calls for multiple recipients.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, OutboundCallRecipient from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.create( call_name="call_name", agent_id="agent_id", recipients=[ OutboundCallRecipient() ], ) ```
#### ⚙� Parameters
**call_name:** `str`
**agent_id:** `str`
**recipients:** `typing.List[OutboundCallRecipient]`
**scheduled_time_unix:** `typing.Optional[int]`
**agent_phone_number_id:** `typing.Optional[str]`
**whatsapp_params:** `typing.Optional[BatchCallWhatsAppParams]`
**timezone:** `typing.Optional[str]`
**branch_id:** `typing.Optional[str]`
**environment:** `typing.Optional[str]`
**telephony_call_config:** `typing.Optional[TelephonyCallConfig]`
**target_concurrency_limit:** `typing.Optional[int]` — Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.list(...) -> WorkspaceBatchCallsResponse
#### � Description
Get all batch calls for the current workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.list( limit=1, last_doc="last_doc", agent_id="agent_id", ) ```
#### ⚙� Parameters
**limit:** `typing.Optional[int]`
**last_doc:** `typing.Optional[str]`
**agent_id:** `typing.Optional[str]` — Filter batch calls to a single agent.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.get(...) -> BatchCallDetailedResponse
#### � Description
Get detailed information about a batch call including all recipients.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.get( batch_id="batch_id", ) ```
#### ⚙� Parameters
**batch_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.delete(...)
#### � Description
Permanently delete a batch call and all recipient records. Conversations remain in history.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.delete( batch_id="batch_id", ) ```
#### ⚙� Parameters
**batch_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.cancel(...) -> BatchCallResponse
#### � Description
Cancel a running batch call and set all recipients to cancelled status.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.cancel( batch_id="batch_id", ) ```
#### ⚙� Parameters
**batch_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.retry(...) -> BatchCallResponse
#### � Description
Retry a batch call, calling failed and no-response recipients again.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.retry( batch_id="batch_id", ) ```
#### ⚙� Parameters
**batch_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.batch_calls.export(...) -> typing.Iterator[bytes]
#### � Description
Download all recipients and conversation results for a terminal batch call as CSV.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.batch_calls.export( batch_id="batch_id", ) ```
#### ⚙� Parameters
**batch_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi SipTrunk
client.conversational_ai.sip_trunk.outbound_call(...) -> SipTrunkOutboundCallResponse
#### � Description
Handle an outbound call via SIP trunk
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.sip_trunk.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**agent_phone_number_id:** `str`
**to_number:** `str`
**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]`
**telephony_call_config:** `typing.Optional[TelephonyCallConfig]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi McpServers
client.conversational_ai.mcp_servers.list() -> McpServersResponseModel
#### � Description
Retrieve all MCP server configurations available in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.create(...) -> McpServerResponseModel
#### � Description
Create a new MCP server configuration in the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, McpServerConfigInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.create( config=McpServerConfigInput( url="url", name="name", ), ) ```
#### ⚙� Parameters
**config:** `McpServerConfigInput` — Configuration details for the MCP Server.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.get(...) -> McpServerResponseModel
#### � Description
Retrieve a specific MCP server configuration from the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.get( mcp_server_id="mcp_server_id", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.delete(...) -> typing.Any
#### � Description
Delete a specific MCP server configuration from the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.delete( mcp_server_id="mcp_server_id", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.update(...) -> McpServerResponseModel
#### � Description
Update the configuration settings for an MCP server.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.update( mcp_server_id="mcp_server_id", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**approval_policy:** `typing.Optional[McpApprovalPolicy]` — The approval mode to set for the MCP server
**force_pre_tool_speech:** `typing.Optional[bool]` — DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool.
**pre_tool_speech:** `typing.Optional[PreToolSpeechMode]` — If set, overrides the server's pre_tool_speech setting for this tool.
**disable_interruptions:** `typing.Optional[bool]` — DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool.
**interruption_mode:** `typing.Optional[ToolInterruptionMode]` — If set, overrides the server's interruption_mode setting for this tool.
**tool_call_sound:** `typing.Optional[ToolCallSoundType]` — Predefined tool call sound type to play during tool execution for all tools from this MCP server
**tool_call_sound_behavior:** `typing.Optional[ToolCallSoundBehavior]` — Determines when the tool call sound should play for all tools from this MCP server
**execution_mode:** `typing.Optional[ToolExecutionMode]` — If set, overrides the server's execution_mode setting for this tool
**response_timeout_secs:** `typing.Optional[int]` — The maximum time in seconds to wait for each MCP tool call to complete.
**request_headers:** `typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]]` — The headers to include in requests to the MCP server
**request_meta:** `typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]]]` — Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call.
**disable_compression:** `typing.Optional[bool]` — Whether to disable HTTP compression for this MCP server
**secret_token:** `typing.Optional[ConvAiSecretLocator]` — Optional secret token for authentication with this MCP server
**auth_connection:** `typing.Optional[McpServerConfigUpdateRequestModelAuthConnection]` — Optional auth connection to use for authentication with this MCP server
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi WhatsappAccounts
client.conversational_ai.whatsapp_accounts.get(...) -> GetWhatsAppAccountResponse
#### � Description
Get a WhatsApp account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp_accounts.get( phone_number_id="phone_number_id", ) ```
#### ⚙� Parameters
**phone_number_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.whatsapp_accounts.delete(...) -> typing.Any
#### � Description
Delete a WhatsApp account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp_accounts.delete( phone_number_id="phone_number_id", ) ```
#### ⚙� Parameters
**phone_number_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.whatsapp_accounts.update(...) -> typing.Any
#### � Description
Update a WhatsApp account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp_accounts.update( phone_number_id="phone_number_id", ) ```
#### ⚙� Parameters
**phone_number_id:** `str`
**assigned_agent_id:** `typing.Optional[str]`
**enable_messaging:** `typing.Optional[bool]`
**enable_audio_message_response:** `typing.Optional[bool]`
**enable_typing_indicator:** `typing.Optional[bool]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.whatsapp_accounts.list(...) -> ListWhatsAppAccountsResponse
#### � Description
List all WhatsApp accounts
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.whatsapp_accounts.list( agent_id="agent_id", ) ```
#### ⚙� Parameters
**agent_id:** `typing.Optional[str]` — Filter by assigned agent ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Summaries
client.conversational_ai.agents.summaries.get(...) -> typing.Dict[str, SummariesGetResponseValue]
#### � Description
Returns summaries for the specified agents.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.summaries.get( agent_ids=[ "agent_ids" ], ) ```
#### ⚙� Parameters
**agent_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — List of agent IDs to fetch summaries for
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Widget
client.conversational_ai.agents.widget.get(...) -> GetAgentEmbedResponseModel
#### � Description
Retrieve the widget configuration for an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.widget.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", conversation_signature="conversation_signature", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**conversation_signature:** `typing.Optional[str]` — An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Link
client.conversational_ai.agents.link.get(...) -> GetAgentLinkResponseModel
#### � Description
Get the current link used to share the agent with others
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.link.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents KnowledgeBase
client.conversational_ai.agents.knowledge_base.size(...) -> GetAgentKnowledgebaseSizeResponseModel
#### � Description
Returns the number of pages in the agent's knowledge base.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.knowledge_base.size( agent_id="agent_id", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents LlmUsage
client.conversational_ai.agents.llm_usage.calculate(...) -> LlmUsageCalculatorResponseModel
#### � Description
Calculates expected number of LLM tokens needed for the specified agent.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.llm_usage.calculate( agent_id="agent_id", ) ```
#### ⚙� Parameters
**agent_id:** `str`
**prompt_length:** `typing.Optional[int]` — Length of the prompt in characters.
**number_of_pages:** `typing.Optional[int]` — Pages of content in pdf documents OR urls in agent's Knowledge Base.
**rag_enabled:** `typing.Optional[bool]` — Whether RAG is enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Branches
client.conversational_ai.agents.branches.list(...) -> ListResponseAgentBranchSummary
#### � Description
Returns a list of branches an agent has
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_archived=True, limit=1, include_commit_status=True, ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**include_archived:** `typing.Optional[bool]` — Whether archived branches should be included
**limit:** `typing.Optional[int]` — How many results at most should be returned
**include_commit_status:** `typing.Optional[bool]` — Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.create(...) -> CreateAgentBranchResponseModel
#### � Description
Create a new branch from a given version of any branch
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", parent_version_id="parent_version_id", name="name", description="description", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**parent_version_id:** `str` — ID of the version to branch from
**name:** `str` — Name of the branch. It is unique within the agent.
**description:** `str` — Description for the branch
**conversation_config:** `typing.Optional[typing.Dict[str, typing.Any]]` — Changes to apply to conversation config
**platform_settings:** `typing.Optional[typing.Dict[str, typing.Any]]` — Changes to apply to platform settings
**workflow:** `typing.Optional[AgentWorkflowRequestModel]` — Updated workflow definition
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.get(...) -> AgentBranchResponse
#### � Description
Get information about a single agent branch
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — Unique identifier for the branch.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.update(...) -> AgentBranchResponse
#### � Description
Update agent branch properties such as archiving status and protection level
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — Unique identifier for the branch.
**name:** `typing.Optional[str]` — New name for the branch. Must be unique within the agent.
**is_archived:** `typing.Optional[bool]` — Whether the branch should be archived
**protection_status:** `typing.Optional[BranchProtectionStatus]` — The protection level for the branch
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.preview_merge(...) -> MergePreviewResponseModel
#### � Description
Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.preview_merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", force=True, ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**source_branch_id:** `str` — Unique identifier for the source branch to merge from.
**target_branch_id:** `str` — The ID of the target branch to merge into.
**force:** `typing.Optional[bool]` — When true, source branch changes always win conflicts regardless of timestamps
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.merge(...) -> typing.Any
#### � Description
Merge a branch into a target branch
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**source_branch_id:** `str` — Unique identifier for the source branch to merge from.
**target_branch_id:** `str` — The ID of the target branch to merge into.
**archive_source_branch:** `typing.Optional[bool]` — Whether to archive the source branch after merging
**force:** `typing.Optional[bool]` — Force source branch changes onto the target, overriding timestamp-based conflict resolution
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.preview_rebase(...) -> MergePreviewResponseModel
#### � Description
Returns the result of rebasing the branch onto main without performing the rebase. Useful for showing an accurate diff before confirming.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.preview_rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — Unique identifier for the source branch to merge from.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.branches.rebase(...) -> typing.Any
#### � Description
Rebase a branch onto the latest main branch, incorporating main's changes while preserving the branch's own changes.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.branches.rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — Unique identifier for the source branch to merge from.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Versions
client.conversational_ai.agents.versions.get(...) -> AgentVersionMetadata
#### � Description
Get metadata for a specific agent version
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.versions.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="agtvrsn_0901k4aafjxxfxt93gd841r7tv5t", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**version_id:** `str` — Unique identifier for the version.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Deployments
client.conversational_ai.agents.deployments.create(...) -> AgentDeploymentResponse
#### � Description
Create a new deployment for an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, AgentDeploymentRequest, AgentDeploymentRequestItem, AgentDeploymentPercentageStrategy from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.deployments.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", deployment_request=AgentDeploymentRequest( requests=[ AgentDeploymentRequestItem( branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", deployment_strategy=AgentDeploymentPercentageStrategy( type="percentage", traffic_percentage=0.5, ), ) ], ), ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**deployment_request:** `AgentDeploymentRequest` — Request to create a new deployment
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Drafts
client.conversational_ai.agents.drafts.create(...) -> typing.Any
#### � Description
Create a new draft for an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, AgentWorkflowRequestModel, WorkflowEdgeModelInput from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.drafts.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", conversation_config={ "key": "value" }, platform_settings={ "key": "value" }, workflow=AgentWorkflowRequestModel( edges={ "entry_to_tool_a": WorkflowEdgeModelInput( source="entry_node", target="tool_node_a", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "start_to_entry": WorkflowEdgeModelInput( source="start_node", target="entry_node", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_a_to_failure": WorkflowEdgeModelInput( source="tool_node_a", target="failure_node", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_a_to_tool_b": WorkflowEdgeModelInput( source="tool_node_a", target="tool_node_b", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_b_to_agent_transfer": WorkflowEdgeModelInput( source="tool_node_b", target="success_transfer", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_b_to_conversation": WorkflowEdgeModelInput( source="tool_node_b", target="success_conversation", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_b_to_end": WorkflowEdgeModelInput( source="tool_node_b", target="success_end", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ), "tool_b_to_phone": WorkflowEdgeModelInput( source="tool_node_b", target="success_phone", forward_condition={ "type": "expression", "expression": { "type": "and_operator", "children": [] } }, ) }, nodes={ "entry_node": { "type": "end" }, "failure_node": { "type": "end" }, "start_node": { "type": "end" }, "success_conversation": { "type": "end" }, "success_end": { "type": "end" }, "success_phone": { "type": "end" }, "success_transfer": { "type": "end" }, "tool_node_a": { "type": "end" }, "tool_node_b": { "type": "end" } }, ), name="name", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — The ID of the agent branch to use
**conversation_config:** `typing.Dict[str, typing.Any]` — Conversation config for the draft
**platform_settings:** `typing.Dict[str, typing.Any]` — Platform settings for the draft
**workflow:** `AgentWorkflowRequestModel` — Workflow for the draft
**name:** `str` — Name for the draft
**tags:** `typing.Optional[typing.List[str]]` — Tags to help classify and filter the agent
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.drafts.delete(...) -> typing.Any
#### � Description
Delete a draft for an agent
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**branch_id:** `str` — The ID of the agent branch to use
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Procedures
client.conversational_ai.agents.procedures.list(...) -> ListProceduresResponseModel
#### � Description
List the agent's procedures on a branch with their procedure_id, version_id, name, type, trigger, and has_draft. has_draft is true when a procedure has unpublished draft changes on this branch; its name/type/trigger then reflect that draft. Does not return procedure content -- use Get Procedure to read a procedure's body.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.create(...) -> CreateProcedureResponseModel
#### � Description
Create a new procedure for the agent on a branch.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, CreateProcedureRequestModel from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", request=CreateProcedureRequestModel(), ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**request:** `typing.Optional[CreateProcedureRequestModel]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.compile(...) -> CompileProceduresResponseModel
#### � Description
Compile procedure drafts into a workflow.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.compile( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.get(...) -> ProcedureAtVersionResponseModel
#### � Description
Retrieve a procedure at a specific version or the current branch HEAD.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", version_id="version_id", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**procedure_id:** `str` — The procedure ID
**version_id:** `typing.Optional[str]` — The version ID to retrieve. If omitted, returns the version at branch HEAD.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.remove(...) -> typing.Any
#### � Description
Remove a procedure from the agent's draft working set.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.remove( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**procedure_id:** `str` — The procedure ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Procedures Drafts
client.conversational_ai.agents.procedures.drafts.get(...) -> ProcedureDraftResponseModel
#### � Description
Get user's draft for a procedure
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.drafts.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**procedure_id:** `str` — The procedure ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.drafts.delete(...) -> typing.Any
#### � Description
Delete user's draft for a procedure, resetting to the committed version
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**procedure_id:** `str` — The procedure ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.agents.procedures.drafts.update(...) -> ProcedureDraftResponseModel
#### � Description
Create or update user's draft for a procedure
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.procedures.drafts.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", name="name", content="content", type="free_form", ) ```
#### ⚙� Parameters
**agent_id:** `str` — Agent ID to get the procedure draft from
**branch_id:** `str` — Branch ID to get the procedure draft from
**procedure_id:** `str` — The procedure ID
**name:** `str` — Procedure name
**content:** `str` — Procedure content
**type:** `ProcedureType` — Procedure type
**trigger:** `typing.Optional[str]` — When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Agents Widget Avatar
client.conversational_ai.agents.widget.avatar.create(...) -> PostAgentAvatarResponseModel
#### � Description
Sets the avatar for an agent displayed in the widget
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.agents.widget.avatar.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", avatar_file="example_avatar_file", ) ```
#### ⚙� Parameters
**agent_id:** `str` — The id of an agent. This is returned on agent creation.
**avatar_file:** `core.File` — An image file to be used as the agent's avatar.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Analytics LiveCount
client.conversational_ai.analytics.live_count.get(...) -> GetLiveCountResponse
#### � Description
Get the live count of the ongoing conversations.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.analytics.live_count.get( agent_id="agent_id", ) ```
#### ⚙� Parameters
**agent_id:** `typing.Optional[str]` — The id of an agent to restrict the analytics to.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Audio
client.conversational_ai.conversations.audio.get(...) -> typing.Iterator[bytes]
#### � Description
Get the audio recording of a particular conversation
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.audio.get( conversation_id="conversation_id", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — The id of the conversation you're taking the action on.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Feedback
client.conversational_ai.conversations.feedback.create(...) -> typing.Any
#### � Description
Send the feedback for the given conversation
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.feedback.create( conversation_id="21m00Tcm4TlvDq8ikWAM", feedback="like", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — The id of the conversation you're taking the action on.
**feedback:** `typing.Optional[UserFeedbackScore]` — Either 'like' or 'dislike' to indicate the feedback for the conversation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Messages
client.conversational_ai.conversations.messages.text_search(...) -> MessagesSearchResponse
#### � Description
Search through conversation transcript messages by full-text and fuzzy search
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.messages.text_search( text_query="refund policy", agent_id="agent_id", visited_agent_ids=[ "visited_agent_ids" ], visited_agent_branch_ids=[ "visited_agent_branch_ids" ], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=[ "evaluation_params" ], data_collection_params=[ "data_collection_params" ], tool_names=[ "tool_names" ], tool_names_successful=[ "tool_names_successful" ], tool_names_errored=[ "tool_names_errored" ], main_languages=[ "main_languages" ], exclude_statuses=[ "initiated" ], termination_reasons=[ "termination_reasons" ], page_size=1, summary_mode="exclude", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", topic_ids=[ "topic_ids" ], sort_by="search_score", cursor="cursor", ) ```
#### ⚙� Parameters
**text_query:** `str` — The search query text for full-text and fuzzy matching
**agent_id:** `typing.Optional[str]` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**visited_agent_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations where any of these agents participated. Can not exceed 50 values.
**visited_agent_branch_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations where any of these agent branches participated. Can not exceed 50 values.
**call_successful:** `typing.Optional[EvaluationSuccessResult]` — The result of the success evaluation
**call_start_before_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations up to this start date.
**call_start_after_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations after to this start date.
**call_duration_min_secs:** `typing.Optional[int]` — Minimum call duration in seconds.
**call_duration_max_secs:** `typing.Optional[int]` — Maximum call duration in seconds.
**rating_max:** `typing.Optional[int]` — Maximum overall rating (1-5).
**rating_min:** `typing.Optional[int]` — Minimum overall rating (1-5).
**has_feedback_comment:** `typing.Optional[bool]` — Filter conversations with user feedback comments.
**user_id:** `typing.Optional[str]` — Filter conversations by the user ID who initiated them.
**evaluation_params:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success
**data_collection_params:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values.
**tool_names:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names used during the call.
**tool_names_successful:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names that had successful calls.
**tool_names_errored:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by tool names that had errored calls.
**main_languages:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by detected main language (language code).
**exclude_statuses:** `typing.Optional[typing.Union[MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem]]]` — Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views.
**termination_reasons:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several.
**page_size:** `typing.Optional[int]` — Number of results per page. Max 50.
**summary_mode:** `typing.Optional[MessagesTextSearchRequestSummaryMode]` — Whether to include transcript summaries in the response.
**conversation_initiation_source:** `typing.Optional[ConversationInitiationSource]`
**text_only:** `typing.Optional[bool]`
**conversation_product_type:** `typing.Optional[ConversationProduct]` — Restrict results to a single conversation product surface.
**branch_id:** `typing.Optional[str]` — Filter conversations by branch ID.
**version_id:** `typing.Optional[str]` — Filter conversations by version ID.
**topic_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter conversations by topic IDs assigned during topic discovery.
**sort_by:** `typing.Optional[MessageSearchSortBy]` — Sort order for search results. 'search_score' sorts by search score, 'created_at' sorts by conversation start time.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.messages.search(...) -> MessagesSearchResponse
#### � Description
Search conversation transcripts by semantic similarity to surface relevant messages based on meaning and intent, rather than exact keyword matches
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.messages.search( text_query="Customer asking to cancel and get money back", agent_id="agent_id", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**text_query:** `str` — The search query text for semantic similarity matching
**agent_id:** `typing.Optional[str]` — Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource.
**page_size:** `typing.Optional[int]` — Number of results per page. Max 50.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Tags
client.conversational_ai.conversations.tags.assign(...)
#### � Description
Assign one or more conversation tags to a conversation. Tags that are already assigned are ignored. Tags must belong to the same workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.assign( conversation_id="conversation_id", tag_ids=[ "tag_ids" ], ) ```
#### ⚙� Parameters
**conversation_id:** `str`
**tag_ids:** `typing.List[str]` — Tag IDs to add to the conversation. Re-assigning an existing tag is a no-op.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.unassign(...)
#### � Description
Remove a single conversation tag from a conversation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.unassign( conversation_id="conversation_id", tag_id="tag_id", ) ```
#### ⚙� Parameters
**conversation_id:** `str`
**tag_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.list(...) -> GetConversationTagsPageResponseModel
#### � Description
List conversation tags for the workspace, ordered by most recently created first.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.list( page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — How many conversation tags to return. Can not exceed 100.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.create(...) -> ConversationTagResponseModel
#### � Description
Create a new conversation tag for the workspace.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.create( title="title", ) ```
#### ⚙� Parameters
**title:** `str` — Display title of the tag.
**description:** `typing.Optional[str]` — Optional free-text description.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.get(...) -> ConversationTagResponseModel
#### � Description
Get a conversation tag by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.get( tag_id="tag_id", ) ```
#### ⚙� Parameters
**tag_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.delete(...)
#### � Description
Delete a conversation tag. Restricted to the tag owner or a workspace admin.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.delete( tag_id="tag_id", ) ```
#### ⚙� Parameters
**tag_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.tags.update(...) -> ConversationTagResponseModel
#### � Description
Update a conversation tag's title and/or description. Restricted to the tag owner or a workspace admin.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.tags.update( tag_id="tag_id", ) ```
#### ⚙� Parameters
**tag_id:** `str`
**title:** `typing.Optional[str]` — If provided, replaces the tag title. Omit to leave unchanged.
**description:** `typing.Optional[str]` — If provided, replaces the tag description. Omit to leave unchanged.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Files
client.conversational_ai.conversations.files.create(...) -> ConvAiFileUploadResponseModel
#### � Description
Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.files.create( conversation_id="conversation_id", file="example_file", ) ```
#### ⚙� Parameters
**conversation_id:** `str`
**file:** `core.File` — Image or PDF file to upload
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.files.delete(...) -> ConvAiFileUploadResponseModel
#### � Description
Remove a file upload from a conversation. Only possible if the file hasn't already been used in the conversation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.files.delete( conversation_id="conversation_id", file_id="file_id", ) ```
#### ⚙� Parameters
**conversation_id:** `str`
**file_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Topics
client.conversational_ai.conversations.topics.get(...) -> GetAgentTopicsResponseModel
#### � Description
Returns the latest topic discovery run results for a given agent.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.topics.get( agent_id="agent_id", from_unix_secs=1, to_unix_secs=1, ) ```
#### ⚙� Parameters
**agent_id:** `str` — ID of the agent
**from_unix_secs:** `typing.Optional[int]` — Start of the window to view topics for. When set with to_unix_secs, per-day topics in the range are aggregated together.
**to_unix_secs:** `typing.Optional[int]` — End of the window to view topics for.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Conversations Analysis
client.conversational_ai.conversations.analysis.run(...) -> GetConversationResponseModel
#### � Description
Run the analysis for a conversation using the agent's current evaluation criteria and data collection settings.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.analysis.run( conversation_id="conversation_id", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — ID of the conversation
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.conversations.analysis.run_evaluation(...) -> GetConversationResponseModel
#### � Description
Rerun a specific evaluation for a conversation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.conversations.analysis.run_evaluation( conversation_id="conversation_id", evaluation_id="evaluation_id", ) ```
#### ⚙� Parameters
**conversation_id:** `str` — ID of the conversation
**evaluation_id:** `str` — ID of the single evaluation criterion to rerun.
**scope:** `typing.Optional[AnalysisScope]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Dashboard Settings
client.conversational_ai.dashboard.settings.get() -> GetConvAiDashboardSettingsResponseModel
#### � Description
Retrieve Convai dashboard settings for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.dashboard.settings.get() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.dashboard.settings.update(...) -> GetConvAiDashboardSettingsResponseModel
#### � Description
Update Convai dashboard settings for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.dashboard.settings.update() ```
#### ⚙� Parameters
**charts:** `typing.Optional[typing.List[PatchConvAiDashboardSettingsRequestChartsItem]]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase Documents
client.conversational_ai.knowledge_base.documents.create_from_url(...) -> AddKnowledgeBaseResponseModel
#### � Description
Create a knowledge base document generated by scraping the given webpage.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.create_from_url( url="url", ) ```
#### ⚙� Parameters
**url:** `str` — URL to a page of documentation that the agent will have access to in order to interact with users.
**name:** `typing.Optional[str]` — A custom, human-readable name for the document.
**parent_folder_id:** `typing.Optional[str]` — If set, the created document or folder will be placed inside the given folder.
**enable_auto_sync:** `typing.Optional[bool]` — Whether to enable auto-sync for this URL document.
**auto_remove:** `typing.Optional[bool]` — Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.create_from_file(...) -> AddKnowledgeBaseResponseModel
#### � Description
Create a knowledge base document generated form the uploaded file.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.create_from_file( file="example_file", ) ```
#### ⚙� Parameters
**file:** `core.File` — Documentation that the agent will have access to in order to interact with users.
**name:** `typing.Optional[str]` — A custom, human-readable name for the document.
**parent_folder_id:** `typing.Optional[str]` — If set, the created document or folder will be placed inside the given folder.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.create_from_text(...) -> AddKnowledgeBaseResponseModel
#### � Description
Create a knowledge base document containing the provided text.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.create_from_text( text="text", ) ```
#### ⚙� Parameters
**text:** `str` — Text content to be added to the knowledge base.
**name:** `typing.Optional[str]` — A custom, human-readable name for the document.
**parent_folder_id:** `typing.Optional[str]` — If set, the created document or folder will be placed inside the given folder.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.create_folder(...) -> AddKnowledgeBaseResponseModel
#### � Description
Create a folder used for grouping documents together.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.create_folder( name="name", ) ```
#### ⚙� Parameters
**name:** `str` — A custom, human-readable name for the document.
**parent_folder_id:** `typing.Optional[str]` — If set, the created document or folder will be placed inside the given folder.
**enable_auto_sync:** `typing.Optional[bool]` — Whether to enable auto-sync for this URL document.
**auto_remove:** `typing.Optional[bool]` — Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.get(...) -> DocumentsGetResponse
#### � Description
Get details about a specific documentation making up the agent's knowledge base
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.get( documentation_id="21m00Tcm4TlvDq8ikWAM", agent_id="agent_id", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**agent_id:** `typing.Optional[str]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.delete(...) -> typing.Any
#### � Description
Delete a document or folder from the knowledge base.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.delete( documentation_id="21m00Tcm4TlvDq8ikWAM", force=True, ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**force:** `typing.Optional[bool]` — If set to true, the document or folder will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.update(...) -> DocumentsUpdateResponse
#### � Description
Update the name and/or content of a document.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.update( documentation_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**name:** `typing.Optional[str]` — A custom, human-readable name for the document.
**content:** `typing.Optional[str]` — Updated content for the document. Only supported for text documents, URL documents with auto-sync disabled, and file documents.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.get_agents(...) -> GetKnowledgeBaseDependentAgentsResponseModel
#### � Description
Get a list of agents depending on this knowledge base document
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.get_agents( documentation_id="21m00Tcm4TlvDq8ikWAM", dependent_type="direct", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**dependent_type:** `typing.Optional[KnowledgeBaseDependentType]` — Type of dependent agents to return.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.get_bulk_agents(...) -> GetKnowledgeBaseDependentAgentsResponseModel
#### � Description
Get a list of agents depending on any of the given knowledge base documents.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.get_bulk_agents( dependent_type="direct", page_size=1, cursor="cursor", document_ids=[ "21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM" ], ) ```
#### ⚙� Parameters
**document_ids:** `typing.List[str]` — The ids of documents or folders from the knowledge base.
**dependent_type:** `typing.Optional[KnowledgeBaseDependentType]` — Type of dependent agents to return.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.get_content(...) -> str
#### � Description
Get the entire content of a document from the knowledge base
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.get_content( documentation_id="documentation_id", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.get_source_file_url(...) -> KnowledgeBaseSourceFileUrlResponseModel
#### � Description
Get a signed URL to download the original source file of a file-type document from the knowledge base
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.get_source_file_url( documentation_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.move(...)
#### � Description
Moves the entity from one folder to another.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.move( document_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**document_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**move_to:** `typing.Optional[str]` — The folder to move the entities to. If not set, the entities will be moved to the root folder.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.bulk_move(...)
#### � Description
Moves multiple entities from one folder to another.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.bulk_move( document_ids=[ "21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM" ], ) ```
#### ⚙� Parameters
**document_ids:** `typing.List[str]` — The ids of documents or folders from the knowledge base.
**move_to:** `typing.Optional[str]` — The folder to move the entities to. If not set, the entities will be moved to the root folder.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.documents.bulk_delete(...) -> typing.Dict[str, DocumentsBulkDeleteResponseValue]
#### � Description
Delete multiple documents or folders from the knowledge base. Each id succeeds or fails independently.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.bulk_delete( document_ids=[ "21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM" ], ) ```
#### ⚙� Parameters
**document_ids:** `typing.List[str]` — The ids of documents or folders from the knowledge base.
**force:** `typing.Optional[bool]` — If set to true, documents or folders will be deleted regardless of whether they are used by any agents and will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase CrawlJobs
client.conversational_ai.knowledge_base.crawl_jobs.list(...) -> ListCrawlJobsResponseModel
#### � Description
Get a list of ongoing and recent crawl jobs for the user.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.crawl_jobs.list( include_job_ids=[ "include_job_ids" ], page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**include_job_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Ids of additional crawl jobs to retrieve
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.crawl_jobs.create(...) -> CreateCrawlJobResponseModel
#### � Description
Create a crawl job to crawl the given URL with specified depth and page limits.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.crawl_jobs.create( url="url", ) ```
#### ⚙� Parameters
**url:** `str` — URL to a page of documentation that the agent will have access to in order to interact with users.
**max_depth:** `typing.Optional[int]` — Maximum depth for crawling (1-5), defaults to 3.
**max_pages:** `typing.Optional[int]` — Maximum number of pages to crawl (1-10,000), defaults to 1000.
**pattern:** `typing.Optional[str]` — If set, only URLs that match this pattern are included.
**sitemap_urls:** `typing.Optional[typing.List[str]]` — List of URLs to crawl from sitemap (optional, overrides automatic URL discovery).
**parent_folder_id:** `typing.Optional[str]` — If set, the created document or folder will be placed inside the given folder.
**enable_auto_sync:** `typing.Optional[bool]` — Whether to enable auto-sync for this URL document.
**auto_remove:** `typing.Optional[bool]` — Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.crawl_jobs.get(...) -> GetCrawlJobResponseModel
#### � Description
Get details about a specific crawl job including status and progress.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.crawl_jobs.get( crawl_job_id="crawl_job_id", ) ```
#### ⚙� Parameters
**crawl_job_id:** `str` — The id of the crawl job to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.crawl_jobs.cancel(...) -> typing.Any
#### � Description
Cancel a crawl job and delete all associated documents and folders.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.crawl_jobs.cancel( crawl_job_id="crawl_job_id", ) ```
#### ⚙� Parameters
**crawl_job_id:** `str` — The id of the crawl job to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase Document
client.conversational_ai.knowledge_base.document.update_file(...) -> DocumentUpdateFileResponse
#### � Description
Update the source file of a file document. The document name, content, and metadata are updated to reflect the new file. Any manual content edits will be overwritten.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.document.update_file( documentation_id="21m00Tcm4TlvDq8ikWAM", file="example_file", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**file:** `core.File` — Documentation that the agent will have access to in order to interact with users.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.document.refresh(...) -> DocumentRefreshResponse
#### � Description
Manually refresh a URL document by re-fetching its content from the source URL.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.document.refresh( documentation_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.knowledge_base.document.compute_rag_index(...) -> RagDocumentIndexResponseModel
#### � Description
In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.document.compute_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", model="e5_mistral_7b_instruct", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**model:** `EmbeddingModelEnum`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase Documents Summaries
client.conversational_ai.knowledge_base.documents.summaries.get(...) -> typing.Dict[str, SummariesGetResponseValue]
#### � Description
Gets multiple knowledge base document summaries by their IDs.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.summaries.get( document_ids=[ "21m00Tcm4TlvDq8ikWAM", "31n11Udm5UmwEr9jkXBN" ], ) ```
#### ⚙� Parameters
**document_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — The ids of knowledge base documents.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase Documents Chunk
client.conversational_ai.knowledge_base.documents.chunk.get(...) -> KnowledgeBaseDocumentChunkResponseModel
#### � Description
Get details about a specific documentation part used by RAG.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.chunk.get( documentation_id="21m00Tcm4TlvDq8ikWAM", chunk_id="chunk_id", embedding_model="e5_mistral_7b_instruct", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**chunk_id:** `str` — The id of a document RAG chunk from the knowledge base.
**embedding_model:** `typing.Optional[EmbeddingModelEnum]` — The embedding model used to retrieve the chunk.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi KnowledgeBase Documents Chunks
client.conversational_ai.knowledge_base.documents.chunks.list(...) -> KnowledgeBaseDocumentChunksResponseModel
#### � Description
Get all RAG chunks for a specific knowledge base document.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.knowledge_base.documents.chunks.list( documentation_id="21m00Tcm4TlvDq8ikWAM", embedding_model="e5_mistral_7b_instruct", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition.
**embedding_model:** `EmbeddingModelEnum` — The embedding model used to retrieve the chunk.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi McpServers Tools
client.conversational_ai.mcp_servers.tools.list(...) -> ListMcpToolsResponseModel
#### � Description
Retrieve all tools available for a specific MCP server configuration.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tools.list( mcp_server_id="mcp_server_id", environment="environment", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**environment:** `typing.Optional[str]` — Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi McpServers ApprovalPolicy
client.conversational_ai.mcp_servers.approval_policy.update(...) -> McpServerResponseModel
#### � Description
Update the approval policy configuration for an MCP server. DEPRECATED: Use PATCH /mcp-servers/{id} endpoint instead.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.approval_policy.update( mcp_server_id="mcp_server_id", approval_policy="auto_approve_all", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**approval_policy:** `McpApprovalPolicy` — The approval mode to set for the MCP server
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi McpServers ToolApprovals
client.conversational_ai.mcp_servers.tool_approvals.create(...) -> McpServerResponseModel
#### � Description
Add approval for a specific MCP tool when using per-tool approval mode.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_approvals.create( mcp_server_id="mcp_server_id", tool_name="tool_name", tool_description="tool_description", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — The name of the MCP tool
**tool_description:** `str` — The description of the MCP tool
**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input schema of the MCP tool (the schema defined on the MCP server before ElevenLabs does any extra processing)
**approval_policy:** `typing.Optional[McpToolApprovalPolicy]` — The tool-level approval policy
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.tool_approvals.delete(...) -> McpServerResponseModel
#### � Description
Remove approval for a specific MCP tool when using per-tool approval mode.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_approvals.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — Name of the MCP tool to remove approval for.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi McpServers ToolConfigs
client.conversational_ai.mcp_servers.tool_configs.create(...) -> McpServerResponseModel
#### � Description
Create configuration overrides for a specific MCP tool.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_configs.create( mcp_server_id="mcp_server_id", environment="environment", tool_name="tool_name", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — The name of the MCP tool
**environment:** `typing.Optional[str]` — Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production.
**force_pre_tool_speech:** `typing.Optional[bool]` — DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool.
**pre_tool_speech:** `typing.Optional[PreToolSpeechMode]` — If set, overrides the server's pre_tool_speech setting for this tool.
**disable_interruptions:** `typing.Optional[bool]` — DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool.
**interruption_mode:** `typing.Optional[ToolInterruptionMode]` — If set, overrides the server's interruption_mode setting for this tool.
**tool_call_sound:** `typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound]` — Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default).
**tool_call_sound_behavior:** `typing.Optional[ToolCallSoundBehavior]` — If set, overrides the server's tool_call_sound_behavior setting for this tool
**execution_mode:** `typing.Optional[ToolExecutionMode]` — If set, overrides the server's execution_mode setting for this tool
**response_timeout_secs:** `typing.Optional[int]` — If set, overrides the server's response timeout for this MCP tool.
**assignments:** `typing.Optional[typing.List[DynamicVariableAssignment]]` — Dynamic variable assignments for this MCP tool
**input_overrides:** `typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]]]` — Mapping of json path to input override configuration
**response_mocks:** `typing.Optional[typing.List[ToolResponseMockConfigInput]]` — Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.tool_configs.get(...) -> McpToolConfigOverrideOutput
#### � Description
Retrieve configuration overrides for a specific MCP tool.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_configs.get( mcp_server_id="mcp_server_id", tool_name="tool_name", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — Name of the MCP tool to retrieve config overrides for.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.tool_configs.delete(...) -> McpServerResponseModel
#### � Description
Remove configuration overrides for a specific MCP tool.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_configs.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — Name of the MCP tool to remove config overrides for.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.mcp_servers.tool_configs.update(...) -> McpServerResponseModel
#### � Description
Update configuration overrides for a specific MCP tool.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.mcp_servers.tool_configs.update( mcp_server_id="mcp_server_id", tool_name="tool_name", environment="environment", ) ```
#### ⚙� Parameters
**mcp_server_id:** `str` — ID of the MCP Server.
**tool_name:** `str` — Name of the MCP tool to update config overrides for.
**environment:** `typing.Optional[str]` — Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production.
**force_pre_tool_speech:** `typing.Optional[bool]` — DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool.
**pre_tool_speech:** `typing.Optional[PreToolSpeechMode]` — If set, overrides the server's pre_tool_speech setting for this tool.
**disable_interruptions:** `typing.Optional[bool]` — DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool.
**interruption_mode:** `typing.Optional[ToolInterruptionMode]` — If set, overrides the server's interruption_mode setting for this tool.
**tool_call_sound:** `typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound]` — Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default).
**tool_call_sound_behavior:** `typing.Optional[ToolCallSoundBehavior]` — If set, overrides the server's tool_call_sound_behavior setting for this tool
**execution_mode:** `typing.Optional[ToolExecutionMode]` — If set, overrides the server's execution_mode setting for this tool
**response_timeout_secs:** `typing.Optional[int]` — If set, overrides the server's response timeout for this MCP tool.
**assignments:** `typing.Optional[typing.List[DynamicVariableAssignment]]` — Dynamic variable assignments for this MCP tool
**input_overrides:** `typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]]]` — Mapping of json path to input override configuration
**response_mocks:** `typing.Optional[typing.List[ToolResponseMockConfigInput]]` — Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Tests Folders
client.conversational_ai.tests.folders.create(...) -> CreateAgentTestFolderResponseModel
#### � Description
Creates a folder for organizing agent tests.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.folders.create( name="name", ) ```
#### ⚙� Parameters
**name:** `str` — The name of the folder to create
**parent_folder_id:** `typing.Optional[str]` — The ID of the parent folder. If not provided, the folder will be created at the root level.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.folders.get(...) -> GetAgentTestFolderResponseModel
#### � Description
Gets an agent test folder by ID, including its folder path.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.folders.get( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", ) ```
#### ⚙� Parameters
**folder_id:** `str` — The folder ID.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.folders.delete(...)
#### � Description
Deletes an agent test folder by ID. Use force=true to delete a non-empty folder and all its contents.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.folders.delete( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", force=True, ) ```
#### ⚙� Parameters
**folder_id:** `str` — The folder ID.
**force:** `typing.Optional[bool]` — Force delete. Required for deleting non-empty folders.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.folders.update(...) -> GetAgentTestFolderResponseModel
#### � Description
Updates an agent test folder. Currently only supports updating the folder name.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.folders.update( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", name="name", ) ```
#### ⚙� Parameters
**folder_id:** `str` — The folder ID.
**name:** `str` — The new name for the folder
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Tests Invocations
client.conversational_ai.tests.invocations.list(...) -> GetTestInvocationsPageResponseModel
#### � Description
Lists all test invocations with pagination support and optional search filtering.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.invocations.list( agent_id="agent_id", page_size=1, cursor="cursor", ) ```
#### ⚙� Parameters
**agent_id:** `typing.Optional[str]` — Filter by agent ID
**page_size:** `typing.Optional[int]` — How many Tests to return at maximum. Can not exceed 100, defaults to 30.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.invocations.get(...) -> GetTestSuiteInvocationResponseModel
#### � Description
Gets a test invocation by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.invocations.get( test_invocation_id="test_invocation_id", ) ```
#### ⚙� Parameters
**test_invocation_id:** `str` — The id of a test invocation. This is returned when tests are run.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversational_ai.tests.invocations.resubmit(...) -> typing.Any
#### � Description
Resubmits specific test runs from a test invocation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tests.invocations.resubmit( test_invocation_id="test_invocation_id", test_run_ids=[ "test_run_ids" ], agent_id="agent_id", ) ```
#### ⚙� Parameters
**test_invocation_id:** `str` — The id of a test invocation. This is returned when tests are run.
**test_run_ids:** `typing.List[str]` — List of test run IDs to resubmit
**agent_id:** `str` — Agent ID to resubmit tests for
**agent_config_override:** `typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]` — Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.
**branch_id:** `typing.Optional[str]` — ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ConversationalAi Tools Executions
client.conversational_ai.tools.executions.get(...) -> GetToolExecutionsPageResponseModel
#### � Description
Get paginated list of tool executions for a specific tool.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.conversational_ai.tools.executions.get( tool_id="tool_id", cursor="cursor", page_size=1, is_error=True, agent_id="agent_id", branch_id="branch_id", start_time=1.1, end_time=1.1, ) ```
#### ⚙� Parameters
**tool_id:** `str` — ID of the requested tool.
**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
**is_error:** `typing.Optional[bool]` — Filter by error status. If not provided, returns all executions.
**agent_id:** `typing.Optional[str]` — Filter by agent ID.
**branch_id:** `typing.Optional[str]` — Filter by agent branch ID.
**start_time:** `typing.Optional[float]` — Filter executions from this Unix timestamp (inclusive).
**end_time:** `typing.Optional[float]` — Filter executions until this Unix timestamp (inclusive).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Project
client.dubbing.project.list(...) -> DubbingProjectListResponse
#### � Description
List the workspace's dubbing projects (cursor-paginated).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.list( page_size=20, ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Pagination cursor from a previous response's next_cursor.
**page_size:** `typing.Optional[int]` — Number of projects per page (max 100).
**status:** `typing.Optional[str]` — Filter to projects in this status (preparing, ready, failed).
**sort_direction:** `typing.Optional[ProjectListRequestSortDirection]` — Sort by creation time (default 'DESCENDING').
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.create(...) -> DubbingProjectResponse
#### � Description
Create a dubbing project from an uploaded file or a source URL.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.create( file="example_file", transcript="example_transcript", source_url="https://example.com/promo.mp4", reference="Q3 marketing video", source_language="en", ) ```
#### ⚙� Parameters
**file:** `typing.Optional[core.File]` — The source media file to dub. Provide this or source_url.
**source_url:** `typing.Optional[str]` — Public URL to fetch the source media from. Provide this or file.
**reference:** `typing.Optional[str]` — Optional free-form string (max 500 characters) to identify the project on your end.
**source_language:** `typing.Optional[str]` — BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect.
**model_id:** `typing.Optional[ProjectCreateRequestModelId]` — Default dubbing model id ('dubbing_v1' or 'dubbing_v2') for the project's language targets; a target may override it. Omit to use the system default.
**keyterms:** `typing.Optional[typing.List[str]]` — Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\` are not allowed.
**webhook_ids:** `typing.Optional[typing.List[str]]` — Ids of workspace webhooks to notify when this project becomes ready or fails, and when any of its languages completes or fails. At most 3; each must be a webhook configured in your workspace.
**target_language:** `typing.Optional[str]` — Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects.
**transcript:** `typing.Optional[core.File]` — Enterprise only. Optional JSON transcript to use instead of automatic transcription. When provided, source_language is required. Segments may include an optional external_id and an optional translation; if any segment includes a translation, target_language is required and every segment must include one (used to seed the target created via target_language).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.get(...) -> DubbingProjectResponse
#### � Description
Full project detail, including its language target ids.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project to fetch.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.delete(...)
#### � Description
Delete a project and its language targets.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project to delete.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Resource
client.dubbing.resource.get(...) -> DubbingResource
#### � Description
Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.get( dubbing_id="dubbing_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.migrate_segments(...) -> SegmentMigrationResponse
#### � Description
Change the attribution of one or more segments to a different speaker.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.migrate_segments( dubbing_id="dubbing_id", segment_ids=[ "segment_ids" ], speaker_id="speaker_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segment_ids:** `typing.List[str]`
**speaker_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.transcribe(...) -> SegmentTranscriptionResponse
#### � Description
Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.transcribe( dubbing_id="dubbing_id", segments=[ "segments" ], ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segments:** `typing.List[str]` — Transcribe this specific list of segments.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.translate(...) -> SegmentTranslationResponse
#### � Description
Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.translate( dubbing_id="dubbing_id", segments=[ "segments" ], ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segments:** `typing.List[str]` — Translate only this list of segments.
**languages:** `typing.Optional[typing.List[str]]` — Translate only these languages for each segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.dub(...) -> SegmentDubResponse
#### � 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 from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.dub( dubbing_id="dubbing_id", segments=[ "segments" ], ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segments:** `typing.List[str]` — Dub only this list of segments.
**languages:** `typing.Optional[typing.List[str]]` — Dub only these languages for each segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.render(...) -> DubbingRenderResponseModel
#### � Description
Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.render( dubbing_id="dubbing_id", language="language", render_type="mp4", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**language:** `str` — The target language code to render, eg. 'es'. To render the source track use 'original'.
**render_type:** `RenderType` — The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip']
**normalize_volume:** `typing.Optional[bool]` — Whether to normalize the volume of the rendered audio.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Audio
client.dubbing.audio.get(...) -> typing.Iterator[bytes]
#### � Description
Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.audio.get( dubbing_id="dubbing_id", language_code="language_code", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**language_code:** `str` — ID of the language.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Transcript
client.dubbing.transcript.get_transcript_for_dub(...) -> TranscriptGetTranscriptForDubResponse
#### � Description
Returns transcript for the dub as an SRT or WEBVTT file.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.transcript.get_transcript_for_dub( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**language_code:** `str` — ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media.
**format_type:** `typing.Optional[TranscriptGetTranscriptForDubRequestFormatType]` — Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Transcripts
client.dubbing.transcripts.get(...) -> DubbingTranscriptsResponseModel
#### � Description
Fetch the transcript for one of the languages in a dub.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.transcripts.get( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**language_code:** `str` — ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media.
**format_type:** `TranscriptsGetRequestFormatType` — Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Project Language
client.dubbing.project.language.list(...) -> DubbingLanguageListResponse
#### � Description
List a project's language targets (cursor-paginated).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.list( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", page_size=20, ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the parent dubbing project.
**cursor:** `typing.Optional[str]` — Pagination cursor from a previous response's next_cursor.
**page_size:** `typing.Optional[int]` — Number of language targets per page (max 100).
**status:** `typing.Optional[str]` — Filter to targets in this status (queued, processing, completed, stale, failed).
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.create(...) -> DubbingLanguageResponse
#### � Description
Queue a language target for a project (starts once the project is ready).
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.create( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", target_language="es", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the parent dubbing project.
**target_language:** `str` — BCP-47 language tag to dub the project into (e.g. 'fr', 'es-MX'); must be a language the dubbing model supports. A region-qualified tag must be one of the supported dialects.
**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings applied to the whole language (e.g. cloning strength).
**translations:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Enterprise only. Optional translations to use instead of machine translation. A map from each source segment's external_id (or its id, if you supplied none) to the translated text; every source segment must be covered exactly once. At most 20000 entries, totalling at most 4 MiB of text.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.get(...) -> DubbingLanguageResponse
#### � Description
Full language-target detail.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the parent dubbing project.
**language_id:** `str` — Identifier of the language target to fetch.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.delete(...)
#### � Description
Delete a language target.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the parent dubbing project.
**language_id:** `str` — Identifier of the language target to delete.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Project Transcript
client.dubbing.project.transcript.get(...) -> DubbingSourceTranscriptResponse
#### � Description
The project's source transcript, as editable segments.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.transcript.delete_segment(...) -> DubbingTranscriptRevisionResponse
#### � Description
Enterprise only. Remove a source segment from the transcript.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.transcript.delete_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**segment_id:** `str` — Identifier of the segment to remove.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.transcript.update_segment(...) -> DubbingSourceSegmentUpdateResponse
#### � Description
Enterprise only. Edit a source segment's text, speaker, or timing.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DubbingSegmentUpdateRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**segment_id:** `str` — Identifier of the segment to edit.
**request:** `DubbingSegmentUpdateRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.transcript.update_segments(...) -> DubbingBulkSourceSegmentUpdateResponse
#### � Description
Enterprise only. Edit several source segments' text, speaker, or timing in one atomic request.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DubbingSegmentUpdateRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingSegmentUpdateRequest( speaker_id="narrator", ) }, ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**segments:** `typing.Dict[str, DubbingSegmentUpdateRequest]` — Map of segment id to the partial update to apply to that segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.transcript.create_segment(...) -> DubbingSourceSegmentUpdateResponse
#### � Description
Enterprise only. Add a new source segment to the transcript.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.transcript.create_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", text="Thanks for watching.", speaker_id="default_speaker", start_s=42, end_s=44, ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**text:** `str` — The text of the new segment.
**speaker_id:** `str` — Identifier of the segment's speaker.
**start_s:** `float` — Start time of the segment, in seconds.
**end_s:** `float` — End time of the segment, in seconds.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Project Language Transcript
client.dubbing.project.language.transcript.get(...) -> DubbingTargetTranscriptResponse
#### � Description
A language target's transcript: source segments with their translations.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**language_id:** `str` — Identifier of the language target.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.transcript.update_segment(...) -> DubbingTargetSegmentUpdateResponse
#### � Description
Enterprise only. Edit a segment's translation for a language target.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DubbingTargetSegmentUpdateRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**language_id:** `str` — Identifier of the language target.
**segment_id:** `str` — Identifier of the segment to edit.
**request:** `DubbingTargetSegmentUpdateRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.transcript.update_segments(...) -> DubbingBulkTargetSegmentUpdateResponse
#### � Description
Enterprise only. Edit several segments' translations for a language target in one atomic request.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, DubbingTargetSegmentUpdateRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingTargetSegmentUpdateRequest( translation="Empecemos.", ) }, ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**language_id:** `str` — Identifier of the language target.
**segments:** `typing.Dict[str, DubbingTargetSegmentUpdateRequest]` — Map of segment id to the translation edit to apply to that segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.project.language.transcript.regenerate(...) -> DubbingRegenerateResponse
#### � Description
Enterprise only. Re-dub a target from its edited transcript, re-synthesizing only the edited regions (charged like a generation). Conflicts when the target has no edits to apply -- nothing is dispatched and nothing is charged.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.project.language.transcript.regenerate( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) ```
#### ⚙� Parameters
**project_id:** `str` — Identifier of the dubbing project.
**language_id:** `str` — Identifier of the language target.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Resource Language
client.dubbing.resource.language.add(...) -> LanguageAddedResponse
#### � Description
Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.language.add( dubbing_id="dubbing_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**language:** `typing.Optional[str]` — The Target language.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Resource Segment
client.dubbing.resource.segment.update(...) -> SegmentUpdateResponse
#### � Description
Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.segment.update( dubbing_id="dubbing_id", segment_id="segment_id", language="language", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segment_id:** `str` — ID of the segment
**language:** `str` — ID of the language.
**start_time:** `typing.Optional[float]`
**end_time:** `typing.Optional[float]`
**text:** `typing.Optional[str]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.segment.delete(...) -> SegmentDeleteResponse
#### � Description
Deletes a single segment from the dubbing.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.segment.delete( dubbing_id="dubbing_id", segment_id="segment_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**segment_id:** `str` — ID of the segment
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Resource Speaker
client.dubbing.resource.speaker.update(...) -> SpeakerUpdatedResponse
#### � Description
Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.speaker.update( dubbing_id="dubbing_id", speaker_id="speaker_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**speaker_id:** `str` — ID of the speaker.
**speaker_name:** `typing.Optional[str]` — Name to attribute to this speaker.
**voice_id:** `typing.Optional[str]` — Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].
**voice_stability:** `typing.Optional[float]` — For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].
**voice_similarity:** `typing.Optional[float]` — For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].
**voice_style:** `typing.Optional[float]` — For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].
**languages:** `typing.Optional[typing.List[str]]` — Languages to apply these changes to. If empty, will apply to all languages.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.speaker.create(...) -> SpeakerCreatedResponse
#### � Description
Creates a new speaker in a dubbing resource. The speaker is added to every available language and can optionally be associated with an ElevenLabs voice and voice settings.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.speaker.create( dubbing_id="dubbing_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**speaker_name:** `typing.Optional[str]` — Name to attribute to this speaker.
**voice_id:** `typing.Optional[str]` — Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].
**voice_stability:** `typing.Optional[float]` — For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0].
**voice_similarity:** `typing.Optional[float]` — For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0].
**voice_style:** `typing.Optional[float]` — For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0].
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.dubbing.resource.speaker.find_similar_voices(...) -> SimilarVoicesForSpeakerResponse
#### � Description
Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.speaker.find_similar_voices( dubbing_id="dubbing_id", speaker_id="speaker_id", ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**speaker_id:** `str` — ID of the speaker.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Dubbing Resource Speaker Segment
client.dubbing.resource.speaker.segment.create(...) -> SegmentCreateResponse
#### � Description
Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.dubbing.resource.speaker.segment.create( dubbing_id="dubbing_id", speaker_id="speaker_id", start_time=1.1, end_time=1.1, ) ```
#### ⚙� Parameters
**dubbing_id:** `str` — ID of the dubbing project.
**speaker_id:** `str` — ID of the speaker.
**start_time:** `float`
**end_time:** `float`
**text:** `typing.Optional[str]`
**translations:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Music CompositionPlan
client.music.composition_plan.create(...) -> CompositionPlanCreateResponse
#### � Description
Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.composition_plan.create( prompt="prompt", ) ```
#### ⚙� Parameters
**prompt:** `str` — A simple text prompt to compose a plan from.
**music_length_ms:** `typing.Optional[int]` — The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
**source_composition_plan:** `typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan]` — An optional composition plan to use as a source for the new composition plan.
**model_id:** `typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId]` — The model to use for the generation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Music Finetunes
client.music.finetunes.list(...) -> MusicFinetunePageResponseModel
#### � Description
List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.finetunes.list( cursor="cursor", page_size=1, visibility="private", created_by="self", sort="created_at", sort_direction="asc", ) ```
#### ⚙� Parameters
**cursor:** `typing.Optional[str]` — Used for fetching the next page. Cursor is returned in the response.
**page_size:** `typing.Optional[int]` — How many finetunes to return. Max 100, default 50.
**visibility:** `typing.Optional[FinetuneVisibility]` — Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes.
**created_by:** `typing.Optional[FinetuneCreatedBy]` — Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators.
**sort:** `typing.Optional[FinetunesListRequestSort]` — Sort by field (created_at or name)
**sort_direction:** `typing.Optional[FinetunesListRequestSortDirection]` — Sort direction (asc or desc)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.finetunes.create(...) -> MusicFinetuneResponseModel
#### � Description
Create a new music finetune
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.finetunes.create( files=["example_files"], name="name", primary_genre="primary_genre", ) ```
#### ⚙� Parameters
**name:** `str` — Name for the finetune (5-200 characters).
**primary_genre:** `str` — Primary musical genre of the finetune.
**files:** `typing.Optional[typing.List[core.File]]` — Audio files to train on.
**tags:** `typing.Optional[typing.List[str]]` — Tags to associate with the finetune.
**visibility:** `typing.Optional[FinetunesCreateRequestVisibility]` — Finetune visibility. Only 'private' and 'workspace' can be set.
**model_id:** `typing.Optional[FinetunesCreateRequestModelId]` — The model to create a finetune for.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.finetunes.get(...) -> MusicFinetuneResponseModel
#### � Description
Get a music finetune.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.finetunes.get( finetune_id="finetune_id", ) ```
#### ⚙� Parameters
**finetune_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.finetunes.delete(...) -> MusicFinetuneResponseModel
#### � Description
Delete a music finetune
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.finetunes.delete( finetune_id="finetune_id", ) ```
#### ⚙� Parameters
**finetune_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.music.finetunes.update(...) -> MusicFinetuneResponseModel
#### � Description
Update a music finetune.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.music.finetunes.update( finetune_id="finetune_id", ) ```
#### ⚙� Parameters
**finetune_id:** `str`
**name:** `typing.Optional[str]` — Updated name for the finetune.
**tags:** `typing.Optional[typing.List[str]]` — Replacement set of tags.
**primary_genre:** `typing.Optional[str]` — Updated primary musical genre.
**visibility:** `typing.Optional[UpdateMusicFinetuneRequestModelVisibility]` — Finetune visibility. Only 'private' and 'workspace' can be set.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Productions Orders
client.productions.orders.list(...) -> ListOrdersResponse
#### � Description
Lists Productions orders in the workspace. Supports filtering by status and date range, with pagination.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment import datetime client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.list( page_size=1, offset=1, status=[ "open" ], start_date=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), end_date=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), ) ```
#### ⚙� Parameters
**page_size:** `typing.Optional[int]` — Maximum number of orders to return per page.
**offset:** `typing.Optional[int]` — Number of orders to skip for pagination.
**status:** `typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]]` — Filter orders by one or more statuses.
**start_date:** `typing.Optional[datetime.datetime]` — Filter orders created on or after this date.
**end_date:** `typing.Optional[datetime.datetime]` — Filter orders created on or before this date.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.create(...) -> CreateOrderResponse
#### � Description
Creates a new Productions order in the workspace. The order starts in the open state and can be configured with items before submission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, CreateOrderRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.create( request=CreateOrderRequest( sandbox=False, ), ) ```
#### ⚙� Parameters
**request:** `typing.Optional[CreateOrderRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.get(...) -> OrderResponse
#### � Description
Retrieves full details for a Productions order. Quote and pricing information may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until it is ready.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.get( order_id="order_id", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.update(...) -> UpdateOrderResponse
#### � Description
Updates an open order.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, UpdateOrderRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.update( order_id="order_id", request=UpdateOrderRequest( name="Spanish Dubs", ), ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**request:** `UpdateOrderRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.submit(...) -> SubmitOrderResponse
#### � Description
Submits an open order for processing. The order must have at least one item. Once submitted, items can no longer be modified. Upon submission, the workspace will be charged for the order. The quote is based on information extracted from the uploaded media, such as its duration. The quote may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until the quote is ready.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.submit( order_id="order_id", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Productions Orders Media
client.productions.orders.media.register(...) -> RegisterMediaResponse
#### � Description
Registers a media file with an order, either by uploading it directly or by providing a URL to fetch it from. Exactly one of `media` or `media_url` must be provided. The registered media can then be referenced when adding order items.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.media.register( order_id="order_id", media="example_media", declared_language="declared_language", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order to which this media will be attached.
**declared_language:** `str` — The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind.
**media:** `typing.Optional[core.File]` — The media file to upload. Mutually exclusive with media_url.
**media_url:** `typing.Optional[str]` — A URL to fetch the media file from. Mutually exclusive with media.
**media_url_filename:** `typing.Optional[str]` — The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url.
**media_url_content_type:** `typing.Optional[str]` — The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.media.get(...) -> OrderMediaResponse
#### � Description
Retrieves metadata and a time-limited download URL for a previously uploaded media file.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.media.get( order_id="order_id", media_id="media_id", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**media_id:** `MediaId` — The ID of the media file.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Productions Orders Items
client.productions.orders.items.upsert(...) -> UpsertOrderItemResponse
#### � Description
Adds or updates an order item on an open order. Returns the item ID and the quoted price.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, UpsertOrderItemRequest from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.items.upsert( order_id="order_id", request=UpsertOrderItemRequest( item={ "kind": "dub", "media_id": "prodmedia_01jgatk6h0fwxrtbjade61yqhx", "source_language": "en", "destination_languages": [ "hi", "fr-FR", "de" ], "include_captions": True, "include_source_captions": False, "instructions": "Voices don\'t need to match the originals, prioritize native-sounding voices", "captions_sdh": False }, ), ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**request:** `UpsertOrderItemRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.productions.orders.items.remove(...) -> RemoveOrderItemResponse
#### � Description
Removes an order item from an open order.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.items.remove( order_id="order_id", item_id="item_id", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**item_id:** `ItemId` — The ID of the order item.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Productions Orders Deliverables
client.productions.orders.deliverables.list(...) -> OrderDeliverablesResponse
#### � Description
Retrieves the delivered files for a completed order. Returns an empty list if the order is not yet completed.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.deliverables.list( order_id="order_id", ) ```
#### ⚙� Parameters
**order_id:** `OrderId` — The ID of the order.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Productions Orders Languages
client.productions.orders.languages.list(...) -> LanguagesResponse
#### � Description
Returns the available languages for a given order item kind.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.productions.orders.languages.list( order_item_kind="dub", ) ```
#### ⚙� Parameters
**order_item_kind:** `OrderItemKind` — The kind of order item.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## PronunciationDictionaries Rules
client.pronunciation_dictionaries.rules.set(...) -> PronunciationDictionaryRulesResponseModel
#### � Description
Replaces all existing rules on the pronunciation dictionary with the provided ones.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.rules.set( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ { "type": "alias", "string_to_replace": "Thailand", "case_sensitive": True, "word_boundaries": True, "alias": "tie-land" } ], ) ```
#### ⚙� Parameters
**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary
**rules:** `typing.List[BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem]` List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.rules.add(...) -> PronunciationDictionaryRulesResponseModel
#### � Description
Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.rules.add( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ { "type": "alias", "string_to_replace": "Thailand", "case_sensitive": True, "word_boundaries": True, "alias": "tie-land" } ], ) ```
#### ⚙� Parameters
**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary
**rules:** `typing.List[PronunciationDictionaryRule]` List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.pronunciation_dictionaries.rules.remove(...) -> PronunciationDictionaryRulesResponseModel
#### � Description
Remove rules from the pronunciation dictionary
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.pronunciation_dictionaries.rules.remove( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rule_strings=[ "rule_strings" ], ) ```
#### ⚙� Parameters
**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary
**rule_strings:** `typing.List[str]` — List of strings to remove from the pronunciation dictionary.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## ServiceAccounts ApiKeys
client.service_accounts.api_keys.list(...) -> WorkspaceApiKeyListResponseModel
#### � Description
Get all API keys for a service account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.api_keys.list( service_account_user_id="service_account_user_id", ) ```
#### ⚙� Parameters
**service_account_user_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.service_accounts.api_keys.create(...) -> WorkspaceCreateApiKeyResponseModel
#### � Description
Create a new API key for a service account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.api_keys.create( service_account_user_id="service_account_user_id", name="name", permissions="all", ) ```
#### ⚙� Parameters
**service_account_user_id:** `str`
**name:** `str`
**permissions:** `BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions` — The permissions of the XI API.
**character_limit:** `typing.Optional[int]` — The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.
**allowed_ips:** `typing.Optional[typing.List[str]]` — List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it.
**third_party_disable_allowed:** `typing.Optional[bool]` — Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.service_accounts.api_keys.delete(...) -> typing.Any
#### � Description
Delete an existing API key for a service account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.api_keys.delete( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) ```
#### ⚙� Parameters
**service_account_user_id:** `str`
**api_key_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.service_accounts.api_keys.update(...) -> typing.Any
#### � Description
Update an existing API key for a service account
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.service_accounts.api_keys.update( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) ```
#### ⚙� Parameters
**service_account_user_id:** `str`
**api_key_id:** `str`
**is_enabled:** `typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled]` — Whether to enable or disable the API key.
**name:** `typing.Optional[str]` — The name of the XI API key to use (used for identification purposes only).
**permissions:** `typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions]` — The permissions of the XI API.
**character_limit:** `typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit]` — The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.
**allowed_ips:** `typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps]` — List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it.
**third_party_disable_allowed:** `typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed]` — Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## SpeechToText Transcripts
client.speech_to_text.transcripts.get(...) -> TranscriptsGetResponse
#### � Description
Retrieve a previously generated transcript by its ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_to_text.transcripts.get( transcription_id="transcription_id", ) ```
#### ⚙� Parameters
**transcription_id:** `str` — The unique ID of the transcript to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.speech_to_text.transcripts.delete(...) -> typing.Any
#### � Description
Delete a previously generated transcript by its ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.speech_to_text.transcripts.delete( transcription_id="transcription_id", ) ```
#### ⚙� Parameters
**transcription_id:** `str` — The unique ID of the transcript to delete
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects
client.studio.projects.list() -> GetProjectsResponse
#### � Description
Returns a list of your Studio projects with metadata.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.create(...) -> AddProjectResponseModel
#### � Description
Creates a new Studio project, it can be either initialized as blank, from a document or from a URL.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.create( from_document="example_from_document", name="name", ) ```
#### ⚙� Parameters
**name:** `str` — The name of the Studio project, used for identification only.
**default_title_voice_id:** `typing.Optional[str]` — The voice_id that corresponds to the default voice used for new titles.
**default_paragraph_voice_id:** `typing.Optional[str]` — The voice_id that corresponds to the default voice used for new paragraphs.
**default_model_id:** `typing.Optional[str]` — The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models.
**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
**from_document:** `typing.Optional[core.File]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
**from_content_json:** `typing.Optional[str]` An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}]
**quality_preset:** `typing.Optional[QualityPresetType]` Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format.
**title:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.
**author:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.
**description:** `typing.Optional[str]` — An optional description of the Studio project.
**genres:** `typing.Optional[typing.List[str]]` — An optional list of genres associated with the Studio project.
**target_audience:** `typing.Optional[ProjectsCreateRequestTargetAudience]` — An optional target audience of the Studio project.
**language:** `typing.Optional[str]` — An optional language of the Studio project. Two-letter language code (ISO 639-1).
**content_type:** `typing.Optional[str]` — An optional content type of the Studio project.
**original_publication_date:** `typing.Optional[str]` — An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY.
**mature_content:** `typing.Optional[bool]` — An optional specification of whether this Studio project contains mature content.
**isbn_number:** `typing.Optional[str]` — An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.
**acx_volume_normalization:** `typing.Optional[bool]` — [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements
**volume_normalization:** `typing.Optional[bool]` — When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements
**pronunciation_dictionary_locators:** `typing.Optional[typing.List[str]]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'.
**callback_url:** `typing.Optional[str]` A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } }
**fiction:** `typing.Optional[ProjectsCreateRequestFiction]` — An optional specification of whether the content of this Studio project is fiction.
**apply_text_normalization:** `typing.Optional[ProjectsCreateRequestApplyTextNormalization]` This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not.
**auto_assign_voices:** `typing.Optional[bool]` — [Alpha Feature] Whether automatically assign voices to phrases in the create Project.
**source_type:** `typing.Optional[ProjectsCreateRequestSourceType]` — The type of Studio project to create.
**voice_settings:** `typing.Optional[typing.List[str]]` Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\"voice_id\": \"21m00Tcm4TlvDq8ikWAM\", \"stability\": 0.7, \"similarity_boost\": 0.8, \"style\": 0.5, \"speed\": 1.0, \"use_speaker_boost\": true}"]
**create_publishing_read:** `typing.Optional[bool]` — If true, creates a corresponding read for direct publishing in draft state
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.get(...) -> ProjectExtendedResponse
#### � Description
Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.get( project_id="21m00Tcm4TlvDq8ikWAM", share_id="share_id", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**share_id:** `typing.Optional[str]` — The share ID of the project
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.update(...) -> EditProjectResponseModel
#### � Description
Updates the specified Studio project by setting the values of the parameters passed.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.update( project_id="21m00Tcm4TlvDq8ikWAM", name="Project 1", default_title_voice_id="21m00Tcm4TlvDq8ikWAM", default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**name:** `str` — The name of the Studio project, used for identification only.
**default_title_voice_id:** `str` — The voice_id that corresponds to the default voice used for new titles.
**default_paragraph_voice_id:** `str` — The voice_id that corresponds to the default voice used for new paragraphs.
**title:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.
**author:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download.
**isbn_number:** `typing.Optional[str]` — An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download.
**volume_normalization:** `typing.Optional[bool]` — When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.delete(...) -> DeleteProjectResponseModel
#### � Description
Deletes a Studio project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.delete( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.convert(...) -> ConvertProjectResponseModel
#### � Description
Starts conversion of a Studio project and all of its chapters.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.convert( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.get_muted_tracks(...) -> ProjectMutedTracksResponseModel
#### � Description
Returns a list of chapter IDs that have muted tracks in a project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.get_muted_tracks( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects PronunciationDictionaries
client.studio.projects.pronunciation_dictionaries.create(...) -> CreatePronunciationDictionaryResponseModel
#### � Description
Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, PronunciationDictionaryVersionLocator from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.pronunciation_dictionaries.create( project_id="21m00Tcm4TlvDq8ikWAM", pronunciation_dictionary_locators=[ PronunciationDictionaryVersionLocator( pronunciation_dictionary_id="pronunciation_dictionary_id", ) ], ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**pronunciation_dictionary_locators:** `typing.List[PronunciationDictionaryVersionLocator]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'.
**invalidate_affected_text:** `typing.Optional[bool]` — This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects Content
client.studio.projects.content.update(...) -> EditProjectResponseModel
#### � Description
Updates Studio project content.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.content.update( project_id="21m00Tcm4TlvDq8ikWAM", from_document="example_from_document", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
**from_document:** `typing.Optional[core.File]` — An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
**from_content_json:** `typing.Optional[str]` An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}]
**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects Snapshots
client.studio.projects.snapshots.list(...) -> ProjectSnapshotsResponse
#### � Description
Retrieves a list of snapshots for a Studio project.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.snapshots.get(...) -> ProjectSnapshotExtendedResponseModel
#### � Description
Returns the project snapshot.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", project_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**project_snapshot_id:** `str` — The ID of the Studio project snapshot.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.snapshots.stream(...) -> typing.Iterator[bytes]
#### � Description
Stream the audio from a Studio project snapshot.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.snapshots.stream( project_id="project_id", project_snapshot_id="project_snapshot_id", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**project_snapshot_id:** `str` — The ID of the Studio project snapshot.
**convert_to_mpeg:** `typing.Optional[bool]` — Whether to convert the audio to mpeg format.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.snapshots.stream_archive(...) -> typing.Iterator[bytes]
#### � Description
Returns a compressed archive of the Studio project's audio.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.snapshots.stream_archive( project_id="project_id", project_snapshot_id="project_snapshot_id", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**project_snapshot_id:** `str` — The ID of the Studio project snapshot.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects Chapters
client.studio.projects.chapters.list(...) -> GetChaptersResponse
#### � Description
Returns a list of a Studio project's chapters.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.list( project_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.create(...) -> AddChapterResponseModel
#### � Description
Creates a new chapter either as blank or from a URL.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.create( project_id="21m00Tcm4TlvDq8ikWAM", name="Chapter 1", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**name:** `str` — The name of the chapter, used for identification only.
**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.get(...) -> ChapterWithContentResponseModel
#### � Description
Returns information about a specific chapter.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.update(...) -> EditChapterResponseModel
#### � Description
Updates a chapter.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.update( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**name:** `typing.Optional[str]` — The name of the chapter, used for identification only.
**content:** `typing.Optional[ChapterContentInputModel]` — The chapter content to use.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.delete(...) -> DeleteChapterResponseModel
#### � Description
Deletes a chapter.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.delete( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.convert(...) -> ConvertChapterResponseModel
#### � Description
Starts conversion of a specific chapter.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.convert( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Studio Projects Chapters Snapshots
client.studio.projects.chapters.snapshots.list(...) -> ChapterSnapshotsResponse
#### � Description
Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.snapshots.get(...) -> ChapterSnapshotExtendedResponseModel
#### � Description
Returns the chapter snapshot.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the Studio project.
**chapter_id:** `str` — The ID of the chapter.
**chapter_snapshot_id:** `str` — The ID of the chapter snapshot.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.studio.projects.chapters.snapshots.stream(...) -> typing.Iterator[bytes]
#### � Description
Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.studio.projects.chapters.snapshots.stream( project_id="project_id", chapter_id="chapter_id", chapter_snapshot_id="chapter_snapshot_id", ) ```
#### ⚙� Parameters
**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.
**chapter_snapshot_id:** `str` — The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots.
**convert_to_mpeg:** `typing.Optional[bool]` — Whether to convert the audio to mpeg format.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## TextToVoice Preview
client.text_to_voice.preview.stream(...) -> typing.Iterator[bytes]
#### � Description
Stream a voice preview that was created via the /v1/text-to-voice/design endpoint.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.text_to_voice.preview.stream( generated_voice_id="generated_voice_id", ) ```
#### ⚙� Parameters
**generated_voice_id:** `str` — The generated_voice_id to stream.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Tokens SingleUse
client.tokens.single_use.create(...) -> SingleUseTokenResponseModel
#### � Description
Generate a time limited single-use token with embedded authentication for frontend clients.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.tokens.single_use.create( token_type="realtime_scribe", ) ```
#### ⚙� Parameters
**token_type:** `SingleUseTokenType`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## User Subscription
client.user.subscription.get() -> Subscription
#### � Description
Gets extended information about the users subscription
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.user.subscription.get() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Settings
client.voices.settings.get_default() -> VoiceSettings
#### � Description
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.settings.get_default() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.settings.get(...) -> VoiceSettings
#### � Description
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.settings.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.settings.update(...) -> EditVoiceSettingsResponseModel
#### � Description
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs, VoiceSettings from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.settings.update( voice_id="21m00Tcm4TlvDq8ikWAM", request=VoiceSettings( stability=1, use_speaker_boost=True, similarity_boost=1, style=0, speed=1, ), ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**request:** `VoiceSettings` — The settings for a specific voice.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Accents
client.voices.accents.get(...) -> GetVoiceAccentsResponseModel
#### � Description
Gets the list of available accents in the shared voice library.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.accents.get( language="language", model_id="model_id", ) ```
#### ⚙� Parameters
**language:** `typing.Optional[str]` — If provided, only accents for this language code are returned.
**model_id:** `typing.Optional[str]` — If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Ivc
client.voices.ivc.create(...) -> AddVoiceIvcResponseModel
#### � Description
Create a voice clone and add it to your Voices
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.ivc.create( files=["example_files"], name="name", ) ```
#### ⚙� Parameters
**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website.
**files:** `typing.List[core.File]` — A list of file paths to audio recordings intended for voice cloning.
**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
**description:** `typing.Optional[str]` — A description of the voice.
**labels:** `typing.Optional[AddVoiceRequestLabels]` — Labels for the voice. Keys can be language, accent, gender, or age.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Pvc
client.voices.pvc.create(...) -> AddVoiceResponseModel
#### � Description
Creates a new PVC voice with metadata but no samples
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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]]]` — Labels for the voice. Keys can be language, accent, gender, or age.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.pvc.update(...) -> AddVoiceResponseModel
#### � Description
Edit PVC voice metadata
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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]]]` — Labels for the voice. Keys can be language, accent, gender, or age.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.pvc.train(...) -> StartPvcVoiceTrainingResponseModel
#### � Description
Start PVC training process for a voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> typing.List[VoiceSample]
#### � Description
Add audio samples to a PVC voice
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.pvc.samples.create( voice_id="21m00Tcm4TlvDq8ikWAM", files=["example_files"], ) ```
#### ⚙� 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]` — Audio files used to create the voice.
**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(...) -> AddVoiceResponseModel
#### � Description
Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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.List[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
**file_name:** `typing.Optional[str]` — The name of the audio file to be used for PVC training.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.voices.pvc.samples.delete(...) -> DeleteVoiceSampleResponseModel
#### � Description
Delete a sample from a PVC voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> RequestPvcManualVerificationResponseModel
#### � Description
Request manual verification for a PVC voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.pvc.verification.request( voice_id="21m00Tcm4TlvDq8ikWAM", files=["example_files"], ) ```
#### ⚙� 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]` — Verification documents
**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(...) -> VoiceSamplePreviewResponseModel
#### � Description
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.pvc.samples.audio.get( voice_id="21m00Tcm4TlvDq8ikWAM", sample_id="VW7YKqPnjY4h39yTbx2L", remove_background_noise=True, ) ```
#### ⚙� 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.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Pvc Samples Waveform
client.voices.pvc.samples.waveform.get(...) -> VoiceSampleVisualWaveformResponseModel
#### � Description
Retrieve the visual waveform of a voice sample.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> SpeakerSeparationResponseModel
#### � Description
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> StartSpeakerSeparationResponseModel
#### � Description
Start speaker separation process for a sample
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> SpeakerAudioResponseModel
#### � Description
Retrieve the separated audio for a specific speaker.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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 from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) 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(...) -> VerifyPvcVoiceCaptchaResponseModel
#### � Description
Submit captcha verification for PVC voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.pvc.verification.captcha.verify( voice_id="21m00Tcm4TlvDq8ikWAM", recording="example_recording", ) ```
#### ⚙� 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` — Audio recording of the user
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Voices Samples Audio
client.voices.samples.audio.get(...) -> typing.Iterator[bytes]
#### � Description
Returns the audio corresponding to a sample attached to a voice.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.voices.samples.audio.get( voice_id="voice_id", sample_id="sample_id", ) ```
#### ⚙� Parameters
**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
**sample_id:** `str` — ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace AuditLogs
client.workspace.audit_logs.list(...) -> WorkspaceAuditLogsPageResponse
#### � Description
Returns the audit log for the workspace. Requires enterprise tier and the audit_log_read permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.audit_logs.list( limit=1, cursor="cursor", time_from_unix_ms=1, time_to_unix_ms=1, actor_uid="actor_uid", class_name="class_name", activity_name="activity_name", ) ```
#### ⚙� Parameters
**limit:** `typing.Optional[int]` — Maximum number of entries per page
**cursor:** `typing.Optional[str]` — Cursor for the next page (from previous response)
**time_from_unix_ms:** `typing.Optional[int]` — Only include entries at or after this time (ms since epoch)
**time_to_unix_ms:** `typing.Optional[int]` — Only include entries at or before this time (ms since epoch)
**actor_uid:** `typing.Optional[str]` — Filter by actor user ID
**class_name:** `typing.Optional[str]` — Filter by OCSF event class name (e.g. Account Change)
**activity_name:** `typing.Optional[str]` — Filter by audit activity name (e.g. Subscription Creation)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace AuthConnections
client.workspace.auth_connections.list() -> ListAuthConnectionsResponse
#### � Description
Get all auth connections for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.auth_connections.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.auth_connections.create(...) -> AuthConnectionsCreateResponse
#### � Description
Create a new OAuth2 auth connection for the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.auth_connections.create( request={ "auth_type": "oauth2_client_credentials", "name": "name", "provider": "provider", "client_id": "client_id", "token_url": "token_url", "client_secret": "client_secret" }, ) ```
#### ⚙� Parameters
**request:** `AuthConnectionsCreateRequestBody` — Auth connection to create
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.auth_connections.delete(...) -> typing.Any
#### � Description
Delete an auth connection
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.auth_connections.delete( auth_connection_id="auth_connection_id", ) ```
#### ⚙� Parameters
**auth_connection_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.auth_connections.update(...) -> AuthConnectionsUpdateResponse
#### � Description
Update an auth connection
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.auth_connections.update( auth_connection_id="auth_connection_id", request={ "auth_type": "oauth2_client_credentials" }, ) ```
#### ⚙� Parameters
**auth_connection_id:** `str`
**request:** `AuthConnectionsUpdateRequestBody` — Updated auth connection fields
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Groups
client.workspace.groups.list() -> typing.Dict[str, WorkspaceGroupResponseModel]
#### � Description
Get all groups in the workspace
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.groups.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.groups.search(...) -> typing.List[WorkspaceGroupByNameResponseModel]
#### � Description
Searches for user groups in the workspace. Multiple or no groups may be returned.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.groups.search( name="name", ) ```
#### ⚙� Parameters
**name:** `str` — Name of the target group.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Invites
client.workspace.invites.create(...) -> AddWorkspaceInviteResponseModel
#### � Description
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.invites.create( email="john.doe@testmail.com", ) ```
#### ⚙� Parameters
**email:** `str` — The email of the customer
**workspace_permission:** `typing.Optional[str]` — The workspace permission of the user. This is deprecated, use `seat_type` instead.
**seat_type:** `typing.Optional[SeatType]` — The seat type of the user
**group_ids:** `typing.Optional[typing.List[str]]` — The group ids of the user
**usage_limit:** `typing.Optional[int]` — Monthly credit usage limit for the invitee. Omit or set to null for no custom cap.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.invites.create_batch(...) -> AddWorkspaceInviteResponseModel
#### � Description
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.invites.create_batch( emails=[ "emails" ], ) ```
#### ⚙� Parameters
**emails:** `typing.List[str]` — The email of the customer
**seat_type:** `typing.Optional[SeatType]` — The seat type of the user
**group_ids:** `typing.Optional[typing.List[str]]` — The group ids of the user
**usage_limit:** `typing.Optional[int]` — Monthly credit usage limit for the invitee. Omit or set to null for no custom cap.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.invites.delete(...) -> DeleteWorkspaceInviteResponseModel
#### � Description
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.invites.delete( email="john.doe@testmail.com", ) ```
#### ⚙� Parameters
**email:** `str` — The email of the customer
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Members
client.workspace.members.list() -> typing.List[WorkspaceMemberResponseModel]
#### � Description
Gets a list of all members of the workspace, including locked members. Service accounts are excluded. Requires the workspace_members_read permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.members.list() ```
#### ⚙� Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.members.update(...) -> UpdateWorkspaceMemberResponseModel
#### � Description
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.members.update( email="email", ) ```
#### ⚙� Parameters
**email:** `str` — Email of the target user.
**is_locked:** `typing.Optional[bool]` — Whether to lock or unlock the user account.
**workspace_role:** `typing.Optional[SeatType]` — The workspace role of the user. This is deprecated, use `workspace_seat_type` instead.
**workspace_seat_type:** `typing.Optional[SeatType]` — The workspace seat type
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Resources
client.workspace.resources.get(...) -> ResourceMetadataResponseModel
#### � Description
Gets the metadata of a resource by ID.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.resources.get( resource_id="resource_id", resource_type="voice", ) ```
#### ⚙� Parameters
**resource_id:** `str` — The ID of the target resource.
**resource_type:** `WorkspaceResourceType` — Resource type of the target resource.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.resources.share(...) -> typing.Any
#### � Description
Grants a role (one of 'admin', 'editor', 'commenter', or 'viewer') on a workspace resource to a user, group, or workspace (service account) API key. This overrides any existing role the target has on the resource. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be shared with the service account associated with that key. You must have admin access to the resource to share it.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.resources.share( resource_id="resource_id", role="admin", resource_type="voice", ) ```
#### ⚙� Parameters
**resource_id:** `str` — The ID of the target resource.
**role:** `BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole` — Role to grant to the target: one of 'admin', 'editor', 'commenter', or 'viewer'.
**resource_type:** `WorkspaceResourceType` — Resource type of the target resource.
**user_email:** `typing.Optional[str]` — The email of the user or service account.
**group_id:** `typing.Optional[str]` — The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key.
**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.resources.unshare(...) -> typing.Any
#### � Description
Removes any existing role on a workspace resource from a user, group, or workspace (service account) API key. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be unshared from the service account associated with that key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.resources.unshare( resource_id="resource_id", resource_type="voice", ) ```
#### ⚙� Parameters
**resource_id:** `str` — The ID of the target resource.
**resource_type:** `WorkspaceResourceType` — Resource type of the target resource.
**user_email:** `typing.Optional[str]` — The email of the user or service account.
**group_id:** `typing.Optional[str]` — The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key.
**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Usage
client.workspace.usage.get_usage_by_product_over_time(...) -> WorkspaceAnalyticsQueryResponseModel
#### � Description
Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.usage.get_usage_by_product_over_time( start_time=1, end_time=1, ) ```
#### ⚙� Parameters
**start_time:** `int` — Start of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01.
**end_time:** `int` — End of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01.
**interval_seconds:** `typing.Optional[int]` — Bucket size in seconds. Each row in the response covers this many seconds of the selected time range. For example, pass 3600 for hourly buckets or 86400 for daily buckets. Whether `time_zone` shifts bucket boundaries depends on this value: whole-day multiples (e.g. 86400) align to local midnight; whole-hour multiples up to 24 hours (e.g. 3600, 14400) align to local hour boundaries from midnight; sub-hour values and other sizes remain UTC-anchored regardless of `time_zone`.
**group_by:** `typing.Optional[typing.List[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem]]`
**filters:** `typing.Optional[typing.List[ColumnFilter]]`
**time_zone:** `typing.Optional[str]` — IANA time zone identifier (e.g. 'America/New_York', 'Europe/London', 'UTC') used to align bucket boundaries for eligible `interval_seconds` values. Whole-day multiples start at local midnight; whole-hour multiples up to 24 hours align to local hour boundaries from midnight. Sub-hour intervals and other bucket sizes remain UTC-anchored regardless of this setting. Defaults to UTC.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Analytics Requests
client.workspace.analytics.requests.get(...) -> WorkspaceAnalyticsQueryResponseModel
#### � Description
Returns a list of API requests. Supports filtering by time range, column filters, and search terms. At least one of start_time or end_time must be provided. An optional sort parameter controls timestamp ordering. Results are ordered by timestamp. Descending if end_time is used, ascending if start_time is used. The response is a tabular structure with columns, column_types, column_units, and rows.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.analytics.requests.get() ```
#### ⚙� Parameters
**start_time:** `typing.Optional[int]` — Start of the time range as a Unix timestamp in milliseconds.
**end_time:** `typing.Optional[int]` — End of the time range as a Unix timestamp in milliseconds.
**limit:** `typing.Optional[int]`
**sort:** `typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort]` — Optional timestamp sort direction. If omitted, defaults to desc when end_time is provided, otherwise asc.
**filters:** `typing.Optional[typing.List[ColumnFilter]]`
**search:** `typing.Optional[str]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspace Groups Members
client.workspace.groups.members.remove(...) -> DeleteWorkspaceGroupMemberResponseModel
#### � Description
Removes a member from the specified group. Requires `group_members_manage` permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.groups.members.remove( group_id="group_id", email="email", ) ```
#### ⚙� Parameters
**group_id:** `str` — The ID of the target group.
**email:** `str` — The email of the target workspace member.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.workspace.groups.members.add(...) -> AddWorkspaceGroupMemberResponseModel
#### � Description
Adds a member of your workspace to the specified group. Requires `group_members_manage` permission.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspace.groups.members.add( group_id="group_id", email="email", ) ```
#### ⚙� Parameters
**group_id:** `str` — The ID of the target group.
**email:** `str` — The email of the target workspace member.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workspaces ApiKeys
client.workspaces.api_keys.disable(...) -> typing.Any
#### � Description
Disable the API key used to authenticate this request. Requires the query parameter `api_key_name=self` as an explicit confirmation.
#### 🔌 Usage
```python from elevenlabs import ElevenLabs from elevenlabs.environment import ElevenLabsEnvironment client = ElevenLabs( environment=ElevenLabsEnvironment.PRODUCTION, ) client.workspaces.api_keys.disable( api_key_name="self", ) ```
#### ⚙� Parameters
**api_key_name:** `str` — Must be set to `self` to disable the API key used to authenticate this request. Required as an explicit confirmation to avoid accidentally disabling the wrong key.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
elevenlabs-elevenlabs-python-b6e5614/requirements.txt000066400000000000000000000001771523660243400231230ustar00rootroot00000000000000httpx>=0.21.2 pyaudio>=0.2.14 pydantic>= 1.9.2 pydantic-core>=2.18.2 requests>=2.20 typing_extensions>= 4.0.0 websockets>=13.0 elevenlabs-elevenlabs-python-b6e5614/src/000077500000000000000000000000001523660243400204215ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/000077500000000000000000000000001523660243400225415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/__init__.py000066400000000000000000010407641523660243400246660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import sys import typing from importlib import import_module if sys.getrecursionlimit() < 10000: sys.setrecursionlimit(10000) if typing.TYPE_CHECKING: from .types import ( AccountChangeActivityId, ActorModel, AddChapterResponseModel, AddKnowledgeBaseResponseModel, AddProjectRequest, AddProjectResponseModel, AddPronunciationDictionaryResponseModel, AddPronunciationDictionaryResponseModelPermissionOnResource, AddSharingVoiceRequest, AddVoiceIvcResponseModel, AddVoiceResponseModel, AddWorkspaceGroupMemberResponseModel, AddWorkspaceInviteResponseModel, AdditionalFormatResponseModel, AdditionalFormats, AdhocAgentConfigOverrideForTestRequestModel, Age, AgentAnalysisItemsInput, AgentAnalysisItemsInputDataCollectionItem, AgentAnalysisItemsInputDataCollectionItem_System, AgentAnalysisItemsInputDataCollectionItem_User, AgentAnalysisItemsInputEvaluationCriteriaItem, AgentAnalysisItemsInputEvaluationCriteriaItem_System, AgentAnalysisItemsInputEvaluationCriteriaItem_User, AgentAnalysisItemsOutput, AgentAnalysisItemsOutputDataCollectionItem, AgentAnalysisItemsOutputDataCollectionItem_System, AgentAnalysisItemsOutputDataCollectionItem_User, AgentAnalysisItemsOutputEvaluationCriteriaItem, AgentAnalysisItemsOutputEvaluationCriteriaItem_System, AgentAnalysisItemsOutputEvaluationCriteriaItem_User, AgentBranchBasicInfo, AgentBranchResponse, AgentBranchSummary, AgentCallLimits, AgentConfig, AgentConfigApiModelWorkflowOverrideInput, AgentConfigApiModelWorkflowOverrideOutput, AgentConfigOverrideConfig, AgentConfigOverrideInput, AgentConfigOverrideOutput, AgentDefinitionSource, AgentDeploymentPercentageStrategy, AgentDeploymentRequest, AgentDeploymentRequestItem, AgentDeploymentResponse, AgentFailureResponseExample, AgentKnowledgeBaseRagChunkResponseModel, AgentKnowledgeBaseRagQueryRequestModel, AgentKnowledgeBaseRagQueryResponseModel, AgentMetadata, AgentMetadataDbModel, AgentMetadataResponseModel, AgentPlatformSettingsRequestModel, AgentPlatformSettingsResponseModel, AgentResponsePayload, AgentSimulatedChatTestResponseModel, AgentSortBy, AgentSuccessfulResponseExample, AgentSummaryBatchSuccessfulResponseModel, AgentSummaryResponseModel, AgentTestEntityType, AgentTestFolderPathSegmentResponseModel, AgentTestingSettings, AgentTopicResponseModel, AgentTransferInput, AgentTransferOp, AgentTransferOpPop, AgentTransferOpPush, AgentTransferOpReplace, AgentTransferOp_Pop, AgentTransferOp_Push, AgentTransferOp_Replace, AgentTransferOutput, AgentTrustContext, AgentVersionMetadata, AgentVersionParents, AgentWorkflowRequestModel, AgentWorkflowRequestModelNodesValue, AgentWorkflowRequestModelNodesValue_End, AgentWorkflowRequestModelNodesValue_OverrideAgent, AgentWorkflowRequestModelNodesValue_PhoneNumber, AgentWorkflowRequestModelNodesValue_StandaloneAgent, AgentWorkflowRequestModelNodesValue_Start, AgentWorkflowRequestModelNodesValue_Tool, AgentWorkflowResponseModel, AgentWorkflowResponseModelNodesValue, AgentWorkflowResponseModelNodesValue_End, AgentWorkflowResponseModelNodesValue_OverrideAgent, AgentWorkflowResponseModelNodesValue_PhoneNumber, AgentWorkflowResponseModelNodesValue_StandaloneAgent, AgentWorkflowResponseModelNodesValue_Start, AgentWorkflowResponseModelNodesValue_Tool, AgentWorkspaceOverridesInput, AgentWorkspaceOverridesOutput, AlertingMonitorConfig, AlertingSettings, AlertingSettingsResponse, AlertingWebhookHeader, AlertingWebhookMethod, AlertingWebhookNotifier, AlertingWebhookNotifierResponse, Alignment, AllowedOutputFormats, AllowlistItem, AnalysisCharging, AnalysisProperty, AnalysisPropertyConstantValue, AnalysisPropertyType, AnalysisRunSnapshot, AnalysisRunningTotal, AnalysisScope, AnalysisType, ApiIntegrationOAuth2AuthCodeResponse, ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ApiIntegrationOAuth2CustomAppResponse, ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ApiIntegrationWebhookOverrides, ApiIntegrationWebhookOverridesRequestHeadersValue, ApiIntegrationWebhookOverridesSchemaOverridesValue, ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant, ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable, ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm, ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit, ApiIntegrationWebhookToolConfigInput, ApiIntegrationWebhookToolConfigOutput, ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems, ArrayJsonSchemaPropertyInputPropertyKind, ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems, AsrConversationalConfig, AsrConversationalConfigOverride, AsrConversationalConfigOverrideConfig, AsrConversationalConfigWorkflowOverride, AsrInputFormat, AsrProvider, AsrQuality, AssetTranscription, AssetTranscriptionData, AssetTranscriptionStatus, AstAdditionOperatorNodeInput, AstAdditionOperatorNodeOutput, AstAndOperatorNodeInput, AstAndOperatorNodeOutput, AstBooleanNodeInput, AstBooleanNodeOutput, AstConditionalOperatorNodeInput, AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeInput, AstDivisionOperatorNodeOutput, AstDynamicVariableNodeInput, AstDynamicVariableNodeOutput, AstEqualsOperatorNodeInput, AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeInput, AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeInput, AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeInput, AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeInput, AstMultiplicationOperatorNodeOutput, AstNodeInput, AstNodeInputLlm, AstNodeInput_AddOperator, AstNodeInput_AndOperator, AstNodeInput_BooleanLiteral, AstNodeInput_ConditionalOperator, AstNodeInput_DivOperator, AstNodeInput_DynamicVariable, AstNodeInput_EqOperator, AstNodeInput_GtOperator, AstNodeInput_GteOperator, AstNodeInput_Llm, AstNodeInput_LtOperator, AstNodeInput_LteOperator, AstNodeInput_MulOperator, AstNodeInput_NeqOperator, AstNodeInput_NullLiteral, AstNodeInput_NumberLiteral, AstNodeInput_OrOperator, AstNodeInput_StringLiteral, AstNodeInput_SubOperator, AstNodeOutput, AstNodeOutput_AddOperator, AstNodeOutput_AndOperator, AstNodeOutput_BooleanLiteral, AstNodeOutput_ConditionalOperator, AstNodeOutput_DivOperator, AstNodeOutput_DynamicVariable, AstNodeOutput_EqOperator, AstNodeOutput_GtOperator, AstNodeOutput_GteOperator, AstNodeOutput_Llm, AstNodeOutput_LtOperator, AstNodeOutput_LteOperator, AstNodeOutput_MulOperator, AstNodeOutput_NeqOperator, AstNodeOutput_NullLiteral, AstNodeOutput_NumberLiteral, AstNodeOutput_OrOperator, AstNodeOutput_StringLiteral, AstNodeOutput_SubOperator, AstNotEqualsOperatorNodeInput, AstNotEqualsOperatorNodeOutput, AstNullNodeInput, AstNullNodeOutput, AstNumberNodeInput, AstNumberNodeInputValue, AstNumberNodeOutput, AstNumberNodeOutputValue, AstOrOperatorNodeInput, AstOrOperatorNodeOutput, AstStringNodeInput, AstStringNodeOutput, AstSubtractionOperatorNodeInput, AstSubtractionOperatorNodeOutput, AstllmNodeInput, AstllmNodeInputPrompt, AstllmNodeInputValueSchema, AstllmNodeOutput, AsyncConversationMetadata, AsyncConversationMetadataDeliveryStatus, AttachedSystemDataCollectionRef, AttachedSystemEvaluationRef, AttachedSystemEvaluationRefAnalysisItemId, AttachedTestModel, AttachedUserDataCollectionRef, AttachedUserEvaluationRef, AudioAnalysis, AudioAnalysisResult, AudioAnalysisStatus, AudioFormatEnum, AudioIsolationHistoryItemResponseModel, AudioKeyMoment, AudioNativeCreateProjectResponseModel, AudioNativeEditContentResponseModel, AudioNativeProjectSettingsResponseModel, AudioNativeProjectSettingsResponseModelStatus, AudioOutput, AudioOutputMulti, AudioRefChunk, AudioSegment, AudioWithTimestampsAndVoiceSegmentsResponseModel, AudioWithTimestampsResponse, AuthConnectionDependencies, AuthConnectionDependenciesMcpServersItem, AuthConnectionDependenciesMcpServersItem_Available, AuthConnectionDependenciesMcpServersItem_Unknown, AuthConnectionDependenciesToolsItem, AuthConnectionDependenciesToolsItem_Available, AuthConnectionDependenciesToolsItem_Unknown, AuthConnectionLocator, AuthConnectionStatus, AuthSettings, AuthenticationActivityId, AuthorizationMethod, AutoGenerationMetadata, AutoSyncInfo, BackgroundSoundConfig, BackgroundSoundConfigWorkflowOverride, BackgroundSoundPresetId, BackgroundSoundSourceType, BackupLlmDefault, BackupLlmDisabled, BackupLlmOverride, BadRequestErrorBody, BaseTurnConfig, BasicAuthResponse, BatchCallDetailedResponse, BatchCallRecipientStatus, BatchCallResponse, BatchCallStatus, BatchCallWhatsAppParams, BatchFailureResponseModel, BearerAuthResponse, BehaviorOverride, BillingPeriod, BranchProtectionStatus, BreakdownTypes, BucketingStatus, BuiltInToolsInput, BuiltInToolsOutput, BuiltInToolsWorkflowOverrideInput, BuiltInToolsWorkflowOverrideOutput, CancelCalendarEventParams, CancelGroupSessionForAllParams, CancelGroupSessionRegistrationParams, CanvasPlacement, CaptionStyleCharacterAnimationModel, CaptionStyleCharacterAnimationModelEnterType, CaptionStyleCharacterAnimationModelExitType, CaptionStyleHorizontalPlacementModel, CaptionStyleHorizontalPlacementModelAlign, CaptionStyleModel, CaptionStyleModelTextAlign, CaptionStyleModelTextBlendMode, CaptionStyleModelTextStyle, CaptionStyleModelTextTransform, CaptionStyleModelTextWeight, CaptionStyleSectionAnimationModel, CaptionStyleSectionAnimationModelEnterType, CaptionStyleSectionAnimationModelExitType, CaptionStyleTemplateModel, CaptionStyleVerticalPlacementModel, CaptionStyleVerticalPlacementModelAlign, CaptionStyleWordAnimationModel, CaptionStyleWordAnimationModelEnterType, CaptionStyleWordAnimationModelExitType, ChapterContentBlockExtendableNodeResponseModel, ChapterContentBlockInputModel, ChapterContentBlockInputModelSubType, ChapterContentBlockResponseModel, ChapterContentBlockResponseModelNodesItem, ChapterContentBlockResponseModelNodesItem_Other, ChapterContentBlockResponseModelNodesItem_TtsNode, ChapterContentBlockTtsNodeResponseModel, ChapterContentInputModel, ChapterContentParagraphTtsNodeInputModel, ChapterContentResponseModel, ChapterResponse, ChapterSnapshotExtendedResponseModel, ChapterSnapshotResponse, ChapterSnapshotsResponse, ChapterState, ChapterStatisticsResponse, ChapterWithContentResponseModel, ChapterWithContentResponseModelState, CharacterAge, CharacterAlignmentModel, CharacterAlignmentResponseModel, CharacterGender, CharacterMetadataResponseModel, CharacterRefreshPeriod, CharacterResponseModel, CharacterRole, CharacterUsageResponse, ChatSourceMedium, CheckServiceAvailabilityParams, ClientEvent, ClientToolConfigInput, ClientToolConfigOutput, ClipAnimation, ClipAnimationEnterEffect, ClipAnimationExitEffect, CloseConnection, CloseContext, ClosePayload, CloseSocket, ColumnFilter, ColumnFilterOperation, ColumnFilterValuesItem, ColumnUnit, CommittedTranscriptEntitiesPayload, CommittedTranscriptPayload, CommittedTranscriptWithTimestampsPayload, CompileProceduresResponseModel, CompileProceduresValidationErrorResponseModel, CompositionPlan, CompositionPlanChunksItem, ConfigEntityType, ConflictSection, ConstantSchemaOverride, ConstantSchemaOverrideConstantValue, ContentConfig, ContentFormat, ContentGuardrailInput, ContentGuardrailInputTriggerAction, ContentGuardrailInputTriggerAction_EndCall, ContentGuardrailInputTriggerAction_Retry, ContentGuardrailOutput, ContentGuardrailOutputTriggerAction, ContentGuardrailOutputTriggerAction_EndCall, ContentGuardrailOutputTriggerAction_Retry, ContentThresholdGuardrail, ContentThresholdGuardrailThreshold, ContextualUpdateInfo, Contributor, ConvAiDynamicVariable, ConvAiEnvVarLocator, ConvAiFileUploadResponseModel, ConvAiSecretLocator, ConvAiStoredSecretDependencies, ConvAiStoredSecretDependenciesAgentsItem, ConvAiStoredSecretDependenciesAgentsItem_Available, ConvAiStoredSecretDependenciesAgentsItem_Unknown, ConvAiStoredSecretDependenciesMcpServersItem, ConvAiStoredSecretDependenciesMcpServersItem_Available, ConvAiStoredSecretDependenciesMcpServersItem_Unknown, ConvAiStoredSecretDependenciesToolsItem, ConvAiStoredSecretDependenciesToolsItem_Available, ConvAiStoredSecretDependenciesToolsItem_Unknown, ConvAiUserSecretDbModel, ConvAiWebhooks, ConvAiWorkspaceStoredSecretConfig, ConversationAsrUsageModel, ConversationChargingCommonModel, ConversationConfigClientOverrideConfigInput, ConversationConfigClientOverrideConfigOutput, ConversationConfigClientOverrideInput, ConversationConfigClientOverrideOutput, ConversationConfigInput, ConversationConfigOutput, ConversationConfigOverride, ConversationConfigOverrideConfig, ConversationConfigWorkflowOverrideInput, ConversationConfigWorkflowOverrideOutput, ConversationDeletionSettings, ConversationFeedbackType, ConversationHistoryAnalysisCommonModel, ConversationHistoryBatchCallModel, ConversationHistoryElevenAssistantCommonModel, ConversationHistoryErrorCommonModel, ConversationHistoryEvaluationCriteriaResultCommonModel, ConversationHistoryExotelPhoneCallModel, ConversationHistoryFeedbackCommonModel, ConversationHistoryMetadataCommonModel, ConversationHistoryMetadataCommonModelPhoneCall, ConversationHistoryMetadataCommonModelPhoneCall_Exotel, ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ConversationHistoryMultivoiceMessageModel, ConversationHistoryMultivoiceMessagePartModel, ConversationHistoryRagUsageCommonModel, ConversationHistoryRedactionConfig, ConversationHistorySipTrunkingPhoneCallModel, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ConversationHistoryTranscriptCommonModelInput, ConversationHistoryTranscriptCommonModelInputRole, ConversationHistoryTranscriptCommonModelInputToolResultsItem, ConversationHistoryTranscriptCommonModelOutput, ConversationHistoryTranscriptCommonModelOutputRole, ConversationHistoryTranscriptCommonModelOutputToolResultsItem, ConversationHistoryTranscriptFileInputResponseModel, ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptOtherToolsResultCommonModelType, ConversationHistoryTranscriptResponseModel, ConversationHistoryTranscriptResponseModelRole, ConversationHistoryTranscriptResponseModelToolResultsItem, ConversationHistoryTranscriptSystemToolResultCommonModelInput, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess, ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput, ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput, ConversationHistoryTranscriptToolCallClientDetails, ConversationHistoryTranscriptToolCallCommonModelInput, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook, ConversationHistoryTranscriptToolCallCommonModelOutput, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook, ConversationHistoryTranscriptToolCallMcpDetails, ConversationHistoryTranscriptToolCallWebhookDetails, ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ConversationHistoryTwilioPhoneCallModel, ConversationInitiationClientDataConfigInput, ConversationInitiationClientDataConfigOutput, ConversationInitiationClientDataInternal, ConversationInitiationClientDataRequestInput, ConversationInitiationClientDataRequestOutput, ConversationInitiationClientDataWebhook, ConversationInitiationClientDataWebhookRequestHeadersValue, ConversationInitiationSource, ConversationInitiationSourceInfo, ConversationProduct, ConversationReasoningModel, ConversationSentimentAnalysis, ConversationSentimentAnalysisOverallLabel, ConversationSignedUrlResponseModel, ConversationSimulationSpecification, ConversationSource, ConversationSummaryResponseModel, ConversationSummaryResponseModelStatus, ConversationTagResponseModel, ConversationTokenPurpose, ConversationTokenResponseModel, ConversationTtsUsageModel, ConversationTurnMetrics, ConversationUserResponseModel, ConversationVoiceRewardModel, ConversationVoiceUsageModel, ConversationalConfig, ConversationalConfigApiModelWorkflowOverrideInput, ConversationalConfigApiModelWorkflowOverrideOutput, ConvertChapterResponseModel, ConvertProjectResponseModel, CrawlStatus, CrawlType, CreateAgentBranchResponseModel, CreateAgentProcedureParams, CreateAgentResponseModel, CreateAgentRuleParams, CreateAgentTestFolderResponseModel, CreateAgentTestResponseModel, CreateAssetParams, CreateAudioNativeProjectRequest, CreateAuthConnectionEnvironmentVariableRequest, CreateBasicAuthRequest, CreateBearerAuthRequest, CreateClientAppointmentParams, CreateClientInteractionParams, CreateClientParams, CreateCrawlJobResponseModel, CreateCustomHeaderAuthRequest, CreateExotelPhoneNumberRequest, CreateHolidayParams, CreateLocationParams, CreateMtlsAuthRequest, CreateOAuth2ClientCredsRequest, CreateOAuth2JwtRequest, CreateOAuth2JwtRequestAlgorithm, CreateOAuth2JwtRequestTokenResponseField, CreateOrderRequest, CreateOrderResponse, CreatePhoneNumberResponseModel, CreatePreviouslyGeneratedVoiceRequest, CreatePrivateKeyJwtRequest, CreatePrivateKeyJwtRequestAlgorithm, CreateProcedureRequestModel, CreateProcedureResponseModel, CreateProductParams, CreatePronunciationDictionaryResponseModel, CreateResponseUnitTestRequest, CreateSecretEnvironmentVariableRequest, CreateServiceParams, CreateSimulationTestRequest, CreateSipTrunkPhoneNumberRequest, CreateStaffParams, CreateStringEnvironmentVariableRequest, CreateToolCallUnitTestRequest, CreateTranscriptRequest, CreateTransferRuleParams, CreateTwilioPhoneNumberRequest, CriteriaScoringMode, CueOptionsRequest, Currency, CustomGuardrailConfig, CustomGuardrailConfigModel, CustomGuardrailConfigTriggerAction, CustomGuardrailConfigTriggerAction_EndCall, CustomGuardrailConfigTriggerAction_Retry, CustomGuardrailInput, CustomGuardrailOutput, CustomGuardrailsConfigInput, CustomGuardrailsConfigOutput, CustomHeaderAuthResponse, CustomLlm, CustomLlmApiKey, CustomLlmAuthConnection, CustomLlmRequestHeadersValue, CustomLlmapiType, CustomSipHeader, CustomSipHeaderWithDynamicVariable, CustomToolApiSchemaConfig, DashboardCallSuccessChartModel, DashboardCriteriaChartModel, DashboardDataCollectionChartModel, DataCollectionResultCommonModel, DefaultSharingGroupConfig, DefaultSharingGroupConfigPermissionLevel, DefaultSharingGroupResponseModel, DefaultSharingGroupResponseModelPermissionLevel, DeleteAgentProcedureParams, DeleteAgentRuleParams, DeleteAssetParams, DeleteCalendarEventParams, DeleteChapterRequest, DeleteChapterResponseModel, DeleteClientInteractionParams, DeleteClientParams, DeleteDubbingResponseModel, DeleteGroupSessionParams, DeleteHistoryItemResponse, DeleteHolidayParams, DeleteLocationParams, DeleteProductParams, DeleteProjectRequest, DeleteProjectResponseModel, DeleteSampleResponse, DeleteServiceParams, DeleteStaffParams, DeleteTransferRuleParams, DeleteVoiceResponseModel, DeleteVoiceSampleResponseModel, DeleteWorkspaceGroupMemberResponseModel, DeleteWorkspaceInviteResponseModel, DeleteWorkspaceWebhookResponseModel, DeliverableInfo, DependentAvailableAgentIdentifier, DependentAvailableAgentIdentifierAccessLevel, DependentAvailableMcpServerIdentifier, DependentAvailableMcpServerIdentifierAccessLevel, DependentAvailableToolIdentifier, DependentAvailableToolIdentifierAccessLevel, DependentBranchInfo, DependentIntegrationConnectionIdentifier, DependentPhoneNumberIdentifier, DependentUnknownAgentIdentifier, DependentUnknownMcpServerIdentifier, DependentUnknownToolIdentifier, DetailedMusicResponse, DetailedMusicResponseCompositionPlan, DetectedEntity, DeviceModel, DialogueInput, DialogueInputResponseModel, DialogueTextAlignment, DirectPublishingReadResponseModel, DirectPublishingReadResponseModelDisplayMode, DirectPublishingReadResponseModelGenreItem, DirectPublishingReadResponseModelPayoutType, DirectPublishingReadResponseModelTargetAudience, DiscountResponseModel, DoDubbingResponse, DocumentUsageModeEnum, DocxExportOptions, DtmfInputConfig, DubOrderItemRequest, DubbedSegment, DubbingBulkSourceSegmentUpdateResponse, DubbingBulkTargetSegmentUpdateResponse, DubbingError, DubbingLanguageListResponse, DubbingLanguageOutputs, DubbingLanguageResponse, DubbingLanguageResponseStatus, DubbingMediaMetadata, DubbingMediaReference, DubbingMetadataPageResponseModel, DubbingMetadataResponse, DubbingProjectListResponse, DubbingProjectResponse, DubbingProjectResponseStatus, DubbingRegenerateResponse, DubbingRenderResponseModel, DubbingResource, DubbingSegmentUpdateRequest, DubbingSourceMediaInfo, DubbingSourceSegmentUpdateResponse, DubbingSourceTranscriptResponse, DubbingTargetSegmentUpdateRequest, DubbingTargetSegmentUpdateResponse, DubbingTargetTranscriptResponse, DubbingTargetTranscriptSegment, DubbingTranscript, DubbingTranscriptCharacter, DubbingTranscriptResponseModel, DubbingTranscriptRevisionResponse, DubbingTranscriptSegment, DubbingTranscriptUtterance, DubbingTranscriptWord, DubbingTranscriptsResponseModel, DubbingTranscriptsResponseModelTranscriptFormat, DummyToolResultModel, DynamicVariableAssignment, DynamicVariableNestedValueTypeInput, DynamicVariableNestedValueTypeOutput, DynamicVariableSchemaOverride, DynamicVariableUpdateCommonModel, DynamicVariablesConfig, DynamicVariablesConfigWorkflowOverride, EditChapterResponseModel, EditProjectResponseModel, EditVoiceResponseModel, EditVoiceSettingsRequest, EditVoiceSettingsResponseModel, EmbedVariant, EmbeddingModelEnum, EndCallToolConfig, EndCallToolResultModel, EndCallTriggerAction, EndProcedureToolConfigInput, EndProcedureToolConfigOutput, EndProcedureToolErrorStatus, EntityManagementActivityId, EntryBehavior, EnvironmentAuthConnectionLocator, EnvironmentVariableAuthConnectionValue, EnvironmentVariableAuthConnectionValueRequest, EnvironmentVariableResponse, EnvironmentVariableResponseType, EnvironmentVariableResponseValues, EnvironmentVariableSecretValue, EnvironmentVariableSecretValueRequest, EnvironmentVariablesListResponse, ErrorPayload, EvaluationCriteriaSummaryResult, EvaluationSettingsInput, EvaluationSettingsOutput, EvaluationSuccessResult, ExactParameterEvaluationStrategy, ExotelApiSubdomain, ExotelOutboundCallResponse, ExportOptions, ExportOptions_Docx, ExportOptions_Html, ExportOptions_Pdf, ExportOptions_SegmentedJson, ExportOptions_Srt, ExportOptions_Txt, ExternalFileSyncInfo, ExternalFolderSyncInfo, ExternalSyncJobTrigger, ExternalSyncJobType, ExternalSyncProvider, FeatureStatusCommonModel, FeaturesUsageCommonModel, FeedbackItem, FieldConflict, FileInputConfig, FileInputConfigWorkflowOverride, FileRefreshStatus, FinalOutput, FinalOutputMulti, FinalTranscript, FinalTranscriptWithTimestamps, FinalTranscriptWithTimestampsWordsItem, FinalTranscriptWithTimestampsWordsItemCharactersItem, FinalTranscriptWithTimestampsWordsItemType, FineTuningResponse, FineTuningResponseStateValue, FinetuneCreatedBy, FinetuneVisibility, FlushContext, FocusGuardrail, ForcedAlignmentCharacterResponseModel, ForcedAlignmentResponseModel, ForcedAlignmentWordResponseModel, FrustratedConversationRef, FrustratedConversationRefOverallLabel, Gender, GenerateVoiceRequest, GenerationChunkInput, GenerationChunkInputConditionStrength, GenerationChunkInputContextAdherence, GenerationChunkOutput, GenerationChunkOutputConditionStrength, GenerationChunkOutputContextAdherence, GenerationConfig, GenerationSourceContext, GenesysBotOutcome, GenesysRegion, GetAgentEmbedResponseModel, GetAgentKnowledgebaseSizeResponseModel, GetAgentLinkResponseModel, GetAgentResponseModel, GetAgentResponseModelPhoneNumbersItem, GetAgentResponseModelPhoneNumbersItem_Exotel, GetAgentResponseModelPhoneNumbersItem_SipTrunk, GetAgentResponseModelPhoneNumbersItem_Twilio, GetAgentTestFolderResponseModel, GetAgentTopicsResponseModel, GetAgentsPageResponseModel, GetAnalyticsSummaryParams, GetAppointmentByConfirmationNumberParams, GetAudioIsolationHistoryResponseModel, GetAudioNativeProjectSettingsResponseModel, GetBookingPageSettingsParams, GetBookingSlugStatusParams, GetChapterRequest, GetChapterSnapshotsRequest, GetChaptersRequest, GetChaptersResponse, GetClientAppointmentsParams, GetClientByPhoneParams, GetConvAiDashboardSettingsResponseModel, GetConvAiDashboardSettingsResponseModelChartsItem, GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, GetConvAiSettingsResponseModel, GetConversationResponseModel, GetConversationResponseModelStatus, GetConversationTagsPageResponseModel, GetConversationUsersPageResponseModel, GetConversationsPageResponseModel, GetCrawlJobResponseModel, GetKnowledgeBaseDependentAgentsResponseModel, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown, GetKnowledgeBaseFileResponseModel, GetKnowledgeBaseFolderResponseModel, GetKnowledgeBaseListResponseModel, GetKnowledgeBaseListResponseModelDocumentsItem, GetKnowledgeBaseListResponseModelDocumentsItem_File, GetKnowledgeBaseListResponseModelDocumentsItem_Folder, GetKnowledgeBaseListResponseModelDocumentsItem_Text, GetKnowledgeBaseListResponseModelDocumentsItem_Url, GetKnowledgeBaseSummaryFileResponseModel, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown, GetKnowledgeBaseSummaryFolderResponseModel, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown, GetKnowledgeBaseSummaryTextResponseModel, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown, GetKnowledgeBaseSummaryUrlResponseModel, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown, GetKnowledgeBaseTextResponseModel, GetKnowledgeBaseUrlResponseModel, GetLibraryVoicesResponse, GetLiveCountResponse, GetOrCreateRagIndexRequestModel, GetPhoneNumberExotelResponseModel, GetPhoneNumberInboundSipTrunkConfigResponseModel, GetPhoneNumberOutboundSipTrunkConfigResponseModel, GetPhoneNumberResponse, GetPhoneNumberSipTrunkResponseModel, GetPhoneNumberTwilioResponseModel, GetProjectRequest, GetProjectsRequest, GetProjectsResponse, GetPronunciationDictionariesMetadataResponseModel, GetPronunciationDictionariesResponse, GetPronunciationDictionaryMetadataResponse, GetPronunciationDictionaryMetadataResponsePermissionOnResource, GetPronunciationDictionaryResponse, GetPronunciationDictionaryWithRulesResponseModel, GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource, GetPronunciationDictionaryWithRulesResponseModelRulesItem, GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias, GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme, GetResponseUnitTestResponseModel, GetScheduleParams, GetSecretDependenciesResponseModel, GetSecretDependenciesResponseModelDependencies, GetSecretDependenciesResponseModelDependenciesOneItem, GetSecretDependenciesResponseModelDependenciesOneItem_Available, GetSecretDependenciesResponseModelDependenciesOneItem_Unknown, GetSecretDependenciesResponseModelDependenciesZeroItem, GetSecretDependenciesResponseModelDependenciesZeroItem_Available, GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown, GetSimulationTestResponseModel, GetSipLogMessagesResponse, GetSpeechHistoryResponse, GetTestInvocationsPageResponseModel, GetTestSuiteInvocationResponseModel, GetTestsPageResponseModel, GetTestsSummariesByIdsResponseModel, GetToolCallUnitTestResponseModel, GetToolDependentAgentsResponseModel, GetToolDependentAgentsResponseModelAgentsItem, GetToolDependentAgentsResponseModelAgentsItem_Available, GetToolDependentAgentsResponseModelAgentsItem_Unknown, GetToolExecutionsPageResponseModel, GetVoiceAccentsResponseModel, GetVoicesResponse, GetVoicesV2Response, GetWhatsAppAccountResponse, GetWorkspaceSecretsResponseModel, GroupManagementActivityId, GuardrailExecutionMode, GuardrailType, GuardrailsV1Input, GuardrailsV1Output, HistoryAlignmentResponseModel, HistoryAlignmentsResponseModel, HistoryItemResponse, HtmlExportOptions, HttpRequestModel, HttpValidationError, Icon, ImageAnalysis, ImageAnalysisResult, ImageAnalysisStatus, ImageAvatar, ImageSubject, InboundSipTrunkConfigRequestModel, InitPayload, InitialiseContext, InitializeConnection, InitializeConnectionMulti, InputAudioChunkPayload, IntegrationType, InteractionBudget, InternalAlertingWebhookNotifier, InvoiceResponse, InvoiceResponsePaymentIntentStatus, InvoiceResponsePaymentIntentStatussesItem, ItemId, KbExternalSyncJob, KeepContextAlive, KnowledgeBaseBulkDeleteSuccessfulResponseModel, KnowledgeBaseContentSearchResponseModel, KnowledgeBaseContentSearchResult, KnowledgeBaseContentSearchResultDocument, KnowledgeBaseContentSearchResultDocument_File, KnowledgeBaseContentSearchResultDocument_Folder, KnowledgeBaseContentSearchResultDocument_Text, KnowledgeBaseContentSearchResultDocument_Url, KnowledgeBaseDeletedResponseModel, KnowledgeBaseDependentType, KnowledgeBaseDocumentChunkResponseModel, KnowledgeBaseDocumentChunksResponseModel, KnowledgeBaseDocumentMetadataResponseModel, KnowledgeBaseDocumentType, KnowledgeBaseFolderPathSegmentResponseModel, KnowledgeBaseFolderPathSegmentSummaryResponseModel, KnowledgeBaseLocator, KnowledgeBaseRagChunkModel, KnowledgeBaseRagToolConfig, KnowledgeBaseRagToolResultModel, KnowledgeBaseRagToolStatus, KnowledgeBaseSortBy, KnowledgeBaseSourceFileUrlResponseModel, KnowledgeBaseSummaryBatchSuccessfulResponseModel, KnowledgeBaseSummaryBatchSuccessfulResponseModelData, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url, KnowledgeBaseToolConfig, KnowledgeBaseToolInfo, KnowledgeBaseToolResultModel, KnowledgeBaseToolStatus, LanguageAddedResponse, LanguageDetectionToolConfig, LanguageDetectionToolResultModel, LanguageInfo, LanguagePairInfo, LanguagePresetInput, LanguagePresetOutput, LanguagePresetTranslation, LanguageResponse, LanguagesResponse, LanguagesResponse_Pair, LanguagesResponse_Single, LeaveMessageParams, LibraryVoiceResponse, LibraryVoiceResponseCategory, ListAgentProceduresParams, ListAgentReferencesParams, ListAgentRulesParams, ListAssetsParams, ListAuthConnectionsResponse, ListAuthConnectionsResponseAuthConnectionsItem, ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode, ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp, ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth, ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth, ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth, ListAuthConnectionsResponseAuthConnectionsItem_Mtls, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt, ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt, ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth, ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth, ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret, ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth, ListCalendarEventsParams, ListClientInteractionsParams, ListClientsParams, ListCrawlJobsResponseModel, ListCustomerFacingAgentsParams, ListGroupSessionsParams, ListHolidaysParams, ListLocationsParams, ListMcpToolsResponseModel, ListOrdersResponse, ListProceduresResponseModel, ListProductsParams, ListResponseAgentBranchSummary, ListResponseMeta, ListServicesParams, ListSpeechEnginesResponse, ListStaffParams, ListTransferRulesParams, ListWhatsAppAccountsResponse, LiteralJsonSchemaProperty, LiteralJsonSchemaPropertyConstantValue, LiteralJsonSchemaPropertyType, LivekitStackType, Llm, LlmCategoryUsage, LlmDeprecationConfigModel, LlmDeprecationInfoModel, LlmInfoModelInput, LlmInfoModelOutput, LlmInputOutputTokensUsage, LlmListResponseModelInput, LlmListResponseModelOutput, LlmLiteralJsonSchemaProperty, LlmLiteralJsonSchemaPropertyType, LlmParameterEvaluationStrategy, LlmReasoningEffort, LlmSchemaOverride, LlmTokensCategoryUsage, LlmUsageCalculatorLlmResponseModel, LlmUsageCalculatorResponseModel, LlmUsageInput, LlmUsageOutput, LoadMemoryEntryToolErrorStatus, LoadableMemoryEntry, LockReason, ManualSource, ManualVerificationFileResponse, ManualVerificationResponse, MatchAnythingParameterEvaluationStrategy, McpApprovalPolicy, McpServerConfigInput, McpServerConfigInputAuthConnection, McpServerConfigInputRequestHeadersValue, McpServerConfigInputRequestMetaValue, McpServerConfigInputSecretToken, McpServerConfigInputUrl, McpServerConfigOutput, McpServerConfigOutputAuthConnection, McpServerConfigOutputRequestHeadersValue, McpServerConfigOutputRequestMetaValue, McpServerConfigOutputSecretToken, McpServerConfigOutputUrl, McpServerMetadataResponseModel, McpServerResponseModel, McpServerResponseModelDependentAgentsItem, McpServerResponseModelDependentAgentsItem_Available, McpServerResponseModelDependentAgentsItem_Unknown, McpServerTransport, McpServersResponseModel, McpToolApprovalHash, McpToolApprovalPolicy, McpToolConfigOverrideInput, McpToolConfigOverrideInputInputOverridesValue, McpToolConfigOverrideInputInputOverridesValue_Constant, McpToolConfigOverrideInputInputOverridesValue_DynamicVariable, McpToolConfigOverrideInputInputOverridesValue_Llm, McpToolConfigOverrideInputInputOverridesValue_Omit, McpToolConfigOverrideInputToolCallSound, McpToolConfigOverrideOutput, McpToolConfigOverrideOutputInputOverridesValue, McpToolConfigOverrideOutputInputOverridesValue_Constant, McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable, McpToolConfigOverrideOutputInputOverridesValue_Llm, McpToolConfigOverrideOutputInputOverridesValue_Omit, McpToolConfigOverrideOutputToolCallSound, MediaCodec, MediaId, MemoryEntrySearchResult, MemoryEntrySearchResultSource, MergePreviewResponseModel, MergePreviewResponseModelPhoneNumbersItem, MergePreviewResponseModelPhoneNumbersItem_Exotel, MergePreviewResponseModelPhoneNumbersItem_SipTrunk, MergePreviewResponseModelPhoneNumbersItem_Twilio, MessageSearchSortBy, MessagesSearchResponse, MessagesSearchResult, MetricRecord, MetricType, MockNoMatchBehavior, MockingStrategy, Model, ModelRatesResponseModel, ModelSettingsResponseModel, ModerationConfig, ModerationGuardrailInput, ModerationGuardrailOutput, MtlsAuthResponse, MultichannelSpeechToTextResponseModel, MultipartMusicResponse, MusicAllowedOutputFormats, MusicExploreSongSourceContext, MusicFinetuneFailureReason, MusicFinetunePageResponseModel, MusicFinetuneResponseModel, MusicFinetuneStatus, MusicGenerationMode, MusicOnlyOutputFormats, MusicOutputFormat, MusicPrompt, MusicUploadResponse, MusicUploadResponseCompositionPlan, NonStreamingOutputFormats, NormalizedAlignment, NumericDistributionAggregate, OAuth2ClientCredsResponse, OAuth2JwtResponse, OAuth2JwtResponseAlgorithm, OAuth2JwtResponseTokenResponseField, ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue, ObjectJsonSchemaPropertyInputPropertyKind, ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue, OmitSchemaOverride, OpenAiAudioFormat, OpenerConfig, OptInSmsReminderParams, OptOutSmsReminderParams, OrbAvatar, OrchestratorToolMockBehaviorConfig, OrderDeliverablesResponse, OrderId, OrderItemInfo, OrderItemKind, OrderItemRequestInput, OrderItemRequestInput_Dub, OrderItemRequestInput_Subtitles, OrderItemRequestInput_Transcription, OrderItemRequestOutput, OrderItemRequestOutput_Dub, OrderItemRequestOutput_Subtitles, OrderItemRequestOutput_Transcription, OrderMediaResponse, OrderResponse, OrderState, OrderSummary, OutboundCallRecipient, OutboundCallRecipientResponseModel, OutboundSipTrunkConfigRequestModel, OutputFormat, PairedLanguagesResponse, PartialTranscriptPayload, PatchWorkspaceWebhookResponseModel, PdfExportOptions, PendingBlocksMetadataModel, PendingCancellationResponseModel, PendingClipTask, PendingClipTaskType, PendingExternalAudiosMetadataModel, PendingSubscriptionSwitchResponseModel, PendingSubscriptionSwitchResponseModelNextTier, PermissionType, PhoneNumberAgentInfo, PhoneNumberDynamicVariableTransferDestination, PhoneNumberTransfer, PhoneNumberTransferCustomSipHeadersItem, PhoneNumberTransferCustomSipHeadersItem_Dynamic, PhoneNumberTransferCustomSipHeadersItem_Static, PhoneNumberTransferDestination, PhoneNumberTransferPostDialDigits, PhoneNumberTransferPostDialDigits_Dynamic, PhoneNumberTransferPostDialDigits_Static, PhoneNumberTransferTransferDestination, PhoneNumberTransferTransferDestination_Phone, PhoneNumberTransferTransferDestination_PhoneDynamicVariable, PhoneNumberTransferTransferDestination_SipUri, PhoneNumberTransferTransferDestination_SipUriDynamicVariable, PingPayload, PlatformCategory, PlatformCategoryUsage, PlatformUsage, PlayDtmfResultErrorModel, PlayDtmfResultSuccessModel, PlayDtmfToolConfig, PodcastBulletinMode, PodcastBulletinModeData, PodcastConversationMode, PodcastConversationModeData, PodcastProjectResponseModel, PodcastTextSource, PodcastUrlSource, PongPayload, PositionInput, PositionOutput, PostAgentAvatarResponseModel, PostDialDigitsDynamicVariable, PostDialDigitsStatic, PostWorkspaceSecretResponseModel, PreToolSpeechMode, PreviewAudioDbModel, Price, PrivacyConfigInput, PrivacyConfigOutput, PrivateKeyJwtResponse, PrivateKeyJwtResponseAlgorithm, ProcedureAtVersionInput, ProcedureAtVersionOutput, ProcedureAtVersionResponseModel, ProcedureDraftResponseModel, ProcedureListItemResponseModel, ProcedureRefResponseModel, ProcedureType, ProcedureValidationError, ProjectCreationMetaResponseModel, ProjectCreationMetaResponseModelStatus, ProjectCreationMetaType, ProjectExtendedResponse, ProjectExtendedResponseAccessLevel, ProjectExtendedResponseApplyTextNormalization, ProjectExtendedResponseAspectRatio, ProjectExtendedResponseAssetsItem, ProjectExtendedResponseAssetsItem_Audio, ProjectExtendedResponseAssetsItem_Image, ProjectExtendedResponseAssetsItem_Video, ProjectExtendedResponseFiction, ProjectExtendedResponseSourceType, ProjectExtendedResponseTargetAudience, ProjectExternalAudioResponseModel, ProjectExternalAudioResponseModelSourceContext, ProjectExternalAudioResponseModelSourceContext_MusicExploreSong, ProjectExternalAudioResponseModelSourceContext_Sfx, ProjectExternalAudioResponseModelSourceContext_Song, ProjectImageResponseModel, ProjectMutedTracksResponseModel, ProjectResponse, ProjectResponseAccessLevel, ProjectResponseAspectRatio, ProjectResponseFiction, ProjectResponseSourceType, ProjectResponseTargetAudience, ProjectSnapshotExtendedResponseModel, ProjectSnapshotResponse, ProjectSnapshotsResponse, ProjectState, ProjectVideoResponseModel, ProjectVideoThumbnailSheetResponseModel, ProjectVoiceResponseModel, PromptAgent, PromptAgentApiModelInput, PromptAgentApiModelInputBackupLlmConfig, PromptAgentApiModelInputBackupLlmConfig_Default, PromptAgentApiModelInputBackupLlmConfig_Disabled, PromptAgentApiModelInputBackupLlmConfig_Override, PromptAgentApiModelInputToolsItem, PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelInputToolsItem_Client, PromptAgentApiModelInputToolsItem_Mcp, PromptAgentApiModelInputToolsItem_Smb, PromptAgentApiModelInputToolsItem_System, PromptAgentApiModelInputToolsItem_Webhook, PromptAgentApiModelOutput, PromptAgentApiModelOutputBackupLlmConfig, PromptAgentApiModelOutputBackupLlmConfig_Default, PromptAgentApiModelOutputBackupLlmConfig_Disabled, PromptAgentApiModelOutputBackupLlmConfig_Override, PromptAgentApiModelOutputToolsItem, PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelOutputToolsItem_Client, PromptAgentApiModelOutputToolsItem_Mcp, PromptAgentApiModelOutputToolsItem_Smb, PromptAgentApiModelOutputToolsItem_System, PromptAgentApiModelOutputToolsItem_Webhook, PromptAgentApiModelOverrideConfig, PromptAgentApiModelOverrideInput, PromptAgentApiModelOverrideOutput, PromptAgentApiModelWorkflowOverrideInput, PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig, PromptAgentApiModelWorkflowOverrideInputToolsItem, PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideInputToolsItem_Client, PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideInputToolsItem_System, PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook, PromptAgentApiModelWorkflowOverrideOutput, PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig, PromptAgentApiModelWorkflowOverrideOutputToolsItem, PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideOutputToolsItem_System, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook, PromptAgentDbModel, PromptEvaluationCriteria, PromptInjectionGuardrail, PronunciationDictionaryAliasRuleRequestModel, PronunciationDictionaryAliasRuleResponseModel, PronunciationDictionaryLocator, PronunciationDictionaryLocatorResponseModel, PronunciationDictionaryPhonemeRuleRequestModel, PronunciationDictionaryPhonemeRuleResponseModel, PronunciationDictionaryRulesResponseModel, PronunciationDictionaryVersionLocator, PronunciationDictionaryVersionResponseModel, PronunciationDictionaryVersionResponseModelPermissionOnResource, PydanticPronunciationDictionaryVersionLocator, QualityPresetType, QueryParamsJsonSchema, QuoteInfo, RagChunkMetadata, RagConfigInput, RagConfigOutput, RagConfigWorkflowOverrideInput, RagConfigWorkflowOverrideOutput, RagDocumentIndexResponseModel, RagDocumentIndexUsage, RagDocumentIndexesResponseModel, RagIndexBatchSuccessfulResponseModel, RagIndexOverviewEmbeddingModelResponseModel, RagIndexOverviewResponseModel, RagIndexStatus, RagRetrievalInfo, ReadLegalTerms, ReadMetadataChapterDbModel, ReaderResourceResponseModel, ReaderResourceResponseModelResourceType, RealtimeVoiceSettings, RecordingResponse, ReferenceVideo, ReferencedToolCommonModel, ReferencedToolCommonModelType, RefreshTokenAuthResponse, RegexParameterEvaluationStrategy, RegionConfigRequest, RegionalProcessingSurchargeInfo, RegisterForGroupSessionParams, RegisterMediaResponse, RemoveMemberFromGroupRequest, RemoveOrderItemResponse, Render, RenderStatus, RenderType, ReplicateVoiceToIsolatedEnvironmentResponseModel, ReportKnowledgeGapParams, RequestPvcManualVerificationResponseModel, RequiredConstraint, RequiredConstraints, ResourceAccessInfo, ResourceAccessInfoAccessSource, ResourceAccessInfoAnonymousAccessLevelOverride, ResourceAccessInfoRole, ResourceMetadataResponseModel, ResourceMetadataResponseModelAnonymousAccessLevelOverride, ResponseFilter, ResponseFilterMode, ResponseUnitTestModel, RestoreCalendarEventParams, RetryTriggerAction, ReviewResponseModel, ReviewResponseModelRejectReasonsItem, ReviewResponseModelReviewStatus, ReviewStatus, RunSubagentToolConfigInput, RunSubagentToolConfigOutput, SafetyCommonModelInput, SafetyCommonModelOutput, SafetyEvaluation, SafetyResponseModel, SafetyRule, SampleConfigDbModel, SampleConfigDbModelParentType, SaveVoicePreviewRequest, SayNodeLiteralMessageInput, SayNodeLiteralMessageOutput, SayNodePromptMessageInput, SayNodePromptMessageOutput, ScheduleGroupSessionParams, ScimGroupResponseModel, ScopedAnalysisResult, ScribeAuthErrorPayload, ScribeChunkSizeExceededErrorPayload, ScribeErrorPayload, ScribeInputErrorPayload, ScribeInsufficientAudioActivityErrorPayload, ScribeInvalidRequestError, ScribeQueueOverflowErrorPayload, ScribeQuotaExceededErrorPayload, ScribeRateLimitedErrorPayload, ScribeResourceExhaustedErrorPayload, ScribeSessionTimeLimitExceededErrorPayload, ScribeThrottledErrorPayload, ScribeTranscriberErrorPayload, ScribeUnacceptedTermsErrorPayload, SearchClientsParams, SearchHighlightSegment, SearchStrategy, SeatType, SecretDependencyResourceType, SecretDependencyType, SectionSource, SegmentCreateResponse, SegmentDeleteResponse, SegmentDubResponse, SegmentMigrationResponse, SegmentSubtitleFrame, SegmentTranscriptionResponse, SegmentTranslationResponse, SegmentUpdateResponse, SegmentedJsonExportOptions, SendText, SendTextMulti, SentimentAggregate, SentimentAnalysisSettings, SessionStartedPayload, SessionStartedPayloadConfig, SessionStartedPayloadConfigCommitStrategy, SetBookingSlugParams, SeverityId, SfxModelId, SfxSourceContext, ShareOptionResponseModel, ShareOptionResponseModelType, SimilarVoice, SimilarVoicesForSpeakerResponse, SimulationLibrarySettings, SimulationTestModel, SimulationToolMockBehaviorConfig, SingleLanguagesResponse, SingleTestRunRequestModel, SingleUseTokenResponseModel, SingleUseTokenType, SipLogMessage, SipLogMessageDirection, SipMediaEncryptionEnum, SipTrunkCredentialsRequestModel, SipTrunkOutboundCallResponse, SipTrunkTransportEnum, SipUriDynamicVariableTransferDestination, SipUriTransferDestination, SkipTurnToolConfig, SkipTurnToolResponseModel, SlackBotAuthResponse, SmbClientAccessConfig, SmsConversationInfo, SmsConversationInfoDirection, SoftTimeoutConfig, SoftTimeoutConfigOverride, SoftTimeoutConfigOverrideConfig, SoftTimeoutConfigWorkflowOverride, SongMetadata, SongSection, SongSourceContext, SortDirection, SpeakerAudioResponseModel, SpeakerCreatedResponse, SpeakerResponseModel, SpeakerSegment, SpeakerSeparationResponseModel, SpeakerSeparationResponseModelStatus, SpeakerTrack, SpeakerUpdatedResponse, SpeechEngineConfig, SpeechEngineConfigRequestHeadersValue, SpeechEngineConversationInitiationClientDataConfig, SpeechEngineResponse, SpeechEngineSummaryResponse, SpeechHistoryItemResponse, SpeechHistoryItemResponseSource, SpeechHistoryItemResponseVoiceCategory, SpeechToTextCharacterResponseModel, SpeechToTextChunkResponseModel, SpeechToTextWebhookResponseModel, SpeechToTextWordResponseModel, SpeechToTextWordResponseModelType, SpellingPatience, SrtExportOptions, StartProcedureToolConfigInput, StartProcedureToolConfigOutput, StartProcedureToolErrorStatus, StartPvcVoiceTrainingResponseModel, StartSpeakerSeparationResponseModel, StatusId, StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, StreamingAudioChunkWithTimestampsResponse, StudioAgentSettingsModel, StudioAgentToolSettingsModel, StudioClipReference, StudioClipReferenceClipType, StudioTextStyleOutlineModel, StudioTextStyleShadowModel, SubAgentInput, SubAgentOutput, SubagentRunResultDetails, SubmitBusinessInfoParams, SubmitOrderResponse, Subscription, SubscriptionMaxCreditLimitExtension, SubscriptionPendingChange, SubscriptionResponse, SubscriptionResponseMaxCreditLimitExtension, SubscriptionStatusType, SubtitleOrderItemRequest, SuggestedAudioTag, SupportedVoice, SystemEvaluationCriteria, SystemToolConfigInput, SystemToolConfigInputParams, SystemToolConfigInputParams_EndCall, SystemToolConfigInputParams_EndProcedure, SystemToolConfigInputParams_KnowledgeBase, SystemToolConfigInputParams_KnowledgeBaseRag, SystemToolConfigInputParams_LanguageDetection, SystemToolConfigInputParams_PlayKeypadTouchTone, SystemToolConfigInputParams_RunSubagent, SystemToolConfigInputParams_SkipTurn, SystemToolConfigInputParams_StartProcedure, SystemToolConfigInputParams_TransferToAgent, SystemToolConfigInputParams_TransferToNumber, SystemToolConfigInputParams_VoicemailDetection, SystemToolConfigOutput, SystemToolConfigOutputParams, SystemToolConfigOutputParams_EndCall, SystemToolConfigOutputParams_EndProcedure, SystemToolConfigOutputParams_KnowledgeBase, SystemToolConfigOutputParams_KnowledgeBaseRag, SystemToolConfigOutputParams_LanguageDetection, SystemToolConfigOutputParams_PlayKeypadTouchTone, SystemToolConfigOutputParams_RunSubagent, SystemToolConfigOutputParams_SkipTurn, SystemToolConfigOutputParams_StartProcedure, SystemToolConfigOutputParams_TransferToAgent, SystemToolConfigOutputParams_TransferToNumber, SystemToolConfigOutputParams_VoicemailDetection, TelephonyCallConfig, TelephonyDirection, TelephonyProvider, TestConditionRationaleCommonModel, TestConditionResultCommonModel, TestFromConversationMetadataInput, TestFromConversationMetadataOutput, TestInvocationSummaryResponseModel, TestRunMetadata, TestRunMetadataTestType, TestRunResultBucket, TestRunResultSummary, TestRunStatus, TestSharingMode, TestToolResultModel, TestType, TestsFeatureUsageCommonModel, TextNormalisationType, TextToDialogueWebsocketApplyTextNormalizationEnum, TextToDialogueWebsocketAudioChunk, TextToDialogueWebsocketAudioChunkMulti, TextToDialogueWebsocketClientMessage, TextToDialogueWebsocketClientMessageMulti, TextToDialogueWebsocketError, TextToDialogueWebsocketFinal, TextToDialogueWebsocketFinalAudioForTurn, TextToDialogueWebsocketFinalAudioForTurnMulti, TextToDialogueWebsocketFinalMulti, TextToDialogueWebsocketOutputFormatEnum, TextToDialogueWebsocketVoiceInput, TextToDialogueWebsocketVoiceSettings, TextToSpeechApplyTextNormalizationEnum, TextToSpeechOutputFormatEnum, TextToSpeechRequest, TextToSpeechStreamRequest, TextToSpeechStreamWithTimestampsRequest, TextToSpeechWithTimestampsRequest, ThresholdGuardrail, TimeRange, ToDialogueSettingsResponseModel, TokenResponseModel, Tool, ToolAnnotations, ToolCallSoundBehavior, ToolCallSoundType, ToolCallUnitTestModel, ToolErrorHandlingMode, ToolExecution, ToolExecutionMode, ToolExecutionResponseModel, ToolExecutionResponseModelToolCallDetails, ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook, ToolExecutionResponseModelToolCallDetails_Client, ToolExecutionResponseModelToolCallDetails_Mcp, ToolExecutionResponseModelToolCallDetails_Webhook, ToolExecutionTaskSupport, ToolInterruptionMode, ToolMockConfig, ToolRequestModel, ToolRequestModelToolConfig, ToolRequestModelToolConfig_Client, ToolRequestModelToolConfig_Mcp, ToolRequestModelToolConfig_System, ToolRequestModelToolConfig_Webhook, ToolResponseMockConfigInput, ToolResponseMockConfigOutput, ToolResponseModel, ToolResponseModelToolConfig, ToolResponseModelToolConfig_Client, ToolResponseModelToolConfig_Mcp, ToolResponseModelToolConfig_System, ToolResponseModelToolConfig_Webhook, ToolSortBy, ToolType, ToolTypeFilter, ToolUsageStatsResponseModel, ToolsResponseModel, TopicDiscoverySettings, TopicEvaluationCriteriaAggregate, TopicMetricsAggregate, TopicSentimentAggregate, TranscriptMessage, TranscriptMessageRole, TranscriptionOrderItemRequest, TranscriptionWord, TranscriptionWordType, TransferBranchInfoDefaultingToMain, TransferBranchInfoTrafficSplit, TransferToAgentToolConfigInput, TransferToAgentToolConfigOutput, TransferToAgentToolResultErrorModel, TransferToAgentToolResultSuccessModelInput, TransferToAgentToolResultSuccessModelInputBranchInfo, TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit, TransferToAgentToolResultSuccessModelOutput, TransferToAgentToolResultSuccessModelOutputBranchInfo, TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit, TransferToNumberResultErrorModel, TransferToNumberResultExotelSuccessModel, TransferToNumberResultSipSuccessModel, TransferToNumberResultTwilioSuccessModel, TransferToNumberToolConfigInput, TransferToNumberToolConfigOutput, TransferTypeEnum, TranslateAudioOutputError, TranslateAudioPayload, TranslateAuthError, TranslateEndOfStreamPayload, TranslateErrorPayload, TranslateFinalTranscriptPayload, TranslateInputAudioChunkPayload, TranslateInputError, TranslateInputFormatEnum, TranslateOutputFormatEnum, TranslatePartialTranscriptPayload, TranslateQueueOverflowError, TranslateRateLimitedError, TranslateSessionStartedPayload, TranslateStatusPayload, TranslateTranscriberError, TranslateTranslationError, TranslateTranslationPayload, TranslatedString, TriggerUserVerificationParams, TriggeredGuardrailCommonModel, TtsConversationalConfigInput, TtsConversationalConfigOutput, TtsConversationalConfigOverride, TtsConversationalConfigOverrideConfig, TtsConversationalConfigWorkflowOverrideInput, TtsConversationalConfigWorkflowOverrideOutput, TtsConversationalModel, TtsModelFamily, TtsOptimizeStreamingLatency, TtsOutputFormat, TurnConfig, TurnConfigOverride, TurnConfigOverrideConfig, TurnConfigWorkflowOverride, TurnEagerness, TurnMode, TurnModel, TwilioEdgeLocation, TwilioOutboundCallResponse, TwilioRegionId, TxtExportOptions, UnitTestRunResponseModel, UnitTestRunResponseModelTestInfo, UnitTestRunResponseModelTestInfo_Llm, UnitTestRunResponseModelTestInfo_Simulation, UnitTestRunResponseModelTestInfo_Tool, UnitTestSummaryResponseModel, UnitTestToolCallEvaluationModelInput, UnitTestToolCallEvaluationModelOutput, UnitTestToolCallParameter, UnitTestToolCallParameterEval, UnitTestToolCallParameterEval_Anything, UnitTestToolCallParameterEval_Exact, UnitTestToolCallParameterEval_Llm, UnitTestToolCallParameterEval_Regex, UnitTestWorkflowNodeTransitionEvaluationNodeId, UpdateAgentProcedureParams, UpdateAgentRuleParams, UpdateAssetParams, UpdateAudioNativeProjectRequest, UpdateBasicAuthRequest, UpdateBearerAuthRequest, UpdateBookingPageAppearanceParams, UpdateBookingPageSettingsParams, UpdateBusinessInfoParams, UpdateCalendarEventParams, UpdateChapterRequest, UpdateClientParams, UpdateCustomerFacingConfigParams, UpdateGroupSessionSeatsParams, UpdateHolidayParams, UpdateLocationParams, UpdateOAuth2ClientCredsRequest, UpdateOAuth2JwtRequest, UpdateOAuth2JwtRequestAlgorithm, UpdateOAuth2JwtRequestTokenResponseField, UpdateOrderRequest, UpdateOrderResponse, UpdateProductParams, UpdateProjectRequest, UpdatePronunciationDictionariesRequest, UpdateResponseUnitTestRequest, UpdateServiceParams, UpdateSimulationTestRequest, UpdateStaffParams, UpdateToolCallUnitTestRequest, UpdateTransferRuleParams, UpdateWorkspaceMemberResponseModel, UpsertOrderItemRequest, UpsertOrderItemResponse, UrlAvatar, UrlModel, UrlSecretAuthResponse, UsageAggregationInterval, UsageCharactersResponseModel, User, UserAccessManagementActivityId, UserFeedback, UserFeedbackScore, UserModel, UserTranscriptPayload, UserTypeId, UsersSortBy, UtteranceResponseModel, UuiTransferConfig, UuiTransferConfigProtocolDiscriminatorMode, VadConfig, VadConfigWorkflowOverride, ValidateUserVerificationCodeParams, ValidationError, ValidationErrorLocItem, Verbosity, VerificationAttemptResponse, VerifiedVoiceLanguageResponseModel, VerifyPvcVoiceCaptchaResponseModel, VideoAnalysis, VideoAnalysisResult, VideoAnalysisStatus, VideoKeyMoment, VideoSegment, VideoSubject, VisitedAgentRef, Voice, VoiceAccentResponseModel, VoiceCategory, VoiceDesignPreviewResponse, VoiceGenerationParameterOptionResponse, VoiceGenerationParameterResponse, VoiceLabellingStatus, VoiceMailDetectionResultSuccessModel, VoicePreviewResponseModel, VoiceRecordingQuality, VoiceSafetyControl, VoiceSample, VoiceSamplePreviewResponseModel, VoiceSampleVisualWaveformResponseModel, VoiceSegment, VoiceSettings, VoiceSharingModerationCheckResponseModel, VoiceSharingResponse, VoiceSharingResponseCategory, VoiceSharingState, VoiceStatisticsResponseModel, VoiceVerificationResponse, VoicemailDetectionToolConfig, VoicesNotPermittedWarning, WebhookAuthMethodType, WebhookEventType, WebhookHmacSettings, WebhookToolApiSchemaConfigInput, WebhookToolApiSchemaConfigInputAuthConnection, WebhookToolApiSchemaConfigInputContentType, WebhookToolApiSchemaConfigInputMethod, WebhookToolApiSchemaConfigInputRequestHeadersValue, WebhookToolApiSchemaConfigOutput, WebhookToolApiSchemaConfigOutputAuthConnection, WebhookToolApiSchemaConfigOutputContentType, WebhookToolApiSchemaConfigOutputMethod, WebhookToolApiSchemaConfigOutputRequestHeadersValue, WebhookToolConfigInput, WebhookToolConfigOutput, WebhookTranscriptFormat, WebhookUsageType, WebsocketTtsClientMessageMulti, WebsocketTtsServerMessageMulti, WhatsAppAuthResponse, WhatsAppConversationInfo, WhatsAppConversationInfoDirection, WhatsAppOutboundCallResponse, WhatsAppOutboundMessageResponse, WhatsAppTemplateBodyComponentParams, WhatsAppTemplateButtonComponentParams, WhatsAppTemplateDocumentParam, WhatsAppTemplateDocumentParamDetails, WhatsAppTemplateHeaderComponentParams, WhatsAppTemplateHeaderComponentParamsParametersItem, WhatsAppTemplateHeaderComponentParamsParametersItem_Document, WhatsAppTemplateHeaderComponentParamsParametersItem_Image, WhatsAppTemplateHeaderComponentParamsParametersItem_Location, WhatsAppTemplateHeaderComponentParamsParametersItem_Text, WhatsAppTemplateImageParam, WhatsAppTemplateImageParamDetails, WhatsAppTemplateLocationParam, WhatsAppTemplateLocationParamDetails, WhatsAppTemplateTextParam, WidgetConfig, WidgetConfigAvatar, WidgetConfigAvatar_Image, WidgetConfigAvatar_Orb, WidgetConfigAvatar_Url, WidgetConfigResponse, WidgetConfigResponseAvatar, WidgetConfigResponseAvatar_Image, WidgetConfigResponseAvatar_Orb, WidgetConfigResponseAvatar_Url, WidgetConfigResponseSyntaxHighlightTheme, WidgetConfigSyntaxHighlightTheme, WidgetEndFeedbackConfig, WidgetEndFeedbackType, WidgetExpandable, WidgetFeedbackMode, WidgetLanguagePreset, WidgetLanguagePresetResponse, WidgetPlacement, WidgetStyles, WidgetTermsTranslation, WidgetTextContents, WidgetTextContentsTranslation, WordTimestamp, WorkflowEdgeModelInput, WorkflowEdgeModelInputBackwardCondition, WorkflowEdgeModelInputBackwardCondition_Expression, WorkflowEdgeModelInputBackwardCondition_Llm, WorkflowEdgeModelInputBackwardCondition_Result, WorkflowEdgeModelInputBackwardCondition_Unconditional, WorkflowEdgeModelInputForwardCondition, WorkflowEdgeModelInputForwardCondition_Expression, WorkflowEdgeModelInputForwardCondition_Llm, WorkflowEdgeModelInputForwardCondition_Result, WorkflowEdgeModelInputForwardCondition_Unconditional, WorkflowEdgeModelOutput, WorkflowEdgeModelOutputBackwardCondition, WorkflowEdgeModelOutputBackwardCondition_Expression, WorkflowEdgeModelOutputBackwardCondition_Llm, WorkflowEdgeModelOutputBackwardCondition_Result, WorkflowEdgeModelOutputBackwardCondition_Unconditional, WorkflowEdgeModelOutputForwardCondition, WorkflowEdgeModelOutputForwardCondition_Expression, WorkflowEdgeModelOutputForwardCondition_Llm, WorkflowEdgeModelOutputForwardCondition_Result, WorkflowEdgeModelOutputForwardCondition_Unconditional, WorkflowEndNodeModelInput, WorkflowEndNodeModelOutput, WorkflowExpressionConditionModelInput, WorkflowExpressionConditionModelOutput, WorkflowFeaturesUsageCommonModel, WorkflowLlmConditionModelInput, WorkflowLlmConditionModelOutput, WorkflowOverrideAgentNodeModelInput, WorkflowOverrideAgentNodeModelOutput, WorkflowPhoneNumberNodeModelInput, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static, WorkflowPhoneNumberNodeModelInputPostDialDigits, WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelInputPostDialDigits_Static, WorkflowPhoneNumberNodeModelInputTransferDestination, WorkflowPhoneNumberNodeModelInputTransferDestination_Phone, WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable, WorkflowPhoneNumberNodeModelOutput, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static, WorkflowPhoneNumberNodeModelOutputPostDialDigits, WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static, WorkflowPhoneNumberNodeModelOutputTransferDestination, WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone, WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable, WorkflowResultConditionModelInput, WorkflowResultConditionModelOutput, WorkflowStandaloneAgentNodeModelInput, WorkflowStandaloneAgentNodeModelOutput, WorkflowStartNodeModelInput, WorkflowStartNodeModelOutput, WorkflowToolEdgeStepModel, WorkflowToolLocator, WorkflowToolLocatorSchemaOverridesValue, WorkflowToolLocatorSchemaOverridesValue_Constant, WorkflowToolLocatorSchemaOverridesValue_DynamicVariable, WorkflowToolLocatorSchemaOverridesValue_Llm, WorkflowToolLocatorSchemaOverridesValue_Omit, WorkflowToolMaxIterationsExceededStepModel, WorkflowToolNestedToolsStepModelInput, WorkflowToolNestedToolsStepModelInputResultsItem, WorkflowToolNestedToolsStepModelOutput, WorkflowToolNestedToolsStepModelOutputResultsItem, WorkflowToolNodeModelInput, WorkflowToolNodeModelOutput, WorkflowToolResponseModelInput, WorkflowToolResponseModelInputStepsItem, WorkflowToolResponseModelInputStepsItem_Edge, WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelInputStepsItem_NestedTools, WorkflowToolResponseModelOutput, WorkflowToolResponseModelOutputStepsItem, WorkflowToolResponseModelOutputStepsItem_Edge, WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelOutputStepsItem_NestedTools, WorkflowUnconditionalModelInput, WorkflowUnconditionalModelOutput, WorkspaceAnalyticsQueryResponseModel, WorkspaceAnalyticsQueryResponseModelColumnTypesItem, WorkspaceAnalyticsQueryResponseModelRowsItemItem, WorkspaceApiKeyListResponseModel, WorkspaceApiKeyResponseModel, WorkspaceAuditLogEntryResponse, WorkspaceAuditLogEntryResponseActivityId, WorkspaceAuditLogsPageResponse, WorkspaceBatchCallsResponse, WorkspaceCreateApiKeyResponseModel, WorkspaceCreateServiceAccountResponseModel, WorkspaceCreateWebhookResponseModel, WorkspaceGroupByNameResponseModel, WorkspaceGroupPermission, WorkspaceGroupResponseModel, WorkspaceGroupResponseModelGroupPvcLimit, WorkspaceGroupResponseModelGroupUsageLimit, WorkspaceMemberResponseModel, WorkspaceResourceType, WorkspaceServiceAccountListResponseModel, WorkspaceServiceAccountResponseModel, WorkspaceWebhookEventType, WorkspaceWebhookListResponseModel, WorkspaceWebhookResponseModel, WorkspaceWebhookUsageResponseModel, ) from .errors import ( BadRequestError, ConflictError, ForbiddenError, NotFoundError, TooEarlyError, UnauthorizedError, UnprocessableEntityError, ) from . import ( audio_isolation, audio_native, conversational_ai, dubbing, environment_variables, forced_alignment, history, models, music, productions, pronunciation_dictionaries, samples, service_accounts, speech_engine, speech_engine_upstream, speech_to_speech, speech_to_text, studio, text_to_dialogue, text_to_sound_effects, text_to_speech, text_to_voice, tokens, usage, user, v_1_speech_to_text_realtime, v_1_text_to_dialogue_multi_stream_input, v_1_text_to_dialogue_stream_input, v_1_text_to_speech_voice_id_multi_stream_input, v_1_text_to_speech_voice_id_stream_input, v_1_translate_realtime, voices, webhooks, workspace, workspaces, ) from .audio_isolation import AudioIsolationRequestFileFormat, AudioIsolationStreamRequestFileFormat from .audio_native import AudioNativeCreateRequestApplyTextNormalization from .client import AsyncElevenLabs, ElevenLabs from .dubbing import ( DubRequestMode, DubbingListRequestCreationSourcesItem, DubbingListRequestDubbingModelsItem, DubbingListRequestDubbingStatus, DubbingListRequestDubbingStatusesItem, DubbingListRequestFilterByCreator, DubbingListRequestOrderBy, DubbingListRequestOrderDirection, ) from .environment import ElevenLabsEnvironment from .environment_variables import ( EnvironmentVariablesCreateRequestBody, EnvironmentVariablesCreateRequestBody_AuthConnection, EnvironmentVariablesCreateRequestBody_Secret, EnvironmentVariablesCreateRequestBody_String, EnvironmentVariablesListRequestType, UpdateEnvironmentVariableRequestValuesValue, ) from .history import HistoryListRequestSortDirection, HistoryListRequestSource from .music import ( BodyComposeMusicV1MusicPostCompositionPlan, BodyComposeMusicV1MusicPostModelId, BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, BodyStreamComposedMusicV1MusicStreamPostModelId, BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, MusicComposeDetailedRequestOutputFormat, MusicComposeDetailedStreamRequestOutputFormat, MusicComposeRequestOutputFormat, MusicSeparateStemsRequestStemVariationId, MusicStreamRequestOutputFormat, MusicVideoToMusicRequestModelId, ) from .play import play, save, stream from .pronunciation_dictionaries import ( AddPronunciationDictionaryRequestWorkspaceAccess, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess, PronunciationDictionariesListRequestSort, ) from .realtime import ( AudioFormat, CommitStrategy, RealtimeAudioOptions, RealtimeConnection, RealtimeEvents, RealtimeUrlOptions, ) from .speech_engine_upstream import ReceiveUpstreamMessage, SendUpstreamMessage from .speech_to_speech import ( SpeechToSpeechConvertRequestOutputFormat, SpeechToSpeechRequestFileFormat, SpeechToSpeechStreamRequestFileFormat, SpeechToSpeechStreamRequestOutputFormat, ) from .speech_to_text import ( SpeechToTextConvertRequestEntityDetection, SpeechToTextConvertRequestEntityRedaction, SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestModelId, SpeechToTextConvertRequestMultichannelOutputStyle, SpeechToTextConvertRequestTimestampsGranularity, SpeechToTextConvertRequestWebhookMetadata, SpeechToTextConvertResponse, ) from .studio import ( BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization, BodyCreatePodcastV1StudioPodcastsPostDurationScale, BodyCreatePodcastV1StudioPodcastsPostMode, BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin, BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, BodyCreatePodcastV1StudioPodcastsPostSource, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url, ) from .text_to_dialogue import ( BodyTextToDialogueFullWithTimestampsApplyTextNormalization, BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization, BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization, BodyTextToDialogueStreamWithTimestampsApplyTextNormalization, TextToDialogueConvertRequestOutputFormat, TextToDialogueConvertWithTimestampsRequestOutputFormat, ) from .text_to_speech import ( BodyTextToSpeechFullApplyTextNormalization, BodyTextToSpeechFullWithTimestampsApplyTextNormalization, BodyTextToSpeechStreamApplyTextNormalization, BodyTextToSpeechStreamWithTimestampsApplyTextNormalization, TextToSpeechConvertRequestOutputFormat, TextToSpeechConvertWithTimestampsRequestOutputFormat, TextToSpeechStreamRequestOutputFormat, TextToSpeechStreamWithTimestampsRequestOutputFormat, ) from .text_to_voice import VoiceDesignRequestModelModelId from .v_1_speech_to_text_realtime import ReceiveTranscription from .v_1_text_to_dialogue_multi_stream_input import ReceiveTextToDialogueWebsocketMessageMulti from .v_1_text_to_dialogue_stream_input import ReceiveTextToDialogueWebsocketMessage from .v_1_text_to_speech_voice_id_multi_stream_input import ReceiveMessageMulti, SendMessageMulti from .v_1_text_to_speech_voice_id_stream_input import ReceiveMessage, SendMessage from .v_1_translate_realtime import ReceiveTranslateStreamMessage, SendTranslateStreamMessage from .version import __version__ from .voices import EditVoiceRequestLabels, VoicesGetSharedRequestCategory, VoicesGetSharedRequestSort _dynamic_imports: typing.Dict[str, str] = { "AccountChangeActivityId": ".types", "ActorModel": ".types", "AddChapterResponseModel": ".types", "AddKnowledgeBaseResponseModel": ".types", "AddProjectRequest": ".types", "AddProjectResponseModel": ".types", "AddPronunciationDictionaryRequestWorkspaceAccess": ".pronunciation_dictionaries", "AddPronunciationDictionaryResponseModel": ".types", "AddPronunciationDictionaryResponseModelPermissionOnResource": ".types", "AddSharingVoiceRequest": ".types", "AddVoiceIvcResponseModel": ".types", "AddVoiceResponseModel": ".types", "AddWorkspaceGroupMemberResponseModel": ".types", "AddWorkspaceInviteResponseModel": ".types", "AdditionalFormatResponseModel": ".types", "AdditionalFormats": ".types", "AdhocAgentConfigOverrideForTestRequestModel": ".types", "Age": ".types", "AgentAnalysisItemsInput": ".types", "AgentAnalysisItemsInputDataCollectionItem": ".types", "AgentAnalysisItemsInputDataCollectionItem_System": ".types", "AgentAnalysisItemsInputDataCollectionItem_User": ".types", "AgentAnalysisItemsInputEvaluationCriteriaItem": ".types", "AgentAnalysisItemsInputEvaluationCriteriaItem_System": ".types", "AgentAnalysisItemsInputEvaluationCriteriaItem_User": ".types", "AgentAnalysisItemsOutput": ".types", "AgentAnalysisItemsOutputDataCollectionItem": ".types", "AgentAnalysisItemsOutputDataCollectionItem_System": ".types", "AgentAnalysisItemsOutputDataCollectionItem_User": ".types", "AgentAnalysisItemsOutputEvaluationCriteriaItem": ".types", "AgentAnalysisItemsOutputEvaluationCriteriaItem_System": ".types", "AgentAnalysisItemsOutputEvaluationCriteriaItem_User": ".types", "AgentBranchBasicInfo": ".types", "AgentBranchResponse": ".types", "AgentBranchSummary": ".types", "AgentCallLimits": ".types", "AgentConfig": ".types", "AgentConfigApiModelWorkflowOverrideInput": ".types", "AgentConfigApiModelWorkflowOverrideOutput": ".types", "AgentConfigOverrideConfig": ".types", "AgentConfigOverrideInput": ".types", "AgentConfigOverrideOutput": ".types", "AgentDefinitionSource": ".types", "AgentDeploymentPercentageStrategy": ".types", "AgentDeploymentRequest": ".types", "AgentDeploymentRequestItem": ".types", "AgentDeploymentResponse": ".types", "AgentFailureResponseExample": ".types", "AgentKnowledgeBaseRagChunkResponseModel": ".types", "AgentKnowledgeBaseRagQueryRequestModel": ".types", "AgentKnowledgeBaseRagQueryResponseModel": ".types", "AgentMetadata": ".types", "AgentMetadataDbModel": ".types", "AgentMetadataResponseModel": ".types", "AgentPlatformSettingsRequestModel": ".types", "AgentPlatformSettingsResponseModel": ".types", "AgentResponsePayload": ".types", "AgentSimulatedChatTestResponseModel": ".types", "AgentSortBy": ".types", "AgentSuccessfulResponseExample": ".types", "AgentSummaryBatchSuccessfulResponseModel": ".types", "AgentSummaryResponseModel": ".types", "AgentTestEntityType": ".types", "AgentTestFolderPathSegmentResponseModel": ".types", "AgentTestingSettings": ".types", "AgentTopicResponseModel": ".types", "AgentTransferInput": ".types", "AgentTransferOp": ".types", "AgentTransferOpPop": ".types", "AgentTransferOpPush": ".types", "AgentTransferOpReplace": ".types", "AgentTransferOp_Pop": ".types", "AgentTransferOp_Push": ".types", "AgentTransferOp_Replace": ".types", "AgentTransferOutput": ".types", "AgentTrustContext": ".types", "AgentVersionMetadata": ".types", "AgentVersionParents": ".types", "AgentWorkflowRequestModel": ".types", "AgentWorkflowRequestModelNodesValue": ".types", "AgentWorkflowRequestModelNodesValue_End": ".types", "AgentWorkflowRequestModelNodesValue_OverrideAgent": ".types", "AgentWorkflowRequestModelNodesValue_PhoneNumber": ".types", "AgentWorkflowRequestModelNodesValue_StandaloneAgent": ".types", "AgentWorkflowRequestModelNodesValue_Start": ".types", "AgentWorkflowRequestModelNodesValue_Tool": ".types", "AgentWorkflowResponseModel": ".types", "AgentWorkflowResponseModelNodesValue": ".types", "AgentWorkflowResponseModelNodesValue_End": ".types", "AgentWorkflowResponseModelNodesValue_OverrideAgent": ".types", "AgentWorkflowResponseModelNodesValue_PhoneNumber": ".types", "AgentWorkflowResponseModelNodesValue_StandaloneAgent": ".types", "AgentWorkflowResponseModelNodesValue_Start": ".types", "AgentWorkflowResponseModelNodesValue_Tool": ".types", "AgentWorkspaceOverridesInput": ".types", "AgentWorkspaceOverridesOutput": ".types", "AlertingMonitorConfig": ".types", "AlertingSettings": ".types", "AlertingSettingsResponse": ".types", "AlertingWebhookHeader": ".types", "AlertingWebhookMethod": ".types", "AlertingWebhookNotifier": ".types", "AlertingWebhookNotifierResponse": ".types", "Alignment": ".types", "AllowedOutputFormats": ".types", "AllowlistItem": ".types", "AnalysisCharging": ".types", "AnalysisProperty": ".types", "AnalysisPropertyConstantValue": ".types", "AnalysisPropertyType": ".types", "AnalysisRunSnapshot": ".types", "AnalysisRunningTotal": ".types", "AnalysisScope": ".types", "AnalysisType": ".types", "ApiIntegrationOAuth2AuthCodeResponse": ".types", "ApiIntegrationOAuth2AuthCodeResponseScopeSeparator": ".types", "ApiIntegrationOAuth2CustomAppResponse": ".types", "ApiIntegrationOAuth2CustomAppResponseScopeSeparator": ".types", "ApiIntegrationWebhookOverrides": ".types", "ApiIntegrationWebhookOverridesRequestHeadersValue": ".types", "ApiIntegrationWebhookOverridesSchemaOverridesValue": ".types", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant": ".types", "ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable": ".types", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm": ".types", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit": ".types", "ApiIntegrationWebhookToolConfigInput": ".types", "ApiIntegrationWebhookToolConfigOutput": ".types", "ArrayJsonSchemaPropertyInput": ".types", "ArrayJsonSchemaPropertyInputItems": ".types", "ArrayJsonSchemaPropertyInputPropertyKind": ".types", "ArrayJsonSchemaPropertyOutput": ".types", "ArrayJsonSchemaPropertyOutputItems": ".types", "AsrConversationalConfig": ".types", "AsrConversationalConfigOverride": ".types", "AsrConversationalConfigOverrideConfig": ".types", "AsrConversationalConfigWorkflowOverride": ".types", "AsrInputFormat": ".types", "AsrProvider": ".types", "AsrQuality": ".types", "AssetTranscription": ".types", "AssetTranscriptionData": ".types", "AssetTranscriptionStatus": ".types", "AstAdditionOperatorNodeInput": ".types", "AstAdditionOperatorNodeOutput": ".types", "AstAndOperatorNodeInput": ".types", "AstAndOperatorNodeOutput": ".types", "AstBooleanNodeInput": ".types", "AstBooleanNodeOutput": ".types", "AstConditionalOperatorNodeInput": ".types", "AstConditionalOperatorNodeOutput": ".types", "AstDivisionOperatorNodeInput": ".types", "AstDivisionOperatorNodeOutput": ".types", "AstDynamicVariableNodeInput": ".types", "AstDynamicVariableNodeOutput": ".types", "AstEqualsOperatorNodeInput": ".types", "AstEqualsOperatorNodeOutput": ".types", "AstGreaterThanOperatorNodeInput": ".types", "AstGreaterThanOperatorNodeOutput": ".types", "AstGreaterThanOrEqualsOperatorNodeInput": ".types", "AstGreaterThanOrEqualsOperatorNodeOutput": ".types", "AstLessThanOperatorNodeInput": ".types", "AstLessThanOperatorNodeOutput": ".types", "AstLessThanOrEqualsOperatorNodeInput": ".types", "AstLessThanOrEqualsOperatorNodeOutput": ".types", "AstMultiplicationOperatorNodeInput": ".types", "AstMultiplicationOperatorNodeOutput": ".types", "AstNodeInput": ".types", "AstNodeInputLlm": ".types", "AstNodeInput_AddOperator": ".types", "AstNodeInput_AndOperator": ".types", "AstNodeInput_BooleanLiteral": ".types", "AstNodeInput_ConditionalOperator": ".types", "AstNodeInput_DivOperator": ".types", "AstNodeInput_DynamicVariable": ".types", "AstNodeInput_EqOperator": ".types", "AstNodeInput_GtOperator": ".types", "AstNodeInput_GteOperator": ".types", "AstNodeInput_Llm": ".types", "AstNodeInput_LtOperator": ".types", "AstNodeInput_LteOperator": ".types", "AstNodeInput_MulOperator": ".types", "AstNodeInput_NeqOperator": ".types", "AstNodeInput_NullLiteral": ".types", "AstNodeInput_NumberLiteral": ".types", "AstNodeInput_OrOperator": ".types", "AstNodeInput_StringLiteral": ".types", "AstNodeInput_SubOperator": ".types", "AstNodeOutput": ".types", "AstNodeOutput_AddOperator": ".types", "AstNodeOutput_AndOperator": ".types", "AstNodeOutput_BooleanLiteral": ".types", "AstNodeOutput_ConditionalOperator": ".types", "AstNodeOutput_DivOperator": ".types", "AstNodeOutput_DynamicVariable": ".types", "AstNodeOutput_EqOperator": ".types", "AstNodeOutput_GtOperator": ".types", "AstNodeOutput_GteOperator": ".types", "AstNodeOutput_Llm": ".types", "AstNodeOutput_LtOperator": ".types", "AstNodeOutput_LteOperator": ".types", "AstNodeOutput_MulOperator": ".types", "AstNodeOutput_NeqOperator": ".types", "AstNodeOutput_NullLiteral": ".types", "AstNodeOutput_NumberLiteral": ".types", "AstNodeOutput_OrOperator": ".types", "AstNodeOutput_StringLiteral": ".types", "AstNodeOutput_SubOperator": ".types", "AstNotEqualsOperatorNodeInput": ".types", "AstNotEqualsOperatorNodeOutput": ".types", "AstNullNodeInput": ".types", "AstNullNodeOutput": ".types", "AstNumberNodeInput": ".types", "AstNumberNodeInputValue": ".types", "AstNumberNodeOutput": ".types", "AstNumberNodeOutputValue": ".types", "AstOrOperatorNodeInput": ".types", "AstOrOperatorNodeOutput": ".types", "AstStringNodeInput": ".types", "AstStringNodeOutput": ".types", "AstSubtractionOperatorNodeInput": ".types", "AstSubtractionOperatorNodeOutput": ".types", "AstllmNodeInput": ".types", "AstllmNodeInputPrompt": ".types", "AstllmNodeInputValueSchema": ".types", "AstllmNodeOutput": ".types", "AsyncConversationMetadata": ".types", "AsyncConversationMetadataDeliveryStatus": ".types", "AsyncElevenLabs": ".client", "AttachedSystemDataCollectionRef": ".types", "AttachedSystemEvaluationRef": ".types", "AttachedSystemEvaluationRefAnalysisItemId": ".types", "AttachedTestModel": ".types", "AttachedUserDataCollectionRef": ".types", "AttachedUserEvaluationRef": ".types", "AudioAnalysis": ".types", "AudioAnalysisResult": ".types", "AudioAnalysisStatus": ".types", "AudioFormat": ".realtime", "AudioFormatEnum": ".types", "AudioIsolationHistoryItemResponseModel": ".types", "AudioIsolationRequestFileFormat": ".audio_isolation", "AudioIsolationStreamRequestFileFormat": ".audio_isolation", "AudioKeyMoment": ".types", "AudioNativeCreateProjectResponseModel": ".types", "AudioNativeCreateRequestApplyTextNormalization": ".audio_native", "AudioNativeEditContentResponseModel": ".types", "AudioNativeProjectSettingsResponseModel": ".types", "AudioNativeProjectSettingsResponseModelStatus": ".types", "AudioOutput": ".types", "AudioOutputMulti": ".types", "AudioRefChunk": ".types", "AudioSegment": ".types", "AudioWithTimestampsAndVoiceSegmentsResponseModel": ".types", "AudioWithTimestampsResponse": ".types", "AuthConnectionDependencies": ".types", "AuthConnectionDependenciesMcpServersItem": ".types", "AuthConnectionDependenciesMcpServersItem_Available": ".types", "AuthConnectionDependenciesMcpServersItem_Unknown": ".types", "AuthConnectionDependenciesToolsItem": ".types", "AuthConnectionDependenciesToolsItem_Available": ".types", "AuthConnectionDependenciesToolsItem_Unknown": ".types", "AuthConnectionLocator": ".types", "AuthConnectionStatus": ".types", "AuthSettings": ".types", "AuthenticationActivityId": ".types", "AuthorizationMethod": ".types", "AutoGenerationMetadata": ".types", "AutoSyncInfo": ".types", "BackgroundSoundConfig": ".types", "BackgroundSoundConfigWorkflowOverride": ".types", "BackgroundSoundPresetId": ".types", "BackgroundSoundSourceType": ".types", "BackupLlmDefault": ".types", "BackupLlmDisabled": ".types", "BackupLlmOverride": ".types", "BadRequestError": ".errors", "BadRequestErrorBody": ".types", "BaseTurnConfig": ".types", "BasicAuthResponse": ".types", "BatchCallDetailedResponse": ".types", "BatchCallRecipientStatus": ".types", "BatchCallResponse": ".types", "BatchCallStatus": ".types", "BatchCallWhatsAppParams": ".types", "BatchFailureResponseModel": ".types", "BearerAuthResponse": ".types", "BehaviorOverride": ".types", "BillingPeriod": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem": ".pronunciation_dictionaries", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias": ".pronunciation_dictionaries", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme": ".pronunciation_dictionaries", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess": ".pronunciation_dictionaries", "BodyComposeMusicV1MusicPostCompositionPlan": ".music", "BodyComposeMusicV1MusicPostModelId": ".music", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan": ".music", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId": ".music", "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization": ".studio", "BodyCreatePodcastV1StudioPodcastsPostDurationScale": ".studio", "BodyCreatePodcastV1StudioPodcastsPostMode": ".studio", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin": ".studio", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation": ".studio", "BodyCreatePodcastV1StudioPodcastsPostSource": ".studio", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem": ".studio", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text": ".studio", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url": ".studio", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan": ".music", "BodyStreamComposedMusicV1MusicStreamPostModelId": ".music", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan": ".music", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId": ".music", "BodyTextToDialogueFullWithTimestampsApplyTextNormalization": ".text_to_dialogue", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization": ".text_to_dialogue", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization": ".text_to_dialogue", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization": ".text_to_dialogue", "BodyTextToSpeechFullApplyTextNormalization": ".text_to_speech", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization": ".text_to_speech", "BodyTextToSpeechStreamApplyTextNormalization": ".text_to_speech", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization": ".text_to_speech", "BranchProtectionStatus": ".types", "BreakdownTypes": ".types", "BucketingStatus": ".types", "BuiltInToolsInput": ".types", "BuiltInToolsOutput": ".types", "BuiltInToolsWorkflowOverrideInput": ".types", "BuiltInToolsWorkflowOverrideOutput": ".types", "CancelCalendarEventParams": ".types", "CancelGroupSessionForAllParams": ".types", "CancelGroupSessionRegistrationParams": ".types", "CanvasPlacement": ".types", "CaptionStyleCharacterAnimationModel": ".types", "CaptionStyleCharacterAnimationModelEnterType": ".types", "CaptionStyleCharacterAnimationModelExitType": ".types", "CaptionStyleHorizontalPlacementModel": ".types", "CaptionStyleHorizontalPlacementModelAlign": ".types", "CaptionStyleModel": ".types", "CaptionStyleModelTextAlign": ".types", "CaptionStyleModelTextBlendMode": ".types", "CaptionStyleModelTextStyle": ".types", "CaptionStyleModelTextTransform": ".types", "CaptionStyleModelTextWeight": ".types", "CaptionStyleSectionAnimationModel": ".types", "CaptionStyleSectionAnimationModelEnterType": ".types", "CaptionStyleSectionAnimationModelExitType": ".types", "CaptionStyleTemplateModel": ".types", "CaptionStyleVerticalPlacementModel": ".types", "CaptionStyleVerticalPlacementModelAlign": ".types", "CaptionStyleWordAnimationModel": ".types", "CaptionStyleWordAnimationModelEnterType": ".types", "CaptionStyleWordAnimationModelExitType": ".types", "ChapterContentBlockExtendableNodeResponseModel": ".types", "ChapterContentBlockInputModel": ".types", "ChapterContentBlockInputModelSubType": ".types", "ChapterContentBlockResponseModel": ".types", "ChapterContentBlockResponseModelNodesItem": ".types", "ChapterContentBlockResponseModelNodesItem_Other": ".types", "ChapterContentBlockResponseModelNodesItem_TtsNode": ".types", "ChapterContentBlockTtsNodeResponseModel": ".types", "ChapterContentInputModel": ".types", "ChapterContentParagraphTtsNodeInputModel": ".types", "ChapterContentResponseModel": ".types", "ChapterResponse": ".types", "ChapterSnapshotExtendedResponseModel": ".types", "ChapterSnapshotResponse": ".types", "ChapterSnapshotsResponse": ".types", "ChapterState": ".types", "ChapterStatisticsResponse": ".types", "ChapterWithContentResponseModel": ".types", "ChapterWithContentResponseModelState": ".types", "CharacterAge": ".types", "CharacterAlignmentModel": ".types", "CharacterAlignmentResponseModel": ".types", "CharacterGender": ".types", "CharacterMetadataResponseModel": ".types", "CharacterRefreshPeriod": ".types", "CharacterResponseModel": ".types", "CharacterRole": ".types", "CharacterUsageResponse": ".types", "ChatSourceMedium": ".types", "CheckServiceAvailabilityParams": ".types", "ClientEvent": ".types", "ClientToolConfigInput": ".types", "ClientToolConfigOutput": ".types", "ClipAnimation": ".types", "ClipAnimationEnterEffect": ".types", "ClipAnimationExitEffect": ".types", "CloseConnection": ".types", "CloseContext": ".types", "ClosePayload": ".types", "CloseSocket": ".types", "ColumnFilter": ".types", "ColumnFilterOperation": ".types", "ColumnFilterValuesItem": ".types", "ColumnUnit": ".types", "CommitStrategy": ".realtime", "CommittedTranscriptEntitiesPayload": ".types", "CommittedTranscriptPayload": ".types", "CommittedTranscriptWithTimestampsPayload": ".types", "CompileProceduresResponseModel": ".types", "CompileProceduresValidationErrorResponseModel": ".types", "CompositionPlan": ".types", "CompositionPlanChunksItem": ".types", "ConfigEntityType": ".types", "ConflictError": ".errors", "ConflictSection": ".types", "ConstantSchemaOverride": ".types", "ConstantSchemaOverrideConstantValue": ".types", "ContentConfig": ".types", "ContentFormat": ".types", "ContentGuardrailInput": ".types", "ContentGuardrailInputTriggerAction": ".types", "ContentGuardrailInputTriggerAction_EndCall": ".types", "ContentGuardrailInputTriggerAction_Retry": ".types", "ContentGuardrailOutput": ".types", "ContentGuardrailOutputTriggerAction": ".types", "ContentGuardrailOutputTriggerAction_EndCall": ".types", "ContentGuardrailOutputTriggerAction_Retry": ".types", "ContentThresholdGuardrail": ".types", "ContentThresholdGuardrailThreshold": ".types", "ContextualUpdateInfo": ".types", "Contributor": ".types", "ConvAiDynamicVariable": ".types", "ConvAiEnvVarLocator": ".types", "ConvAiFileUploadResponseModel": ".types", "ConvAiSecretLocator": ".types", "ConvAiStoredSecretDependencies": ".types", "ConvAiStoredSecretDependenciesAgentsItem": ".types", "ConvAiStoredSecretDependenciesAgentsItem_Available": ".types", "ConvAiStoredSecretDependenciesAgentsItem_Unknown": ".types", "ConvAiStoredSecretDependenciesMcpServersItem": ".types", "ConvAiStoredSecretDependenciesMcpServersItem_Available": ".types", "ConvAiStoredSecretDependenciesMcpServersItem_Unknown": ".types", "ConvAiStoredSecretDependenciesToolsItem": ".types", "ConvAiStoredSecretDependenciesToolsItem_Available": ".types", "ConvAiStoredSecretDependenciesToolsItem_Unknown": ".types", "ConvAiUserSecretDbModel": ".types", "ConvAiWebhooks": ".types", "ConvAiWorkspaceStoredSecretConfig": ".types", "ConversationAsrUsageModel": ".types", "ConversationChargingCommonModel": ".types", "ConversationConfigClientOverrideConfigInput": ".types", "ConversationConfigClientOverrideConfigOutput": ".types", "ConversationConfigClientOverrideInput": ".types", "ConversationConfigClientOverrideOutput": ".types", "ConversationConfigInput": ".types", "ConversationConfigOutput": ".types", "ConversationConfigOverride": ".types", "ConversationConfigOverrideConfig": ".types", "ConversationConfigWorkflowOverrideInput": ".types", "ConversationConfigWorkflowOverrideOutput": ".types", "ConversationDeletionSettings": ".types", "ConversationFeedbackType": ".types", "ConversationHistoryAnalysisCommonModel": ".types", "ConversationHistoryBatchCallModel": ".types", "ConversationHistoryElevenAssistantCommonModel": ".types", "ConversationHistoryErrorCommonModel": ".types", "ConversationHistoryEvaluationCriteriaResultCommonModel": ".types", "ConversationHistoryExotelPhoneCallModel": ".types", "ConversationHistoryFeedbackCommonModel": ".types", "ConversationHistoryMetadataCommonModel": ".types", "ConversationHistoryMetadataCommonModelPhoneCall": ".types", "ConversationHistoryMetadataCommonModelPhoneCall_Exotel": ".types", "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking": ".types", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio": ".types", "ConversationHistoryMultivoiceMessageModel": ".types", "ConversationHistoryMultivoiceMessagePartModel": ".types", "ConversationHistoryRagUsageCommonModel": ".types", "ConversationHistoryRedactionConfig": ".types", "ConversationHistorySipTrunkingPhoneCallModel": ".types", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput": ".types", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput": ".types", "ConversationHistoryTranscriptCommonModelInput": ".types", "ConversationHistoryTranscriptCommonModelInputRole": ".types", "ConversationHistoryTranscriptCommonModelInputToolResultsItem": ".types", "ConversationHistoryTranscriptCommonModelOutput": ".types", "ConversationHistoryTranscriptCommonModelOutputRole": ".types", "ConversationHistoryTranscriptCommonModelOutputToolResultsItem": ".types", "ConversationHistoryTranscriptFileInputResponseModel": ".types", "ConversationHistoryTranscriptOtherToolsResultCommonModel": ".types", "ConversationHistoryTranscriptOtherToolsResultCommonModelType": ".types", "ConversationHistoryTranscriptResponseModel": ".types", "ConversationHistoryTranscriptResponseModelRole": ".types", "ConversationHistoryTranscriptResponseModelToolResultsItem": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInput": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutput": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess": ".types", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess": ".types", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput": ".types", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput": ".types", "ConversationHistoryTranscriptToolCallClientDetails": ".types", "ConversationHistoryTranscriptToolCallCommonModelInput": ".types", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails": ".types", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook": ".types", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client": ".types", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp": ".types", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutput": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp": ".types", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook": ".types", "ConversationHistoryTranscriptToolCallMcpDetails": ".types", "ConversationHistoryTranscriptToolCallWebhookDetails": ".types", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput": ".types", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput": ".types", "ConversationHistoryTwilioPhoneCallModel": ".types", "ConversationInitiationClientDataConfigInput": ".types", "ConversationInitiationClientDataConfigOutput": ".types", "ConversationInitiationClientDataInternal": ".types", "ConversationInitiationClientDataRequestInput": ".types", "ConversationInitiationClientDataRequestOutput": ".types", "ConversationInitiationClientDataWebhook": ".types", "ConversationInitiationClientDataWebhookRequestHeadersValue": ".types", "ConversationInitiationSource": ".types", "ConversationInitiationSourceInfo": ".types", "ConversationProduct": ".types", "ConversationReasoningModel": ".types", "ConversationSentimentAnalysis": ".types", "ConversationSentimentAnalysisOverallLabel": ".types", "ConversationSignedUrlResponseModel": ".types", "ConversationSimulationSpecification": ".types", "ConversationSource": ".types", "ConversationSummaryResponseModel": ".types", "ConversationSummaryResponseModelStatus": ".types", "ConversationTagResponseModel": ".types", "ConversationTokenPurpose": ".types", "ConversationTokenResponseModel": ".types", "ConversationTtsUsageModel": ".types", "ConversationTurnMetrics": ".types", "ConversationUserResponseModel": ".types", "ConversationVoiceRewardModel": ".types", "ConversationVoiceUsageModel": ".types", "ConversationalConfig": ".types", "ConversationalConfigApiModelWorkflowOverrideInput": ".types", "ConversationalConfigApiModelWorkflowOverrideOutput": ".types", "ConvertChapterResponseModel": ".types", "ConvertProjectResponseModel": ".types", "CrawlStatus": ".types", "CrawlType": ".types", "CreateAgentBranchResponseModel": ".types", "CreateAgentProcedureParams": ".types", "CreateAgentResponseModel": ".types", "CreateAgentRuleParams": ".types", "CreateAgentTestFolderResponseModel": ".types", "CreateAgentTestResponseModel": ".types", "CreateAssetParams": ".types", "CreateAudioNativeProjectRequest": ".types", "CreateAuthConnectionEnvironmentVariableRequest": ".types", "CreateBasicAuthRequest": ".types", "CreateBearerAuthRequest": ".types", "CreateClientAppointmentParams": ".types", "CreateClientInteractionParams": ".types", "CreateClientParams": ".types", "CreateCrawlJobResponseModel": ".types", "CreateCustomHeaderAuthRequest": ".types", "CreateExotelPhoneNumberRequest": ".types", "CreateHolidayParams": ".types", "CreateLocationParams": ".types", "CreateMtlsAuthRequest": ".types", "CreateOAuth2ClientCredsRequest": ".types", "CreateOAuth2JwtRequest": ".types", "CreateOAuth2JwtRequestAlgorithm": ".types", "CreateOAuth2JwtRequestTokenResponseField": ".types", "CreateOrderRequest": ".types", "CreateOrderResponse": ".types", "CreatePhoneNumberResponseModel": ".types", "CreatePreviouslyGeneratedVoiceRequest": ".types", "CreatePrivateKeyJwtRequest": ".types", "CreatePrivateKeyJwtRequestAlgorithm": ".types", "CreateProcedureRequestModel": ".types", "CreateProcedureResponseModel": ".types", "CreateProductParams": ".types", "CreatePronunciationDictionaryResponseModel": ".types", "CreateResponseUnitTestRequest": ".types", "CreateSecretEnvironmentVariableRequest": ".types", "CreateServiceParams": ".types", "CreateSimulationTestRequest": ".types", "CreateSipTrunkPhoneNumberRequest": ".types", "CreateStaffParams": ".types", "CreateStringEnvironmentVariableRequest": ".types", "CreateToolCallUnitTestRequest": ".types", "CreateTranscriptRequest": ".types", "CreateTransferRuleParams": ".types", "CreateTwilioPhoneNumberRequest": ".types", "CriteriaScoringMode": ".types", "CueOptionsRequest": ".types", "Currency": ".types", "CustomGuardrailConfig": ".types", "CustomGuardrailConfigModel": ".types", "CustomGuardrailConfigTriggerAction": ".types", "CustomGuardrailConfigTriggerAction_EndCall": ".types", "CustomGuardrailConfigTriggerAction_Retry": ".types", "CustomGuardrailInput": ".types", "CustomGuardrailOutput": ".types", "CustomGuardrailsConfigInput": ".types", "CustomGuardrailsConfigOutput": ".types", "CustomHeaderAuthResponse": ".types", "CustomLlm": ".types", "CustomLlmApiKey": ".types", "CustomLlmAuthConnection": ".types", "CustomLlmRequestHeadersValue": ".types", "CustomLlmapiType": ".types", "CustomSipHeader": ".types", "CustomSipHeaderWithDynamicVariable": ".types", "CustomToolApiSchemaConfig": ".types", "DashboardCallSuccessChartModel": ".types", "DashboardCriteriaChartModel": ".types", "DashboardDataCollectionChartModel": ".types", "DataCollectionResultCommonModel": ".types", "DefaultSharingGroupConfig": ".types", "DefaultSharingGroupConfigPermissionLevel": ".types", "DefaultSharingGroupResponseModel": ".types", "DefaultSharingGroupResponseModelPermissionLevel": ".types", "DeleteAgentProcedureParams": ".types", "DeleteAgentRuleParams": ".types", "DeleteAssetParams": ".types", "DeleteCalendarEventParams": ".types", "DeleteChapterRequest": ".types", "DeleteChapterResponseModel": ".types", "DeleteClientInteractionParams": ".types", "DeleteClientParams": ".types", "DeleteDubbingResponseModel": ".types", "DeleteGroupSessionParams": ".types", "DeleteHistoryItemResponse": ".types", "DeleteHolidayParams": ".types", "DeleteLocationParams": ".types", "DeleteProductParams": ".types", "DeleteProjectRequest": ".types", "DeleteProjectResponseModel": ".types", "DeleteSampleResponse": ".types", "DeleteServiceParams": ".types", "DeleteStaffParams": ".types", "DeleteTransferRuleParams": ".types", "DeleteVoiceResponseModel": ".types", "DeleteVoiceSampleResponseModel": ".types", "DeleteWorkspaceGroupMemberResponseModel": ".types", "DeleteWorkspaceInviteResponseModel": ".types", "DeleteWorkspaceWebhookResponseModel": ".types", "DeliverableInfo": ".types", "DependentAvailableAgentIdentifier": ".types", "DependentAvailableAgentIdentifierAccessLevel": ".types", "DependentAvailableMcpServerIdentifier": ".types", "DependentAvailableMcpServerIdentifierAccessLevel": ".types", "DependentAvailableToolIdentifier": ".types", "DependentAvailableToolIdentifierAccessLevel": ".types", "DependentBranchInfo": ".types", "DependentIntegrationConnectionIdentifier": ".types", "DependentPhoneNumberIdentifier": ".types", "DependentUnknownAgentIdentifier": ".types", "DependentUnknownMcpServerIdentifier": ".types", "DependentUnknownToolIdentifier": ".types", "DetailedMusicResponse": ".types", "DetailedMusicResponseCompositionPlan": ".types", "DetectedEntity": ".types", "DeviceModel": ".types", "DialogueInput": ".types", "DialogueInputResponseModel": ".types", "DialogueTextAlignment": ".types", "DirectPublishingReadResponseModel": ".types", "DirectPublishingReadResponseModelDisplayMode": ".types", "DirectPublishingReadResponseModelGenreItem": ".types", "DirectPublishingReadResponseModelPayoutType": ".types", "DirectPublishingReadResponseModelTargetAudience": ".types", "DiscountResponseModel": ".types", "DoDubbingResponse": ".types", "DocumentUsageModeEnum": ".types", "DocxExportOptions": ".types", "DtmfInputConfig": ".types", "DubOrderItemRequest": ".types", "DubRequestMode": ".dubbing", "DubbedSegment": ".types", "DubbingBulkSourceSegmentUpdateResponse": ".types", "DubbingBulkTargetSegmentUpdateResponse": ".types", "DubbingError": ".types", "DubbingLanguageListResponse": ".types", "DubbingLanguageOutputs": ".types", "DubbingLanguageResponse": ".types", "DubbingLanguageResponseStatus": ".types", "DubbingListRequestCreationSourcesItem": ".dubbing", "DubbingListRequestDubbingModelsItem": ".dubbing", "DubbingListRequestDubbingStatus": ".dubbing", "DubbingListRequestDubbingStatusesItem": ".dubbing", "DubbingListRequestFilterByCreator": ".dubbing", "DubbingListRequestOrderBy": ".dubbing", "DubbingListRequestOrderDirection": ".dubbing", "DubbingMediaMetadata": ".types", "DubbingMediaReference": ".types", "DubbingMetadataPageResponseModel": ".types", "DubbingMetadataResponse": ".types", "DubbingProjectListResponse": ".types", "DubbingProjectResponse": ".types", "DubbingProjectResponseStatus": ".types", "DubbingRegenerateResponse": ".types", "DubbingRenderResponseModel": ".types", "DubbingResource": ".types", "DubbingSegmentUpdateRequest": ".types", "DubbingSourceMediaInfo": ".types", "DubbingSourceSegmentUpdateResponse": ".types", "DubbingSourceTranscriptResponse": ".types", "DubbingTargetSegmentUpdateRequest": ".types", "DubbingTargetSegmentUpdateResponse": ".types", "DubbingTargetTranscriptResponse": ".types", "DubbingTargetTranscriptSegment": ".types", "DubbingTranscript": ".types", "DubbingTranscriptCharacter": ".types", "DubbingTranscriptResponseModel": ".types", "DubbingTranscriptRevisionResponse": ".types", "DubbingTranscriptSegment": ".types", "DubbingTranscriptUtterance": ".types", "DubbingTranscriptWord": ".types", "DubbingTranscriptsResponseModel": ".types", "DubbingTranscriptsResponseModelTranscriptFormat": ".types", "DummyToolResultModel": ".types", "DynamicVariableAssignment": ".types", "DynamicVariableNestedValueTypeInput": ".types", "DynamicVariableNestedValueTypeOutput": ".types", "DynamicVariableSchemaOverride": ".types", "DynamicVariableUpdateCommonModel": ".types", "DynamicVariablesConfig": ".types", "DynamicVariablesConfigWorkflowOverride": ".types", "EditChapterResponseModel": ".types", "EditProjectResponseModel": ".types", "EditVoiceRequestLabels": ".voices", "EditVoiceResponseModel": ".types", "EditVoiceSettingsRequest": ".types", "EditVoiceSettingsResponseModel": ".types", "ElevenLabs": ".client", "ElevenLabsEnvironment": ".environment", "EmbedVariant": ".types", "EmbeddingModelEnum": ".types", "EndCallToolConfig": ".types", "EndCallToolResultModel": ".types", "EndCallTriggerAction": ".types", "EndProcedureToolConfigInput": ".types", "EndProcedureToolConfigOutput": ".types", "EndProcedureToolErrorStatus": ".types", "EntityManagementActivityId": ".types", "EntryBehavior": ".types", "EnvironmentAuthConnectionLocator": ".types", "EnvironmentVariableAuthConnectionValue": ".types", "EnvironmentVariableAuthConnectionValueRequest": ".types", "EnvironmentVariableResponse": ".types", "EnvironmentVariableResponseType": ".types", "EnvironmentVariableResponseValues": ".types", "EnvironmentVariableSecretValue": ".types", "EnvironmentVariableSecretValueRequest": ".types", "EnvironmentVariablesCreateRequestBody": ".environment_variables", "EnvironmentVariablesCreateRequestBody_AuthConnection": ".environment_variables", "EnvironmentVariablesCreateRequestBody_Secret": ".environment_variables", "EnvironmentVariablesCreateRequestBody_String": ".environment_variables", "EnvironmentVariablesListRequestType": ".environment_variables", "EnvironmentVariablesListResponse": ".types", "ErrorPayload": ".types", "EvaluationCriteriaSummaryResult": ".types", "EvaluationSettingsInput": ".types", "EvaluationSettingsOutput": ".types", "EvaluationSuccessResult": ".types", "ExactParameterEvaluationStrategy": ".types", "ExotelApiSubdomain": ".types", "ExotelOutboundCallResponse": ".types", "ExportOptions": ".types", "ExportOptions_Docx": ".types", "ExportOptions_Html": ".types", "ExportOptions_Pdf": ".types", "ExportOptions_SegmentedJson": ".types", "ExportOptions_Srt": ".types", "ExportOptions_Txt": ".types", "ExternalFileSyncInfo": ".types", "ExternalFolderSyncInfo": ".types", "ExternalSyncJobTrigger": ".types", "ExternalSyncJobType": ".types", "ExternalSyncProvider": ".types", "FeatureStatusCommonModel": ".types", "FeaturesUsageCommonModel": ".types", "FeedbackItem": ".types", "FieldConflict": ".types", "FileInputConfig": ".types", "FileInputConfigWorkflowOverride": ".types", "FileRefreshStatus": ".types", "FinalOutput": ".types", "FinalOutputMulti": ".types", "FinalTranscript": ".types", "FinalTranscriptWithTimestamps": ".types", "FinalTranscriptWithTimestampsWordsItem": ".types", "FinalTranscriptWithTimestampsWordsItemCharactersItem": ".types", "FinalTranscriptWithTimestampsWordsItemType": ".types", "FineTuningResponse": ".types", "FineTuningResponseStateValue": ".types", "FinetuneCreatedBy": ".types", "FinetuneVisibility": ".types", "FlushContext": ".types", "FocusGuardrail": ".types", "ForbiddenError": ".errors", "ForcedAlignmentCharacterResponseModel": ".types", "ForcedAlignmentResponseModel": ".types", "ForcedAlignmentWordResponseModel": ".types", "FrustratedConversationRef": ".types", "FrustratedConversationRefOverallLabel": ".types", "Gender": ".types", "GenerateVoiceRequest": ".types", "GenerationChunkInput": ".types", "GenerationChunkInputConditionStrength": ".types", "GenerationChunkInputContextAdherence": ".types", "GenerationChunkOutput": ".types", "GenerationChunkOutputConditionStrength": ".types", "GenerationChunkOutputContextAdherence": ".types", "GenerationConfig": ".types", "GenerationSourceContext": ".types", "GenesysBotOutcome": ".types", "GenesysRegion": ".types", "GetAgentEmbedResponseModel": ".types", "GetAgentKnowledgebaseSizeResponseModel": ".types", "GetAgentLinkResponseModel": ".types", "GetAgentResponseModel": ".types", "GetAgentResponseModelPhoneNumbersItem": ".types", "GetAgentResponseModelPhoneNumbersItem_Exotel": ".types", "GetAgentResponseModelPhoneNumbersItem_SipTrunk": ".types", "GetAgentResponseModelPhoneNumbersItem_Twilio": ".types", "GetAgentTestFolderResponseModel": ".types", "GetAgentTopicsResponseModel": ".types", "GetAgentsPageResponseModel": ".types", "GetAnalyticsSummaryParams": ".types", "GetAppointmentByConfirmationNumberParams": ".types", "GetAudioIsolationHistoryResponseModel": ".types", "GetAudioNativeProjectSettingsResponseModel": ".types", "GetBookingPageSettingsParams": ".types", "GetBookingSlugStatusParams": ".types", "GetChapterRequest": ".types", "GetChapterSnapshotsRequest": ".types", "GetChaptersRequest": ".types", "GetChaptersResponse": ".types", "GetClientAppointmentsParams": ".types", "GetClientByPhoneParams": ".types", "GetConvAiDashboardSettingsResponseModel": ".types", "GetConvAiDashboardSettingsResponseModelChartsItem": ".types", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess": ".types", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria": ".types", "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection": ".types", "GetConvAiSettingsResponseModel": ".types", "GetConversationResponseModel": ".types", "GetConversationResponseModelStatus": ".types", "GetConversationTagsPageResponseModel": ".types", "GetConversationUsersPageResponseModel": ".types", "GetConversationsPageResponseModel": ".types", "GetCrawlJobResponseModel": ".types", "GetKnowledgeBaseDependentAgentsResponseModel": ".types", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem": ".types", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available": ".types", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown": ".types", "GetKnowledgeBaseFileResponseModel": ".types", "GetKnowledgeBaseFolderResponseModel": ".types", "GetKnowledgeBaseListResponseModel": ".types", "GetKnowledgeBaseListResponseModelDocumentsItem": ".types", "GetKnowledgeBaseListResponseModelDocumentsItem_File": ".types", "GetKnowledgeBaseListResponseModelDocumentsItem_Folder": ".types", "GetKnowledgeBaseListResponseModelDocumentsItem_Text": ".types", "GetKnowledgeBaseListResponseModelDocumentsItem_Url": ".types", "GetKnowledgeBaseSummaryFileResponseModel": ".types", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem": ".types", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available": ".types", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown": ".types", "GetKnowledgeBaseSummaryFolderResponseModel": ".types", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem": ".types", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available": ".types", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown": ".types", "GetKnowledgeBaseSummaryTextResponseModel": ".types", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem": ".types", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available": ".types", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown": ".types", "GetKnowledgeBaseSummaryUrlResponseModel": ".types", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem": ".types", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available": ".types", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown": ".types", "GetKnowledgeBaseTextResponseModel": ".types", "GetKnowledgeBaseUrlResponseModel": ".types", "GetLibraryVoicesResponse": ".types", "GetLiveCountResponse": ".types", "GetOrCreateRagIndexRequestModel": ".types", "GetPhoneNumberExotelResponseModel": ".types", "GetPhoneNumberInboundSipTrunkConfigResponseModel": ".types", "GetPhoneNumberOutboundSipTrunkConfigResponseModel": ".types", "GetPhoneNumberResponse": ".types", "GetPhoneNumberSipTrunkResponseModel": ".types", "GetPhoneNumberTwilioResponseModel": ".types", "GetProjectRequest": ".types", "GetProjectsRequest": ".types", "GetProjectsResponse": ".types", "GetPronunciationDictionariesMetadataResponseModel": ".types", "GetPronunciationDictionariesResponse": ".types", "GetPronunciationDictionaryMetadataResponse": ".types", "GetPronunciationDictionaryMetadataResponsePermissionOnResource": ".types", "GetPronunciationDictionaryResponse": ".types", "GetPronunciationDictionaryWithRulesResponseModel": ".types", "GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource": ".types", "GetPronunciationDictionaryWithRulesResponseModelRulesItem": ".types", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias": ".types", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme": ".types", "GetResponseUnitTestResponseModel": ".types", "GetScheduleParams": ".types", "GetSecretDependenciesResponseModel": ".types", "GetSecretDependenciesResponseModelDependencies": ".types", "GetSecretDependenciesResponseModelDependenciesOneItem": ".types", "GetSecretDependenciesResponseModelDependenciesOneItem_Available": ".types", "GetSecretDependenciesResponseModelDependenciesOneItem_Unknown": ".types", "GetSecretDependenciesResponseModelDependenciesZeroItem": ".types", "GetSecretDependenciesResponseModelDependenciesZeroItem_Available": ".types", "GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown": ".types", "GetSimulationTestResponseModel": ".types", "GetSipLogMessagesResponse": ".types", "GetSpeechHistoryResponse": ".types", "GetTestInvocationsPageResponseModel": ".types", "GetTestSuiteInvocationResponseModel": ".types", "GetTestsPageResponseModel": ".types", "GetTestsSummariesByIdsResponseModel": ".types", "GetToolCallUnitTestResponseModel": ".types", "GetToolDependentAgentsResponseModel": ".types", "GetToolDependentAgentsResponseModelAgentsItem": ".types", "GetToolDependentAgentsResponseModelAgentsItem_Available": ".types", "GetToolDependentAgentsResponseModelAgentsItem_Unknown": ".types", "GetToolExecutionsPageResponseModel": ".types", "GetVoiceAccentsResponseModel": ".types", "GetVoicesResponse": ".types", "GetVoicesV2Response": ".types", "GetWhatsAppAccountResponse": ".types", "GetWorkspaceSecretsResponseModel": ".types", "GroupManagementActivityId": ".types", "GuardrailExecutionMode": ".types", "GuardrailType": ".types", "GuardrailsV1Input": ".types", "GuardrailsV1Output": ".types", "HistoryAlignmentResponseModel": ".types", "HistoryAlignmentsResponseModel": ".types", "HistoryItemResponse": ".types", "HistoryListRequestSortDirection": ".history", "HistoryListRequestSource": ".history", "HtmlExportOptions": ".types", "HttpRequestModel": ".types", "HttpValidationError": ".types", "Icon": ".types", "ImageAnalysis": ".types", "ImageAnalysisResult": ".types", "ImageAnalysisStatus": ".types", "ImageAvatar": ".types", "ImageSubject": ".types", "InboundSipTrunkConfigRequestModel": ".types", "InitPayload": ".types", "InitialiseContext": ".types", "InitializeConnection": ".types", "InitializeConnectionMulti": ".types", "InputAudioChunkPayload": ".types", "IntegrationType": ".types", "InteractionBudget": ".types", "InternalAlertingWebhookNotifier": ".types", "InvoiceResponse": ".types", "InvoiceResponsePaymentIntentStatus": ".types", "InvoiceResponsePaymentIntentStatussesItem": ".types", "ItemId": ".types", "KbExternalSyncJob": ".types", "KeepContextAlive": ".types", "KnowledgeBaseBulkDeleteSuccessfulResponseModel": ".types", "KnowledgeBaseContentSearchResponseModel": ".types", "KnowledgeBaseContentSearchResult": ".types", "KnowledgeBaseContentSearchResultDocument": ".types", "KnowledgeBaseContentSearchResultDocument_File": ".types", "KnowledgeBaseContentSearchResultDocument_Folder": ".types", "KnowledgeBaseContentSearchResultDocument_Text": ".types", "KnowledgeBaseContentSearchResultDocument_Url": ".types", "KnowledgeBaseDeletedResponseModel": ".types", "KnowledgeBaseDependentType": ".types", "KnowledgeBaseDocumentChunkResponseModel": ".types", "KnowledgeBaseDocumentChunksResponseModel": ".types", "KnowledgeBaseDocumentMetadataResponseModel": ".types", "KnowledgeBaseDocumentType": ".types", "KnowledgeBaseFolderPathSegmentResponseModel": ".types", "KnowledgeBaseFolderPathSegmentSummaryResponseModel": ".types", "KnowledgeBaseLocator": ".types", "KnowledgeBaseRagChunkModel": ".types", "KnowledgeBaseRagToolConfig": ".types", "KnowledgeBaseRagToolResultModel": ".types", "KnowledgeBaseRagToolStatus": ".types", "KnowledgeBaseSortBy": ".types", "KnowledgeBaseSourceFileUrlResponseModel": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModel": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url": ".types", "KnowledgeBaseToolConfig": ".types", "KnowledgeBaseToolInfo": ".types", "KnowledgeBaseToolResultModel": ".types", "KnowledgeBaseToolStatus": ".types", "LanguageAddedResponse": ".types", "LanguageDetectionToolConfig": ".types", "LanguageDetectionToolResultModel": ".types", "LanguageInfo": ".types", "LanguagePairInfo": ".types", "LanguagePresetInput": ".types", "LanguagePresetOutput": ".types", "LanguagePresetTranslation": ".types", "LanguageResponse": ".types", "LanguagesResponse": ".types", "LanguagesResponse_Pair": ".types", "LanguagesResponse_Single": ".types", "LeaveMessageParams": ".types", "LibraryVoiceResponse": ".types", "LibraryVoiceResponseCategory": ".types", "ListAgentProceduresParams": ".types", "ListAgentReferencesParams": ".types", "ListAgentRulesParams": ".types", "ListAssetsParams": ".types", "ListAuthConnectionsResponse": ".types", "ListAuthConnectionsResponseAuthConnectionsItem": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_Mtls": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret": ".types", "ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth": ".types", "ListCalendarEventsParams": ".types", "ListClientInteractionsParams": ".types", "ListClientsParams": ".types", "ListCrawlJobsResponseModel": ".types", "ListCustomerFacingAgentsParams": ".types", "ListGroupSessionsParams": ".types", "ListHolidaysParams": ".types", "ListLocationsParams": ".types", "ListMcpToolsResponseModel": ".types", "ListOrdersResponse": ".types", "ListProceduresResponseModel": ".types", "ListProductsParams": ".types", "ListResponseAgentBranchSummary": ".types", "ListResponseMeta": ".types", "ListServicesParams": ".types", "ListSpeechEnginesResponse": ".types", "ListStaffParams": ".types", "ListTransferRulesParams": ".types", "ListWhatsAppAccountsResponse": ".types", "LiteralJsonSchemaProperty": ".types", "LiteralJsonSchemaPropertyConstantValue": ".types", "LiteralJsonSchemaPropertyType": ".types", "LivekitStackType": ".types", "Llm": ".types", "LlmCategoryUsage": ".types", "LlmDeprecationConfigModel": ".types", "LlmDeprecationInfoModel": ".types", "LlmInfoModelInput": ".types", "LlmInfoModelOutput": ".types", "LlmInputOutputTokensUsage": ".types", "LlmListResponseModelInput": ".types", "LlmListResponseModelOutput": ".types", "LlmLiteralJsonSchemaProperty": ".types", "LlmLiteralJsonSchemaPropertyType": ".types", "LlmParameterEvaluationStrategy": ".types", "LlmReasoningEffort": ".types", "LlmSchemaOverride": ".types", "LlmTokensCategoryUsage": ".types", "LlmUsageCalculatorLlmResponseModel": ".types", "LlmUsageCalculatorResponseModel": ".types", "LlmUsageInput": ".types", "LlmUsageOutput": ".types", "LoadMemoryEntryToolErrorStatus": ".types", "LoadableMemoryEntry": ".types", "LockReason": ".types", "ManualSource": ".types", "ManualVerificationFileResponse": ".types", "ManualVerificationResponse": ".types", "MatchAnythingParameterEvaluationStrategy": ".types", "McpApprovalPolicy": ".types", "McpServerConfigInput": ".types", "McpServerConfigInputAuthConnection": ".types", "McpServerConfigInputRequestHeadersValue": ".types", "McpServerConfigInputRequestMetaValue": ".types", "McpServerConfigInputSecretToken": ".types", "McpServerConfigInputUrl": ".types", "McpServerConfigOutput": ".types", "McpServerConfigOutputAuthConnection": ".types", "McpServerConfigOutputRequestHeadersValue": ".types", "McpServerConfigOutputRequestMetaValue": ".types", "McpServerConfigOutputSecretToken": ".types", "McpServerConfigOutputUrl": ".types", "McpServerMetadataResponseModel": ".types", "McpServerResponseModel": ".types", "McpServerResponseModelDependentAgentsItem": ".types", "McpServerResponseModelDependentAgentsItem_Available": ".types", "McpServerResponseModelDependentAgentsItem_Unknown": ".types", "McpServerTransport": ".types", "McpServersResponseModel": ".types", "McpToolApprovalHash": ".types", "McpToolApprovalPolicy": ".types", "McpToolConfigOverrideInput": ".types", "McpToolConfigOverrideInputInputOverridesValue": ".types", "McpToolConfigOverrideInputInputOverridesValue_Constant": ".types", "McpToolConfigOverrideInputInputOverridesValue_DynamicVariable": ".types", "McpToolConfigOverrideInputInputOverridesValue_Llm": ".types", "McpToolConfigOverrideInputInputOverridesValue_Omit": ".types", "McpToolConfigOverrideInputToolCallSound": ".types", "McpToolConfigOverrideOutput": ".types", "McpToolConfigOverrideOutputInputOverridesValue": ".types", "McpToolConfigOverrideOutputInputOverridesValue_Constant": ".types", "McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable": ".types", "McpToolConfigOverrideOutputInputOverridesValue_Llm": ".types", "McpToolConfigOverrideOutputInputOverridesValue_Omit": ".types", "McpToolConfigOverrideOutputToolCallSound": ".types", "MediaCodec": ".types", "MediaId": ".types", "MemoryEntrySearchResult": ".types", "MemoryEntrySearchResultSource": ".types", "MergePreviewResponseModel": ".types", "MergePreviewResponseModelPhoneNumbersItem": ".types", "MergePreviewResponseModelPhoneNumbersItem_Exotel": ".types", "MergePreviewResponseModelPhoneNumbersItem_SipTrunk": ".types", "MergePreviewResponseModelPhoneNumbersItem_Twilio": ".types", "MessageSearchSortBy": ".types", "MessagesSearchResponse": ".types", "MessagesSearchResult": ".types", "MetricRecord": ".types", "MetricType": ".types", "MockNoMatchBehavior": ".types", "MockingStrategy": ".types", "Model": ".types", "ModelRatesResponseModel": ".types", "ModelSettingsResponseModel": ".types", "ModerationConfig": ".types", "ModerationGuardrailInput": ".types", "ModerationGuardrailOutput": ".types", "MtlsAuthResponse": ".types", "MultichannelSpeechToTextResponseModel": ".types", "MultipartMusicResponse": ".types", "MusicAllowedOutputFormats": ".types", "MusicComposeDetailedRequestOutputFormat": ".music", "MusicComposeDetailedStreamRequestOutputFormat": ".music", "MusicComposeRequestOutputFormat": ".music", "MusicExploreSongSourceContext": ".types", "MusicFinetuneFailureReason": ".types", "MusicFinetunePageResponseModel": ".types", "MusicFinetuneResponseModel": ".types", "MusicFinetuneStatus": ".types", "MusicGenerationMode": ".types", "MusicOnlyOutputFormats": ".types", "MusicOutputFormat": ".types", "MusicPrompt": ".types", "MusicSeparateStemsRequestStemVariationId": ".music", "MusicStreamRequestOutputFormat": ".music", "MusicUploadResponse": ".types", "MusicUploadResponseCompositionPlan": ".types", "MusicVideoToMusicRequestModelId": ".music", "NonStreamingOutputFormats": ".types", "NormalizedAlignment": ".types", "NotFoundError": ".errors", "NumericDistributionAggregate": ".types", "OAuth2ClientCredsResponse": ".types", "OAuth2JwtResponse": ".types", "OAuth2JwtResponseAlgorithm": ".types", "OAuth2JwtResponseTokenResponseField": ".types", "ObjectJsonSchemaPropertyInput": ".types", "ObjectJsonSchemaPropertyInputPropertiesValue": ".types", "ObjectJsonSchemaPropertyInputPropertyKind": ".types", "ObjectJsonSchemaPropertyOutput": ".types", "ObjectJsonSchemaPropertyOutputPropertiesValue": ".types", "OmitSchemaOverride": ".types", "OpenAiAudioFormat": ".types", "OpenerConfig": ".types", "OptInSmsReminderParams": ".types", "OptOutSmsReminderParams": ".types", "OrbAvatar": ".types", "OrchestratorToolMockBehaviorConfig": ".types", "OrderDeliverablesResponse": ".types", "OrderId": ".types", "OrderItemInfo": ".types", "OrderItemKind": ".types", "OrderItemRequestInput": ".types", "OrderItemRequestInput_Dub": ".types", "OrderItemRequestInput_Subtitles": ".types", "OrderItemRequestInput_Transcription": ".types", "OrderItemRequestOutput": ".types", "OrderItemRequestOutput_Dub": ".types", "OrderItemRequestOutput_Subtitles": ".types", "OrderItemRequestOutput_Transcription": ".types", "OrderMediaResponse": ".types", "OrderResponse": ".types", "OrderState": ".types", "OrderSummary": ".types", "OutboundCallRecipient": ".types", "OutboundCallRecipientResponseModel": ".types", "OutboundSipTrunkConfigRequestModel": ".types", "OutputFormat": ".types", "PairedLanguagesResponse": ".types", "PartialTranscriptPayload": ".types", "PatchWorkspaceWebhookResponseModel": ".types", "PdfExportOptions": ".types", "PendingBlocksMetadataModel": ".types", "PendingCancellationResponseModel": ".types", "PendingClipTask": ".types", "PendingClipTaskType": ".types", "PendingExternalAudiosMetadataModel": ".types", "PendingSubscriptionSwitchResponseModel": ".types", "PendingSubscriptionSwitchResponseModelNextTier": ".types", "PermissionType": ".types", "PhoneNumberAgentInfo": ".types", "PhoneNumberDynamicVariableTransferDestination": ".types", "PhoneNumberTransfer": ".types", "PhoneNumberTransferCustomSipHeadersItem": ".types", "PhoneNumberTransferCustomSipHeadersItem_Dynamic": ".types", "PhoneNumberTransferCustomSipHeadersItem_Static": ".types", "PhoneNumberTransferDestination": ".types", "PhoneNumberTransferPostDialDigits": ".types", "PhoneNumberTransferPostDialDigits_Dynamic": ".types", "PhoneNumberTransferPostDialDigits_Static": ".types", "PhoneNumberTransferTransferDestination": ".types", "PhoneNumberTransferTransferDestination_Phone": ".types", "PhoneNumberTransferTransferDestination_PhoneDynamicVariable": ".types", "PhoneNumberTransferTransferDestination_SipUri": ".types", "PhoneNumberTransferTransferDestination_SipUriDynamicVariable": ".types", "PingPayload": ".types", "PlatformCategory": ".types", "PlatformCategoryUsage": ".types", "PlatformUsage": ".types", "PlayDtmfResultErrorModel": ".types", "PlayDtmfResultSuccessModel": ".types", "PlayDtmfToolConfig": ".types", "PodcastBulletinMode": ".types", "PodcastBulletinModeData": ".types", "PodcastConversationMode": ".types", "PodcastConversationModeData": ".types", "PodcastProjectResponseModel": ".types", "PodcastTextSource": ".types", "PodcastUrlSource": ".types", "PongPayload": ".types", "PositionInput": ".types", "PositionOutput": ".types", "PostAgentAvatarResponseModel": ".types", "PostDialDigitsDynamicVariable": ".types", "PostDialDigitsStatic": ".types", "PostWorkspaceSecretResponseModel": ".types", "PreToolSpeechMode": ".types", "PreviewAudioDbModel": ".types", "Price": ".types", "PrivacyConfigInput": ".types", "PrivacyConfigOutput": ".types", "PrivateKeyJwtResponse": ".types", "PrivateKeyJwtResponseAlgorithm": ".types", "ProcedureAtVersionInput": ".types", "ProcedureAtVersionOutput": ".types", "ProcedureAtVersionResponseModel": ".types", "ProcedureDraftResponseModel": ".types", "ProcedureListItemResponseModel": ".types", "ProcedureRefResponseModel": ".types", "ProcedureType": ".types", "ProcedureValidationError": ".types", "ProjectCreationMetaResponseModel": ".types", "ProjectCreationMetaResponseModelStatus": ".types", "ProjectCreationMetaType": ".types", "ProjectExtendedResponse": ".types", "ProjectExtendedResponseAccessLevel": ".types", "ProjectExtendedResponseApplyTextNormalization": ".types", "ProjectExtendedResponseAspectRatio": ".types", "ProjectExtendedResponseAssetsItem": ".types", "ProjectExtendedResponseAssetsItem_Audio": ".types", "ProjectExtendedResponseAssetsItem_Image": ".types", "ProjectExtendedResponseAssetsItem_Video": ".types", "ProjectExtendedResponseFiction": ".types", "ProjectExtendedResponseSourceType": ".types", "ProjectExtendedResponseTargetAudience": ".types", "ProjectExternalAudioResponseModel": ".types", "ProjectExternalAudioResponseModelSourceContext": ".types", "ProjectExternalAudioResponseModelSourceContext_MusicExploreSong": ".types", "ProjectExternalAudioResponseModelSourceContext_Sfx": ".types", "ProjectExternalAudioResponseModelSourceContext_Song": ".types", "ProjectImageResponseModel": ".types", "ProjectMutedTracksResponseModel": ".types", "ProjectResponse": ".types", "ProjectResponseAccessLevel": ".types", "ProjectResponseAspectRatio": ".types", "ProjectResponseFiction": ".types", "ProjectResponseSourceType": ".types", "ProjectResponseTargetAudience": ".types", "ProjectSnapshotExtendedResponseModel": ".types", "ProjectSnapshotResponse": ".types", "ProjectSnapshotsResponse": ".types", "ProjectState": ".types", "ProjectVideoResponseModel": ".types", "ProjectVideoThumbnailSheetResponseModel": ".types", "ProjectVoiceResponseModel": ".types", "PromptAgent": ".types", "PromptAgentApiModelInput": ".types", "PromptAgentApiModelInputBackupLlmConfig": ".types", "PromptAgentApiModelInputBackupLlmConfig_Default": ".types", "PromptAgentApiModelInputBackupLlmConfig_Disabled": ".types", "PromptAgentApiModelInputBackupLlmConfig_Override": ".types", "PromptAgentApiModelInputToolsItem": ".types", "PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook": ".types", "PromptAgentApiModelInputToolsItem_Client": ".types", "PromptAgentApiModelInputToolsItem_Mcp": ".types", "PromptAgentApiModelInputToolsItem_Smb": ".types", "PromptAgentApiModelInputToolsItem_System": ".types", "PromptAgentApiModelInputToolsItem_Webhook": ".types", "PromptAgentApiModelOutput": ".types", "PromptAgentApiModelOutputBackupLlmConfig": ".types", "PromptAgentApiModelOutputBackupLlmConfig_Default": ".types", "PromptAgentApiModelOutputBackupLlmConfig_Disabled": ".types", "PromptAgentApiModelOutputBackupLlmConfig_Override": ".types", "PromptAgentApiModelOutputToolsItem": ".types", "PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook": ".types", "PromptAgentApiModelOutputToolsItem_Client": ".types", "PromptAgentApiModelOutputToolsItem_Mcp": ".types", "PromptAgentApiModelOutputToolsItem_Smb": ".types", "PromptAgentApiModelOutputToolsItem_System": ".types", "PromptAgentApiModelOutputToolsItem_Webhook": ".types", "PromptAgentApiModelOverrideConfig": ".types", "PromptAgentApiModelOverrideInput": ".types", "PromptAgentApiModelOverrideOutput": ".types", "PromptAgentApiModelWorkflowOverrideInput": ".types", "PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Client": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_System": ".types", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook": ".types", "PromptAgentApiModelWorkflowOverrideOutput": ".types", "PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_System": ".types", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook": ".types", "PromptAgentDbModel": ".types", "PromptEvaluationCriteria": ".types", "PromptInjectionGuardrail": ".types", "PronunciationDictionariesListRequestSort": ".pronunciation_dictionaries", "PronunciationDictionaryAliasRuleRequestModel": ".types", "PronunciationDictionaryAliasRuleResponseModel": ".types", "PronunciationDictionaryLocator": ".types", "PronunciationDictionaryLocatorResponseModel": ".types", "PronunciationDictionaryPhonemeRuleRequestModel": ".types", "PronunciationDictionaryPhonemeRuleResponseModel": ".types", "PronunciationDictionaryRulesResponseModel": ".types", "PronunciationDictionaryVersionLocator": ".types", "PronunciationDictionaryVersionResponseModel": ".types", "PronunciationDictionaryVersionResponseModelPermissionOnResource": ".types", "PydanticPronunciationDictionaryVersionLocator": ".types", "QualityPresetType": ".types", "QueryParamsJsonSchema": ".types", "QuoteInfo": ".types", "RagChunkMetadata": ".types", "RagConfigInput": ".types", "RagConfigOutput": ".types", "RagConfigWorkflowOverrideInput": ".types", "RagConfigWorkflowOverrideOutput": ".types", "RagDocumentIndexResponseModel": ".types", "RagDocumentIndexUsage": ".types", "RagDocumentIndexesResponseModel": ".types", "RagIndexBatchSuccessfulResponseModel": ".types", "RagIndexOverviewEmbeddingModelResponseModel": ".types", "RagIndexOverviewResponseModel": ".types", "RagIndexStatus": ".types", "RagRetrievalInfo": ".types", "ReadLegalTerms": ".types", "ReadMetadataChapterDbModel": ".types", "ReaderResourceResponseModel": ".types", "ReaderResourceResponseModelResourceType": ".types", "RealtimeAudioOptions": ".realtime", "RealtimeConnection": ".realtime", "RealtimeEvents": ".realtime", "RealtimeUrlOptions": ".realtime", "RealtimeVoiceSettings": ".types", "ReceiveMessage": ".v_1_text_to_speech_voice_id_stream_input", "ReceiveMessageMulti": ".v_1_text_to_speech_voice_id_multi_stream_input", "ReceiveTextToDialogueWebsocketMessage": ".v_1_text_to_dialogue_stream_input", "ReceiveTextToDialogueWebsocketMessageMulti": ".v_1_text_to_dialogue_multi_stream_input", "ReceiveTranscription": ".v_1_speech_to_text_realtime", "ReceiveTranslateStreamMessage": ".v_1_translate_realtime", "ReceiveUpstreamMessage": ".speech_engine_upstream", "RecordingResponse": ".types", "ReferenceVideo": ".types", "ReferencedToolCommonModel": ".types", "ReferencedToolCommonModelType": ".types", "RefreshTokenAuthResponse": ".types", "RegexParameterEvaluationStrategy": ".types", "RegionConfigRequest": ".types", "RegionalProcessingSurchargeInfo": ".types", "RegisterForGroupSessionParams": ".types", "RegisterMediaResponse": ".types", "RemoveMemberFromGroupRequest": ".types", "RemoveOrderItemResponse": ".types", "Render": ".types", "RenderStatus": ".types", "RenderType": ".types", "ReplicateVoiceToIsolatedEnvironmentResponseModel": ".types", "ReportKnowledgeGapParams": ".types", "RequestPvcManualVerificationResponseModel": ".types", "RequiredConstraint": ".types", "RequiredConstraints": ".types", "ResourceAccessInfo": ".types", "ResourceAccessInfoAccessSource": ".types", "ResourceAccessInfoAnonymousAccessLevelOverride": ".types", "ResourceAccessInfoRole": ".types", "ResourceMetadataResponseModel": ".types", "ResourceMetadataResponseModelAnonymousAccessLevelOverride": ".types", "ResponseFilter": ".types", "ResponseFilterMode": ".types", "ResponseUnitTestModel": ".types", "RestoreCalendarEventParams": ".types", "RetryTriggerAction": ".types", "ReviewResponseModel": ".types", "ReviewResponseModelRejectReasonsItem": ".types", "ReviewResponseModelReviewStatus": ".types", "ReviewStatus": ".types", "RunSubagentToolConfigInput": ".types", "RunSubagentToolConfigOutput": ".types", "SafetyCommonModelInput": ".types", "SafetyCommonModelOutput": ".types", "SafetyEvaluation": ".types", "SafetyResponseModel": ".types", "SafetyRule": ".types", "SampleConfigDbModel": ".types", "SampleConfigDbModelParentType": ".types", "SaveVoicePreviewRequest": ".types", "SayNodeLiteralMessageInput": ".types", "SayNodeLiteralMessageOutput": ".types", "SayNodePromptMessageInput": ".types", "SayNodePromptMessageOutput": ".types", "ScheduleGroupSessionParams": ".types", "ScimGroupResponseModel": ".types", "ScopedAnalysisResult": ".types", "ScribeAuthErrorPayload": ".types", "ScribeChunkSizeExceededErrorPayload": ".types", "ScribeErrorPayload": ".types", "ScribeInputErrorPayload": ".types", "ScribeInsufficientAudioActivityErrorPayload": ".types", "ScribeInvalidRequestError": ".types", "ScribeQueueOverflowErrorPayload": ".types", "ScribeQuotaExceededErrorPayload": ".types", "ScribeRateLimitedErrorPayload": ".types", "ScribeResourceExhaustedErrorPayload": ".types", "ScribeSessionTimeLimitExceededErrorPayload": ".types", "ScribeThrottledErrorPayload": ".types", "ScribeTranscriberErrorPayload": ".types", "ScribeUnacceptedTermsErrorPayload": ".types", "SearchClientsParams": ".types", "SearchHighlightSegment": ".types", "SearchStrategy": ".types", "SeatType": ".types", "SecretDependencyResourceType": ".types", "SecretDependencyType": ".types", "SectionSource": ".types", "SegmentCreateResponse": ".types", "SegmentDeleteResponse": ".types", "SegmentDubResponse": ".types", "SegmentMigrationResponse": ".types", "SegmentSubtitleFrame": ".types", "SegmentTranscriptionResponse": ".types", "SegmentTranslationResponse": ".types", "SegmentUpdateResponse": ".types", "SegmentedJsonExportOptions": ".types", "SendMessage": ".v_1_text_to_speech_voice_id_stream_input", "SendMessageMulti": ".v_1_text_to_speech_voice_id_multi_stream_input", "SendText": ".types", "SendTextMulti": ".types", "SendTranslateStreamMessage": ".v_1_translate_realtime", "SendUpstreamMessage": ".speech_engine_upstream", "SentimentAggregate": ".types", "SentimentAnalysisSettings": ".types", "SessionStartedPayload": ".types", "SessionStartedPayloadConfig": ".types", "SessionStartedPayloadConfigCommitStrategy": ".types", "SetBookingSlugParams": ".types", "SeverityId": ".types", "SfxModelId": ".types", "SfxSourceContext": ".types", "ShareOptionResponseModel": ".types", "ShareOptionResponseModelType": ".types", "SimilarVoice": ".types", "SimilarVoicesForSpeakerResponse": ".types", "SimulationLibrarySettings": ".types", "SimulationTestModel": ".types", "SimulationToolMockBehaviorConfig": ".types", "SingleLanguagesResponse": ".types", "SingleTestRunRequestModel": ".types", "SingleUseTokenResponseModel": ".types", "SingleUseTokenType": ".types", "SipLogMessage": ".types", "SipLogMessageDirection": ".types", "SipMediaEncryptionEnum": ".types", "SipTrunkCredentialsRequestModel": ".types", "SipTrunkOutboundCallResponse": ".types", "SipTrunkTransportEnum": ".types", "SipUriDynamicVariableTransferDestination": ".types", "SipUriTransferDestination": ".types", "SkipTurnToolConfig": ".types", "SkipTurnToolResponseModel": ".types", "SlackBotAuthResponse": ".types", "SmbClientAccessConfig": ".types", "SmsConversationInfo": ".types", "SmsConversationInfoDirection": ".types", "SoftTimeoutConfig": ".types", "SoftTimeoutConfigOverride": ".types", "SoftTimeoutConfigOverrideConfig": ".types", "SoftTimeoutConfigWorkflowOverride": ".types", "SongMetadata": ".types", "SongSection": ".types", "SongSourceContext": ".types", "SortDirection": ".types", "SpeakerAudioResponseModel": ".types", "SpeakerCreatedResponse": ".types", "SpeakerResponseModel": ".types", "SpeakerSegment": ".types", "SpeakerSeparationResponseModel": ".types", "SpeakerSeparationResponseModelStatus": ".types", "SpeakerTrack": ".types", "SpeakerUpdatedResponse": ".types", "SpeechEngineConfig": ".types", "SpeechEngineConfigRequestHeadersValue": ".types", "SpeechEngineConversationInitiationClientDataConfig": ".types", "SpeechEngineResponse": ".types", "SpeechEngineSummaryResponse": ".types", "SpeechHistoryItemResponse": ".types", "SpeechHistoryItemResponseSource": ".types", "SpeechHistoryItemResponseVoiceCategory": ".types", "SpeechToSpeechConvertRequestOutputFormat": ".speech_to_speech", "SpeechToSpeechRequestFileFormat": ".speech_to_speech", "SpeechToSpeechStreamRequestFileFormat": ".speech_to_speech", "SpeechToSpeechStreamRequestOutputFormat": ".speech_to_speech", "SpeechToTextCharacterResponseModel": ".types", "SpeechToTextChunkResponseModel": ".types", "SpeechToTextConvertRequestEntityDetection": ".speech_to_text", "SpeechToTextConvertRequestEntityRedaction": ".speech_to_text", "SpeechToTextConvertRequestFileFormat": ".speech_to_text", "SpeechToTextConvertRequestModelId": ".speech_to_text", "SpeechToTextConvertRequestMultichannelOutputStyle": ".speech_to_text", "SpeechToTextConvertRequestTimestampsGranularity": ".speech_to_text", "SpeechToTextConvertRequestWebhookMetadata": ".speech_to_text", "SpeechToTextConvertResponse": ".speech_to_text", "SpeechToTextWebhookResponseModel": ".types", "SpeechToTextWordResponseModel": ".types", "SpeechToTextWordResponseModelType": ".types", "SpellingPatience": ".types", "SrtExportOptions": ".types", "StartProcedureToolConfigInput": ".types", "StartProcedureToolConfigOutput": ".types", "StartProcedureToolErrorStatus": ".types", "StartPvcVoiceTrainingResponseModel": ".types", "StartSpeakerSeparationResponseModel": ".types", "StatusId": ".types", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel": ".types", "StreamingAudioChunkWithTimestampsResponse": ".types", "StudioAgentSettingsModel": ".types", "StudioAgentToolSettingsModel": ".types", "StudioClipReference": ".types", "StudioClipReferenceClipType": ".types", "StudioTextStyleOutlineModel": ".types", "StudioTextStyleShadowModel": ".types", "SubAgentInput": ".types", "SubAgentOutput": ".types", "SubagentRunResultDetails": ".types", "SubmitBusinessInfoParams": ".types", "SubmitOrderResponse": ".types", "Subscription": ".types", "SubscriptionMaxCreditLimitExtension": ".types", "SubscriptionPendingChange": ".types", "SubscriptionResponse": ".types", "SubscriptionResponseMaxCreditLimitExtension": ".types", "SubscriptionStatusType": ".types", "SubtitleOrderItemRequest": ".types", "SuggestedAudioTag": ".types", "SupportedVoice": ".types", "SystemEvaluationCriteria": ".types", "SystemToolConfigInput": ".types", "SystemToolConfigInputParams": ".types", "SystemToolConfigInputParams_EndCall": ".types", "SystemToolConfigInputParams_EndProcedure": ".types", "SystemToolConfigInputParams_KnowledgeBase": ".types", "SystemToolConfigInputParams_KnowledgeBaseRag": ".types", "SystemToolConfigInputParams_LanguageDetection": ".types", "SystemToolConfigInputParams_PlayKeypadTouchTone": ".types", "SystemToolConfigInputParams_RunSubagent": ".types", "SystemToolConfigInputParams_SkipTurn": ".types", "SystemToolConfigInputParams_StartProcedure": ".types", "SystemToolConfigInputParams_TransferToAgent": ".types", "SystemToolConfigInputParams_TransferToNumber": ".types", "SystemToolConfigInputParams_VoicemailDetection": ".types", "SystemToolConfigOutput": ".types", "SystemToolConfigOutputParams": ".types", "SystemToolConfigOutputParams_EndCall": ".types", "SystemToolConfigOutputParams_EndProcedure": ".types", "SystemToolConfigOutputParams_KnowledgeBase": ".types", "SystemToolConfigOutputParams_KnowledgeBaseRag": ".types", "SystemToolConfigOutputParams_LanguageDetection": ".types", "SystemToolConfigOutputParams_PlayKeypadTouchTone": ".types", "SystemToolConfigOutputParams_RunSubagent": ".types", "SystemToolConfigOutputParams_SkipTurn": ".types", "SystemToolConfigOutputParams_StartProcedure": ".types", "SystemToolConfigOutputParams_TransferToAgent": ".types", "SystemToolConfigOutputParams_TransferToNumber": ".types", "SystemToolConfigOutputParams_VoicemailDetection": ".types", "TelephonyCallConfig": ".types", "TelephonyDirection": ".types", "TelephonyProvider": ".types", "TestConditionRationaleCommonModel": ".types", "TestConditionResultCommonModel": ".types", "TestFromConversationMetadataInput": ".types", "TestFromConversationMetadataOutput": ".types", "TestInvocationSummaryResponseModel": ".types", "TestRunMetadata": ".types", "TestRunMetadataTestType": ".types", "TestRunResultBucket": ".types", "TestRunResultSummary": ".types", "TestRunStatus": ".types", "TestSharingMode": ".types", "TestToolResultModel": ".types", "TestType": ".types", "TestsFeatureUsageCommonModel": ".types", "TextNormalisationType": ".types", "TextToDialogueConvertRequestOutputFormat": ".text_to_dialogue", "TextToDialogueConvertWithTimestampsRequestOutputFormat": ".text_to_dialogue", "TextToDialogueWebsocketApplyTextNormalizationEnum": ".types", "TextToDialogueWebsocketAudioChunk": ".types", "TextToDialogueWebsocketAudioChunkMulti": ".types", "TextToDialogueWebsocketClientMessage": ".types", "TextToDialogueWebsocketClientMessageMulti": ".types", "TextToDialogueWebsocketError": ".types", "TextToDialogueWebsocketFinal": ".types", "TextToDialogueWebsocketFinalAudioForTurn": ".types", "TextToDialogueWebsocketFinalAudioForTurnMulti": ".types", "TextToDialogueWebsocketFinalMulti": ".types", "TextToDialogueWebsocketOutputFormatEnum": ".types", "TextToDialogueWebsocketVoiceInput": ".types", "TextToDialogueWebsocketVoiceSettings": ".types", "TextToSpeechApplyTextNormalizationEnum": ".types", "TextToSpeechConvertRequestOutputFormat": ".text_to_speech", "TextToSpeechConvertWithTimestampsRequestOutputFormat": ".text_to_speech", "TextToSpeechOutputFormatEnum": ".types", "TextToSpeechRequest": ".types", "TextToSpeechStreamRequest": ".types", "TextToSpeechStreamRequestOutputFormat": ".text_to_speech", "TextToSpeechStreamWithTimestampsRequest": ".types", "TextToSpeechStreamWithTimestampsRequestOutputFormat": ".text_to_speech", "TextToSpeechWithTimestampsRequest": ".types", "ThresholdGuardrail": ".types", "TimeRange": ".types", "ToDialogueSettingsResponseModel": ".types", "TokenResponseModel": ".types", "TooEarlyError": ".errors", "Tool": ".types", "ToolAnnotations": ".types", "ToolCallSoundBehavior": ".types", "ToolCallSoundType": ".types", "ToolCallUnitTestModel": ".types", "ToolErrorHandlingMode": ".types", "ToolExecution": ".types", "ToolExecutionMode": ".types", "ToolExecutionResponseModel": ".types", "ToolExecutionResponseModelToolCallDetails": ".types", "ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook": ".types", "ToolExecutionResponseModelToolCallDetails_Client": ".types", "ToolExecutionResponseModelToolCallDetails_Mcp": ".types", "ToolExecutionResponseModelToolCallDetails_Webhook": ".types", "ToolExecutionTaskSupport": ".types", "ToolInterruptionMode": ".types", "ToolMockConfig": ".types", "ToolRequestModel": ".types", "ToolRequestModelToolConfig": ".types", "ToolRequestModelToolConfig_Client": ".types", "ToolRequestModelToolConfig_Mcp": ".types", "ToolRequestModelToolConfig_System": ".types", "ToolRequestModelToolConfig_Webhook": ".types", "ToolResponseMockConfigInput": ".types", "ToolResponseMockConfigOutput": ".types", "ToolResponseModel": ".types", "ToolResponseModelToolConfig": ".types", "ToolResponseModelToolConfig_Client": ".types", "ToolResponseModelToolConfig_Mcp": ".types", "ToolResponseModelToolConfig_System": ".types", "ToolResponseModelToolConfig_Webhook": ".types", "ToolSortBy": ".types", "ToolType": ".types", "ToolTypeFilter": ".types", "ToolUsageStatsResponseModel": ".types", "ToolsResponseModel": ".types", "TopicDiscoverySettings": ".types", "TopicEvaluationCriteriaAggregate": ".types", "TopicMetricsAggregate": ".types", "TopicSentimentAggregate": ".types", "TranscriptMessage": ".types", "TranscriptMessageRole": ".types", "TranscriptionOrderItemRequest": ".types", "TranscriptionWord": ".types", "TranscriptionWordType": ".types", "TransferBranchInfoDefaultingToMain": ".types", "TransferBranchInfoTrafficSplit": ".types", "TransferToAgentToolConfigInput": ".types", "TransferToAgentToolConfigOutput": ".types", "TransferToAgentToolResultErrorModel": ".types", "TransferToAgentToolResultSuccessModelInput": ".types", "TransferToAgentToolResultSuccessModelInputBranchInfo": ".types", "TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain": ".types", "TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit": ".types", "TransferToAgentToolResultSuccessModelOutput": ".types", "TransferToAgentToolResultSuccessModelOutputBranchInfo": ".types", "TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain": ".types", "TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit": ".types", "TransferToNumberResultErrorModel": ".types", "TransferToNumberResultExotelSuccessModel": ".types", "TransferToNumberResultSipSuccessModel": ".types", "TransferToNumberResultTwilioSuccessModel": ".types", "TransferToNumberToolConfigInput": ".types", "TransferToNumberToolConfigOutput": ".types", "TransferTypeEnum": ".types", "TranslateAudioOutputError": ".types", "TranslateAudioPayload": ".types", "TranslateAuthError": ".types", "TranslateEndOfStreamPayload": ".types", "TranslateErrorPayload": ".types", "TranslateFinalTranscriptPayload": ".types", "TranslateInputAudioChunkPayload": ".types", "TranslateInputError": ".types", "TranslateInputFormatEnum": ".types", "TranslateOutputFormatEnum": ".types", "TranslatePartialTranscriptPayload": ".types", "TranslateQueueOverflowError": ".types", "TranslateRateLimitedError": ".types", "TranslateSessionStartedPayload": ".types", "TranslateStatusPayload": ".types", "TranslateTranscriberError": ".types", "TranslateTranslationError": ".types", "TranslateTranslationPayload": ".types", "TranslatedString": ".types", "TriggerUserVerificationParams": ".types", "TriggeredGuardrailCommonModel": ".types", "TtsConversationalConfigInput": ".types", "TtsConversationalConfigOutput": ".types", "TtsConversationalConfigOverride": ".types", "TtsConversationalConfigOverrideConfig": ".types", "TtsConversationalConfigWorkflowOverrideInput": ".types", "TtsConversationalConfigWorkflowOverrideOutput": ".types", "TtsConversationalModel": ".types", "TtsModelFamily": ".types", "TtsOptimizeStreamingLatency": ".types", "TtsOutputFormat": ".types", "TurnConfig": ".types", "TurnConfigOverride": ".types", "TurnConfigOverrideConfig": ".types", "TurnConfigWorkflowOverride": ".types", "TurnEagerness": ".types", "TurnMode": ".types", "TurnModel": ".types", "TwilioEdgeLocation": ".types", "TwilioOutboundCallResponse": ".types", "TwilioRegionId": ".types", "TxtExportOptions": ".types", "UnauthorizedError": ".errors", "UnitTestRunResponseModel": ".types", "UnitTestRunResponseModelTestInfo": ".types", "UnitTestRunResponseModelTestInfo_Llm": ".types", "UnitTestRunResponseModelTestInfo_Simulation": ".types", "UnitTestRunResponseModelTestInfo_Tool": ".types", "UnitTestSummaryResponseModel": ".types", "UnitTestToolCallEvaluationModelInput": ".types", "UnitTestToolCallEvaluationModelOutput": ".types", "UnitTestToolCallParameter": ".types", "UnitTestToolCallParameterEval": ".types", "UnitTestToolCallParameterEval_Anything": ".types", "UnitTestToolCallParameterEval_Exact": ".types", "UnitTestToolCallParameterEval_Llm": ".types", "UnitTestToolCallParameterEval_Regex": ".types", "UnitTestWorkflowNodeTransitionEvaluationNodeId": ".types", "UnprocessableEntityError": ".errors", "UpdateAgentProcedureParams": ".types", "UpdateAgentRuleParams": ".types", "UpdateAssetParams": ".types", "UpdateAudioNativeProjectRequest": ".types", "UpdateBasicAuthRequest": ".types", "UpdateBearerAuthRequest": ".types", "UpdateBookingPageAppearanceParams": ".types", "UpdateBookingPageSettingsParams": ".types", "UpdateBusinessInfoParams": ".types", "UpdateCalendarEventParams": ".types", "UpdateChapterRequest": ".types", "UpdateClientParams": ".types", "UpdateCustomerFacingConfigParams": ".types", "UpdateEnvironmentVariableRequestValuesValue": ".environment_variables", "UpdateGroupSessionSeatsParams": ".types", "UpdateHolidayParams": ".types", "UpdateLocationParams": ".types", "UpdateOAuth2ClientCredsRequest": ".types", "UpdateOAuth2JwtRequest": ".types", "UpdateOAuth2JwtRequestAlgorithm": ".types", "UpdateOAuth2JwtRequestTokenResponseField": ".types", "UpdateOrderRequest": ".types", "UpdateOrderResponse": ".types", "UpdateProductParams": ".types", "UpdateProjectRequest": ".types", "UpdatePronunciationDictionariesRequest": ".types", "UpdateResponseUnitTestRequest": ".types", "UpdateServiceParams": ".types", "UpdateSimulationTestRequest": ".types", "UpdateStaffParams": ".types", "UpdateToolCallUnitTestRequest": ".types", "UpdateTransferRuleParams": ".types", "UpdateWorkspaceMemberResponseModel": ".types", "UpsertOrderItemRequest": ".types", "UpsertOrderItemResponse": ".types", "UrlAvatar": ".types", "UrlModel": ".types", "UrlSecretAuthResponse": ".types", "UsageAggregationInterval": ".types", "UsageCharactersResponseModel": ".types", "User": ".types", "UserAccessManagementActivityId": ".types", "UserFeedback": ".types", "UserFeedbackScore": ".types", "UserModel": ".types", "UserTranscriptPayload": ".types", "UserTypeId": ".types", "UsersSortBy": ".types", "UtteranceResponseModel": ".types", "UuiTransferConfig": ".types", "UuiTransferConfigProtocolDiscriminatorMode": ".types", "VadConfig": ".types", "VadConfigWorkflowOverride": ".types", "ValidateUserVerificationCodeParams": ".types", "ValidationError": ".types", "ValidationErrorLocItem": ".types", "Verbosity": ".types", "VerificationAttemptResponse": ".types", "VerifiedVoiceLanguageResponseModel": ".types", "VerifyPvcVoiceCaptchaResponseModel": ".types", "VideoAnalysis": ".types", "VideoAnalysisResult": ".types", "VideoAnalysisStatus": ".types", "VideoKeyMoment": ".types", "VideoSegment": ".types", "VideoSubject": ".types", "VisitedAgentRef": ".types", "Voice": ".types", "VoiceAccentResponseModel": ".types", "VoiceCategory": ".types", "VoiceDesignPreviewResponse": ".types", "VoiceDesignRequestModelModelId": ".text_to_voice", "VoiceGenerationParameterOptionResponse": ".types", "VoiceGenerationParameterResponse": ".types", "VoiceLabellingStatus": ".types", "VoiceMailDetectionResultSuccessModel": ".types", "VoicePreviewResponseModel": ".types", "VoiceRecordingQuality": ".types", "VoiceSafetyControl": ".types", "VoiceSample": ".types", "VoiceSamplePreviewResponseModel": ".types", "VoiceSampleVisualWaveformResponseModel": ".types", "VoiceSegment": ".types", "VoiceSettings": ".types", "VoiceSharingModerationCheckResponseModel": ".types", "VoiceSharingResponse": ".types", "VoiceSharingResponseCategory": ".types", "VoiceSharingState": ".types", "VoiceStatisticsResponseModel": ".types", "VoiceVerificationResponse": ".types", "VoicemailDetectionToolConfig": ".types", "VoicesGetSharedRequestCategory": ".voices", "VoicesGetSharedRequestSort": ".voices", "VoicesNotPermittedWarning": ".types", "WebhookAuthMethodType": ".types", "WebhookEventType": ".types", "WebhookHmacSettings": ".types", "WebhookToolApiSchemaConfigInput": ".types", "WebhookToolApiSchemaConfigInputAuthConnection": ".types", "WebhookToolApiSchemaConfigInputContentType": ".types", "WebhookToolApiSchemaConfigInputMethod": ".types", "WebhookToolApiSchemaConfigInputRequestHeadersValue": ".types", "WebhookToolApiSchemaConfigOutput": ".types", "WebhookToolApiSchemaConfigOutputAuthConnection": ".types", "WebhookToolApiSchemaConfigOutputContentType": ".types", "WebhookToolApiSchemaConfigOutputMethod": ".types", "WebhookToolApiSchemaConfigOutputRequestHeadersValue": ".types", "WebhookToolConfigInput": ".types", "WebhookToolConfigOutput": ".types", "WebhookTranscriptFormat": ".types", "WebhookUsageType": ".types", "WebsocketTtsClientMessageMulti": ".types", "WebsocketTtsServerMessageMulti": ".types", "WhatsAppAuthResponse": ".types", "WhatsAppConversationInfo": ".types", "WhatsAppConversationInfoDirection": ".types", "WhatsAppOutboundCallResponse": ".types", "WhatsAppOutboundMessageResponse": ".types", "WhatsAppTemplateBodyComponentParams": ".types", "WhatsAppTemplateButtonComponentParams": ".types", "WhatsAppTemplateDocumentParam": ".types", "WhatsAppTemplateDocumentParamDetails": ".types", "WhatsAppTemplateHeaderComponentParams": ".types", "WhatsAppTemplateHeaderComponentParamsParametersItem": ".types", "WhatsAppTemplateHeaderComponentParamsParametersItem_Document": ".types", "WhatsAppTemplateHeaderComponentParamsParametersItem_Image": ".types", "WhatsAppTemplateHeaderComponentParamsParametersItem_Location": ".types", "WhatsAppTemplateHeaderComponentParamsParametersItem_Text": ".types", "WhatsAppTemplateImageParam": ".types", "WhatsAppTemplateImageParamDetails": ".types", "WhatsAppTemplateLocationParam": ".types", "WhatsAppTemplateLocationParamDetails": ".types", "WhatsAppTemplateTextParam": ".types", "WidgetConfig": ".types", "WidgetConfigAvatar": ".types", "WidgetConfigAvatar_Image": ".types", "WidgetConfigAvatar_Orb": ".types", "WidgetConfigAvatar_Url": ".types", "WidgetConfigResponse": ".types", "WidgetConfigResponseAvatar": ".types", "WidgetConfigResponseAvatar_Image": ".types", "WidgetConfigResponseAvatar_Orb": ".types", "WidgetConfigResponseAvatar_Url": ".types", "WidgetConfigResponseSyntaxHighlightTheme": ".types", "WidgetConfigSyntaxHighlightTheme": ".types", "WidgetEndFeedbackConfig": ".types", "WidgetEndFeedbackType": ".types", "WidgetExpandable": ".types", "WidgetFeedbackMode": ".types", "WidgetLanguagePreset": ".types", "WidgetLanguagePresetResponse": ".types", "WidgetPlacement": ".types", "WidgetStyles": ".types", "WidgetTermsTranslation": ".types", "WidgetTextContents": ".types", "WidgetTextContentsTranslation": ".types", "WordTimestamp": ".types", "WorkflowEdgeModelInput": ".types", "WorkflowEdgeModelInputBackwardCondition": ".types", "WorkflowEdgeModelInputBackwardCondition_Expression": ".types", "WorkflowEdgeModelInputBackwardCondition_Llm": ".types", "WorkflowEdgeModelInputBackwardCondition_Result": ".types", "WorkflowEdgeModelInputBackwardCondition_Unconditional": ".types", "WorkflowEdgeModelInputForwardCondition": ".types", "WorkflowEdgeModelInputForwardCondition_Expression": ".types", "WorkflowEdgeModelInputForwardCondition_Llm": ".types", "WorkflowEdgeModelInputForwardCondition_Result": ".types", "WorkflowEdgeModelInputForwardCondition_Unconditional": ".types", "WorkflowEdgeModelOutput": ".types", "WorkflowEdgeModelOutputBackwardCondition": ".types", "WorkflowEdgeModelOutputBackwardCondition_Expression": ".types", "WorkflowEdgeModelOutputBackwardCondition_Llm": ".types", "WorkflowEdgeModelOutputBackwardCondition_Result": ".types", "WorkflowEdgeModelOutputBackwardCondition_Unconditional": ".types", "WorkflowEdgeModelOutputForwardCondition": ".types", "WorkflowEdgeModelOutputForwardCondition_Expression": ".types", "WorkflowEdgeModelOutputForwardCondition_Llm": ".types", "WorkflowEdgeModelOutputForwardCondition_Result": ".types", "WorkflowEdgeModelOutputForwardCondition_Unconditional": ".types", "WorkflowEndNodeModelInput": ".types", "WorkflowEndNodeModelOutput": ".types", "WorkflowExpressionConditionModelInput": ".types", "WorkflowExpressionConditionModelOutput": ".types", "WorkflowFeaturesUsageCommonModel": ".types", "WorkflowLlmConditionModelInput": ".types", "WorkflowLlmConditionModelOutput": ".types", "WorkflowOverrideAgentNodeModelInput": ".types", "WorkflowOverrideAgentNodeModelOutput": ".types", "WorkflowPhoneNumberNodeModelInput": ".types", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem": ".types", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic": ".types", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static": ".types", "WorkflowPhoneNumberNodeModelInputPostDialDigits": ".types", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic": ".types", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Static": ".types", "WorkflowPhoneNumberNodeModelInputTransferDestination": ".types", "WorkflowPhoneNumberNodeModelInputTransferDestination_Phone": ".types", "WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable": ".types", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri": ".types", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable": ".types", "WorkflowPhoneNumberNodeModelOutput": ".types", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem": ".types", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic": ".types", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static": ".types", "WorkflowPhoneNumberNodeModelOutputPostDialDigits": ".types", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic": ".types", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static": ".types", "WorkflowPhoneNumberNodeModelOutputTransferDestination": ".types", "WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone": ".types", "WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable": ".types", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri": ".types", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable": ".types", "WorkflowResultConditionModelInput": ".types", "WorkflowResultConditionModelOutput": ".types", "WorkflowStandaloneAgentNodeModelInput": ".types", "WorkflowStandaloneAgentNodeModelOutput": ".types", "WorkflowStartNodeModelInput": ".types", "WorkflowStartNodeModelOutput": ".types", "WorkflowToolEdgeStepModel": ".types", "WorkflowToolLocator": ".types", "WorkflowToolLocatorSchemaOverridesValue": ".types", "WorkflowToolLocatorSchemaOverridesValue_Constant": ".types", "WorkflowToolLocatorSchemaOverridesValue_DynamicVariable": ".types", "WorkflowToolLocatorSchemaOverridesValue_Llm": ".types", "WorkflowToolLocatorSchemaOverridesValue_Omit": ".types", "WorkflowToolMaxIterationsExceededStepModel": ".types", "WorkflowToolNestedToolsStepModelInput": ".types", "WorkflowToolNestedToolsStepModelInputResultsItem": ".types", "WorkflowToolNestedToolsStepModelOutput": ".types", "WorkflowToolNestedToolsStepModelOutputResultsItem": ".types", "WorkflowToolNodeModelInput": ".types", "WorkflowToolNodeModelOutput": ".types", "WorkflowToolResponseModelInput": ".types", "WorkflowToolResponseModelInputStepsItem": ".types", "WorkflowToolResponseModelInputStepsItem_Edge": ".types", "WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded": ".types", "WorkflowToolResponseModelInputStepsItem_NestedTools": ".types", "WorkflowToolResponseModelOutput": ".types", "WorkflowToolResponseModelOutputStepsItem": ".types", "WorkflowToolResponseModelOutputStepsItem_Edge": ".types", "WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded": ".types", "WorkflowToolResponseModelOutputStepsItem_NestedTools": ".types", "WorkflowUnconditionalModelInput": ".types", "WorkflowUnconditionalModelOutput": ".types", "WorkspaceAnalyticsQueryResponseModel": ".types", "WorkspaceAnalyticsQueryResponseModelColumnTypesItem": ".types", "WorkspaceAnalyticsQueryResponseModelRowsItemItem": ".types", "WorkspaceApiKeyListResponseModel": ".types", "WorkspaceApiKeyResponseModel": ".types", "WorkspaceAuditLogEntryResponse": ".types", "WorkspaceAuditLogEntryResponseActivityId": ".types", "WorkspaceAuditLogsPageResponse": ".types", "WorkspaceBatchCallsResponse": ".types", "WorkspaceCreateApiKeyResponseModel": ".types", "WorkspaceCreateServiceAccountResponseModel": ".types", "WorkspaceCreateWebhookResponseModel": ".types", "WorkspaceGroupByNameResponseModel": ".types", "WorkspaceGroupPermission": ".types", "WorkspaceGroupResponseModel": ".types", "WorkspaceGroupResponseModelGroupPvcLimit": ".types", "WorkspaceGroupResponseModelGroupUsageLimit": ".types", "WorkspaceMemberResponseModel": ".types", "WorkspaceResourceType": ".types", "WorkspaceServiceAccountListResponseModel": ".types", "WorkspaceServiceAccountResponseModel": ".types", "WorkspaceWebhookEventType": ".types", "WorkspaceWebhookListResponseModel": ".types", "WorkspaceWebhookResponseModel": ".types", "WorkspaceWebhookUsageResponseModel": ".types", "__version__": ".version", "audio_isolation": ".audio_isolation", "audio_native": ".audio_native", "conversational_ai": ".conversational_ai", "dubbing": ".dubbing", "environment_variables": ".environment_variables", "forced_alignment": ".forced_alignment", "history": ".history", "models": ".models", "music": ".music", "play": ".play", "productions": ".productions", "pronunciation_dictionaries": ".pronunciation_dictionaries", "samples": ".samples", "save": ".play", "service_accounts": ".service_accounts", "speech_engine": ".speech_engine", "speech_engine_upstream": ".speech_engine_upstream", "speech_to_speech": ".speech_to_speech", "speech_to_text": ".speech_to_text", "stream": ".play", "studio": ".studio", "text_to_dialogue": ".text_to_dialogue", "text_to_sound_effects": ".text_to_sound_effects", "text_to_speech": ".text_to_speech", "text_to_voice": ".text_to_voice", "tokens": ".tokens", "usage": ".usage", "user": ".user", "v_1_speech_to_text_realtime": ".v_1_speech_to_text_realtime", "v_1_text_to_dialogue_multi_stream_input": ".v_1_text_to_dialogue_multi_stream_input", "v_1_text_to_dialogue_stream_input": ".v_1_text_to_dialogue_stream_input", "v_1_text_to_speech_voice_id_multi_stream_input": ".v_1_text_to_speech_voice_id_multi_stream_input", "v_1_text_to_speech_voice_id_stream_input": ".v_1_text_to_speech_voice_id_stream_input", "v_1_translate_realtime": ".v_1_translate_realtime", "voices": ".voices", "webhooks": ".webhooks", "workspace": ".workspace", "workspaces": ".workspaces", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AccountChangeActivityId", "ActorModel", "AddChapterResponseModel", "AddKnowledgeBaseResponseModel", "AddProjectRequest", "AddProjectResponseModel", "AddPronunciationDictionaryRequestWorkspaceAccess", "AddPronunciationDictionaryResponseModel", "AddPronunciationDictionaryResponseModelPermissionOnResource", "AddSharingVoiceRequest", "AddVoiceIvcResponseModel", "AddVoiceResponseModel", "AddWorkspaceGroupMemberResponseModel", "AddWorkspaceInviteResponseModel", "AdditionalFormatResponseModel", "AdditionalFormats", "AdhocAgentConfigOverrideForTestRequestModel", "Age", "AgentAnalysisItemsInput", "AgentAnalysisItemsInputDataCollectionItem", "AgentAnalysisItemsInputDataCollectionItem_System", "AgentAnalysisItemsInputDataCollectionItem_User", "AgentAnalysisItemsInputEvaluationCriteriaItem", "AgentAnalysisItemsInputEvaluationCriteriaItem_System", "AgentAnalysisItemsInputEvaluationCriteriaItem_User", "AgentAnalysisItemsOutput", "AgentAnalysisItemsOutputDataCollectionItem", "AgentAnalysisItemsOutputDataCollectionItem_System", "AgentAnalysisItemsOutputDataCollectionItem_User", "AgentAnalysisItemsOutputEvaluationCriteriaItem", "AgentAnalysisItemsOutputEvaluationCriteriaItem_System", "AgentAnalysisItemsOutputEvaluationCriteriaItem_User", "AgentBranchBasicInfo", "AgentBranchResponse", "AgentBranchSummary", "AgentCallLimits", "AgentConfig", "AgentConfigApiModelWorkflowOverrideInput", "AgentConfigApiModelWorkflowOverrideOutput", "AgentConfigOverrideConfig", "AgentConfigOverrideInput", "AgentConfigOverrideOutput", "AgentDefinitionSource", "AgentDeploymentPercentageStrategy", "AgentDeploymentRequest", "AgentDeploymentRequestItem", "AgentDeploymentResponse", "AgentFailureResponseExample", "AgentKnowledgeBaseRagChunkResponseModel", "AgentKnowledgeBaseRagQueryRequestModel", "AgentKnowledgeBaseRagQueryResponseModel", "AgentMetadata", "AgentMetadataDbModel", "AgentMetadataResponseModel", "AgentPlatformSettingsRequestModel", "AgentPlatformSettingsResponseModel", "AgentResponsePayload", "AgentSimulatedChatTestResponseModel", "AgentSortBy", "AgentSuccessfulResponseExample", "AgentSummaryBatchSuccessfulResponseModel", "AgentSummaryResponseModel", "AgentTestEntityType", "AgentTestFolderPathSegmentResponseModel", "AgentTestingSettings", "AgentTopicResponseModel", "AgentTransferInput", "AgentTransferOp", "AgentTransferOpPop", "AgentTransferOpPush", "AgentTransferOpReplace", "AgentTransferOp_Pop", "AgentTransferOp_Push", "AgentTransferOp_Replace", "AgentTransferOutput", "AgentTrustContext", "AgentVersionMetadata", "AgentVersionParents", "AgentWorkflowRequestModel", "AgentWorkflowRequestModelNodesValue", "AgentWorkflowRequestModelNodesValue_End", "AgentWorkflowRequestModelNodesValue_OverrideAgent", "AgentWorkflowRequestModelNodesValue_PhoneNumber", "AgentWorkflowRequestModelNodesValue_StandaloneAgent", "AgentWorkflowRequestModelNodesValue_Start", "AgentWorkflowRequestModelNodesValue_Tool", "AgentWorkflowResponseModel", "AgentWorkflowResponseModelNodesValue", "AgentWorkflowResponseModelNodesValue_End", "AgentWorkflowResponseModelNodesValue_OverrideAgent", "AgentWorkflowResponseModelNodesValue_PhoneNumber", "AgentWorkflowResponseModelNodesValue_StandaloneAgent", "AgentWorkflowResponseModelNodesValue_Start", "AgentWorkflowResponseModelNodesValue_Tool", "AgentWorkspaceOverridesInput", "AgentWorkspaceOverridesOutput", "AlertingMonitorConfig", "AlertingSettings", "AlertingSettingsResponse", "AlertingWebhookHeader", "AlertingWebhookMethod", "AlertingWebhookNotifier", "AlertingWebhookNotifierResponse", "Alignment", "AllowedOutputFormats", "AllowlistItem", "AnalysisCharging", "AnalysisProperty", "AnalysisPropertyConstantValue", "AnalysisPropertyType", "AnalysisRunSnapshot", "AnalysisRunningTotal", "AnalysisScope", "AnalysisType", "ApiIntegrationOAuth2AuthCodeResponse", "ApiIntegrationOAuth2AuthCodeResponseScopeSeparator", "ApiIntegrationOAuth2CustomAppResponse", "ApiIntegrationOAuth2CustomAppResponseScopeSeparator", "ApiIntegrationWebhookOverrides", "ApiIntegrationWebhookOverridesRequestHeadersValue", "ApiIntegrationWebhookOverridesSchemaOverridesValue", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant", "ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit", "ApiIntegrationWebhookToolConfigInput", "ApiIntegrationWebhookToolConfigOutput", "ArrayJsonSchemaPropertyInput", "ArrayJsonSchemaPropertyInputItems", "ArrayJsonSchemaPropertyInputPropertyKind", "ArrayJsonSchemaPropertyOutput", "ArrayJsonSchemaPropertyOutputItems", "AsrConversationalConfig", "AsrConversationalConfigOverride", "AsrConversationalConfigOverrideConfig", "AsrConversationalConfigWorkflowOverride", "AsrInputFormat", "AsrProvider", "AsrQuality", "AssetTranscription", "AssetTranscriptionData", "AssetTranscriptionStatus", "AstAdditionOperatorNodeInput", "AstAdditionOperatorNodeOutput", "AstAndOperatorNodeInput", "AstAndOperatorNodeOutput", "AstBooleanNodeInput", "AstBooleanNodeOutput", "AstConditionalOperatorNodeInput", "AstConditionalOperatorNodeOutput", "AstDivisionOperatorNodeInput", "AstDivisionOperatorNodeOutput", "AstDynamicVariableNodeInput", "AstDynamicVariableNodeOutput", "AstEqualsOperatorNodeInput", "AstEqualsOperatorNodeOutput", "AstGreaterThanOperatorNodeInput", "AstGreaterThanOperatorNodeOutput", "AstGreaterThanOrEqualsOperatorNodeInput", "AstGreaterThanOrEqualsOperatorNodeOutput", "AstLessThanOperatorNodeInput", "AstLessThanOperatorNodeOutput", "AstLessThanOrEqualsOperatorNodeInput", "AstLessThanOrEqualsOperatorNodeOutput", "AstMultiplicationOperatorNodeInput", "AstMultiplicationOperatorNodeOutput", "AstNodeInput", "AstNodeInputLlm", "AstNodeInput_AddOperator", "AstNodeInput_AndOperator", "AstNodeInput_BooleanLiteral", "AstNodeInput_ConditionalOperator", "AstNodeInput_DivOperator", "AstNodeInput_DynamicVariable", "AstNodeInput_EqOperator", "AstNodeInput_GtOperator", "AstNodeInput_GteOperator", "AstNodeInput_Llm", "AstNodeInput_LtOperator", "AstNodeInput_LteOperator", "AstNodeInput_MulOperator", "AstNodeInput_NeqOperator", "AstNodeInput_NullLiteral", "AstNodeInput_NumberLiteral", "AstNodeInput_OrOperator", "AstNodeInput_StringLiteral", "AstNodeInput_SubOperator", "AstNodeOutput", "AstNodeOutput_AddOperator", "AstNodeOutput_AndOperator", "AstNodeOutput_BooleanLiteral", "AstNodeOutput_ConditionalOperator", "AstNodeOutput_DivOperator", "AstNodeOutput_DynamicVariable", "AstNodeOutput_EqOperator", "AstNodeOutput_GtOperator", "AstNodeOutput_GteOperator", "AstNodeOutput_Llm", "AstNodeOutput_LtOperator", "AstNodeOutput_LteOperator", "AstNodeOutput_MulOperator", "AstNodeOutput_NeqOperator", "AstNodeOutput_NullLiteral", "AstNodeOutput_NumberLiteral", "AstNodeOutput_OrOperator", "AstNodeOutput_StringLiteral", "AstNodeOutput_SubOperator", "AstNotEqualsOperatorNodeInput", "AstNotEqualsOperatorNodeOutput", "AstNullNodeInput", "AstNullNodeOutput", "AstNumberNodeInput", "AstNumberNodeInputValue", "AstNumberNodeOutput", "AstNumberNodeOutputValue", "AstOrOperatorNodeInput", "AstOrOperatorNodeOutput", "AstStringNodeInput", "AstStringNodeOutput", "AstSubtractionOperatorNodeInput", "AstSubtractionOperatorNodeOutput", "AstllmNodeInput", "AstllmNodeInputPrompt", "AstllmNodeInputValueSchema", "AstllmNodeOutput", "AsyncConversationMetadata", "AsyncConversationMetadataDeliveryStatus", "AsyncElevenLabs", "AttachedSystemDataCollectionRef", "AttachedSystemEvaluationRef", "AttachedSystemEvaluationRefAnalysisItemId", "AttachedTestModel", "AttachedUserDataCollectionRef", "AttachedUserEvaluationRef", "AudioAnalysis", "AudioAnalysisResult", "AudioAnalysisStatus", "AudioFormat", "AudioFormatEnum", "AudioIsolationHistoryItemResponseModel", "AudioIsolationRequestFileFormat", "AudioIsolationStreamRequestFileFormat", "AudioKeyMoment", "AudioNativeCreateProjectResponseModel", "AudioNativeCreateRequestApplyTextNormalization", "AudioNativeEditContentResponseModel", "AudioNativeProjectSettingsResponseModel", "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", "AudioOutputMulti", "AudioRefChunk", "AudioSegment", "AudioWithTimestampsAndVoiceSegmentsResponseModel", "AudioWithTimestampsResponse", "AuthConnectionDependencies", "AuthConnectionDependenciesMcpServersItem", "AuthConnectionDependenciesMcpServersItem_Available", "AuthConnectionDependenciesMcpServersItem_Unknown", "AuthConnectionDependenciesToolsItem", "AuthConnectionDependenciesToolsItem_Available", "AuthConnectionDependenciesToolsItem_Unknown", "AuthConnectionLocator", "AuthConnectionStatus", "AuthSettings", "AuthenticationActivityId", "AuthorizationMethod", "AutoGenerationMetadata", "AutoSyncInfo", "BackgroundSoundConfig", "BackgroundSoundConfigWorkflowOverride", "BackgroundSoundPresetId", "BackgroundSoundSourceType", "BackupLlmDefault", "BackupLlmDisabled", "BackupLlmOverride", "BadRequestError", "BadRequestErrorBody", "BaseTurnConfig", "BasicAuthResponse", "BatchCallDetailedResponse", "BatchCallRecipientStatus", "BatchCallResponse", "BatchCallStatus", "BatchCallWhatsAppParams", "BatchFailureResponseModel", "BearerAuthResponse", "BehaviorOverride", "BillingPeriod", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess", "BodyComposeMusicV1MusicPostCompositionPlan", "BodyComposeMusicV1MusicPostModelId", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId", "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization", "BodyCreatePodcastV1StudioPodcastsPostDurationScale", "BodyCreatePodcastV1StudioPodcastsPostMode", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation", "BodyCreatePodcastV1StudioPodcastsPostSource", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan", "BodyStreamComposedMusicV1MusicStreamPostModelId", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId", "BodyTextToDialogueFullWithTimestampsApplyTextNormalization", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization", "BodyTextToSpeechFullApplyTextNormalization", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization", "BodyTextToSpeechStreamApplyTextNormalization", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization", "BranchProtectionStatus", "BreakdownTypes", "BucketingStatus", "BuiltInToolsInput", "BuiltInToolsOutput", "BuiltInToolsWorkflowOverrideInput", "BuiltInToolsWorkflowOverrideOutput", "CancelCalendarEventParams", "CancelGroupSessionForAllParams", "CancelGroupSessionRegistrationParams", "CanvasPlacement", "CaptionStyleCharacterAnimationModel", "CaptionStyleCharacterAnimationModelEnterType", "CaptionStyleCharacterAnimationModelExitType", "CaptionStyleHorizontalPlacementModel", "CaptionStyleHorizontalPlacementModelAlign", "CaptionStyleModel", "CaptionStyleModelTextAlign", "CaptionStyleModelTextBlendMode", "CaptionStyleModelTextStyle", "CaptionStyleModelTextTransform", "CaptionStyleModelTextWeight", "CaptionStyleSectionAnimationModel", "CaptionStyleSectionAnimationModelEnterType", "CaptionStyleSectionAnimationModelExitType", "CaptionStyleTemplateModel", "CaptionStyleVerticalPlacementModel", "CaptionStyleVerticalPlacementModelAlign", "CaptionStyleWordAnimationModel", "CaptionStyleWordAnimationModelEnterType", "CaptionStyleWordAnimationModelExitType", "ChapterContentBlockExtendableNodeResponseModel", "ChapterContentBlockInputModel", "ChapterContentBlockInputModelSubType", "ChapterContentBlockResponseModel", "ChapterContentBlockResponseModelNodesItem", "ChapterContentBlockResponseModelNodesItem_Other", "ChapterContentBlockResponseModelNodesItem_TtsNode", "ChapterContentBlockTtsNodeResponseModel", "ChapterContentInputModel", "ChapterContentParagraphTtsNodeInputModel", "ChapterContentResponseModel", "ChapterResponse", "ChapterSnapshotExtendedResponseModel", "ChapterSnapshotResponse", "ChapterSnapshotsResponse", "ChapterState", "ChapterStatisticsResponse", "ChapterWithContentResponseModel", "ChapterWithContentResponseModelState", "CharacterAge", "CharacterAlignmentModel", "CharacterAlignmentResponseModel", "CharacterGender", "CharacterMetadataResponseModel", "CharacterRefreshPeriod", "CharacterResponseModel", "CharacterRole", "CharacterUsageResponse", "ChatSourceMedium", "CheckServiceAvailabilityParams", "ClientEvent", "ClientToolConfigInput", "ClientToolConfigOutput", "ClipAnimation", "ClipAnimationEnterEffect", "ClipAnimationExitEffect", "CloseConnection", "CloseContext", "ClosePayload", "CloseSocket", "ColumnFilter", "ColumnFilterOperation", "ColumnFilterValuesItem", "ColumnUnit", "CommitStrategy", "CommittedTranscriptEntitiesPayload", "CommittedTranscriptPayload", "CommittedTranscriptWithTimestampsPayload", "CompileProceduresResponseModel", "CompileProceduresValidationErrorResponseModel", "CompositionPlan", "CompositionPlanChunksItem", "ConfigEntityType", "ConflictError", "ConflictSection", "ConstantSchemaOverride", "ConstantSchemaOverrideConstantValue", "ContentConfig", "ContentFormat", "ContentGuardrailInput", "ContentGuardrailInputTriggerAction", "ContentGuardrailInputTriggerAction_EndCall", "ContentGuardrailInputTriggerAction_Retry", "ContentGuardrailOutput", "ContentGuardrailOutputTriggerAction", "ContentGuardrailOutputTriggerAction_EndCall", "ContentGuardrailOutputTriggerAction_Retry", "ContentThresholdGuardrail", "ContentThresholdGuardrailThreshold", "ContextualUpdateInfo", "Contributor", "ConvAiDynamicVariable", "ConvAiEnvVarLocator", "ConvAiFileUploadResponseModel", "ConvAiSecretLocator", "ConvAiStoredSecretDependencies", "ConvAiStoredSecretDependenciesAgentsItem", "ConvAiStoredSecretDependenciesAgentsItem_Available", "ConvAiStoredSecretDependenciesAgentsItem_Unknown", "ConvAiStoredSecretDependenciesMcpServersItem", "ConvAiStoredSecretDependenciesMcpServersItem_Available", "ConvAiStoredSecretDependenciesMcpServersItem_Unknown", "ConvAiStoredSecretDependenciesToolsItem", "ConvAiStoredSecretDependenciesToolsItem_Available", "ConvAiStoredSecretDependenciesToolsItem_Unknown", "ConvAiUserSecretDbModel", "ConvAiWebhooks", "ConvAiWorkspaceStoredSecretConfig", "ConversationAsrUsageModel", "ConversationChargingCommonModel", "ConversationConfigClientOverrideConfigInput", "ConversationConfigClientOverrideConfigOutput", "ConversationConfigClientOverrideInput", "ConversationConfigClientOverrideOutput", "ConversationConfigInput", "ConversationConfigOutput", "ConversationConfigOverride", "ConversationConfigOverrideConfig", "ConversationConfigWorkflowOverrideInput", "ConversationConfigWorkflowOverrideOutput", "ConversationDeletionSettings", "ConversationFeedbackType", "ConversationHistoryAnalysisCommonModel", "ConversationHistoryBatchCallModel", "ConversationHistoryElevenAssistantCommonModel", "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryExotelPhoneCallModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", "ConversationHistoryMetadataCommonModelPhoneCall_Exotel", "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", "ConversationHistoryMultivoiceMessageModel", "ConversationHistoryMultivoiceMessagePartModel", "ConversationHistoryRagUsageCommonModel", "ConversationHistoryRedactionConfig", "ConversationHistorySipTrunkingPhoneCallModel", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput", "ConversationHistoryTranscriptCommonModelInput", "ConversationHistoryTranscriptCommonModelInputRole", "ConversationHistoryTranscriptCommonModelInputToolResultsItem", "ConversationHistoryTranscriptCommonModelOutput", "ConversationHistoryTranscriptCommonModelOutputRole", "ConversationHistoryTranscriptCommonModelOutputToolResultsItem", "ConversationHistoryTranscriptFileInputResponseModel", "ConversationHistoryTranscriptOtherToolsResultCommonModel", "ConversationHistoryTranscriptOtherToolsResultCommonModelType", "ConversationHistoryTranscriptResponseModel", "ConversationHistoryTranscriptResponseModelRole", "ConversationHistoryTranscriptResponseModelToolResultsItem", "ConversationHistoryTranscriptSystemToolResultCommonModelInput", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutput", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput", "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModelInput", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook", "ConversationHistoryTranscriptToolCallCommonModelOutput", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook", "ConversationHistoryTranscriptToolCallMcpDetails", "ConversationHistoryTranscriptToolCallWebhookDetails", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput", "ConversationHistoryTwilioPhoneCallModel", "ConversationInitiationClientDataConfigInput", "ConversationInitiationClientDataConfigOutput", "ConversationInitiationClientDataInternal", "ConversationInitiationClientDataRequestInput", "ConversationInitiationClientDataRequestOutput", "ConversationInitiationClientDataWebhook", "ConversationInitiationClientDataWebhookRequestHeadersValue", "ConversationInitiationSource", "ConversationInitiationSourceInfo", "ConversationProduct", "ConversationReasoningModel", "ConversationSentimentAnalysis", "ConversationSentimentAnalysisOverallLabel", "ConversationSignedUrlResponseModel", "ConversationSimulationSpecification", "ConversationSource", "ConversationSummaryResponseModel", "ConversationSummaryResponseModelStatus", "ConversationTagResponseModel", "ConversationTokenPurpose", "ConversationTokenResponseModel", "ConversationTtsUsageModel", "ConversationTurnMetrics", "ConversationUserResponseModel", "ConversationVoiceRewardModel", "ConversationVoiceUsageModel", "ConversationalConfig", "ConversationalConfigApiModelWorkflowOverrideInput", "ConversationalConfigApiModelWorkflowOverrideOutput", "ConvertChapterResponseModel", "ConvertProjectResponseModel", "CrawlStatus", "CrawlType", "CreateAgentBranchResponseModel", "CreateAgentProcedureParams", "CreateAgentResponseModel", "CreateAgentRuleParams", "CreateAgentTestFolderResponseModel", "CreateAgentTestResponseModel", "CreateAssetParams", "CreateAudioNativeProjectRequest", "CreateAuthConnectionEnvironmentVariableRequest", "CreateBasicAuthRequest", "CreateBearerAuthRequest", "CreateClientAppointmentParams", "CreateClientInteractionParams", "CreateClientParams", "CreateCrawlJobResponseModel", "CreateCustomHeaderAuthRequest", "CreateExotelPhoneNumberRequest", "CreateHolidayParams", "CreateLocationParams", "CreateMtlsAuthRequest", "CreateOAuth2ClientCredsRequest", "CreateOAuth2JwtRequest", "CreateOAuth2JwtRequestAlgorithm", "CreateOAuth2JwtRequestTokenResponseField", "CreateOrderRequest", "CreateOrderResponse", "CreatePhoneNumberResponseModel", "CreatePreviouslyGeneratedVoiceRequest", "CreatePrivateKeyJwtRequest", "CreatePrivateKeyJwtRequestAlgorithm", "CreateProcedureRequestModel", "CreateProcedureResponseModel", "CreateProductParams", "CreatePronunciationDictionaryResponseModel", "CreateResponseUnitTestRequest", "CreateSecretEnvironmentVariableRequest", "CreateServiceParams", "CreateSimulationTestRequest", "CreateSipTrunkPhoneNumberRequest", "CreateStaffParams", "CreateStringEnvironmentVariableRequest", "CreateToolCallUnitTestRequest", "CreateTranscriptRequest", "CreateTransferRuleParams", "CreateTwilioPhoneNumberRequest", "CriteriaScoringMode", "CueOptionsRequest", "Currency", "CustomGuardrailConfig", "CustomGuardrailConfigModel", "CustomGuardrailConfigTriggerAction", "CustomGuardrailConfigTriggerAction_EndCall", "CustomGuardrailConfigTriggerAction_Retry", "CustomGuardrailInput", "CustomGuardrailOutput", "CustomGuardrailsConfigInput", "CustomGuardrailsConfigOutput", "CustomHeaderAuthResponse", "CustomLlm", "CustomLlmApiKey", "CustomLlmAuthConnection", "CustomLlmRequestHeadersValue", "CustomLlmapiType", "CustomSipHeader", "CustomSipHeaderWithDynamicVariable", "CustomToolApiSchemaConfig", "DashboardCallSuccessChartModel", "DashboardCriteriaChartModel", "DashboardDataCollectionChartModel", "DataCollectionResultCommonModel", "DefaultSharingGroupConfig", "DefaultSharingGroupConfigPermissionLevel", "DefaultSharingGroupResponseModel", "DefaultSharingGroupResponseModelPermissionLevel", "DeleteAgentProcedureParams", "DeleteAgentRuleParams", "DeleteAssetParams", "DeleteCalendarEventParams", "DeleteChapterRequest", "DeleteChapterResponseModel", "DeleteClientInteractionParams", "DeleteClientParams", "DeleteDubbingResponseModel", "DeleteGroupSessionParams", "DeleteHistoryItemResponse", "DeleteHolidayParams", "DeleteLocationParams", "DeleteProductParams", "DeleteProjectRequest", "DeleteProjectResponseModel", "DeleteSampleResponse", "DeleteServiceParams", "DeleteStaffParams", "DeleteTransferRuleParams", "DeleteVoiceResponseModel", "DeleteVoiceSampleResponseModel", "DeleteWorkspaceGroupMemberResponseModel", "DeleteWorkspaceInviteResponseModel", "DeleteWorkspaceWebhookResponseModel", "DeliverableInfo", "DependentAvailableAgentIdentifier", "DependentAvailableAgentIdentifierAccessLevel", "DependentAvailableMcpServerIdentifier", "DependentAvailableMcpServerIdentifierAccessLevel", "DependentAvailableToolIdentifier", "DependentAvailableToolIdentifierAccessLevel", "DependentBranchInfo", "DependentIntegrationConnectionIdentifier", "DependentPhoneNumberIdentifier", "DependentUnknownAgentIdentifier", "DependentUnknownMcpServerIdentifier", "DependentUnknownToolIdentifier", "DetailedMusicResponse", "DetailedMusicResponseCompositionPlan", "DetectedEntity", "DeviceModel", "DialogueInput", "DialogueInputResponseModel", "DialogueTextAlignment", "DirectPublishingReadResponseModel", "DirectPublishingReadResponseModelDisplayMode", "DirectPublishingReadResponseModelGenreItem", "DirectPublishingReadResponseModelPayoutType", "DirectPublishingReadResponseModelTargetAudience", "DiscountResponseModel", "DoDubbingResponse", "DocumentUsageModeEnum", "DocxExportOptions", "DtmfInputConfig", "DubOrderItemRequest", "DubRequestMode", "DubbedSegment", "DubbingBulkSourceSegmentUpdateResponse", "DubbingBulkTargetSegmentUpdateResponse", "DubbingError", "DubbingLanguageListResponse", "DubbingLanguageOutputs", "DubbingLanguageResponse", "DubbingLanguageResponseStatus", "DubbingListRequestCreationSourcesItem", "DubbingListRequestDubbingModelsItem", "DubbingListRequestDubbingStatus", "DubbingListRequestDubbingStatusesItem", "DubbingListRequestFilterByCreator", "DubbingListRequestOrderBy", "DubbingListRequestOrderDirection", "DubbingMediaMetadata", "DubbingMediaReference", "DubbingMetadataPageResponseModel", "DubbingMetadataResponse", "DubbingProjectListResponse", "DubbingProjectResponse", "DubbingProjectResponseStatus", "DubbingRegenerateResponse", "DubbingRenderResponseModel", "DubbingResource", "DubbingSegmentUpdateRequest", "DubbingSourceMediaInfo", "DubbingSourceSegmentUpdateResponse", "DubbingSourceTranscriptResponse", "DubbingTargetSegmentUpdateRequest", "DubbingTargetSegmentUpdateResponse", "DubbingTargetTranscriptResponse", "DubbingTargetTranscriptSegment", "DubbingTranscript", "DubbingTranscriptCharacter", "DubbingTranscriptResponseModel", "DubbingTranscriptRevisionResponse", "DubbingTranscriptSegment", "DubbingTranscriptUtterance", "DubbingTranscriptWord", "DubbingTranscriptsResponseModel", "DubbingTranscriptsResponseModelTranscriptFormat", "DummyToolResultModel", "DynamicVariableAssignment", "DynamicVariableNestedValueTypeInput", "DynamicVariableNestedValueTypeOutput", "DynamicVariableSchemaOverride", "DynamicVariableUpdateCommonModel", "DynamicVariablesConfig", "DynamicVariablesConfigWorkflowOverride", "EditChapterResponseModel", "EditProjectResponseModel", "EditVoiceRequestLabels", "EditVoiceResponseModel", "EditVoiceSettingsRequest", "EditVoiceSettingsResponseModel", "ElevenLabs", "ElevenLabsEnvironment", "EmbedVariant", "EmbeddingModelEnum", "EndCallToolConfig", "EndCallToolResultModel", "EndCallTriggerAction", "EndProcedureToolConfigInput", "EndProcedureToolConfigOutput", "EndProcedureToolErrorStatus", "EntityManagementActivityId", "EntryBehavior", "EnvironmentAuthConnectionLocator", "EnvironmentVariableAuthConnectionValue", "EnvironmentVariableAuthConnectionValueRequest", "EnvironmentVariableResponse", "EnvironmentVariableResponseType", "EnvironmentVariableResponseValues", "EnvironmentVariableSecretValue", "EnvironmentVariableSecretValueRequest", "EnvironmentVariablesCreateRequestBody", "EnvironmentVariablesCreateRequestBody_AuthConnection", "EnvironmentVariablesCreateRequestBody_Secret", "EnvironmentVariablesCreateRequestBody_String", "EnvironmentVariablesListRequestType", "EnvironmentVariablesListResponse", "ErrorPayload", "EvaluationCriteriaSummaryResult", "EvaluationSettingsInput", "EvaluationSettingsOutput", "EvaluationSuccessResult", "ExactParameterEvaluationStrategy", "ExotelApiSubdomain", "ExotelOutboundCallResponse", "ExportOptions", "ExportOptions_Docx", "ExportOptions_Html", "ExportOptions_Pdf", "ExportOptions_SegmentedJson", "ExportOptions_Srt", "ExportOptions_Txt", "ExternalFileSyncInfo", "ExternalFolderSyncInfo", "ExternalSyncJobTrigger", "ExternalSyncJobType", "ExternalSyncProvider", "FeatureStatusCommonModel", "FeaturesUsageCommonModel", "FeedbackItem", "FieldConflict", "FileInputConfig", "FileInputConfigWorkflowOverride", "FileRefreshStatus", "FinalOutput", "FinalOutputMulti", "FinalTranscript", "FinalTranscriptWithTimestamps", "FinalTranscriptWithTimestampsWordsItem", "FinalTranscriptWithTimestampsWordsItemCharactersItem", "FinalTranscriptWithTimestampsWordsItemType", "FineTuningResponse", "FineTuningResponseStateValue", "FinetuneCreatedBy", "FinetuneVisibility", "FlushContext", "FocusGuardrail", "ForbiddenError", "ForcedAlignmentCharacterResponseModel", "ForcedAlignmentResponseModel", "ForcedAlignmentWordResponseModel", "FrustratedConversationRef", "FrustratedConversationRefOverallLabel", "Gender", "GenerateVoiceRequest", "GenerationChunkInput", "GenerationChunkInputConditionStrength", "GenerationChunkInputContextAdherence", "GenerationChunkOutput", "GenerationChunkOutputConditionStrength", "GenerationChunkOutputContextAdherence", "GenerationConfig", "GenerationSourceContext", "GenesysBotOutcome", "GenesysRegion", "GetAgentEmbedResponseModel", "GetAgentKnowledgebaseSizeResponseModel", "GetAgentLinkResponseModel", "GetAgentResponseModel", "GetAgentResponseModelPhoneNumbersItem", "GetAgentResponseModelPhoneNumbersItem_Exotel", "GetAgentResponseModelPhoneNumbersItem_SipTrunk", "GetAgentResponseModelPhoneNumbersItem_Twilio", "GetAgentTestFolderResponseModel", "GetAgentTopicsResponseModel", "GetAgentsPageResponseModel", "GetAnalyticsSummaryParams", "GetAppointmentByConfirmationNumberParams", "GetAudioIsolationHistoryResponseModel", "GetAudioNativeProjectSettingsResponseModel", "GetBookingPageSettingsParams", "GetBookingSlugStatusParams", "GetChapterRequest", "GetChapterSnapshotsRequest", "GetChaptersRequest", "GetChaptersResponse", "GetClientAppointmentsParams", "GetClientByPhoneParams", "GetConvAiDashboardSettingsResponseModel", "GetConvAiDashboardSettingsResponseModelChartsItem", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria", "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection", "GetConvAiSettingsResponseModel", "GetConversationResponseModel", "GetConversationResponseModelStatus", "GetConversationTagsPageResponseModel", "GetConversationUsersPageResponseModel", "GetConversationsPageResponseModel", "GetCrawlJobResponseModel", "GetKnowledgeBaseDependentAgentsResponseModel", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown", "GetKnowledgeBaseFileResponseModel", "GetKnowledgeBaseFolderResponseModel", "GetKnowledgeBaseListResponseModel", "GetKnowledgeBaseListResponseModelDocumentsItem", "GetKnowledgeBaseListResponseModelDocumentsItem_File", "GetKnowledgeBaseListResponseModelDocumentsItem_Folder", "GetKnowledgeBaseListResponseModelDocumentsItem_Text", "GetKnowledgeBaseListResponseModelDocumentsItem_Url", "GetKnowledgeBaseSummaryFileResponseModel", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryFolderResponseModel", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryTextResponseModel", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryUrlResponseModel", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseTextResponseModel", "GetKnowledgeBaseUrlResponseModel", "GetLibraryVoicesResponse", "GetLiveCountResponse", "GetOrCreateRagIndexRequestModel", "GetPhoneNumberExotelResponseModel", "GetPhoneNumberInboundSipTrunkConfigResponseModel", "GetPhoneNumberOutboundSipTrunkConfigResponseModel", "GetPhoneNumberResponse", "GetPhoneNumberSipTrunkResponseModel", "GetPhoneNumberTwilioResponseModel", "GetProjectRequest", "GetProjectsRequest", "GetProjectsResponse", "GetPronunciationDictionariesMetadataResponseModel", "GetPronunciationDictionariesResponse", "GetPronunciationDictionaryMetadataResponse", "GetPronunciationDictionaryMetadataResponsePermissionOnResource", "GetPronunciationDictionaryResponse", "GetPronunciationDictionaryWithRulesResponseModel", "GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource", "GetPronunciationDictionaryWithRulesResponseModelRulesItem", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme", "GetResponseUnitTestResponseModel", "GetScheduleParams", "GetSecretDependenciesResponseModel", "GetSecretDependenciesResponseModelDependencies", "GetSecretDependenciesResponseModelDependenciesOneItem", "GetSecretDependenciesResponseModelDependenciesOneItem_Available", "GetSecretDependenciesResponseModelDependenciesOneItem_Unknown", "GetSecretDependenciesResponseModelDependenciesZeroItem", "GetSecretDependenciesResponseModelDependenciesZeroItem_Available", "GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown", "GetSimulationTestResponseModel", "GetSipLogMessagesResponse", "GetSpeechHistoryResponse", "GetTestInvocationsPageResponseModel", "GetTestSuiteInvocationResponseModel", "GetTestsPageResponseModel", "GetTestsSummariesByIdsResponseModel", "GetToolCallUnitTestResponseModel", "GetToolDependentAgentsResponseModel", "GetToolDependentAgentsResponseModelAgentsItem", "GetToolDependentAgentsResponseModelAgentsItem_Available", "GetToolDependentAgentsResponseModelAgentsItem_Unknown", "GetToolExecutionsPageResponseModel", "GetVoiceAccentsResponseModel", "GetVoicesResponse", "GetVoicesV2Response", "GetWhatsAppAccountResponse", "GetWorkspaceSecretsResponseModel", "GroupManagementActivityId", "GuardrailExecutionMode", "GuardrailType", "GuardrailsV1Input", "GuardrailsV1Output", "HistoryAlignmentResponseModel", "HistoryAlignmentsResponseModel", "HistoryItemResponse", "HistoryListRequestSortDirection", "HistoryListRequestSource", "HtmlExportOptions", "HttpRequestModel", "HttpValidationError", "Icon", "ImageAnalysis", "ImageAnalysisResult", "ImageAnalysisStatus", "ImageAvatar", "ImageSubject", "InboundSipTrunkConfigRequestModel", "InitPayload", "InitialiseContext", "InitializeConnection", "InitializeConnectionMulti", "InputAudioChunkPayload", "IntegrationType", "InteractionBudget", "InternalAlertingWebhookNotifier", "InvoiceResponse", "InvoiceResponsePaymentIntentStatus", "InvoiceResponsePaymentIntentStatussesItem", "ItemId", "KbExternalSyncJob", "KeepContextAlive", "KnowledgeBaseBulkDeleteSuccessfulResponseModel", "KnowledgeBaseContentSearchResponseModel", "KnowledgeBaseContentSearchResult", "KnowledgeBaseContentSearchResultDocument", "KnowledgeBaseContentSearchResultDocument_File", "KnowledgeBaseContentSearchResultDocument_Folder", "KnowledgeBaseContentSearchResultDocument_Text", "KnowledgeBaseContentSearchResultDocument_Url", "KnowledgeBaseDeletedResponseModel", "KnowledgeBaseDependentType", "KnowledgeBaseDocumentChunkResponseModel", "KnowledgeBaseDocumentChunksResponseModel", "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", "KnowledgeBaseFolderPathSegmentResponseModel", "KnowledgeBaseFolderPathSegmentSummaryResponseModel", "KnowledgeBaseLocator", "KnowledgeBaseRagChunkModel", "KnowledgeBaseRagToolConfig", "KnowledgeBaseRagToolResultModel", "KnowledgeBaseRagToolStatus", "KnowledgeBaseSortBy", "KnowledgeBaseSourceFileUrlResponseModel", "KnowledgeBaseSummaryBatchSuccessfulResponseModel", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url", "KnowledgeBaseToolConfig", "KnowledgeBaseToolInfo", "KnowledgeBaseToolResultModel", "KnowledgeBaseToolStatus", "LanguageAddedResponse", "LanguageDetectionToolConfig", "LanguageDetectionToolResultModel", "LanguageInfo", "LanguagePairInfo", "LanguagePresetInput", "LanguagePresetOutput", "LanguagePresetTranslation", "LanguageResponse", "LanguagesResponse", "LanguagesResponse_Pair", "LanguagesResponse_Single", "LeaveMessageParams", "LibraryVoiceResponse", "LibraryVoiceResponseCategory", "ListAgentProceduresParams", "ListAgentReferencesParams", "ListAgentRulesParams", "ListAssetsParams", "ListAuthConnectionsResponse", "ListAuthConnectionsResponseAuthConnectionsItem", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp", "ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth", "ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth", "ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth", "ListAuthConnectionsResponseAuthConnectionsItem_Mtls", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt", "ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt", "ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth", "ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth", "ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret", "ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth", "ListCalendarEventsParams", "ListClientInteractionsParams", "ListClientsParams", "ListCrawlJobsResponseModel", "ListCustomerFacingAgentsParams", "ListGroupSessionsParams", "ListHolidaysParams", "ListLocationsParams", "ListMcpToolsResponseModel", "ListOrdersResponse", "ListProceduresResponseModel", "ListProductsParams", "ListResponseAgentBranchSummary", "ListResponseMeta", "ListServicesParams", "ListSpeechEnginesResponse", "ListStaffParams", "ListTransferRulesParams", "ListWhatsAppAccountsResponse", "LiteralJsonSchemaProperty", "LiteralJsonSchemaPropertyConstantValue", "LiteralJsonSchemaPropertyType", "LivekitStackType", "Llm", "LlmCategoryUsage", "LlmDeprecationConfigModel", "LlmDeprecationInfoModel", "LlmInfoModelInput", "LlmInfoModelOutput", "LlmInputOutputTokensUsage", "LlmListResponseModelInput", "LlmListResponseModelOutput", "LlmLiteralJsonSchemaProperty", "LlmLiteralJsonSchemaPropertyType", "LlmParameterEvaluationStrategy", "LlmReasoningEffort", "LlmSchemaOverride", "LlmTokensCategoryUsage", "LlmUsageCalculatorLlmResponseModel", "LlmUsageCalculatorResponseModel", "LlmUsageInput", "LlmUsageOutput", "LoadMemoryEntryToolErrorStatus", "LoadableMemoryEntry", "LockReason", "ManualSource", "ManualVerificationFileResponse", "ManualVerificationResponse", "MatchAnythingParameterEvaluationStrategy", "McpApprovalPolicy", "McpServerConfigInput", "McpServerConfigInputAuthConnection", "McpServerConfigInputRequestHeadersValue", "McpServerConfigInputRequestMetaValue", "McpServerConfigInputSecretToken", "McpServerConfigInputUrl", "McpServerConfigOutput", "McpServerConfigOutputAuthConnection", "McpServerConfigOutputRequestHeadersValue", "McpServerConfigOutputRequestMetaValue", "McpServerConfigOutputSecretToken", "McpServerConfigOutputUrl", "McpServerMetadataResponseModel", "McpServerResponseModel", "McpServerResponseModelDependentAgentsItem", "McpServerResponseModelDependentAgentsItem_Available", "McpServerResponseModelDependentAgentsItem_Unknown", "McpServerTransport", "McpServersResponseModel", "McpToolApprovalHash", "McpToolApprovalPolicy", "McpToolConfigOverrideInput", "McpToolConfigOverrideInputInputOverridesValue", "McpToolConfigOverrideInputInputOverridesValue_Constant", "McpToolConfigOverrideInputInputOverridesValue_DynamicVariable", "McpToolConfigOverrideInputInputOverridesValue_Llm", "McpToolConfigOverrideInputInputOverridesValue_Omit", "McpToolConfigOverrideInputToolCallSound", "McpToolConfigOverrideOutput", "McpToolConfigOverrideOutputInputOverridesValue", "McpToolConfigOverrideOutputInputOverridesValue_Constant", "McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable", "McpToolConfigOverrideOutputInputOverridesValue_Llm", "McpToolConfigOverrideOutputInputOverridesValue_Omit", "McpToolConfigOverrideOutputToolCallSound", "MediaCodec", "MediaId", "MemoryEntrySearchResult", "MemoryEntrySearchResultSource", "MergePreviewResponseModel", "MergePreviewResponseModelPhoneNumbersItem", "MergePreviewResponseModelPhoneNumbersItem_Exotel", "MergePreviewResponseModelPhoneNumbersItem_SipTrunk", "MergePreviewResponseModelPhoneNumbersItem_Twilio", "MessageSearchSortBy", "MessagesSearchResponse", "MessagesSearchResult", "MetricRecord", "MetricType", "MockNoMatchBehavior", "MockingStrategy", "Model", "ModelRatesResponseModel", "ModelSettingsResponseModel", "ModerationConfig", "ModerationGuardrailInput", "ModerationGuardrailOutput", "MtlsAuthResponse", "MultichannelSpeechToTextResponseModel", "MultipartMusicResponse", "MusicAllowedOutputFormats", "MusicComposeDetailedRequestOutputFormat", "MusicComposeDetailedStreamRequestOutputFormat", "MusicComposeRequestOutputFormat", "MusicExploreSongSourceContext", "MusicFinetuneFailureReason", "MusicFinetunePageResponseModel", "MusicFinetuneResponseModel", "MusicFinetuneStatus", "MusicGenerationMode", "MusicOnlyOutputFormats", "MusicOutputFormat", "MusicPrompt", "MusicSeparateStemsRequestStemVariationId", "MusicStreamRequestOutputFormat", "MusicUploadResponse", "MusicUploadResponseCompositionPlan", "MusicVideoToMusicRequestModelId", "NonStreamingOutputFormats", "NormalizedAlignment", "NotFoundError", "NumericDistributionAggregate", "OAuth2ClientCredsResponse", "OAuth2JwtResponse", "OAuth2JwtResponseAlgorithm", "OAuth2JwtResponseTokenResponseField", "ObjectJsonSchemaPropertyInput", "ObjectJsonSchemaPropertyInputPropertiesValue", "ObjectJsonSchemaPropertyInputPropertyKind", "ObjectJsonSchemaPropertyOutput", "ObjectJsonSchemaPropertyOutputPropertiesValue", "OmitSchemaOverride", "OpenAiAudioFormat", "OpenerConfig", "OptInSmsReminderParams", "OptOutSmsReminderParams", "OrbAvatar", "OrchestratorToolMockBehaviorConfig", "OrderDeliverablesResponse", "OrderId", "OrderItemInfo", "OrderItemKind", "OrderItemRequestInput", "OrderItemRequestInput_Dub", "OrderItemRequestInput_Subtitles", "OrderItemRequestInput_Transcription", "OrderItemRequestOutput", "OrderItemRequestOutput_Dub", "OrderItemRequestOutput_Subtitles", "OrderItemRequestOutput_Transcription", "OrderMediaResponse", "OrderResponse", "OrderState", "OrderSummary", "OutboundCallRecipient", "OutboundCallRecipientResponseModel", "OutboundSipTrunkConfigRequestModel", "OutputFormat", "PairedLanguagesResponse", "PartialTranscriptPayload", "PatchWorkspaceWebhookResponseModel", "PdfExportOptions", "PendingBlocksMetadataModel", "PendingCancellationResponseModel", "PendingClipTask", "PendingClipTaskType", "PendingExternalAudiosMetadataModel", "PendingSubscriptionSwitchResponseModel", "PendingSubscriptionSwitchResponseModelNextTier", "PermissionType", "PhoneNumberAgentInfo", "PhoneNumberDynamicVariableTransferDestination", "PhoneNumberTransfer", "PhoneNumberTransferCustomSipHeadersItem", "PhoneNumberTransferCustomSipHeadersItem_Dynamic", "PhoneNumberTransferCustomSipHeadersItem_Static", "PhoneNumberTransferDestination", "PhoneNumberTransferPostDialDigits", "PhoneNumberTransferPostDialDigits_Dynamic", "PhoneNumberTransferPostDialDigits_Static", "PhoneNumberTransferTransferDestination", "PhoneNumberTransferTransferDestination_Phone", "PhoneNumberTransferTransferDestination_PhoneDynamicVariable", "PhoneNumberTransferTransferDestination_SipUri", "PhoneNumberTransferTransferDestination_SipUriDynamicVariable", "PingPayload", "PlatformCategory", "PlatformCategoryUsage", "PlatformUsage", "PlayDtmfResultErrorModel", "PlayDtmfResultSuccessModel", "PlayDtmfToolConfig", "PodcastBulletinMode", "PodcastBulletinModeData", "PodcastConversationMode", "PodcastConversationModeData", "PodcastProjectResponseModel", "PodcastTextSource", "PodcastUrlSource", "PongPayload", "PositionInput", "PositionOutput", "PostAgentAvatarResponseModel", "PostDialDigitsDynamicVariable", "PostDialDigitsStatic", "PostWorkspaceSecretResponseModel", "PreToolSpeechMode", "PreviewAudioDbModel", "Price", "PrivacyConfigInput", "PrivacyConfigOutput", "PrivateKeyJwtResponse", "PrivateKeyJwtResponseAlgorithm", "ProcedureAtVersionInput", "ProcedureAtVersionOutput", "ProcedureAtVersionResponseModel", "ProcedureDraftResponseModel", "ProcedureListItemResponseModel", "ProcedureRefResponseModel", "ProcedureType", "ProcedureValidationError", "ProjectCreationMetaResponseModel", "ProjectCreationMetaResponseModelStatus", "ProjectCreationMetaType", "ProjectExtendedResponse", "ProjectExtendedResponseAccessLevel", "ProjectExtendedResponseApplyTextNormalization", "ProjectExtendedResponseAspectRatio", "ProjectExtendedResponseAssetsItem", "ProjectExtendedResponseAssetsItem_Audio", "ProjectExtendedResponseAssetsItem_Image", "ProjectExtendedResponseAssetsItem_Video", "ProjectExtendedResponseFiction", "ProjectExtendedResponseSourceType", "ProjectExtendedResponseTargetAudience", "ProjectExternalAudioResponseModel", "ProjectExternalAudioResponseModelSourceContext", "ProjectExternalAudioResponseModelSourceContext_MusicExploreSong", "ProjectExternalAudioResponseModelSourceContext_Sfx", "ProjectExternalAudioResponseModelSourceContext_Song", "ProjectImageResponseModel", "ProjectMutedTracksResponseModel", "ProjectResponse", "ProjectResponseAccessLevel", "ProjectResponseAspectRatio", "ProjectResponseFiction", "ProjectResponseSourceType", "ProjectResponseTargetAudience", "ProjectSnapshotExtendedResponseModel", "ProjectSnapshotResponse", "ProjectSnapshotsResponse", "ProjectState", "ProjectVideoResponseModel", "ProjectVideoThumbnailSheetResponseModel", "ProjectVoiceResponseModel", "PromptAgent", "PromptAgentApiModelInput", "PromptAgentApiModelInputBackupLlmConfig", "PromptAgentApiModelInputBackupLlmConfig_Default", "PromptAgentApiModelInputBackupLlmConfig_Disabled", "PromptAgentApiModelInputBackupLlmConfig_Override", "PromptAgentApiModelInputToolsItem", "PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelInputToolsItem_Client", "PromptAgentApiModelInputToolsItem_Mcp", "PromptAgentApiModelInputToolsItem_Smb", "PromptAgentApiModelInputToolsItem_System", "PromptAgentApiModelInputToolsItem_Webhook", "PromptAgentApiModelOutput", "PromptAgentApiModelOutputBackupLlmConfig", "PromptAgentApiModelOutputBackupLlmConfig_Default", "PromptAgentApiModelOutputBackupLlmConfig_Disabled", "PromptAgentApiModelOutputBackupLlmConfig_Override", "PromptAgentApiModelOutputToolsItem", "PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelOutputToolsItem_Client", "PromptAgentApiModelOutputToolsItem_Mcp", "PromptAgentApiModelOutputToolsItem_Smb", "PromptAgentApiModelOutputToolsItem_System", "PromptAgentApiModelOutputToolsItem_Webhook", "PromptAgentApiModelOverrideConfig", "PromptAgentApiModelOverrideInput", "PromptAgentApiModelOverrideOutput", "PromptAgentApiModelWorkflowOverrideInput", "PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig", "PromptAgentApiModelWorkflowOverrideInputToolsItem", "PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Client", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb", "PromptAgentApiModelWorkflowOverrideInputToolsItem_System", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook", "PromptAgentApiModelWorkflowOverrideOutput", "PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig", "PromptAgentApiModelWorkflowOverrideOutputToolsItem", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_System", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook", "PromptAgentDbModel", "PromptEvaluationCriteria", "PromptInjectionGuardrail", "PronunciationDictionariesListRequestSort", "PronunciationDictionaryAliasRuleRequestModel", "PronunciationDictionaryAliasRuleResponseModel", "PronunciationDictionaryLocator", "PronunciationDictionaryLocatorResponseModel", "PronunciationDictionaryPhonemeRuleRequestModel", "PronunciationDictionaryPhonemeRuleResponseModel", "PronunciationDictionaryRulesResponseModel", "PronunciationDictionaryVersionLocator", "PronunciationDictionaryVersionResponseModel", "PronunciationDictionaryVersionResponseModelPermissionOnResource", "PydanticPronunciationDictionaryVersionLocator", "QualityPresetType", "QueryParamsJsonSchema", "QuoteInfo", "RagChunkMetadata", "RagConfigInput", "RagConfigOutput", "RagConfigWorkflowOverrideInput", "RagConfigWorkflowOverrideOutput", "RagDocumentIndexResponseModel", "RagDocumentIndexUsage", "RagDocumentIndexesResponseModel", "RagIndexBatchSuccessfulResponseModel", "RagIndexOverviewEmbeddingModelResponseModel", "RagIndexOverviewResponseModel", "RagIndexStatus", "RagRetrievalInfo", "ReadLegalTerms", "ReadMetadataChapterDbModel", "ReaderResourceResponseModel", "ReaderResourceResponseModelResourceType", "RealtimeAudioOptions", "RealtimeConnection", "RealtimeEvents", "RealtimeUrlOptions", "RealtimeVoiceSettings", "ReceiveMessage", "ReceiveMessageMulti", "ReceiveTextToDialogueWebsocketMessage", "ReceiveTextToDialogueWebsocketMessageMulti", "ReceiveTranscription", "ReceiveTranslateStreamMessage", "ReceiveUpstreamMessage", "RecordingResponse", "ReferenceVideo", "ReferencedToolCommonModel", "ReferencedToolCommonModelType", "RefreshTokenAuthResponse", "RegexParameterEvaluationStrategy", "RegionConfigRequest", "RegionalProcessingSurchargeInfo", "RegisterForGroupSessionParams", "RegisterMediaResponse", "RemoveMemberFromGroupRequest", "RemoveOrderItemResponse", "Render", "RenderStatus", "RenderType", "ReplicateVoiceToIsolatedEnvironmentResponseModel", "ReportKnowledgeGapParams", "RequestPvcManualVerificationResponseModel", "RequiredConstraint", "RequiredConstraints", "ResourceAccessInfo", "ResourceAccessInfoAccessSource", "ResourceAccessInfoAnonymousAccessLevelOverride", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", "ResourceMetadataResponseModelAnonymousAccessLevelOverride", "ResponseFilter", "ResponseFilterMode", "ResponseUnitTestModel", "RestoreCalendarEventParams", "RetryTriggerAction", "ReviewResponseModel", "ReviewResponseModelRejectReasonsItem", "ReviewResponseModelReviewStatus", "ReviewStatus", "RunSubagentToolConfigInput", "RunSubagentToolConfigOutput", "SafetyCommonModelInput", "SafetyCommonModelOutput", "SafetyEvaluation", "SafetyResponseModel", "SafetyRule", "SampleConfigDbModel", "SampleConfigDbModelParentType", "SaveVoicePreviewRequest", "SayNodeLiteralMessageInput", "SayNodeLiteralMessageOutput", "SayNodePromptMessageInput", "SayNodePromptMessageOutput", "ScheduleGroupSessionParams", "ScimGroupResponseModel", "ScopedAnalysisResult", "ScribeAuthErrorPayload", "ScribeChunkSizeExceededErrorPayload", "ScribeErrorPayload", "ScribeInputErrorPayload", "ScribeInsufficientAudioActivityErrorPayload", "ScribeInvalidRequestError", "ScribeQueueOverflowErrorPayload", "ScribeQuotaExceededErrorPayload", "ScribeRateLimitedErrorPayload", "ScribeResourceExhaustedErrorPayload", "ScribeSessionTimeLimitExceededErrorPayload", "ScribeThrottledErrorPayload", "ScribeTranscriberErrorPayload", "ScribeUnacceptedTermsErrorPayload", "SearchClientsParams", "SearchHighlightSegment", "SearchStrategy", "SeatType", "SecretDependencyResourceType", "SecretDependencyType", "SectionSource", "SegmentCreateResponse", "SegmentDeleteResponse", "SegmentDubResponse", "SegmentMigrationResponse", "SegmentSubtitleFrame", "SegmentTranscriptionResponse", "SegmentTranslationResponse", "SegmentUpdateResponse", "SegmentedJsonExportOptions", "SendMessage", "SendMessageMulti", "SendText", "SendTextMulti", "SendTranslateStreamMessage", "SendUpstreamMessage", "SentimentAggregate", "SentimentAnalysisSettings", "SessionStartedPayload", "SessionStartedPayloadConfig", "SessionStartedPayloadConfigCommitStrategy", "SetBookingSlugParams", "SeverityId", "SfxModelId", "SfxSourceContext", "ShareOptionResponseModel", "ShareOptionResponseModelType", "SimilarVoice", "SimilarVoicesForSpeakerResponse", "SimulationLibrarySettings", "SimulationTestModel", "SimulationToolMockBehaviorConfig", "SingleLanguagesResponse", "SingleTestRunRequestModel", "SingleUseTokenResponseModel", "SingleUseTokenType", "SipLogMessage", "SipLogMessageDirection", "SipMediaEncryptionEnum", "SipTrunkCredentialsRequestModel", "SipTrunkOutboundCallResponse", "SipTrunkTransportEnum", "SipUriDynamicVariableTransferDestination", "SipUriTransferDestination", "SkipTurnToolConfig", "SkipTurnToolResponseModel", "SlackBotAuthResponse", "SmbClientAccessConfig", "SmsConversationInfo", "SmsConversationInfoDirection", "SoftTimeoutConfig", "SoftTimeoutConfigOverride", "SoftTimeoutConfigOverrideConfig", "SoftTimeoutConfigWorkflowOverride", "SongMetadata", "SongSection", "SongSourceContext", "SortDirection", "SpeakerAudioResponseModel", "SpeakerCreatedResponse", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", "SpeakerSeparationResponseModelStatus", "SpeakerTrack", "SpeakerUpdatedResponse", "SpeechEngineConfig", "SpeechEngineConfigRequestHeadersValue", "SpeechEngineConversationInitiationClientDataConfig", "SpeechEngineResponse", "SpeechEngineSummaryResponse", "SpeechHistoryItemResponse", "SpeechHistoryItemResponseSource", "SpeechHistoryItemResponseVoiceCategory", "SpeechToSpeechConvertRequestOutputFormat", "SpeechToSpeechRequestFileFormat", "SpeechToSpeechStreamRequestFileFormat", "SpeechToSpeechStreamRequestOutputFormat", "SpeechToTextCharacterResponseModel", "SpeechToTextChunkResponseModel", "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestEntityRedaction", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestModelId", "SpeechToTextConvertRequestMultichannelOutputStyle", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", "SpeechToTextConvertResponse", "SpeechToTextWebhookResponseModel", "SpeechToTextWordResponseModel", "SpeechToTextWordResponseModelType", "SpellingPatience", "SrtExportOptions", "StartProcedureToolConfigInput", "StartProcedureToolConfigOutput", "StartProcedureToolErrorStatus", "StartPvcVoiceTrainingResponseModel", "StartSpeakerSeparationResponseModel", "StatusId", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel", "StreamingAudioChunkWithTimestampsResponse", "StudioAgentSettingsModel", "StudioAgentToolSettingsModel", "StudioClipReference", "StudioClipReferenceClipType", "StudioTextStyleOutlineModel", "StudioTextStyleShadowModel", "SubAgentInput", "SubAgentOutput", "SubagentRunResultDetails", "SubmitBusinessInfoParams", "SubmitOrderResponse", "Subscription", "SubscriptionMaxCreditLimitExtension", "SubscriptionPendingChange", "SubscriptionResponse", "SubscriptionResponseMaxCreditLimitExtension", "SubscriptionStatusType", "SubtitleOrderItemRequest", "SuggestedAudioTag", "SupportedVoice", "SystemEvaluationCriteria", "SystemToolConfigInput", "SystemToolConfigInputParams", "SystemToolConfigInputParams_EndCall", "SystemToolConfigInputParams_EndProcedure", "SystemToolConfigInputParams_KnowledgeBase", "SystemToolConfigInputParams_KnowledgeBaseRag", "SystemToolConfigInputParams_LanguageDetection", "SystemToolConfigInputParams_PlayKeypadTouchTone", "SystemToolConfigInputParams_RunSubagent", "SystemToolConfigInputParams_SkipTurn", "SystemToolConfigInputParams_StartProcedure", "SystemToolConfigInputParams_TransferToAgent", "SystemToolConfigInputParams_TransferToNumber", "SystemToolConfigInputParams_VoicemailDetection", "SystemToolConfigOutput", "SystemToolConfigOutputParams", "SystemToolConfigOutputParams_EndCall", "SystemToolConfigOutputParams_EndProcedure", "SystemToolConfigOutputParams_KnowledgeBase", "SystemToolConfigOutputParams_KnowledgeBaseRag", "SystemToolConfigOutputParams_LanguageDetection", "SystemToolConfigOutputParams_PlayKeypadTouchTone", "SystemToolConfigOutputParams_RunSubagent", "SystemToolConfigOutputParams_SkipTurn", "SystemToolConfigOutputParams_StartProcedure", "SystemToolConfigOutputParams_TransferToAgent", "SystemToolConfigOutputParams_TransferToNumber", "SystemToolConfigOutputParams_VoicemailDetection", "TelephonyCallConfig", "TelephonyDirection", "TelephonyProvider", "TestConditionRationaleCommonModel", "TestConditionResultCommonModel", "TestFromConversationMetadataInput", "TestFromConversationMetadataOutput", "TestInvocationSummaryResponseModel", "TestRunMetadata", "TestRunMetadataTestType", "TestRunResultBucket", "TestRunResultSummary", "TestRunStatus", "TestSharingMode", "TestToolResultModel", "TestType", "TestsFeatureUsageCommonModel", "TextNormalisationType", "TextToDialogueConvertRequestOutputFormat", "TextToDialogueConvertWithTimestampsRequestOutputFormat", "TextToDialogueWebsocketApplyTextNormalizationEnum", "TextToDialogueWebsocketAudioChunk", "TextToDialogueWebsocketAudioChunkMulti", "TextToDialogueWebsocketClientMessage", "TextToDialogueWebsocketClientMessageMulti", "TextToDialogueWebsocketError", "TextToDialogueWebsocketFinal", "TextToDialogueWebsocketFinalAudioForTurn", "TextToDialogueWebsocketFinalAudioForTurnMulti", "TextToDialogueWebsocketFinalMulti", "TextToDialogueWebsocketOutputFormatEnum", "TextToDialogueWebsocketVoiceInput", "TextToDialogueWebsocketVoiceSettings", "TextToSpeechApplyTextNormalizationEnum", "TextToSpeechConvertRequestOutputFormat", "TextToSpeechConvertWithTimestampsRequestOutputFormat", "TextToSpeechOutputFormatEnum", "TextToSpeechRequest", "TextToSpeechStreamRequest", "TextToSpeechStreamRequestOutputFormat", "TextToSpeechStreamWithTimestampsRequest", "TextToSpeechStreamWithTimestampsRequestOutputFormat", "TextToSpeechWithTimestampsRequest", "ThresholdGuardrail", "TimeRange", "ToDialogueSettingsResponseModel", "TokenResponseModel", "TooEarlyError", "Tool", "ToolAnnotations", "ToolCallSoundBehavior", "ToolCallSoundType", "ToolCallUnitTestModel", "ToolErrorHandlingMode", "ToolExecution", "ToolExecutionMode", "ToolExecutionResponseModel", "ToolExecutionResponseModelToolCallDetails", "ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook", "ToolExecutionResponseModelToolCallDetails_Client", "ToolExecutionResponseModelToolCallDetails_Mcp", "ToolExecutionResponseModelToolCallDetails_Webhook", "ToolExecutionTaskSupport", "ToolInterruptionMode", "ToolMockConfig", "ToolRequestModel", "ToolRequestModelToolConfig", "ToolRequestModelToolConfig_Client", "ToolRequestModelToolConfig_Mcp", "ToolRequestModelToolConfig_System", "ToolRequestModelToolConfig_Webhook", "ToolResponseMockConfigInput", "ToolResponseMockConfigOutput", "ToolResponseModel", "ToolResponseModelToolConfig", "ToolResponseModelToolConfig_Client", "ToolResponseModelToolConfig_Mcp", "ToolResponseModelToolConfig_System", "ToolResponseModelToolConfig_Webhook", "ToolSortBy", "ToolType", "ToolTypeFilter", "ToolUsageStatsResponseModel", "ToolsResponseModel", "TopicDiscoverySettings", "TopicEvaluationCriteriaAggregate", "TopicMetricsAggregate", "TopicSentimentAggregate", "TranscriptMessage", "TranscriptMessageRole", "TranscriptionOrderItemRequest", "TranscriptionWord", "TranscriptionWordType", "TransferBranchInfoDefaultingToMain", "TransferBranchInfoTrafficSplit", "TransferToAgentToolConfigInput", "TransferToAgentToolConfigOutput", "TransferToAgentToolResultErrorModel", "TransferToAgentToolResultSuccessModelInput", "TransferToAgentToolResultSuccessModelInputBranchInfo", "TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain", "TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit", "TransferToAgentToolResultSuccessModelOutput", "TransferToAgentToolResultSuccessModelOutputBranchInfo", "TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain", "TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit", "TransferToNumberResultErrorModel", "TransferToNumberResultExotelSuccessModel", "TransferToNumberResultSipSuccessModel", "TransferToNumberResultTwilioSuccessModel", "TransferToNumberToolConfigInput", "TransferToNumberToolConfigOutput", "TransferTypeEnum", "TranslateAudioOutputError", "TranslateAudioPayload", "TranslateAuthError", "TranslateEndOfStreamPayload", "TranslateErrorPayload", "TranslateFinalTranscriptPayload", "TranslateInputAudioChunkPayload", "TranslateInputError", "TranslateInputFormatEnum", "TranslateOutputFormatEnum", "TranslatePartialTranscriptPayload", "TranslateQueueOverflowError", "TranslateRateLimitedError", "TranslateSessionStartedPayload", "TranslateStatusPayload", "TranslateTranscriberError", "TranslateTranslationError", "TranslateTranslationPayload", "TranslatedString", "TriggerUserVerificationParams", "TriggeredGuardrailCommonModel", "TtsConversationalConfigInput", "TtsConversationalConfigOutput", "TtsConversationalConfigOverride", "TtsConversationalConfigOverrideConfig", "TtsConversationalConfigWorkflowOverrideInput", "TtsConversationalConfigWorkflowOverrideOutput", "TtsConversationalModel", "TtsModelFamily", "TtsOptimizeStreamingLatency", "TtsOutputFormat", "TurnConfig", "TurnConfigOverride", "TurnConfigOverrideConfig", "TurnConfigWorkflowOverride", "TurnEagerness", "TurnMode", "TurnModel", "TwilioEdgeLocation", "TwilioOutboundCallResponse", "TwilioRegionId", "TxtExportOptions", "UnauthorizedError", "UnitTestRunResponseModel", "UnitTestRunResponseModelTestInfo", "UnitTestRunResponseModelTestInfo_Llm", "UnitTestRunResponseModelTestInfo_Simulation", "UnitTestRunResponseModelTestInfo_Tool", "UnitTestSummaryResponseModel", "UnitTestToolCallEvaluationModelInput", "UnitTestToolCallEvaluationModelOutput", "UnitTestToolCallParameter", "UnitTestToolCallParameterEval", "UnitTestToolCallParameterEval_Anything", "UnitTestToolCallParameterEval_Exact", "UnitTestToolCallParameterEval_Llm", "UnitTestToolCallParameterEval_Regex", "UnitTestWorkflowNodeTransitionEvaluationNodeId", "UnprocessableEntityError", "UpdateAgentProcedureParams", "UpdateAgentRuleParams", "UpdateAssetParams", "UpdateAudioNativeProjectRequest", "UpdateBasicAuthRequest", "UpdateBearerAuthRequest", "UpdateBookingPageAppearanceParams", "UpdateBookingPageSettingsParams", "UpdateBusinessInfoParams", "UpdateCalendarEventParams", "UpdateChapterRequest", "UpdateClientParams", "UpdateCustomerFacingConfigParams", "UpdateEnvironmentVariableRequestValuesValue", "UpdateGroupSessionSeatsParams", "UpdateHolidayParams", "UpdateLocationParams", "UpdateOAuth2ClientCredsRequest", "UpdateOAuth2JwtRequest", "UpdateOAuth2JwtRequestAlgorithm", "UpdateOAuth2JwtRequestTokenResponseField", "UpdateOrderRequest", "UpdateOrderResponse", "UpdateProductParams", "UpdateProjectRequest", "UpdatePronunciationDictionariesRequest", "UpdateResponseUnitTestRequest", "UpdateServiceParams", "UpdateSimulationTestRequest", "UpdateStaffParams", "UpdateToolCallUnitTestRequest", "UpdateTransferRuleParams", "UpdateWorkspaceMemberResponseModel", "UpsertOrderItemRequest", "UpsertOrderItemResponse", "UrlAvatar", "UrlModel", "UrlSecretAuthResponse", "UsageAggregationInterval", "UsageCharactersResponseModel", "User", "UserAccessManagementActivityId", "UserFeedback", "UserFeedbackScore", "UserModel", "UserTranscriptPayload", "UserTypeId", "UsersSortBy", "UtteranceResponseModel", "UuiTransferConfig", "UuiTransferConfigProtocolDiscriminatorMode", "VadConfig", "VadConfigWorkflowOverride", "ValidateUserVerificationCodeParams", "ValidationError", "ValidationErrorLocItem", "Verbosity", "VerificationAttemptResponse", "VerifiedVoiceLanguageResponseModel", "VerifyPvcVoiceCaptchaResponseModel", "VideoAnalysis", "VideoAnalysisResult", "VideoAnalysisStatus", "VideoKeyMoment", "VideoSegment", "VideoSubject", "VisitedAgentRef", "Voice", "VoiceAccentResponseModel", "VoiceCategory", "VoiceDesignPreviewResponse", "VoiceDesignRequestModelModelId", "VoiceGenerationParameterOptionResponse", "VoiceGenerationParameterResponse", "VoiceLabellingStatus", "VoiceMailDetectionResultSuccessModel", "VoicePreviewResponseModel", "VoiceRecordingQuality", "VoiceSafetyControl", "VoiceSample", "VoiceSamplePreviewResponseModel", "VoiceSampleVisualWaveformResponseModel", "VoiceSegment", "VoiceSettings", "VoiceSharingModerationCheckResponseModel", "VoiceSharingResponse", "VoiceSharingResponseCategory", "VoiceSharingState", "VoiceStatisticsResponseModel", "VoiceVerificationResponse", "VoicemailDetectionToolConfig", "VoicesGetSharedRequestCategory", "VoicesGetSharedRequestSort", "VoicesNotPermittedWarning", "WebhookAuthMethodType", "WebhookEventType", "WebhookHmacSettings", "WebhookToolApiSchemaConfigInput", "WebhookToolApiSchemaConfigInputAuthConnection", "WebhookToolApiSchemaConfigInputContentType", "WebhookToolApiSchemaConfigInputMethod", "WebhookToolApiSchemaConfigInputRequestHeadersValue", "WebhookToolApiSchemaConfigOutput", "WebhookToolApiSchemaConfigOutputAuthConnection", "WebhookToolApiSchemaConfigOutputContentType", "WebhookToolApiSchemaConfigOutputMethod", "WebhookToolApiSchemaConfigOutputRequestHeadersValue", "WebhookToolConfigInput", "WebhookToolConfigOutput", "WebhookTranscriptFormat", "WebhookUsageType", "WebsocketTtsClientMessageMulti", "WebsocketTtsServerMessageMulti", "WhatsAppAuthResponse", "WhatsAppConversationInfo", "WhatsAppConversationInfoDirection", "WhatsAppOutboundCallResponse", "WhatsAppOutboundMessageResponse", "WhatsAppTemplateBodyComponentParams", "WhatsAppTemplateButtonComponentParams", "WhatsAppTemplateDocumentParam", "WhatsAppTemplateDocumentParamDetails", "WhatsAppTemplateHeaderComponentParams", "WhatsAppTemplateHeaderComponentParamsParametersItem", "WhatsAppTemplateHeaderComponentParamsParametersItem_Document", "WhatsAppTemplateHeaderComponentParamsParametersItem_Image", "WhatsAppTemplateHeaderComponentParamsParametersItem_Location", "WhatsAppTemplateHeaderComponentParamsParametersItem_Text", "WhatsAppTemplateImageParam", "WhatsAppTemplateImageParamDetails", "WhatsAppTemplateLocationParam", "WhatsAppTemplateLocationParamDetails", "WhatsAppTemplateTextParam", "WidgetConfig", "WidgetConfigAvatar", "WidgetConfigAvatar_Image", "WidgetConfigAvatar_Orb", "WidgetConfigAvatar_Url", "WidgetConfigResponse", "WidgetConfigResponseAvatar", "WidgetConfigResponseAvatar_Image", "WidgetConfigResponseAvatar_Orb", "WidgetConfigResponseAvatar_Url", "WidgetConfigResponseSyntaxHighlightTheme", "WidgetConfigSyntaxHighlightTheme", "WidgetEndFeedbackConfig", "WidgetEndFeedbackType", "WidgetExpandable", "WidgetFeedbackMode", "WidgetLanguagePreset", "WidgetLanguagePresetResponse", "WidgetPlacement", "WidgetStyles", "WidgetTermsTranslation", "WidgetTextContents", "WidgetTextContentsTranslation", "WordTimestamp", "WorkflowEdgeModelInput", "WorkflowEdgeModelInputBackwardCondition", "WorkflowEdgeModelInputBackwardCondition_Expression", "WorkflowEdgeModelInputBackwardCondition_Llm", "WorkflowEdgeModelInputBackwardCondition_Result", "WorkflowEdgeModelInputBackwardCondition_Unconditional", "WorkflowEdgeModelInputForwardCondition", "WorkflowEdgeModelInputForwardCondition_Expression", "WorkflowEdgeModelInputForwardCondition_Llm", "WorkflowEdgeModelInputForwardCondition_Result", "WorkflowEdgeModelInputForwardCondition_Unconditional", "WorkflowEdgeModelOutput", "WorkflowEdgeModelOutputBackwardCondition", "WorkflowEdgeModelOutputBackwardCondition_Expression", "WorkflowEdgeModelOutputBackwardCondition_Llm", "WorkflowEdgeModelOutputBackwardCondition_Result", "WorkflowEdgeModelOutputBackwardCondition_Unconditional", "WorkflowEdgeModelOutputForwardCondition", "WorkflowEdgeModelOutputForwardCondition_Expression", "WorkflowEdgeModelOutputForwardCondition_Llm", "WorkflowEdgeModelOutputForwardCondition_Result", "WorkflowEdgeModelOutputForwardCondition_Unconditional", "WorkflowEndNodeModelInput", "WorkflowEndNodeModelOutput", "WorkflowExpressionConditionModelInput", "WorkflowExpressionConditionModelOutput", "WorkflowFeaturesUsageCommonModel", "WorkflowLlmConditionModelInput", "WorkflowLlmConditionModelOutput", "WorkflowOverrideAgentNodeModelInput", "WorkflowOverrideAgentNodeModelOutput", "WorkflowPhoneNumberNodeModelInput", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static", "WorkflowPhoneNumberNodeModelInputPostDialDigits", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Static", "WorkflowPhoneNumberNodeModelInputTransferDestination", "WorkflowPhoneNumberNodeModelInputTransferDestination_Phone", "WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable", "WorkflowPhoneNumberNodeModelOutput", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static", "WorkflowPhoneNumberNodeModelOutputPostDialDigits", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static", "WorkflowPhoneNumberNodeModelOutputTransferDestination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone", "WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable", "WorkflowResultConditionModelInput", "WorkflowResultConditionModelOutput", "WorkflowStandaloneAgentNodeModelInput", "WorkflowStandaloneAgentNodeModelOutput", "WorkflowStartNodeModelInput", "WorkflowStartNodeModelOutput", "WorkflowToolEdgeStepModel", "WorkflowToolLocator", "WorkflowToolLocatorSchemaOverridesValue", "WorkflowToolLocatorSchemaOverridesValue_Constant", "WorkflowToolLocatorSchemaOverridesValue_DynamicVariable", "WorkflowToolLocatorSchemaOverridesValue_Llm", "WorkflowToolLocatorSchemaOverridesValue_Omit", "WorkflowToolMaxIterationsExceededStepModel", "WorkflowToolNestedToolsStepModelInput", "WorkflowToolNestedToolsStepModelInputResultsItem", "WorkflowToolNestedToolsStepModelOutput", "WorkflowToolNestedToolsStepModelOutputResultsItem", "WorkflowToolNodeModelInput", "WorkflowToolNodeModelOutput", "WorkflowToolResponseModelInput", "WorkflowToolResponseModelInputStepsItem", "WorkflowToolResponseModelInputStepsItem_Edge", "WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded", "WorkflowToolResponseModelInputStepsItem_NestedTools", "WorkflowToolResponseModelOutput", "WorkflowToolResponseModelOutputStepsItem", "WorkflowToolResponseModelOutputStepsItem_Edge", "WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded", "WorkflowToolResponseModelOutputStepsItem_NestedTools", "WorkflowUnconditionalModelInput", "WorkflowUnconditionalModelOutput", "WorkspaceAnalyticsQueryResponseModel", "WorkspaceAnalyticsQueryResponseModelColumnTypesItem", "WorkspaceAnalyticsQueryResponseModelRowsItemItem", "WorkspaceApiKeyListResponseModel", "WorkspaceApiKeyResponseModel", "WorkspaceAuditLogEntryResponse", "WorkspaceAuditLogEntryResponseActivityId", "WorkspaceAuditLogsPageResponse", "WorkspaceBatchCallsResponse", "WorkspaceCreateApiKeyResponseModel", "WorkspaceCreateServiceAccountResponseModel", "WorkspaceCreateWebhookResponseModel", "WorkspaceGroupByNameResponseModel", "WorkspaceGroupPermission", "WorkspaceGroupResponseModel", "WorkspaceGroupResponseModelGroupPvcLimit", "WorkspaceGroupResponseModelGroupUsageLimit", "WorkspaceMemberResponseModel", "WorkspaceResourceType", "WorkspaceServiceAccountListResponseModel", "WorkspaceServiceAccountResponseModel", "WorkspaceWebhookEventType", "WorkspaceWebhookListResponseModel", "WorkspaceWebhookResponseModel", "WorkspaceWebhookUsageResponseModel", "__version__", "audio_isolation", "audio_native", "conversational_ai", "dubbing", "environment_variables", "forced_alignment", "history", "models", "music", "play", "productions", "pronunciation_dictionaries", "samples", "save", "service_accounts", "speech_engine", "speech_engine_upstream", "speech_to_speech", "speech_to_text", "stream", "studio", "text_to_dialogue", "text_to_sound_effects", "text_to_speech", "text_to_voice", "tokens", "usage", "user", "v_1_speech_to_text_realtime", "v_1_text_to_dialogue_multi_stream_input", "v_1_text_to_dialogue_stream_input", "v_1_text_to_speech_voice_id_multi_stream_input", "v_1_text_to_speech_voice_id_stream_input", "v_1_translate_realtime", "voices", "webhooks", "workspace", "workspaces", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/000077500000000000000000000000001523660243400257235ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/__init__.py000066400000000000000000000023471523660243400300420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import AudioIsolationRequestFileFormat, AudioIsolationStreamRequestFileFormat _dynamic_imports: typing.Dict[str, str] = { "AudioIsolationRequestFileFormat": ".types", "AudioIsolationStreamRequestFileFormat": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AudioIsolationRequestFileFormat", "AudioIsolationStreamRequestFileFormat"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/client.py000066400000000000000000000272741523660243400275670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.get_audio_isolation_history_response_model import GetAudioIsolationHistoryResponseModel from .raw_client import AsyncRawAudioIsolationClient, RawAudioIsolationClient from .types.audio_isolation_request_file_format import AudioIsolationRequestFileFormat from .types.audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AudioIsolationClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioIsolationClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioIsolationClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioIsolationClient """ return self._raw_client def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT, preview_b_64: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationRequestFileFormat] 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. preview_b_64 : typing.Optional[str] Optional preview image base64 for tracking this generation. 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. Returns ------- typing.Iterator[bytes] Successful Response """ with self._raw_client.convert( audio=audio, file_format=file_format, preview_b_64=preview_b_64, request_options=request_options ) as r: yield from r.data def list( self, *, page_size: typing.Optional[int] = None, page: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAudioIsolationHistoryResponseModel: """ Returns a list of all your audio isolation generations. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Defaults to 100. page : typing.Optional[int] Page number for search pagination (1-based). Only used when search is provided. search : typing.Optional[str] Optional search term used for filtering audio isolation history (title/text). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioIsolationHistoryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_isolation.list( page_size=1, page=1, search="search", ) """ _response = self._raw_client.list( page_size=page_size, page=page, search=search, request_options=request_options ) return _response.data def delete(self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Deletes a specific audio isolation history item and the associated media files. Parameters ---------- history_item_id : str Identifier of the audio isolation history item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_isolation.delete( history_item_id="history_item_id", ) """ _response = self._raw_client.delete(history_item_id, request_options=request_options) return _response.data def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] 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. Returns ------- typing.Iterator[bytes] Successful Response """ with self._raw_client.stream(audio=audio, file_format=file_format, request_options=request_options) as r: yield from r.data class AsyncAudioIsolationClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioIsolationClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioIsolationClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioIsolationClient """ return self._raw_client async def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT, preview_b_64: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationRequestFileFormat] 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. preview_b_64 : typing.Optional[str] Optional preview image base64 for tracking this generation. 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. Returns ------- typing.AsyncIterator[bytes] Successful Response """ async with self._raw_client.convert( audio=audio, file_format=file_format, preview_b_64=preview_b_64, request_options=request_options ) as r: async for _chunk in r.data: yield _chunk async def list( self, *, page_size: typing.Optional[int] = None, page: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAudioIsolationHistoryResponseModel: """ Returns a list of all your audio isolation generations. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Defaults to 100. page : typing.Optional[int] Page number for search pagination (1-based). Only used when search is provided. search : typing.Optional[str] Optional search term used for filtering audio isolation history (title/text). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioIsolationHistoryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.audio_isolation.list( page_size=1, page=1, search="search", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, page=page, search=search, request_options=request_options ) return _response.data async def delete(self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Deletes a specific audio isolation history item and the associated media files. Parameters ---------- history_item_id : str Identifier of the audio isolation history item. 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.audio_isolation.delete( history_item_id="history_item_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(history_item_id, request_options=request_options) return _response.data async def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] 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. Returns ------- typing.AsyncIterator[bytes] Successful Response """ async with self._raw_client.stream(audio=audio, file_format=file_format, request_options=request_options) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/raw_client.py000066400000000000000000000575571523660243400304470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.get_audio_isolation_history_response_model import GetAudioIsolationHistoryResponseModel from .types.audio_isolation_request_file_format import AudioIsolationRequestFileFormat from .types.audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAudioIsolationClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT, preview_b_64: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationRequestFileFormat] 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. preview_b_64 : typing.Optional[str] Optional preview image base64 for tracking this generation. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Successful Response """ with self._client_wrapper.httpx_client.stream( "v1/audio-isolation", method="POST", data={ "file_format": file_format, "preview_b64": preview_b_64, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def list( self, *, page_size: typing.Optional[int] = None, page: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAudioIsolationHistoryResponseModel]: """ Returns a list of all your audio isolation generations. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Defaults to 100. page : typing.Optional[int] Page number for search pagination (1-based). Only used when search is provided. search : typing.Optional[str] Optional search term used for filtering audio isolation history (title/text). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAudioIsolationHistoryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/audio-isolation/history", method="GET", params={ "page_size": page_size, "page": page, "search": search, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioIsolationHistoryResponseModel, construct_type( type_=GetAudioIsolationHistoryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Deletes a specific audio isolation history item and the associated media files. Parameters ---------- history_item_id : str Identifier of the audio isolation history item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/audio-isolation/history/{jsonable_encoder(history_item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Successful Response """ with self._client_wrapper.httpx_client.stream( "v1/audio-isolation/stream", method="POST", data={ "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawAudioIsolationClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT, preview_b_64: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationRequestFileFormat] 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. preview_b_64 : typing.Optional[str] Optional preview image base64 for tracking this generation. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Successful Response """ async with self._client_wrapper.httpx_client.stream( "v1/audio-isolation", method="POST", data={ "file_format": file_format, "preview_b64": preview_b_64, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def list( self, *, page_size: typing.Optional[int] = None, page: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAudioIsolationHistoryResponseModel]: """ Returns a list of all your audio isolation generations. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Defaults to 100. page : typing.Optional[int] Page number for search pagination (1-based). Only used when search is provided. search : typing.Optional[str] Optional search term used for filtering audio isolation history (title/text). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAudioIsolationHistoryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/audio-isolation/history", method="GET", params={ "page_size": page_size, "page": page, "search": search, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioIsolationHistoryResponseModel, construct_type( type_=GetAudioIsolationHistoryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Deletes a specific audio isolation history item and the associated media files. Parameters ---------- history_item_id : str Identifier of the audio isolation history item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/audio-isolation/history/{jsonable_encoder(history_item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Successful Response """ async with self._client_wrapper.httpx_client.stream( "v1/audio-isolation/stream", method="POST", data={ "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/types/000077500000000000000000000000001523660243400270675ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/types/__init__.py000066400000000000000000000026031523660243400312010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .audio_isolation_request_file_format import AudioIsolationRequestFileFormat from .audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat _dynamic_imports: typing.Dict[str, str] = { "AudioIsolationRequestFileFormat": ".audio_isolation_request_file_format", "AudioIsolationStreamRequestFileFormat": ".audio_isolation_stream_request_file_format", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AudioIsolationRequestFileFormat", "AudioIsolationStreamRequestFileFormat"] audio_isolation_request_file_format.py000066400000000000000000000002641523660243400366650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/types# This file was auto-generated by Fern from our API Definition. import typing AudioIsolationRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] audio_isolation_stream_request_file_format.py000066400000000000000000000002721523660243400402370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_isolation/types# This file was auto-generated by Fern from our API Definition. import typing AudioIsolationStreamRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/000077500000000000000000000000001523660243400252105ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/__init__.py000066400000000000000000000022061523660243400273210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import AudioNativeCreateRequestApplyTextNormalization _dynamic_imports: typing.Dict[str, str] = {"AudioNativeCreateRequestApplyTextNormalization": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AudioNativeCreateRequestApplyTextNormalization"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/client.py000066400000000000000000000516631523660243400270530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel from ..types.audio_native_edit_content_response_model import AudioNativeEditContentResponseModel from ..types.get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel from .raw_client import AsyncRawAudioNativeClient, RawAudioNativeClient from .types.audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AudioNativeClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioNativeClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioNativeClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioNativeClient """ return self._raw_client def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeCreateProjectResponseModel: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeCreateProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_native.create( name="name", ) """ _response = self._raw_client.create( name=name, image=image, author=author, title=title, small=small, text_color=text_color, background_color=background_color, sessionization=sessionization, voice_id=voice_id, model_id=model_id, file=file, auto_convert=auto_convert, apply_text_normalization=apply_text_normalization, pronunciation_dictionary_locators=pronunciation_dictionary_locators, request_options=request_options, ) return _response.data def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudioNativeProjectSettingsResponseModel: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioNativeProjectSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_native.get_settings( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get_settings(project_id, request_options=request_options) return _response.data def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentResponseModel: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeEditContentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_native.update( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( project_id, file=file, auto_convert=auto_convert, auto_publish=auto_publish, request_options=request_options ) return _response.data def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentResponseModel: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeEditContentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.audio_native.update_content_from_url( url="https://elevenlabs.io/blog/the_first_ai_that_can_laugh/", ) """ _response = self._raw_client.update_content_from_url( url=url, author=author, title=title, request_options=request_options ) return _response.data class AsyncAudioNativeClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioNativeClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioNativeClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioNativeClient """ return self._raw_client async def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeCreateProjectResponseModel: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeCreateProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.audio_native.create( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, image=image, author=author, title=title, small=small, text_color=text_color, background_color=background_color, sessionization=sessionization, voice_id=voice_id, model_id=model_id, file=file, auto_convert=auto_convert, apply_text_normalization=apply_text_normalization, pronunciation_dictionary_locators=pronunciation_dictionary_locators, request_options=request_options, ) return _response.data async def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudioNativeProjectSettingsResponseModel: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioNativeProjectSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.audio_native.get_settings( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get_settings(project_id, request_options=request_options) return _response.data async def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentResponseModel: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeEditContentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.audio_native.update( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( project_id, file=file, auto_convert=auto_convert, auto_publish=auto_publish, request_options=request_options ) return _response.data async def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentResponseModel: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioNativeEditContentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.audio_native.update_content_from_url( url="https://elevenlabs.io/blog/the_first_ai_that_can_laugh/", ) asyncio.run(main()) """ _response = await self._raw_client.update_content_from_url( url=url, author=author, title=title, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/raw_client.py000066400000000000000000000762241523660243400277240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel from ..types.audio_native_edit_content_response_model import AudioNativeEditContentResponseModel from ..types.get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel from .types.audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAudioNativeClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeCreateProjectResponseModel]: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeCreateProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/audio-native", method="POST", data={ "name": name, "image": image, "author": author, "title": title, "small": small, "text_color": text_color, "background_color": background_color, "sessionization": sessionization, "voice_id": voice_id, "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeCreateProjectResponseModel, construct_type( type_=AudioNativeCreateProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAudioNativeProjectSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioNativeProjectSettingsResponseModel, construct_type( type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeEditContentResponseModel]: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/content", method="POST", data={ "auto_convert": auto_convert, "auto_publish": auto_publish, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeEditContentResponseModel]: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/audio-native/content", method="POST", json={ "url": url, "author": author, "title": title, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAudioNativeClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Optional[str] = OMIT, sessionization: typing.Optional[int] = OMIT, voice_id: typing.Optional[str] = OMIT, model_id: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeCreateProjectResponseModel]: """ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. small : typing.Optional[bool] (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. text_color : typing.Optional[str] Text color used in the player. If not provided, default text color set in the Player settings is used. background_color : typing.Optional[str] Background color used in the player. If not provided, default background color set in the Player settings is used. sessionization : typing.Optional[int] (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. voice_id : typing.Optional[str] Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. model_id : typing.Optional[str] TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeCreateProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/audio-native", method="POST", data={ "name": name, "image": image, "author": author, "title": title, "small": small, "text_color": text_color, "background_color": background_color, "sessionization": sessionization, "voice_id": voice_id, "model_id": model_id, "auto_convert": auto_convert, "apply_text_normalization": apply_text_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeCreateProjectResponseModel, construct_type( type_=AudioNativeCreateProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAudioNativeProjectSettingsResponseModel, construct_type( type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]: """ Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Optional[core.File] See core.File for more documentation auto_convert : typing.Optional[bool] Whether to auto convert the project to audio or not. auto_publish : typing.Optional[bool] Whether to auto publish the new project snapshot after it's converted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/audio-native/{jsonable_encoder(project_id)}/content", method="POST", data={ "auto_convert": auto_convert, "auto_publish": auto_publish, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_content_from_url( self, *, url: str, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]: """ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing. Parameters ---------- url : str URL of the page to extract content from. author : typing.Optional[str] Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. title : typing.Optional[str] Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioNativeEditContentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/audio-native/content", method="POST", json={ "url": url, "author": author, "title": title, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioNativeEditContentResponseModel, construct_type( type_=AudioNativeEditContentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/types/000077500000000000000000000000001523660243400263545ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/types/__init__.py000066400000000000000000000023521523660243400304670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization _dynamic_imports: typing.Dict[str, str] = { "AudioNativeCreateRequestApplyTextNormalization": ".audio_native_create_request_apply_text_normalization" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AudioNativeCreateRequestApplyTextNormalization"] audio_native_create_request_apply_text_normalization.py000066400000000000000000000003261523660243400416310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/audio_native/types# This file was auto-generated by Fern from our API Definition. import typing AudioNativeCreateRequestApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off", "apply_english"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/base_client.py000066400000000000000000000703271523660243400253740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import os import typing import httpx from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .core.logging import LogConfig, Logger from .environment import ElevenLabsEnvironment if typing.TYPE_CHECKING: from .audio_isolation.client import AsyncAudioIsolationClient, AudioIsolationClient from .audio_native.client import AsyncAudioNativeClient, AudioNativeClient from .conversational_ai.client import AsyncConversationalAiClient, ConversationalAiClient from .dubbing.client import AsyncDubbingClient, DubbingClient from .environment_variables.client import AsyncEnvironmentVariablesClient, EnvironmentVariablesClient from .forced_alignment.client import AsyncForcedAlignmentClient, ForcedAlignmentClient from .history.client import AsyncHistoryClient, HistoryClient from .models.client import AsyncModelsClient, ModelsClient from .music.client import AsyncMusicClient, MusicClient from .productions.client import AsyncProductionsClient, ProductionsClient from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient, PronunciationDictionariesClient from .samples.client import AsyncSamplesClient, SamplesClient from .service_accounts.client import AsyncServiceAccountsClient, ServiceAccountsClient from .speech_engine.client import AsyncSpeechEngineClient, SpeechEngineClient from .speech_to_speech.client import AsyncSpeechToSpeechClient, SpeechToSpeechClient from .speech_to_text.client import AsyncSpeechToTextClient, SpeechToTextClient from .studio.client import AsyncStudioClient, StudioClient from .text_to_dialogue.client import AsyncTextToDialogueClient, TextToDialogueClient from .text_to_sound_effects.client import AsyncTextToSoundEffectsClient, TextToSoundEffectsClient from .text_to_speech.client import AsyncTextToSpeechClient, TextToSpeechClient from .text_to_voice.client import AsyncTextToVoiceClient, TextToVoiceClient from .tokens.client import AsyncTokensClient, TokensClient from .usage.client import AsyncUsageClient, UsageClient from .user.client import AsyncUserClient, UserClient from .voices.client import AsyncVoicesClient, VoicesClient from .webhooks.client import AsyncWebhooksClient, WebhooksClient from .workspace.client import AsyncWorkspaceClient, WorkspaceClient from .workspaces.client import AsyncWorkspacesClient, WorkspacesClient class BaseElevenLabs: """ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. Parameters ---------- base_url : typing.Optional[str] The base url to use for requests from the client. environment : ElevenLabsEnvironment The environment to use for requests from the client. from .environment import ElevenLabsEnvironment Defaults to ElevenLabsEnvironment.PRODUCTION api_key : typing.Optional[str] headers : typing.Optional[typing.Dict[str, str]] Additional headers to send with every request. timeout : typing.Optional[float] The timeout to be used, in seconds, for requests. By default the timeout is 240 seconds, unless a custom httpx client is used, in which case this default is not enforced. follow_redirects : typing.Optional[bool] Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. httpx_client : typing.Optional[httpx.Client] The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. logging : typing.Optional[typing.Union[LogConfig, Logger]] Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) """ def __init__( self, *, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION, api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"), headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): _defaulted_timeout = ( timeout if timeout is not None else 240 if httpx_client is None else httpx_client.timeout.read ) self._client_wrapper = SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), api_key=api_key, headers=headers, httpx_client=httpx_client if httpx_client is not None else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(timeout=_defaulted_timeout), timeout=_defaulted_timeout, logging=logging, ) self._history: typing.Optional[HistoryClient] = None self._text_to_sound_effects: typing.Optional[TextToSoundEffectsClient] = None self._audio_isolation: typing.Optional[AudioIsolationClient] = None self._samples: typing.Optional[SamplesClient] = None self._text_to_speech: typing.Optional[TextToSpeechClient] = None self._text_to_dialogue: typing.Optional[TextToDialogueClient] = None self._speech_to_speech: typing.Optional[SpeechToSpeechClient] = None self._text_to_voice: typing.Optional[TextToVoiceClient] = None self._user: typing.Optional[UserClient] = None self._voices: typing.Optional[VoicesClient] = None self._studio: typing.Optional[StudioClient] = None self._dubbing: typing.Optional[DubbingClient] = None self._models: typing.Optional[ModelsClient] = None self._audio_native: typing.Optional[AudioNativeClient] = None self._usage: typing.Optional[UsageClient] = None self._pronunciation_dictionaries: typing.Optional[PronunciationDictionariesClient] = None self._workspace: typing.Optional[WorkspaceClient] = None self._service_accounts: typing.Optional[ServiceAccountsClient] = None self._webhooks: typing.Optional[WebhooksClient] = None self._music: typing.Optional[MusicClient] = None self._speech_to_text: typing.Optional[SpeechToTextClient] = None self._forced_alignment: typing.Optional[ForcedAlignmentClient] = None self._conversational_ai: typing.Optional[ConversationalAiClient] = None self._speech_engine: typing.Optional[SpeechEngineClient] = None self._environment_variables: typing.Optional[EnvironmentVariablesClient] = None self._productions: typing.Optional[ProductionsClient] = None self._tokens: typing.Optional[TokensClient] = None self._workspaces: typing.Optional[WorkspacesClient] = None @property def history(self): if self._history is None: from .history.client import HistoryClient # noqa: E402 self._history = HistoryClient(client_wrapper=self._client_wrapper) return self._history @property def text_to_sound_effects(self): if self._text_to_sound_effects is None: from .text_to_sound_effects.client import TextToSoundEffectsClient # noqa: E402 self._text_to_sound_effects = TextToSoundEffectsClient(client_wrapper=self._client_wrapper) return self._text_to_sound_effects @property def audio_isolation(self): if self._audio_isolation is None: from .audio_isolation.client import AudioIsolationClient # noqa: E402 self._audio_isolation = AudioIsolationClient(client_wrapper=self._client_wrapper) return self._audio_isolation @property def samples(self): if self._samples is None: from .samples.client import SamplesClient # noqa: E402 self._samples = SamplesClient(client_wrapper=self._client_wrapper) return self._samples @property def text_to_speech(self): if self._text_to_speech is None: from .text_to_speech.client import TextToSpeechClient # noqa: E402 self._text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper) return self._text_to_speech @property def text_to_dialogue(self): if self._text_to_dialogue is None: from .text_to_dialogue.client import TextToDialogueClient # noqa: E402 self._text_to_dialogue = TextToDialogueClient(client_wrapper=self._client_wrapper) return self._text_to_dialogue @property def speech_to_speech(self): if self._speech_to_speech is None: from .speech_to_speech.client import SpeechToSpeechClient # noqa: E402 self._speech_to_speech = SpeechToSpeechClient(client_wrapper=self._client_wrapper) return self._speech_to_speech @property def text_to_voice(self): if self._text_to_voice is None: from .text_to_voice.client import TextToVoiceClient # noqa: E402 self._text_to_voice = TextToVoiceClient(client_wrapper=self._client_wrapper) return self._text_to_voice @property def user(self): if self._user is None: from .user.client import UserClient # noqa: E402 self._user = UserClient(client_wrapper=self._client_wrapper) return self._user @property def voices(self): if self._voices is None: from .voices.client import VoicesClient # noqa: E402 self._voices = VoicesClient(client_wrapper=self._client_wrapper) return self._voices @property def studio(self): if self._studio is None: from .studio.client import StudioClient # noqa: E402 self._studio = StudioClient(client_wrapper=self._client_wrapper) return self._studio @property def dubbing(self): if self._dubbing is None: from .dubbing.client import DubbingClient # noqa: E402 self._dubbing = DubbingClient(client_wrapper=self._client_wrapper) return self._dubbing @property def models(self): if self._models is None: from .models.client import ModelsClient # noqa: E402 self._models = ModelsClient(client_wrapper=self._client_wrapper) return self._models @property def audio_native(self): if self._audio_native is None: from .audio_native.client import AudioNativeClient # noqa: E402 self._audio_native = AudioNativeClient(client_wrapper=self._client_wrapper) return self._audio_native @property def usage(self): if self._usage is None: from .usage.client import UsageClient # noqa: E402 self._usage = UsageClient(client_wrapper=self._client_wrapper) return self._usage @property def pronunciation_dictionaries(self): if self._pronunciation_dictionaries is None: from .pronunciation_dictionaries.client import PronunciationDictionariesClient # noqa: E402 self._pronunciation_dictionaries = PronunciationDictionariesClient(client_wrapper=self._client_wrapper) return self._pronunciation_dictionaries @property def workspace(self): if self._workspace is None: from .workspace.client import WorkspaceClient # noqa: E402 self._workspace = WorkspaceClient(client_wrapper=self._client_wrapper) return self._workspace @property def service_accounts(self): if self._service_accounts is None: from .service_accounts.client import ServiceAccountsClient # noqa: E402 self._service_accounts = ServiceAccountsClient(client_wrapper=self._client_wrapper) return self._service_accounts @property def webhooks(self): if self._webhooks is None: from .webhooks.client import WebhooksClient # noqa: E402 self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper) return self._webhooks @property def music(self): if self._music is None: from .music.client import MusicClient # noqa: E402 self._music = MusicClient(client_wrapper=self._client_wrapper) return self._music @property def speech_to_text(self): if self._speech_to_text is None: from .speech_to_text.client import SpeechToTextClient # noqa: E402 self._speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper) return self._speech_to_text @property def forced_alignment(self): if self._forced_alignment is None: from .forced_alignment.client import ForcedAlignmentClient # noqa: E402 self._forced_alignment = ForcedAlignmentClient(client_wrapper=self._client_wrapper) return self._forced_alignment @property def conversational_ai(self): if self._conversational_ai is None: from .conversational_ai.client import ConversationalAiClient # noqa: E402 self._conversational_ai = ConversationalAiClient(client_wrapper=self._client_wrapper) return self._conversational_ai @property def speech_engine(self): if self._speech_engine is None: from .speech_engine.client import SpeechEngineClient # noqa: E402 self._speech_engine = SpeechEngineClient(client_wrapper=self._client_wrapper) return self._speech_engine @property def environment_variables(self): if self._environment_variables is None: from .environment_variables.client import EnvironmentVariablesClient # noqa: E402 self._environment_variables = EnvironmentVariablesClient(client_wrapper=self._client_wrapper) return self._environment_variables @property def productions(self): if self._productions is None: from .productions.client import ProductionsClient # noqa: E402 self._productions = ProductionsClient(client_wrapper=self._client_wrapper) return self._productions @property def tokens(self): if self._tokens is None: from .tokens.client import TokensClient # noqa: E402 self._tokens = TokensClient(client_wrapper=self._client_wrapper) return self._tokens @property def workspaces(self): if self._workspaces is None: from .workspaces.client import WorkspacesClient # noqa: E402 self._workspaces = WorkspacesClient(client_wrapper=self._client_wrapper) return self._workspaces class AsyncBaseElevenLabs: """ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. Parameters ---------- base_url : typing.Optional[str] The base url to use for requests from the client. environment : ElevenLabsEnvironment The environment to use for requests from the client. from .environment import ElevenLabsEnvironment Defaults to ElevenLabsEnvironment.PRODUCTION api_key : typing.Optional[str] headers : typing.Optional[typing.Dict[str, str]] Additional headers to send with every request. timeout : typing.Optional[float] The timeout to be used, in seconds, for requests. By default the timeout is 240 seconds, unless a custom httpx client is used, in which case this default is not enforced. follow_redirects : typing.Optional[bool] Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. httpx_client : typing.Optional[httpx.AsyncClient] The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. logging : typing.Optional[typing.Union[LogConfig, Logger]] Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. Examples -------- from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) """ def __init__( self, *, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION, api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"), headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): _defaulted_timeout = ( timeout if timeout is not None else 240 if httpx_client is None else httpx_client.timeout.read ) self._client_wrapper = AsyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), api_key=api_key, headers=headers, httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, logging=logging, ) self._history: typing.Optional[AsyncHistoryClient] = None self._text_to_sound_effects: typing.Optional[AsyncTextToSoundEffectsClient] = None self._audio_isolation: typing.Optional[AsyncAudioIsolationClient] = None self._samples: typing.Optional[AsyncSamplesClient] = None self._text_to_speech: typing.Optional[AsyncTextToSpeechClient] = None self._text_to_dialogue: typing.Optional[AsyncTextToDialogueClient] = None self._speech_to_speech: typing.Optional[AsyncSpeechToSpeechClient] = None self._text_to_voice: typing.Optional[AsyncTextToVoiceClient] = None self._user: typing.Optional[AsyncUserClient] = None self._voices: typing.Optional[AsyncVoicesClient] = None self._studio: typing.Optional[AsyncStudioClient] = None self._dubbing: typing.Optional[AsyncDubbingClient] = None self._models: typing.Optional[AsyncModelsClient] = None self._audio_native: typing.Optional[AsyncAudioNativeClient] = None self._usage: typing.Optional[AsyncUsageClient] = None self._pronunciation_dictionaries: typing.Optional[AsyncPronunciationDictionariesClient] = None self._workspace: typing.Optional[AsyncWorkspaceClient] = None self._service_accounts: typing.Optional[AsyncServiceAccountsClient] = None self._webhooks: typing.Optional[AsyncWebhooksClient] = None self._music: typing.Optional[AsyncMusicClient] = None self._speech_to_text: typing.Optional[AsyncSpeechToTextClient] = None self._forced_alignment: typing.Optional[AsyncForcedAlignmentClient] = None self._conversational_ai: typing.Optional[AsyncConversationalAiClient] = None self._speech_engine: typing.Optional[AsyncSpeechEngineClient] = None self._environment_variables: typing.Optional[AsyncEnvironmentVariablesClient] = None self._productions: typing.Optional[AsyncProductionsClient] = None self._tokens: typing.Optional[AsyncTokensClient] = None self._workspaces: typing.Optional[AsyncWorkspacesClient] = None @property def history(self): if self._history is None: from .history.client import AsyncHistoryClient # noqa: E402 self._history = AsyncHistoryClient(client_wrapper=self._client_wrapper) return self._history @property def text_to_sound_effects(self): if self._text_to_sound_effects is None: from .text_to_sound_effects.client import AsyncTextToSoundEffectsClient # noqa: E402 self._text_to_sound_effects = AsyncTextToSoundEffectsClient(client_wrapper=self._client_wrapper) return self._text_to_sound_effects @property def audio_isolation(self): if self._audio_isolation is None: from .audio_isolation.client import AsyncAudioIsolationClient # noqa: E402 self._audio_isolation = AsyncAudioIsolationClient(client_wrapper=self._client_wrapper) return self._audio_isolation @property def samples(self): if self._samples is None: from .samples.client import AsyncSamplesClient # noqa: E402 self._samples = AsyncSamplesClient(client_wrapper=self._client_wrapper) return self._samples @property def text_to_speech(self): if self._text_to_speech is None: from .text_to_speech.client import AsyncTextToSpeechClient # noqa: E402 self._text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper) return self._text_to_speech @property def text_to_dialogue(self): if self._text_to_dialogue is None: from .text_to_dialogue.client import AsyncTextToDialogueClient # noqa: E402 self._text_to_dialogue = AsyncTextToDialogueClient(client_wrapper=self._client_wrapper) return self._text_to_dialogue @property def speech_to_speech(self): if self._speech_to_speech is None: from .speech_to_speech.client import AsyncSpeechToSpeechClient # noqa: E402 self._speech_to_speech = AsyncSpeechToSpeechClient(client_wrapper=self._client_wrapper) return self._speech_to_speech @property def text_to_voice(self): if self._text_to_voice is None: from .text_to_voice.client import AsyncTextToVoiceClient # noqa: E402 self._text_to_voice = AsyncTextToVoiceClient(client_wrapper=self._client_wrapper) return self._text_to_voice @property def user(self): if self._user is None: from .user.client import AsyncUserClient # noqa: E402 self._user = AsyncUserClient(client_wrapper=self._client_wrapper) return self._user @property def voices(self): if self._voices is None: from .voices.client import AsyncVoicesClient # noqa: E402 self._voices = AsyncVoicesClient(client_wrapper=self._client_wrapper) return self._voices @property def studio(self): if self._studio is None: from .studio.client import AsyncStudioClient # noqa: E402 self._studio = AsyncStudioClient(client_wrapper=self._client_wrapper) return self._studio @property def dubbing(self): if self._dubbing is None: from .dubbing.client import AsyncDubbingClient # noqa: E402 self._dubbing = AsyncDubbingClient(client_wrapper=self._client_wrapper) return self._dubbing @property def models(self): if self._models is None: from .models.client import AsyncModelsClient # noqa: E402 self._models = AsyncModelsClient(client_wrapper=self._client_wrapper) return self._models @property def audio_native(self): if self._audio_native is None: from .audio_native.client import AsyncAudioNativeClient # noqa: E402 self._audio_native = AsyncAudioNativeClient(client_wrapper=self._client_wrapper) return self._audio_native @property def usage(self): if self._usage is None: from .usage.client import AsyncUsageClient # noqa: E402 self._usage = AsyncUsageClient(client_wrapper=self._client_wrapper) return self._usage @property def pronunciation_dictionaries(self): if self._pronunciation_dictionaries is None: from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient # noqa: E402 self._pronunciation_dictionaries = AsyncPronunciationDictionariesClient(client_wrapper=self._client_wrapper) return self._pronunciation_dictionaries @property def workspace(self): if self._workspace is None: from .workspace.client import AsyncWorkspaceClient # noqa: E402 self._workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper) return self._workspace @property def service_accounts(self): if self._service_accounts is None: from .service_accounts.client import AsyncServiceAccountsClient # noqa: E402 self._service_accounts = AsyncServiceAccountsClient(client_wrapper=self._client_wrapper) return self._service_accounts @property def webhooks(self): if self._webhooks is None: from .webhooks.client import AsyncWebhooksClient # noqa: E402 self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) return self._webhooks @property def music(self): if self._music is None: from .music.client import AsyncMusicClient # noqa: E402 self._music = AsyncMusicClient(client_wrapper=self._client_wrapper) return self._music @property def speech_to_text(self): if self._speech_to_text is None: from .speech_to_text.client import AsyncSpeechToTextClient # noqa: E402 self._speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper) return self._speech_to_text @property def forced_alignment(self): if self._forced_alignment is None: from .forced_alignment.client import AsyncForcedAlignmentClient # noqa: E402 self._forced_alignment = AsyncForcedAlignmentClient(client_wrapper=self._client_wrapper) return self._forced_alignment @property def conversational_ai(self): if self._conversational_ai is None: from .conversational_ai.client import AsyncConversationalAiClient # noqa: E402 self._conversational_ai = AsyncConversationalAiClient(client_wrapper=self._client_wrapper) return self._conversational_ai @property def speech_engine(self): if self._speech_engine is None: from .speech_engine.client import AsyncSpeechEngineClient # noqa: E402 self._speech_engine = AsyncSpeechEngineClient(client_wrapper=self._client_wrapper) return self._speech_engine @property def environment_variables(self): if self._environment_variables is None: from .environment_variables.client import AsyncEnvironmentVariablesClient # noqa: E402 self._environment_variables = AsyncEnvironmentVariablesClient(client_wrapper=self._client_wrapper) return self._environment_variables @property def productions(self): if self._productions is None: from .productions.client import AsyncProductionsClient # noqa: E402 self._productions = AsyncProductionsClient(client_wrapper=self._client_wrapper) return self._productions @property def tokens(self): if self._tokens is None: from .tokens.client import AsyncTokensClient # noqa: E402 self._tokens = AsyncTokensClient(client_wrapper=self._client_wrapper) return self._tokens @property def workspaces(self): if self._workspaces is None: from .workspaces.client import AsyncWorkspacesClient # noqa: E402 self._workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper) return self._workspaces def _get_base_url(*, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment) -> str: if base_url is not None: return base_url elif environment is not None: return environment.value else: raise Exception("Please pass in either base_url or environment to construct the client") elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/client.py000066400000000000000000000134331523660243400243750ustar00rootroot00000000000000import os import typing import httpx from .base_client import AsyncBaseElevenLabs, BaseElevenLabs from .environment import ElevenLabsEnvironment from .music_custom import AsyncMusicClient, MusicClient from .realtime_tts import RealtimeTextToSpeechClient from .speech_engine_custom import AsyncSpeechEngineClient, SpeechEngineClient from .speech_to_text_custom import AsyncSpeechToTextClient, SpeechToTextClient from .webhooks_custom import AsyncWebhooksClient, WebhooksClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) def get_base_url_host(base_url: str) -> str: return httpx.URL(base_url).host class ElevenLabs(BaseElevenLabs): """ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. Parameters: - base_url: typing.Optional[str]. The base url to use for requests from the client. - environment: ElevenLabsEnvironment. The environment to use for requests from the client. from .environment import ElevenLabsEnvironment Defaults to ElevenLabsEnvironment.PRODUCTION - api_key: typing.Optional[str]. - headers: typing.Optional[typing.Dict[str, str]]. Additional headers to send with every request. - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 240 seconds. - follow_redirects: typing.Optional[bool]. Whether the default httpx client should follow redirects. Defaults to True. Ignored when a custom `httpx_client` is supplied. - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. --- from elevenlabs.client import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) """ def __init__( self, *, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION, api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"), headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = 240, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None ): super().__init__( base_url=base_url, environment=environment, api_key=api_key, headers=headers, timeout=timeout, follow_redirects=follow_redirects, httpx_client=httpx_client ) self._text_to_speech = RealtimeTextToSpeechClient(client_wrapper=self._client_wrapper) self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper) self._music = MusicClient(client_wrapper=self._client_wrapper) self._speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper) self._speech_engine = SpeechEngineClient(client_wrapper=self._client_wrapper) @property def speech_engine(self) -> SpeechEngineClient: return typing.cast(SpeechEngineClient, self._speech_engine) class AsyncElevenLabs(AsyncBaseElevenLabs): """ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. Parameters: - base_url: typing.Optional[str]. The base url to use for requests from the client. - environment: ElevenLabsEnvironment. The environment to use for requests from the client. from .environment import ElevenLabsEnvironment Defaults to ElevenLabsEnvironment.PRODUCTION - api_key: typing.Optional[str]. - headers: typing.Optional[typing.Dict[str, str]]. Additional headers to send with every request. - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 240 seconds. - follow_redirects: typing.Optional[bool]. Whether the default httpx client should follow redirects. Defaults to True. Ignored when a custom `httpx_client` is supplied. - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. --- from elevenlabs.client import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) """ def __init__( self, *, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION, api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"), headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = 240, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None ): super().__init__( base_url=base_url, environment=environment, api_key=api_key, headers=headers, timeout=timeout, follow_redirects=follow_redirects, httpx_client=httpx_client ) self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) self._music = AsyncMusicClient(client_wrapper=self._client_wrapper) self._speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper) self._speech_engine = AsyncSpeechEngineClient(client_wrapper=self._client_wrapper) @property def speech_engine(self) -> AsyncSpeechEngineClient: return typing.cast(AsyncSpeechEngineClient, self._speech_engine) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/000077500000000000000000000000001523660243400262415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/__init__.py000066400000000000000000000225541523660243400303620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import ( agents, analytics, batch_calls, conversations, dashboard, exotel, knowledge_base, llm, llm_usage, mcp_servers, phone_numbers, secrets, settings, sip_trunk, tests, tools, twilio, users, whatsapp, whatsapp_accounts, ) from .conversations import ( ConversationsGetRequestFormat, ConversationsListRequestExcludeStatusesItem, ConversationsListRequestSummaryMode, ) from .knowledge_base import ( KnowledgeBaseGetOrCreateRagIndexesResponseValue, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success, ) from .mcp_servers import ( McpServerConfigUpdateRequestModelAuthConnection, McpServerConfigUpdateRequestModelRequestHeadersValue, McpServerConfigUpdateRequestModelRequestMetaValue, ) from .phone_numbers import ( PhoneNumbersCreateRequestBody, PhoneNumbersCreateRequestBody_Exotel, PhoneNumbersCreateRequestBody_SipTrunk, PhoneNumbersCreateRequestBody_Twilio, PhoneNumbersGetResponse, PhoneNumbersGetResponse_Exotel, PhoneNumbersGetResponse_SipTrunk, PhoneNumbersGetResponse_Twilio, PhoneNumbersListResponseItem, PhoneNumbersListResponseItem_Exotel, PhoneNumbersListResponseItem_SipTrunk, PhoneNumbersListResponseItem_Twilio, PhoneNumbersUpdateResponse, PhoneNumbersUpdateResponse_Exotel, PhoneNumbersUpdateResponse_SipTrunk, PhoneNumbersUpdateResponse_Twilio, ) from .tests import ( TestsCreateRequestBody, TestsCreateRequestBody_Llm, TestsCreateRequestBody_Simulation, TestsCreateRequestBody_Tool, TestsGetResponse, TestsGetResponse_Llm, TestsGetResponse_Simulation, TestsGetResponse_Tool, TestsListRequestSortMode, TestsUpdateRequestBody, TestsUpdateRequestBody_Llm, TestsUpdateRequestBody_Simulation, TestsUpdateRequestBody_Tool, TestsUpdateResponse, TestsUpdateResponse_Llm, TestsUpdateResponse_Simulation, TestsUpdateResponse_Tool, ) from .whatsapp import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header, ) _dynamic_imports: typing.Dict[str, str] = { "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem": ".whatsapp", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body": ".whatsapp", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button": ".whatsapp", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header": ".whatsapp", "ConversationsGetRequestFormat": ".conversations", "ConversationsListRequestExcludeStatusesItem": ".conversations", "ConversationsListRequestSummaryMode": ".conversations", "KnowledgeBaseGetOrCreateRagIndexesResponseValue": ".knowledge_base", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure": ".knowledge_base", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success": ".knowledge_base", "McpServerConfigUpdateRequestModelAuthConnection": ".mcp_servers", "McpServerConfigUpdateRequestModelRequestHeadersValue": ".mcp_servers", "McpServerConfigUpdateRequestModelRequestMetaValue": ".mcp_servers", "PhoneNumbersCreateRequestBody": ".phone_numbers", "PhoneNumbersCreateRequestBody_Exotel": ".phone_numbers", "PhoneNumbersCreateRequestBody_SipTrunk": ".phone_numbers", "PhoneNumbersCreateRequestBody_Twilio": ".phone_numbers", "PhoneNumbersGetResponse": ".phone_numbers", "PhoneNumbersGetResponse_Exotel": ".phone_numbers", "PhoneNumbersGetResponse_SipTrunk": ".phone_numbers", "PhoneNumbersGetResponse_Twilio": ".phone_numbers", "PhoneNumbersListResponseItem": ".phone_numbers", "PhoneNumbersListResponseItem_Exotel": ".phone_numbers", "PhoneNumbersListResponseItem_SipTrunk": ".phone_numbers", "PhoneNumbersListResponseItem_Twilio": ".phone_numbers", "PhoneNumbersUpdateResponse": ".phone_numbers", "PhoneNumbersUpdateResponse_Exotel": ".phone_numbers", "PhoneNumbersUpdateResponse_SipTrunk": ".phone_numbers", "PhoneNumbersUpdateResponse_Twilio": ".phone_numbers", "TestsCreateRequestBody": ".tests", "TestsCreateRequestBody_Llm": ".tests", "TestsCreateRequestBody_Simulation": ".tests", "TestsCreateRequestBody_Tool": ".tests", "TestsGetResponse": ".tests", "TestsGetResponse_Llm": ".tests", "TestsGetResponse_Simulation": ".tests", "TestsGetResponse_Tool": ".tests", "TestsListRequestSortMode": ".tests", "TestsUpdateRequestBody": ".tests", "TestsUpdateRequestBody_Llm": ".tests", "TestsUpdateRequestBody_Simulation": ".tests", "TestsUpdateRequestBody_Tool": ".tests", "TestsUpdateResponse": ".tests", "TestsUpdateResponse_Llm": ".tests", "TestsUpdateResponse_Simulation": ".tests", "TestsUpdateResponse_Tool": ".tests", "agents": ".agents", "analytics": ".analytics", "batch_calls": ".batch_calls", "conversations": ".conversations", "dashboard": ".dashboard", "exotel": ".exotel", "knowledge_base": ".knowledge_base", "llm": ".llm", "llm_usage": ".llm_usage", "mcp_servers": ".mcp_servers", "phone_numbers": ".phone_numbers", "secrets": ".secrets", "settings": ".settings", "sip_trunk": ".sip_trunk", "tests": ".tests", "tools": ".tools", "twilio": ".twilio", "users": ".users", "whatsapp": ".whatsapp", "whatsapp_accounts": ".whatsapp_accounts", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header", "ConversationsGetRequestFormat", "ConversationsListRequestExcludeStatusesItem", "ConversationsListRequestSummaryMode", "KnowledgeBaseGetOrCreateRagIndexesResponseValue", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success", "McpServerConfigUpdateRequestModelAuthConnection", "McpServerConfigUpdateRequestModelRequestHeadersValue", "McpServerConfigUpdateRequestModelRequestMetaValue", "PhoneNumbersCreateRequestBody", "PhoneNumbersCreateRequestBody_Exotel", "PhoneNumbersCreateRequestBody_SipTrunk", "PhoneNumbersCreateRequestBody_Twilio", "PhoneNumbersGetResponse", "PhoneNumbersGetResponse_Exotel", "PhoneNumbersGetResponse_SipTrunk", "PhoneNumbersGetResponse_Twilio", "PhoneNumbersListResponseItem", "PhoneNumbersListResponseItem_Exotel", "PhoneNumbersListResponseItem_SipTrunk", "PhoneNumbersListResponseItem_Twilio", "PhoneNumbersUpdateResponse", "PhoneNumbersUpdateResponse_Exotel", "PhoneNumbersUpdateResponse_SipTrunk", "PhoneNumbersUpdateResponse_Twilio", "TestsCreateRequestBody", "TestsCreateRequestBody_Llm", "TestsCreateRequestBody_Simulation", "TestsCreateRequestBody_Tool", "TestsGetResponse", "TestsGetResponse_Llm", "TestsGetResponse_Simulation", "TestsGetResponse_Tool", "TestsListRequestSortMode", "TestsUpdateRequestBody", "TestsUpdateRequestBody_Llm", "TestsUpdateRequestBody_Simulation", "TestsUpdateRequestBody_Tool", "TestsUpdateResponse", "TestsUpdateResponse_Llm", "TestsUpdateResponse_Simulation", "TestsUpdateResponse_Tool", "agents", "analytics", "batch_calls", "conversations", "dashboard", "exotel", "knowledge_base", "llm", "llm_usage", "mcp_servers", "phone_numbers", "secrets", "settings", "sip_trunk", "tests", "tools", "twilio", "users", "whatsapp", "whatsapp_accounts", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/000077500000000000000000000000001523660243400275225ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/__init__.py000066400000000000000000000040501523660243400316320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import ( branches, deployments, drafts, knowledge_base, link, llm_usage, procedures, summaries, versions, widget, ) from .summaries import ( SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success, ) _dynamic_imports: typing.Dict[str, str] = { "SummariesGetResponseValue": ".summaries", "SummariesGetResponseValue_Failure": ".summaries", "SummariesGetResponseValue_Success": ".summaries", "branches": ".branches", "deployments": ".deployments", "drafts": ".drafts", "knowledge_base": ".knowledge_base", "link": ".link", "llm_usage": ".llm_usage", "procedures": ".procedures", "summaries": ".summaries", "versions": ".versions", "widget": ".widget", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success", "branches", "deployments", "drafts", "knowledge_base", "link", "llm_usage", "procedures", "summaries", "versions", "widget", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/branches/000077500000000000000000000000001523660243400313075ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/branches/__init__.py000066400000000000000000000001251523660243400334160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/branches/client.py000066400000000000000000000706021523660243400331440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.agent_branch_response import AgentBranchResponse from ....types.agent_workflow_request_model import AgentWorkflowRequestModel from ....types.branch_protection_status import BranchProtectionStatus from ....types.create_agent_branch_response_model import CreateAgentBranchResponseModel from ....types.list_response_agent_branch_summary import ListResponseAgentBranchSummary from ....types.merge_preview_response_model import MergePreviewResponseModel from .raw_client import AsyncRawBranchesClient, RawBranchesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class BranchesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawBranchesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawBranchesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawBranchesClient """ return self._raw_client def list( self, agent_id: str, *, include_archived: typing.Optional[bool] = None, limit: typing.Optional[int] = None, include_commit_status: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListResponseAgentBranchSummary: """ Returns a list of branches an agent has Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. include_archived : typing.Optional[bool] Whether archived branches should be included limit : typing.Optional[int] How many results at most should be returned include_commit_status : typing.Optional[bool] Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListResponseAgentBranchSummary Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_archived=True, limit=1, include_commit_status=True, ) """ _response = self._raw_client.list( agent_id, include_archived=include_archived, limit=limit, include_commit_status=include_commit_status, request_options=request_options, ) return _response.data def create( self, agent_id: str, *, parent_version_id: str, name: str, description: str, conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentBranchResponseModel: """ Create a new branch from a given version of any branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. parent_version_id : str ID of the version to branch from name : str Name of the branch. It is unique within the agent. description : str Description for the branch conversation_config : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to conversation config platform_settings : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to platform settings workflow : typing.Optional[AgentWorkflowRequestModel] Updated workflow definition request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentBranchResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", parent_version_id="parent_version_id", name="name", description="description", ) """ _response = self._raw_client.create( agent_id, parent_version_id=parent_version_id, name=name, description=description, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, request_options=request_options, ) return _response.data def get( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentBranchResponse: """ Get information about a single agent branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentBranchResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) """ _response = self._raw_client.get(agent_id, branch_id, request_options=request_options) return _response.data def update( self, agent_id: str, branch_id: str, *, name: typing.Optional[str] = OMIT, is_archived: typing.Optional[bool] = OMIT, protection_status: typing.Optional[BranchProtectionStatus] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AgentBranchResponse: """ Update agent branch properties such as archiving status and protection level Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. name : typing.Optional[str] New name for the branch. Must be unique within the agent. is_archived : typing.Optional[bool] Whether the branch should be archived protection_status : typing.Optional[BranchProtectionStatus] The protection level for the branch request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentBranchResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) """ _response = self._raw_client.update( agent_id, branch_id, name=name, is_archived=is_archived, protection_status=protection_status, request_options=request_options, ) return _response.data def preview_merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MergePreviewResponseModel: """ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. force : typing.Optional[bool] When true, source branch changes always win conflicts regardless of timestamps request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MergePreviewResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.preview_merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", force=True, ) """ _response = self._raw_client.preview_merge( agent_id, source_branch_id, target_branch_id=target_branch_id, force=force, request_options=request_options ) return _response.data def merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, archive_source_branch: typing.Optional[bool] = OMIT, force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Merge a branch into a target branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. archive_source_branch : typing.Optional[bool] Whether to archive the source branch after merging force : typing.Optional[bool] Force source branch changes onto the target, overriding timestamp-based conflict resolution request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) """ _response = self._raw_client.merge( agent_id, source_branch_id, target_branch_id=target_branch_id, archive_source_branch=archive_source_branch, force=force, request_options=request_options, ) return _response.data def preview_rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MergePreviewResponseModel: """ Returns the result of rebasing the branch onto main without performing the rebase. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MergePreviewResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.preview_rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) """ _response = self._raw_client.preview_rebase(agent_id, branch_id, request_options=request_options) return _response.data def rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Rebase a branch onto the latest main branch, incorporating main's changes while preserving the branch's own changes. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.branches.rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) """ _response = self._raw_client.rebase(agent_id, branch_id, request_options=request_options) return _response.data class AsyncBranchesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawBranchesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawBranchesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawBranchesClient """ return self._raw_client async def list( self, agent_id: str, *, include_archived: typing.Optional[bool] = None, limit: typing.Optional[int] = None, include_commit_status: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListResponseAgentBranchSummary: """ Returns a list of branches an agent has Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. include_archived : typing.Optional[bool] Whether archived branches should be included limit : typing.Optional[int] How many results at most should be returned include_commit_status : typing.Optional[bool] Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListResponseAgentBranchSummary Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_archived=True, limit=1, include_commit_status=True, ) asyncio.run(main()) """ _response = await self._raw_client.list( agent_id, include_archived=include_archived, limit=limit, include_commit_status=include_commit_status, request_options=request_options, ) return _response.data async def create( self, agent_id: str, *, parent_version_id: str, name: str, description: str, conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentBranchResponseModel: """ Create a new branch from a given version of any branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. parent_version_id : str ID of the version to branch from name : str Name of the branch. It is unique within the agent. description : str Description for the branch conversation_config : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to conversation config platform_settings : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to platform settings workflow : typing.Optional[AgentWorkflowRequestModel] Updated workflow definition request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentBranchResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", parent_version_id="parent_version_id", name="name", description="description", ) asyncio.run(main()) """ _response = await self._raw_client.create( agent_id, parent_version_id=parent_version_id, name=name, description=description, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, request_options=request_options, ) return _response.data async def get( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentBranchResponse: """ Get information about a single agent branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentBranchResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_id, branch_id, request_options=request_options) return _response.data async def update( self, agent_id: str, branch_id: str, *, name: typing.Optional[str] = OMIT, is_archived: typing.Optional[bool] = OMIT, protection_status: typing.Optional[BranchProtectionStatus] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AgentBranchResponse: """ Update agent branch properties such as archiving status and protection level Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. name : typing.Optional[str] New name for the branch. Must be unique within the agent. is_archived : typing.Optional[bool] Whether the branch should be archived protection_status : typing.Optional[BranchProtectionStatus] The protection level for the branch request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentBranchResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) asyncio.run(main()) """ _response = await self._raw_client.update( agent_id, branch_id, name=name, is_archived=is_archived, protection_status=protection_status, request_options=request_options, ) return _response.data async def preview_merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MergePreviewResponseModel: """ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. force : typing.Optional[bool] When true, source branch changes always win conflicts regardless of timestamps request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MergePreviewResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.preview_merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", force=True, ) asyncio.run(main()) """ _response = await self._raw_client.preview_merge( agent_id, source_branch_id, target_branch_id=target_branch_id, force=force, request_options=request_options ) return _response.data async def merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, archive_source_branch: typing.Optional[bool] = OMIT, force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Merge a branch into a target branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. archive_source_branch : typing.Optional[bool] Whether to archive the source branch after merging force : typing.Optional[bool] Force source branch changes onto the target, overriding timestamp-based conflict resolution request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.merge( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) asyncio.run(main()) """ _response = await self._raw_client.merge( agent_id, source_branch_id, target_branch_id=target_branch_id, archive_source_branch=archive_source_branch, force=force, request_options=request_options, ) return _response.data async def preview_rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MergePreviewResponseModel: """ Returns the result of rebasing the branch onto main without performing the rebase. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MergePreviewResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.preview_rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) asyncio.run(main()) """ _response = await self._raw_client.preview_rebase(agent_id, branch_id, request_options=request_options) return _response.data async def rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Rebase a branch onto the latest main branch, incorporating main's changes while preserving the branch's own changes. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.branches.rebase( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) asyncio.run(main()) """ _response = await self._raw_client.rebase(agent_id, branch_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/branches/raw_client.py000066400000000000000000001353341523660243400340210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.agent_branch_response import AgentBranchResponse from ....types.agent_workflow_request_model import AgentWorkflowRequestModel from ....types.branch_protection_status import BranchProtectionStatus from ....types.create_agent_branch_response_model import CreateAgentBranchResponseModel from ....types.list_response_agent_branch_summary import ListResponseAgentBranchSummary from ....types.merge_preview_response_model import MergePreviewResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawBranchesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, agent_id: str, *, include_archived: typing.Optional[bool] = None, limit: typing.Optional[int] = None, include_commit_status: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListResponseAgentBranchSummary]: """ Returns a list of branches an agent has Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. include_archived : typing.Optional[bool] Whether archived branches should be included limit : typing.Optional[int] How many results at most should be returned include_commit_status : typing.Optional[bool] Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListResponseAgentBranchSummary] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches", method="GET", params={ "include_archived": include_archived, "limit": limit, "include_commit_status": include_commit_status, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListResponseAgentBranchSummary, construct_type( type_=ListResponseAgentBranchSummary, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, agent_id: str, *, parent_version_id: str, name: str, description: str, conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateAgentBranchResponseModel]: """ Create a new branch from a given version of any branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. parent_version_id : str ID of the version to branch from name : str Name of the branch. It is unique within the agent. description : str Description for the branch conversation_config : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to conversation config platform_settings : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to platform settings workflow : typing.Optional[AgentWorkflowRequestModel] Updated workflow definition request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateAgentBranchResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches", method="POST", json={ "parent_version_id": parent_version_id, "name": name, "description": description, "conversation_config": conversation_config, "platform_settings": platform_settings, "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentBranchResponseModel, construct_type( type_=CreateAgentBranchResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[AgentBranchResponse]: """ Get information about a single agent branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AgentBranchResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentBranchResponse, construct_type( type_=AgentBranchResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, agent_id: str, branch_id: str, *, name: typing.Optional[str] = OMIT, is_archived: typing.Optional[bool] = OMIT, protection_status: typing.Optional[BranchProtectionStatus] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AgentBranchResponse]: """ Update agent branch properties such as archiving status and protection level Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. name : typing.Optional[str] New name for the branch. Must be unique within the agent. is_archived : typing.Optional[bool] Whether the branch should be archived protection_status : typing.Optional[BranchProtectionStatus] The protection level for the branch request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AgentBranchResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}", method="PATCH", json={ "name": name, "is_archived": is_archived, "protection_status": protection_status, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentBranchResponse, construct_type( type_=AgentBranchResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def preview_merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MergePreviewResponseModel]: """ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. force : typing.Optional[bool] When true, source branch changes always win conflicts regardless of timestamps request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MergePreviewResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge-preview", method="GET", params={ "target_branch_id": target_branch_id, "force": force, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MergePreviewResponseModel, construct_type( type_=MergePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, archive_source_branch: typing.Optional[bool] = OMIT, force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Merge a branch into a target branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. archive_source_branch : typing.Optional[bool] Whether to archive the source branch after merging force : typing.Optional[bool] Force source branch changes onto the target, overriding timestamp-based conflict resolution request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge", method="POST", params={ "target_branch_id": target_branch_id, }, json={ "archive_source_branch": archive_source_branch, "force": force, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def preview_rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[MergePreviewResponseModel]: """ Returns the result of rebasing the branch onto main without performing the rebase. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MergePreviewResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase-preview", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MergePreviewResponseModel, construct_type( type_=MergePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Rebase a branch onto the latest main branch, incorporating main's changes while preserving the branch's own changes. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase", method="POST", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawBranchesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, agent_id: str, *, include_archived: typing.Optional[bool] = None, limit: typing.Optional[int] = None, include_commit_status: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListResponseAgentBranchSummary]: """ Returns a list of branches an agent has Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. include_archived : typing.Optional[bool] Whether archived branches should be included limit : typing.Optional[int] How many results at most should be returned include_commit_status : typing.Optional[bool] Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListResponseAgentBranchSummary] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches", method="GET", params={ "include_archived": include_archived, "limit": limit, "include_commit_status": include_commit_status, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListResponseAgentBranchSummary, construct_type( type_=ListResponseAgentBranchSummary, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, agent_id: str, *, parent_version_id: str, name: str, description: str, conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateAgentBranchResponseModel]: """ Create a new branch from a given version of any branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. parent_version_id : str ID of the version to branch from name : str Name of the branch. It is unique within the agent. description : str Description for the branch conversation_config : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to conversation config platform_settings : typing.Optional[typing.Dict[str, typing.Any]] Changes to apply to platform settings workflow : typing.Optional[AgentWorkflowRequestModel] Updated workflow definition request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateAgentBranchResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches", method="POST", json={ "parent_version_id": parent_version_id, "name": name, "description": description, "conversation_config": conversation_config, "platform_settings": platform_settings, "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentBranchResponseModel, construct_type( type_=CreateAgentBranchResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[AgentBranchResponse]: """ Get information about a single agent branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AgentBranchResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentBranchResponse, construct_type( type_=AgentBranchResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, agent_id: str, branch_id: str, *, name: typing.Optional[str] = OMIT, is_archived: typing.Optional[bool] = OMIT, protection_status: typing.Optional[BranchProtectionStatus] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AgentBranchResponse]: """ Update agent branch properties such as archiving status and protection level Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the branch. name : typing.Optional[str] New name for the branch. Must be unique within the agent. is_archived : typing.Optional[bool] Whether the branch should be archived protection_status : typing.Optional[BranchProtectionStatus] The protection level for the branch request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AgentBranchResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}", method="PATCH", json={ "name": name, "is_archived": is_archived, "protection_status": protection_status, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentBranchResponse, construct_type( type_=AgentBranchResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def preview_merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MergePreviewResponseModel]: """ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. force : typing.Optional[bool] When true, source branch changes always win conflicts regardless of timestamps request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MergePreviewResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge-preview", method="GET", params={ "target_branch_id": target_branch_id, "force": force, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MergePreviewResponseModel, construct_type( type_=MergePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def merge( self, agent_id: str, source_branch_id: str, *, target_branch_id: str, archive_source_branch: typing.Optional[bool] = OMIT, force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Merge a branch into a target branch Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. source_branch_id : str Unique identifier for the source branch to merge from. target_branch_id : str The ID of the target branch to merge into. archive_source_branch : typing.Optional[bool] Whether to archive the source branch after merging force : typing.Optional[bool] Force source branch changes onto the target, overriding timestamp-based conflict resolution request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge", method="POST", params={ "target_branch_id": target_branch_id, }, json={ "archive_source_branch": archive_source_branch, "force": force, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def preview_rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[MergePreviewResponseModel]: """ Returns the result of rebasing the branch onto main without performing the rebase. Useful for showing an accurate diff before confirming. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MergePreviewResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase-preview", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MergePreviewResponseModel, construct_type( type_=MergePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def rebase( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Rebase a branch onto the latest main branch, incorporating main's changes while preserving the branch's own changes. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str Unique identifier for the source branch to merge from. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase", method="POST", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/client.py000066400000000000000000001374201523660243400313610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel from ...types.agent_platform_settings_request_model import AgentPlatformSettingsRequestModel from ...types.agent_simulated_chat_test_response_model import AgentSimulatedChatTestResponseModel from ...types.agent_sort_by import AgentSortBy from ...types.agent_workflow_request_model import AgentWorkflowRequestModel from ...types.conversation_simulation_specification import ConversationSimulationSpecification from ...types.conversational_config import ConversationalConfig from ...types.create_agent_response_model import CreateAgentResponseModel from ...types.get_agent_response_model import GetAgentResponseModel from ...types.get_agents_page_response_model import GetAgentsPageResponseModel from ...types.get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel from ...types.prompt_evaluation_criteria import PromptEvaluationCriteria from ...types.single_test_run_request_model import SingleTestRunRequestModel from ...types.sort_direction import SortDirection from .raw_client import AsyncRawAgentsClient, RawAgentsClient if typing.TYPE_CHECKING: from .branches.client import AsyncBranchesClient, BranchesClient from .deployments.client import AsyncDeploymentsClient, DeploymentsClient from .drafts.client import AsyncDraftsClient, DraftsClient from .knowledge_base.client import AsyncKnowledgeBaseClient, KnowledgeBaseClient from .link.client import AsyncLinkClient, LinkClient from .llm_usage.client import AsyncLlmUsageClient, LlmUsageClient from .procedures.client import AsyncProceduresClient, ProceduresClient from .summaries.client import AsyncSummariesClient, SummariesClient from .versions.client import AsyncVersionsClient, VersionsClient from .widget.client import AsyncWidgetClient, WidgetClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AgentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAgentsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._summaries: typing.Optional[SummariesClient] = None self._widget: typing.Optional[WidgetClient] = None self._link: typing.Optional[LinkClient] = None self._knowledge_base: typing.Optional[KnowledgeBaseClient] = None self._llm_usage: typing.Optional[LlmUsageClient] = None self._branches: typing.Optional[BranchesClient] = None self._versions: typing.Optional[VersionsClient] = None self._deployments: typing.Optional[DeploymentsClient] = None self._drafts: typing.Optional[DraftsClient] = None self._procedures: typing.Optional[ProceduresClient] = None @property def with_raw_response(self) -> RawAgentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAgentsClient """ return self._raw_client def create( self, *, conversation_config: ConversationalConfig, enable_versioning: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent enable_versioning : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentResponseModel Successful Response Examples -------- from elevenlabs import ConversationalConfig, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.create( enable_versioning=True, conversation_config=ConversationalConfig(), ) """ _response = self._raw_client.create( conversation_config=conversation_config, enable_versioning=enable_versioning, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, request_options=request_options, ) return _response.data def get( self, agent_id: str, *, version_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : typing.Optional[str] The ID of the agent version to use branch_id : typing.Optional[str] The ID of the branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="version_id", branch_id="branch_id", ) """ _response = self._raw_client.get( agent_id, version_id=version_id, branch_id=branch_id, request_options=request_options ) return _response.data def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.delete(agent_id, request_options=request_options) return _response.data def update( self, agent_id: str, *, enable_versioning_if_not_enabled: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, version_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. enable_versioning_if_not_enabled : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. branch_id : typing.Optional[str] The ID of the branch to use conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent version_description : typing.Optional[str] Description for this version when publishing changes (only applicable for versioned agents) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", enable_versioning_if_not_enabled=True, branch_id="branch_id", ) """ _response = self._raw_client.update( agent_id, enable_versioning_if_not_enabled=enable_versioning_if_not_enabled, branch_id=branch_id, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, version_description=version_description, request_options=request_options, ) return _response.data def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, archived: typing.Optional[bool] = None, show_only_owned_agents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentsPageResponseModel: """ Returns a list of your agents and their metadata. Parameters ---------- page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search by agents name. archived : typing.Optional[bool] Filter agents by archived status show_only_owned_agents : typing.Optional[bool] If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.list( page_size=1, search="search", archived=True, show_only_owned_agents=True, created_by_user_id="created_by_user_id", sort_direction="asc", sort_by="name", cursor="cursor", ) """ _response = self._raw_client.list( page_size=page_size, search=search, archived=archived, show_only_owned_agents=show_only_owned_agents, created_by_user_id=created_by_user_id, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data def duplicate( self, agent_id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ Create a new agent by duplicating an existing one Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. name : typing.Optional[str] A name to make the agent easier to find request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.duplicate( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.duplicate(agent_id, name=name, request_options=request_options) return _response.data def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AgentSimulatedChatTestResponseModel: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentSimulatedChatTestResponseModel Successful Response Examples -------- from elevenlabs import ( AgentConfig, ConversationSimulationSpecification, ElevenLabs, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.simulate_conversation( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) """ _response = self._raw_client.simulate_conversation( agent_id, simulation_specification=simulation_specification, extra_evaluation_criteria=extra_evaluation_criteria, new_turns_limit=new_turns_limit, request_options=request_options, ) return _response.data def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ( AgentConfig, ConversationSimulationSpecification, ElevenLabs, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.simulate_conversation_stream( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) """ _response = self._raw_client.simulate_conversation_stream( agent_id, simulation_specification=simulation_specification, extra_evaluation_criteria=extra_evaluation_criteria, new_turns_limit=new_turns_limit, request_options=request_options, ) return _response.data def run_tests( self, agent_id: str, *, tests: typing.Sequence[SingleTestRunRequestModel], agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, repeat_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestSuiteInvocationResponseModel: """ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. tests : typing.Sequence[SingleTestRunRequestModel] List of tests to run on the agent agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. repeat_count : typing.Optional[int] Number of times to run each test. When greater than 1, results are grouped and summarized. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestSuiteInvocationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs, SingleTestRunRequestModel client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.run_tests( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", tests=[ SingleTestRunRequestModel( test_id="test_id", ) ], ) """ _response = self._raw_client.run_tests( agent_id, tests=tests, agent_config_override=agent_config_override, branch_id=branch_id, repeat_count=repeat_count, request_options=request_options, ) return _response.data @property def summaries(self): if self._summaries is None: from .summaries.client import SummariesClient # noqa: E402 self._summaries = SummariesClient(client_wrapper=self._client_wrapper) return self._summaries @property def widget(self): if self._widget is None: from .widget.client import WidgetClient # noqa: E402 self._widget = WidgetClient(client_wrapper=self._client_wrapper) return self._widget @property def link(self): if self._link is None: from .link.client import LinkClient # noqa: E402 self._link = LinkClient(client_wrapper=self._client_wrapper) return self._link @property def knowledge_base(self): if self._knowledge_base is None: from .knowledge_base.client import KnowledgeBaseClient # noqa: E402 self._knowledge_base = KnowledgeBaseClient(client_wrapper=self._client_wrapper) return self._knowledge_base @property def llm_usage(self): if self._llm_usage is None: from .llm_usage.client import LlmUsageClient # noqa: E402 self._llm_usage = LlmUsageClient(client_wrapper=self._client_wrapper) return self._llm_usage @property def branches(self): if self._branches is None: from .branches.client import BranchesClient # noqa: E402 self._branches = BranchesClient(client_wrapper=self._client_wrapper) return self._branches @property def versions(self): if self._versions is None: from .versions.client import VersionsClient # noqa: E402 self._versions = VersionsClient(client_wrapper=self._client_wrapper) return self._versions @property def deployments(self): if self._deployments is None: from .deployments.client import DeploymentsClient # noqa: E402 self._deployments = DeploymentsClient(client_wrapper=self._client_wrapper) return self._deployments @property def drafts(self): if self._drafts is None: from .drafts.client import DraftsClient # noqa: E402 self._drafts = DraftsClient(client_wrapper=self._client_wrapper) return self._drafts @property def procedures(self): if self._procedures is None: from .procedures.client import ProceduresClient # noqa: E402 self._procedures = ProceduresClient(client_wrapper=self._client_wrapper) return self._procedures class AsyncAgentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._summaries: typing.Optional[AsyncSummariesClient] = None self._widget: typing.Optional[AsyncWidgetClient] = None self._link: typing.Optional[AsyncLinkClient] = None self._knowledge_base: typing.Optional[AsyncKnowledgeBaseClient] = None self._llm_usage: typing.Optional[AsyncLlmUsageClient] = None self._branches: typing.Optional[AsyncBranchesClient] = None self._versions: typing.Optional[AsyncVersionsClient] = None self._deployments: typing.Optional[AsyncDeploymentsClient] = None self._drafts: typing.Optional[AsyncDraftsClient] = None self._procedures: typing.Optional[AsyncProceduresClient] = None @property def with_raw_response(self) -> AsyncRawAgentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAgentsClient """ return self._raw_client async def create( self, *, conversation_config: ConversationalConfig, enable_versioning: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent enable_versioning : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, ConversationalConfig client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.create( enable_versioning=True, conversation_config=ConversationalConfig(), ) asyncio.run(main()) """ _response = await self._raw_client.create( conversation_config=conversation_config, enable_versioning=enable_versioning, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, request_options=request_options, ) return _response.data async def get( self, agent_id: str, *, version_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : typing.Optional[str] The ID of the agent version to use branch_id : typing.Optional[str] The ID of the branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="version_id", branch_id="branch_id", ) asyncio.run(main()) """ _response = await self._raw_client.get( agent_id, version_id=version_id, branch_id=branch_id, request_options=request_options ) return _response.data async def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. 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.conversational_ai.agents.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.delete(agent_id, request_options=request_options) return _response.data async def update( self, agent_id: str, *, enable_versioning_if_not_enabled: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, version_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. enable_versioning_if_not_enabled : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. branch_id : typing.Optional[str] The ID of the branch to use conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent version_description : typing.Optional[str] Description for this version when publishing changes (only applicable for versioned agents) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", enable_versioning_if_not_enabled=True, branch_id="branch_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( agent_id, enable_versioning_if_not_enabled=enable_versioning_if_not_enabled, branch_id=branch_id, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, version_description=version_description, request_options=request_options, ) return _response.data async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, archived: typing.Optional[bool] = None, show_only_owned_agents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentsPageResponseModel: """ Returns a list of your agents and their metadata. Parameters ---------- page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search by agents name. archived : typing.Optional[bool] Filter agents by archived status show_only_owned_agents : typing.Optional[bool] If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.list( page_size=1, search="search", archived=True, show_only_owned_agents=True, created_by_user_id="created_by_user_id", sort_direction="asc", sort_by="name", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, search=search, archived=archived, show_only_owned_agents=show_only_owned_agents, created_by_user_id=created_by_user_id, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data async def duplicate( self, agent_id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ Create a new agent by duplicating an existing one Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. name : typing.Optional[str] A name to make the agent easier to find request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.duplicate( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.duplicate(agent_id, name=name, request_options=request_options) return _response.data async def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AgentSimulatedChatTestResponseModel: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentSimulatedChatTestResponseModel Successful Response Examples -------- import asyncio from elevenlabs import ( AgentConfig, AsyncElevenLabs, ConversationSimulationSpecification, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.simulate_conversation( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) asyncio.run(main()) """ _response = await self._raw_client.simulate_conversation( agent_id, simulation_specification=simulation_specification, extra_evaluation_criteria=extra_evaluation_criteria, new_turns_limit=new_turns_limit, request_options=request_options, ) return _response.data async def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- import asyncio from elevenlabs import ( AgentConfig, AsyncElevenLabs, ConversationSimulationSpecification, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.simulate_conversation_stream( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", simulation_specification=ConversationSimulationSpecification( simulated_user_config=AgentConfig( first_message="Hello, how can I help you today?", language="en", disable_first_message_interruptions=False, ), ), ) asyncio.run(main()) """ _response = await self._raw_client.simulate_conversation_stream( agent_id, simulation_specification=simulation_specification, extra_evaluation_criteria=extra_evaluation_criteria, new_turns_limit=new_turns_limit, request_options=request_options, ) return _response.data async def run_tests( self, agent_id: str, *, tests: typing.Sequence[SingleTestRunRequestModel], agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, repeat_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestSuiteInvocationResponseModel: """ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. tests : typing.Sequence[SingleTestRunRequestModel] List of tests to run on the agent agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. repeat_count : typing.Optional[int] Number of times to run each test. When greater than 1, results are grouped and summarized. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestSuiteInvocationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, SingleTestRunRequestModel client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.run_tests( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", tests=[ SingleTestRunRequestModel( test_id="test_id", ) ], ) asyncio.run(main()) """ _response = await self._raw_client.run_tests( agent_id, tests=tests, agent_config_override=agent_config_override, branch_id=branch_id, repeat_count=repeat_count, request_options=request_options, ) return _response.data @property def summaries(self): if self._summaries is None: from .summaries.client import AsyncSummariesClient # noqa: E402 self._summaries = AsyncSummariesClient(client_wrapper=self._client_wrapper) return self._summaries @property def widget(self): if self._widget is None: from .widget.client import AsyncWidgetClient # noqa: E402 self._widget = AsyncWidgetClient(client_wrapper=self._client_wrapper) return self._widget @property def link(self): if self._link is None: from .link.client import AsyncLinkClient # noqa: E402 self._link = AsyncLinkClient(client_wrapper=self._client_wrapper) return self._link @property def knowledge_base(self): if self._knowledge_base is None: from .knowledge_base.client import AsyncKnowledgeBaseClient # noqa: E402 self._knowledge_base = AsyncKnowledgeBaseClient(client_wrapper=self._client_wrapper) return self._knowledge_base @property def llm_usage(self): if self._llm_usage is None: from .llm_usage.client import AsyncLlmUsageClient # noqa: E402 self._llm_usage = AsyncLlmUsageClient(client_wrapper=self._client_wrapper) return self._llm_usage @property def branches(self): if self._branches is None: from .branches.client import AsyncBranchesClient # noqa: E402 self._branches = AsyncBranchesClient(client_wrapper=self._client_wrapper) return self._branches @property def versions(self): if self._versions is None: from .versions.client import AsyncVersionsClient # noqa: E402 self._versions = AsyncVersionsClient(client_wrapper=self._client_wrapper) return self._versions @property def deployments(self): if self._deployments is None: from .deployments.client import AsyncDeploymentsClient # noqa: E402 self._deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper) return self._deployments @property def drafts(self): if self._drafts is None: from .drafts.client import AsyncDraftsClient # noqa: E402 self._drafts = AsyncDraftsClient(client_wrapper=self._client_wrapper) return self._drafts @property def procedures(self): if self._procedures is None: from .procedures.client import AsyncProceduresClient # noqa: E402 self._procedures = AsyncProceduresClient(client_wrapper=self._client_wrapper) return self._procedures elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/deployments/000077500000000000000000000000001523660243400320655ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/deployments/__init__.py000066400000000000000000000001251523660243400341740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/deployments/client.py000066400000000000000000000117161523660243400337230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.agent_deployment_request import AgentDeploymentRequest from ....types.agent_deployment_response import AgentDeploymentResponse from .raw_client import AsyncRawDeploymentsClient, RawDeploymentsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DeploymentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDeploymentsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDeploymentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDeploymentsClient """ return self._raw_client def create( self, agent_id: str, *, deployment_request: AgentDeploymentRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AgentDeploymentResponse: """ Create a new deployment for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. deployment_request : AgentDeploymentRequest Request to create a new deployment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentDeploymentResponse Successful Response Examples -------- from elevenlabs import ( AgentDeploymentPercentageStrategy, AgentDeploymentRequest, AgentDeploymentRequestItem, ElevenLabs, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.deployments.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", deployment_request=AgentDeploymentRequest( requests=[ AgentDeploymentRequestItem( branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", deployment_strategy=AgentDeploymentPercentageStrategy( traffic_percentage=0.5, ), ) ], ), ) """ _response = self._raw_client.create( agent_id, deployment_request=deployment_request, request_options=request_options ) return _response.data class AsyncDeploymentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDeploymentsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDeploymentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDeploymentsClient """ return self._raw_client async def create( self, agent_id: str, *, deployment_request: AgentDeploymentRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AgentDeploymentResponse: """ Create a new deployment for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. deployment_request : AgentDeploymentRequest Request to create a new deployment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentDeploymentResponse Successful Response Examples -------- import asyncio from elevenlabs import ( AgentDeploymentPercentageStrategy, AgentDeploymentRequest, AgentDeploymentRequestItem, AsyncElevenLabs, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.deployments.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", deployment_request=AgentDeploymentRequest( requests=[ AgentDeploymentRequestItem( branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", deployment_strategy=AgentDeploymentPercentageStrategy( traffic_percentage=0.5, ), ) ], ), ) asyncio.run(main()) """ _response = await self._raw_client.create( agent_id, deployment_request=deployment_request, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000146651523660243400345230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/deployments# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.agent_deployment_request import AgentDeploymentRequest from ....types.agent_deployment_response import AgentDeploymentResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDeploymentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, agent_id: str, *, deployment_request: AgentDeploymentRequest, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AgentDeploymentResponse]: """ Create a new deployment for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. deployment_request : AgentDeploymentRequest Request to create a new deployment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AgentDeploymentResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments", method="POST", json={ "deployment_request": convert_and_respect_annotation_metadata( object_=deployment_request, annotation=AgentDeploymentRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentDeploymentResponse, construct_type( type_=AgentDeploymentResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDeploymentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, agent_id: str, *, deployment_request: AgentDeploymentRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AgentDeploymentResponse]: """ Create a new deployment for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. deployment_request : AgentDeploymentRequest Request to create a new deployment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AgentDeploymentResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments", method="POST", json={ "deployment_request": convert_and_respect_annotation_metadata( object_=deployment_request, annotation=AgentDeploymentRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentDeploymentResponse, construct_type( type_=AgentDeploymentResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/drafts/000077500000000000000000000000001523660243400310055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/drafts/__init__.py000066400000000000000000000001251523660243400331140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/drafts/client.py000066400000000000000000000424111523660243400326370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.agent_workflow_request_model import AgentWorkflowRequestModel from .raw_client import AsyncRawDraftsClient, RawDraftsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DraftsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDraftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDraftsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDraftsClient """ return self._raw_client def create( self, agent_id: str, *, branch_id: str, conversation_config: typing.Dict[str, typing.Any], platform_settings: typing.Dict[str, typing.Any], workflow: AgentWorkflowRequestModel, name: str, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Create a new draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use conversation_config : typing.Dict[str, typing.Any] Conversation config for the draft platform_settings : typing.Dict[str, typing.Any] Platform settings for the draft workflow : AgentWorkflowRequestModel Workflow for the draft name : str Name for the draft tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ( AgentWorkflowRequestModel, AgentWorkflowRequestModelNodesValue_End, AstNodeInput_AndOperator, ElevenLabs, WorkflowEdgeModelInput, WorkflowEdgeModelInputForwardCondition_Expression, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.drafts.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", conversation_config={"key": "value"}, platform_settings={"key": "value"}, workflow=AgentWorkflowRequestModel( edges={ "entry_to_tool_a": WorkflowEdgeModelInput( source="entry_node", target="tool_node_a", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "start_to_entry": WorkflowEdgeModelInput( source="start_node", target="entry_node", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_a_to_failure": WorkflowEdgeModelInput( source="tool_node_a", target="failure_node", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_a_to_tool_b": WorkflowEdgeModelInput( source="tool_node_a", target="tool_node_b", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_agent_transfer": WorkflowEdgeModelInput( source="tool_node_b", target="success_transfer", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_conversation": WorkflowEdgeModelInput( source="tool_node_b", target="success_conversation", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_end": WorkflowEdgeModelInput( source="tool_node_b", target="success_end", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_phone": WorkflowEdgeModelInput( source="tool_node_b", target="success_phone", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), }, nodes={ "entry_node": AgentWorkflowRequestModelNodesValue_End(), "failure_node": AgentWorkflowRequestModelNodesValue_End(), "start_node": AgentWorkflowRequestModelNodesValue_End(), "success_conversation": AgentWorkflowRequestModelNodesValue_End(), "success_end": AgentWorkflowRequestModelNodesValue_End(), "success_phone": AgentWorkflowRequestModelNodesValue_End(), "success_transfer": AgentWorkflowRequestModelNodesValue_End(), "tool_node_a": AgentWorkflowRequestModelNodesValue_End(), "tool_node_b": AgentWorkflowRequestModelNodesValue_End(), }, ), name="name", ) """ _response = self._raw_client.create( agent_id, branch_id=branch_id, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, request_options=request_options, ) return _response.data def delete( self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) """ _response = self._raw_client.delete(agent_id, branch_id=branch_id, request_options=request_options) return _response.data class AsyncDraftsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDraftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDraftsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDraftsClient """ return self._raw_client async def create( self, agent_id: str, *, branch_id: str, conversation_config: typing.Dict[str, typing.Any], platform_settings: typing.Dict[str, typing.Any], workflow: AgentWorkflowRequestModel, name: str, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Create a new draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use conversation_config : typing.Dict[str, typing.Any] Conversation config for the draft platform_settings : typing.Dict[str, typing.Any] Platform settings for the draft workflow : AgentWorkflowRequestModel Workflow for the draft name : str Name for the draft tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import ( AgentWorkflowRequestModel, AgentWorkflowRequestModelNodesValue_End, AstNodeInput_AndOperator, AsyncElevenLabs, WorkflowEdgeModelInput, WorkflowEdgeModelInputForwardCondition_Expression, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.drafts.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", conversation_config={"key": "value"}, platform_settings={"key": "value"}, workflow=AgentWorkflowRequestModel( edges={ "entry_to_tool_a": WorkflowEdgeModelInput( source="entry_node", target="tool_node_a", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "start_to_entry": WorkflowEdgeModelInput( source="start_node", target="entry_node", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_a_to_failure": WorkflowEdgeModelInput( source="tool_node_a", target="failure_node", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_a_to_tool_b": WorkflowEdgeModelInput( source="tool_node_a", target="tool_node_b", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_agent_transfer": WorkflowEdgeModelInput( source="tool_node_b", target="success_transfer", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_conversation": WorkflowEdgeModelInput( source="tool_node_b", target="success_conversation", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_end": WorkflowEdgeModelInput( source="tool_node_b", target="success_end", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), "tool_b_to_phone": WorkflowEdgeModelInput( source="tool_node_b", target="success_phone", forward_condition=WorkflowEdgeModelInputForwardCondition_Expression( expression=AstNodeInput_AndOperator( children=[], ), ), ), }, nodes={ "entry_node": AgentWorkflowRequestModelNodesValue_End(), "failure_node": AgentWorkflowRequestModelNodesValue_End(), "start_node": AgentWorkflowRequestModelNodesValue_End(), "success_conversation": AgentWorkflowRequestModelNodesValue_End(), "success_end": AgentWorkflowRequestModelNodesValue_End(), "success_phone": AgentWorkflowRequestModelNodesValue_End(), "success_transfer": AgentWorkflowRequestModelNodesValue_End(), "tool_node_a": AgentWorkflowRequestModelNodesValue_End(), "tool_node_b": AgentWorkflowRequestModelNodesValue_End(), }, ), name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( agent_id, branch_id=branch_id, conversation_config=conversation_config, platform_settings=platform_settings, workflow=workflow, name=name, tags=tags, request_options=request_options, ) return _response.data async def delete( self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj", ) asyncio.run(main()) """ _response = await self._raw_client.delete(agent_id, branch_id=branch_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/drafts/raw_client.py000066400000000000000000000315551523660243400335170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.agent_workflow_request_model import AgentWorkflowRequestModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDraftsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, agent_id: str, *, branch_id: str, conversation_config: typing.Dict[str, typing.Any], platform_settings: typing.Dict[str, typing.Any], workflow: AgentWorkflowRequestModel, name: str, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Create a new draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use conversation_config : typing.Dict[str, typing.Any] Conversation config for the draft platform_settings : typing.Dict[str, typing.Any] Platform settings for the draft workflow : AgentWorkflowRequestModel Workflow for the draft name : str Name for the draft tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts", method="POST", params={ "branch_id": branch_id, }, json={ "conversation_config": conversation_config, "platform_settings": platform_settings, "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete a draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts", method="DELETE", params={ "branch_id": branch_id, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDraftsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, agent_id: str, *, branch_id: str, conversation_config: typing.Dict[str, typing.Any], platform_settings: typing.Dict[str, typing.Any], workflow: AgentWorkflowRequestModel, name: str, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Create a new draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use conversation_config : typing.Dict[str, typing.Any] Conversation config for the draft platform_settings : typing.Dict[str, typing.Any] Platform settings for the draft workflow : AgentWorkflowRequestModel Workflow for the draft name : str Name for the draft tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts", method="POST", params={ "branch_id": branch_id, }, json={ "conversation_config": conversation_config, "platform_settings": platform_settings, "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete a draft for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. branch_id : str The ID of the agent branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts", method="DELETE", params={ "branch_id": branch_id, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/knowledge_base/000077500000000000000000000000001523660243400324735ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400345230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/knowledge_base# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000062221523660243400342460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/knowledge_base# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_agent_knowledgebase_size_response_model import GetAgentKnowledgebaseSizeResponseModel from .raw_client import AsyncRawKnowledgeBaseClient, RawKnowledgeBaseClient class KnowledgeBaseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawKnowledgeBaseClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawKnowledgeBaseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawKnowledgeBaseClient """ return self._raw_client def size( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentKnowledgebaseSizeResponseModel: """ Returns the number of pages in the agent's knowledge base. Parameters ---------- agent_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentKnowledgebaseSizeResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.knowledge_base.size( agent_id="agent_id", ) """ _response = self._raw_client.size(agent_id, request_options=request_options) return _response.data class AsyncKnowledgeBaseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawKnowledgeBaseClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawKnowledgeBaseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawKnowledgeBaseClient """ return self._raw_client async def size( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentKnowledgebaseSizeResponseModel: """ Returns the number of pages in the agent's knowledge base. Parameters ---------- agent_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentKnowledgebaseSizeResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.knowledge_base.size( agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.size(agent_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000123701523660243400351200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/knowledge_base# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_agent_knowledgebase_size_response_model import GetAgentKnowledgebaseSizeResponseModel from pydantic import ValidationError class RawKnowledgeBaseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def size( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAgentKnowledgebaseSizeResponseModel]: """ Returns the number of pages in the agent's knowledge base. Parameters ---------- agent_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentKnowledgebaseSizeResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent/{jsonable_encoder(agent_id)}/knowledge-base/size", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentKnowledgebaseSizeResponseModel, construct_type( type_=GetAgentKnowledgebaseSizeResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawKnowledgeBaseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def size( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAgentKnowledgebaseSizeResponseModel]: """ Returns the number of pages in the agent's knowledge base. Parameters ---------- agent_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentKnowledgebaseSizeResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent/{jsonable_encoder(agent_id)}/knowledge-base/size", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentKnowledgebaseSizeResponseModel, construct_type( type_=GetAgentKnowledgebaseSizeResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/link/000077500000000000000000000000001523660243400304575ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/link/__init__.py000066400000000000000000000001251523660243400325660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/link/client.py000066400000000000000000000062071523660243400323140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_agent_link_response_model import GetAgentLinkResponseModel from .raw_client import AsyncRawLinkClient, RawLinkClient class LinkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLinkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLinkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLinkClient """ return self._raw_client def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentLinkResponseModel: """ Get the current link used to share the agent with others Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentLinkResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.link.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.get(agent_id, request_options=request_options) return _response.data class AsyncLinkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLinkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLinkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLinkClient """ return self._raw_client async def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentLinkResponseModel: """ Get the current link used to share the agent with others Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentLinkResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.link.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/link/raw_client.py000066400000000000000000000123111523660243400331560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_agent_link_response_model import GetAgentLinkResponseModel from pydantic import ValidationError class RawLinkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAgentLinkResponseModel]: """ Get the current link used to share the agent with others Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentLinkResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/link", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentLinkResponseModel, construct_type( type_=GetAgentLinkResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLinkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAgentLinkResponseModel]: """ Get the current link used to share the agent with others Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentLinkResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/link", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentLinkResponseModel, construct_type( type_=GetAgentLinkResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/llm_usage/000077500000000000000000000000001523660243400314725ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/llm_usage/__init__.py000066400000000000000000000001251523660243400336010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/llm_usage/client.py000066400000000000000000000107161523660243400333270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.llm_usage_calculator_response_model import LlmUsageCalculatorResponseModel from .raw_client import AsyncRawLlmUsageClient, RawLlmUsageClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class LlmUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLlmUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLlmUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLlmUsageClient """ return self._raw_client def calculate( self, agent_id: str, *, prompt_length: typing.Optional[int] = OMIT, number_of_pages: typing.Optional[int] = OMIT, rag_enabled: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> LlmUsageCalculatorResponseModel: """ Calculates expected number of LLM tokens needed for the specified agent. Parameters ---------- agent_id : str prompt_length : typing.Optional[int] Length of the prompt in characters. number_of_pages : typing.Optional[int] Pages of content in pdf documents OR urls in agent's Knowledge Base. rag_enabled : typing.Optional[bool] Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmUsageCalculatorResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.llm_usage.calculate( agent_id="agent_id", ) """ _response = self._raw_client.calculate( agent_id, prompt_length=prompt_length, number_of_pages=number_of_pages, rag_enabled=rag_enabled, request_options=request_options, ) return _response.data class AsyncLlmUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLlmUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLlmUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLlmUsageClient """ return self._raw_client async def calculate( self, agent_id: str, *, prompt_length: typing.Optional[int] = OMIT, number_of_pages: typing.Optional[int] = OMIT, rag_enabled: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> LlmUsageCalculatorResponseModel: """ Calculates expected number of LLM tokens needed for the specified agent. Parameters ---------- agent_id : str prompt_length : typing.Optional[int] Length of the prompt in characters. number_of_pages : typing.Optional[int] Pages of content in pdf documents OR urls in agent's Knowledge Base. rag_enabled : typing.Optional[bool] Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmUsageCalculatorResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.llm_usage.calculate( agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.calculate( agent_id, prompt_length=prompt_length, number_of_pages=number_of_pages, rag_enabled=rag_enabled, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/llm_usage/raw_client.py000066400000000000000000000155001523660243400341740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.llm_usage_calculator_response_model import LlmUsageCalculatorResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawLlmUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def calculate( self, agent_id: str, *, prompt_length: typing.Optional[int] = OMIT, number_of_pages: typing.Optional[int] = OMIT, rag_enabled: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[LlmUsageCalculatorResponseModel]: """ Calculates expected number of LLM tokens needed for the specified agent. Parameters ---------- agent_id : str prompt_length : typing.Optional[int] Length of the prompt in characters. number_of_pages : typing.Optional[int] Pages of content in pdf documents OR urls in agent's Knowledge Base. rag_enabled : typing.Optional[bool] Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[LlmUsageCalculatorResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent/{jsonable_encoder(agent_id)}/llm-usage/calculate", method="POST", json={ "prompt_length": prompt_length, "number_of_pages": number_of_pages, "rag_enabled": rag_enabled, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmUsageCalculatorResponseModel, construct_type( type_=LlmUsageCalculatorResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLlmUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def calculate( self, agent_id: str, *, prompt_length: typing.Optional[int] = OMIT, number_of_pages: typing.Optional[int] = OMIT, rag_enabled: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[LlmUsageCalculatorResponseModel]: """ Calculates expected number of LLM tokens needed for the specified agent. Parameters ---------- agent_id : str prompt_length : typing.Optional[int] Length of the prompt in characters. number_of_pages : typing.Optional[int] Pages of content in pdf documents OR urls in agent's Knowledge Base. rag_enabled : typing.Optional[bool] Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[LlmUsageCalculatorResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent/{jsonable_encoder(agent_id)}/llm-usage/calculate", method="POST", json={ "prompt_length": prompt_length, "number_of_pages": number_of_pages, "rag_enabled": rag_enabled, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmUsageCalculatorResponseModel, construct_type( type_=LlmUsageCalculatorResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/000077500000000000000000000000001523660243400316755ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/__init__.py000066400000000000000000000020121523660243400340010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import drafts _dynamic_imports: typing.Dict[str, str] = {"drafts": ".drafts"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["drafts"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/client.py000066400000000000000000000404531523660243400335330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.compile_procedures_response_model import CompileProceduresResponseModel from ....types.create_procedure_request_model import CreateProcedureRequestModel from ....types.create_procedure_response_model import CreateProcedureResponseModel from ....types.list_procedures_response_model import ListProceduresResponseModel from ....types.procedure_at_version_response_model import ProcedureAtVersionResponseModel from .raw_client import AsyncRawProceduresClient, RawProceduresClient if typing.TYPE_CHECKING: from .drafts.client import AsyncDraftsClient, DraftsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ProceduresClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawProceduresClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._drafts: typing.Optional[DraftsClient] = None @property def with_raw_response(self) -> RawProceduresClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawProceduresClient """ return self._raw_client def list( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ListProceduresResponseModel: """ List the agent's procedures on a branch with their procedure_id, version_id, name, type, trigger, and has_draft. has_draft is true when a procedure has unpublished draft changes on this branch; its name/type/trigger then reflect that draft. Does not return procedure content -- use Get Procedure to read a procedure's body. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListProceduresResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) """ _response = self._raw_client.list(agent_id, branch_id, request_options=request_options) return _response.data def create( self, agent_id: str, branch_id: str, *, request: typing.Optional[CreateProcedureRequestModel] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateProcedureResponseModel: """ Create a new procedure for the agent on a branch. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request : typing.Optional[CreateProcedureRequestModel] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateProcedureResponseModel Successful Response Examples -------- from elevenlabs import CreateProcedureRequestModel, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", request=CreateProcedureRequestModel(), ) """ _response = self._raw_client.create(agent_id, branch_id, request=request, request_options=request_options) return _response.data def compile( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> CompileProceduresResponseModel: """ Compile procedure drafts into a workflow. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CompileProceduresResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.compile( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) """ _response = self._raw_client.compile(agent_id, branch_id, request_options=request_options) return _response.data def get( self, agent_id: str, branch_id: str, procedure_id: str, *, version_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureAtVersionResponseModel: """ Retrieve a procedure at a specific version or the current branch HEAD. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID version_id : typing.Optional[str] The version ID to retrieve. If omitted, returns the version at branch HEAD. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureAtVersionResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", version_id="version_id", ) """ _response = self._raw_client.get( agent_id, branch_id, procedure_id, version_id=version_id, request_options=request_options ) return _response.data def remove( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Remove a procedure from the agent's draft working set. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.remove( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) """ _response = self._raw_client.remove(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data @property def drafts(self): if self._drafts is None: from .drafts.client import DraftsClient # noqa: E402 self._drafts = DraftsClient(client_wrapper=self._client_wrapper) return self._drafts class AsyncProceduresClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawProceduresClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._drafts: typing.Optional[AsyncDraftsClient] = None @property def with_raw_response(self) -> AsyncRawProceduresClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawProceduresClient """ return self._raw_client async def list( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ListProceduresResponseModel: """ List the agent's procedures on a branch with their procedure_id, version_id, name, type, trigger, and has_draft. has_draft is true when a procedure has unpublished draft changes on this branch; its name/type/trigger then reflect that draft. Does not return procedure content -- use Get Procedure to read a procedure's body. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListProceduresResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.list( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) asyncio.run(main()) """ _response = await self._raw_client.list(agent_id, branch_id, request_options=request_options) return _response.data async def create( self, agent_id: str, branch_id: str, *, request: typing.Optional[CreateProcedureRequestModel] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateProcedureResponseModel: """ Create a new procedure for the agent on a branch. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request : typing.Optional[CreateProcedureRequestModel] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateProcedureResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, CreateProcedureRequestModel client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", request=CreateProcedureRequestModel(), ) asyncio.run(main()) """ _response = await self._raw_client.create(agent_id, branch_id, request=request, request_options=request_options) return _response.data async def compile( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> CompileProceduresResponseModel: """ Compile procedure drafts into a workflow. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CompileProceduresResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.compile( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", ) asyncio.run(main()) """ _response = await self._raw_client.compile(agent_id, branch_id, request_options=request_options) return _response.data async def get( self, agent_id: str, branch_id: str, procedure_id: str, *, version_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureAtVersionResponseModel: """ Retrieve a procedure at a specific version or the current branch HEAD. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID version_id : typing.Optional[str] The version ID to retrieve. If omitted, returns the version at branch HEAD. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureAtVersionResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", version_id="version_id", ) asyncio.run(main()) """ _response = await self._raw_client.get( agent_id, branch_id, procedure_id, version_id=version_id, request_options=request_options ) return _response.data async def remove( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Remove a procedure from the agent's draft working set. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.remove( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) asyncio.run(main()) """ _response = await self._raw_client.remove(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data @property def drafts(self): if self._drafts is None: from .drafts.client import AsyncDraftsClient # noqa: E402 self._drafts = AsyncDraftsClient(client_wrapper=self._client_wrapper) return self._drafts elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/drafts/000077500000000000000000000000001523660243400331605ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400352100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/drafts# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000257561523660243400347500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/drafts# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.procedure_draft_response_model import ProcedureDraftResponseModel from .....types.procedure_type import ProcedureType from .raw_client import AsyncRawDraftsClient, RawDraftsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DraftsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDraftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDraftsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDraftsClient """ return self._raw_client def get( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureDraftResponseModel: """ Get user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureDraftResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.drafts.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) """ _response = self._raw_client.get(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data def delete( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete user's draft for a procedure, resetting to the committed version Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) """ _response = self._raw_client.delete(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data def update( self, agent_id: str, branch_id: str, procedure_id: str, *, name: str, content: str, type: ProcedureType, trigger: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureDraftResponseModel: """ Create or update user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID name : str Procedure name content : str Procedure content type : ProcedureType Procedure type trigger : typing.Optional[str] When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureDraftResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.procedures.drafts.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", name="name", content="content", type="free_form", ) """ _response = self._raw_client.update( agent_id, branch_id, procedure_id, name=name, content=content, type=type, trigger=trigger, request_options=request_options, ) return _response.data class AsyncDraftsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDraftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDraftsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDraftsClient """ return self._raw_client async def get( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureDraftResponseModel: """ Get user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureDraftResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.drafts.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data async def delete( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete user's draft for a procedure, resetting to the committed version Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.drafts.delete( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", ) asyncio.run(main()) """ _response = await self._raw_client.delete(agent_id, branch_id, procedure_id, request_options=request_options) return _response.data async def update( self, agent_id: str, branch_id: str, procedure_id: str, *, name: str, content: str, type: ProcedureType, trigger: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ProcedureDraftResponseModel: """ Create or update user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID name : str Procedure name content : str Procedure content type : ProcedureType Procedure type trigger : typing.Optional[str] When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProcedureDraftResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.procedures.drafts.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t", procedure_id="agtprc_6qbpwdq8n01bxhk44bgjy6f10ck3", name="name", content="content", type="free_form", ) asyncio.run(main()) """ _response = await self._raw_client.update( agent_id, branch_id, procedure_id, name=name, content=content, type=type, trigger=trigger, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000000425271523660243400356140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures/drafts# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.procedure_draft_response_model import ProcedureDraftResponseModel from .....types.procedure_type import ProcedureType from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDraftsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ProcedureDraftResponseModel]: """ Get user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProcedureDraftResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureDraftResponseModel, construct_type( type_=ProcedureDraftResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Delete user's draft for a procedure, resetting to the committed version Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, agent_id: str, branch_id: str, procedure_id: str, *, name: str, content: str, type: ProcedureType, trigger: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ProcedureDraftResponseModel]: """ Create or update user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID name : str Procedure name content : str Procedure content type : ProcedureType Procedure type trigger : typing.Optional[str] When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProcedureDraftResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="PATCH", json={ "name": name, "content": content, "type": type, "trigger": trigger, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureDraftResponseModel, construct_type( type_=ProcedureDraftResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDraftsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ProcedureDraftResponseModel]: """ Get user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProcedureDraftResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureDraftResponseModel, construct_type( type_=ProcedureDraftResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Delete user's draft for a procedure, resetting to the committed version Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, agent_id: str, branch_id: str, procedure_id: str, *, name: str, content: str, type: ProcedureType, trigger: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ProcedureDraftResponseModel]: """ Create or update user's draft for a procedure Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID name : str Procedure name content : str Procedure content type : ProcedureType Procedure type trigger : typing.Optional[str] When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProcedureDraftResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}/draft", method="PATCH", json={ "name": name, "content": content, "type": type, "trigger": trigger, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureDraftResponseModel, construct_type( type_=ProcedureDraftResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) raw_client.py000066400000000000000000000666731523660243400343410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/procedures# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.bad_request_error import BadRequestError from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.compile_procedures_response_model import CompileProceduresResponseModel from ....types.create_procedure_request_model import CreateProcedureRequestModel from ....types.create_procedure_response_model import CreateProcedureResponseModel from ....types.list_procedures_response_model import ListProceduresResponseModel from ....types.procedure_at_version_response_model import ProcedureAtVersionResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawProceduresClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ListProceduresResponseModel]: """ List the agent's procedures on a branch with their procedure_id, version_id, name, type, trigger, and has_draft. has_draft is true when a procedure has unpublished draft changes on this branch; its name/type/trigger then reflect that draft. Does not return procedure content -- use Get Procedure to read a procedure's body. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListProceduresResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListProceduresResponseModel, construct_type( type_=ListProceduresResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, agent_id: str, branch_id: str, *, request: typing.Optional[CreateProcedureRequestModel] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateProcedureResponseModel]: """ Create a new procedure for the agent on a branch. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request : typing.Optional[CreateProcedureRequestModel] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateProcedureResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateProcedureRequestModel, direction="write" ), request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateProcedureResponseModel, construct_type( type_=CreateProcedureResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def compile( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[CompileProceduresResponseModel]: """ Compile procedure drafts into a workflow. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CompileProceduresResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/compile", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CompileProceduresResponseModel, construct_type( type_=CompileProceduresResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, agent_id: str, branch_id: str, procedure_id: str, *, version_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ProcedureAtVersionResponseModel]: """ Retrieve a procedure at a specific version or the current branch HEAD. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID version_id : typing.Optional[str] The version ID to retrieve. If omitted, returns the version at branch HEAD. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProcedureAtVersionResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}", method="GET", params={ "version_id": version_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureAtVersionResponseModel, construct_type( type_=ProcedureAtVersionResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def remove( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Remove a procedure from the agent's draft working set. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawProceduresClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ListProceduresResponseModel]: """ List the agent's procedures on a branch with their procedure_id, version_id, name, type, trigger, and has_draft. has_draft is true when a procedure has unpublished draft changes on this branch; its name/type/trigger then reflect that draft. Does not return procedure content -- use Get Procedure to read a procedure's body. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListProceduresResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListProceduresResponseModel, construct_type( type_=ListProceduresResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, agent_id: str, branch_id: str, *, request: typing.Optional[CreateProcedureRequestModel] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateProcedureResponseModel]: """ Create a new procedure for the agent on a branch. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request : typing.Optional[CreateProcedureRequestModel] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateProcedureResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateProcedureRequestModel, direction="write" ), request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateProcedureResponseModel, construct_type( type_=CreateProcedureResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def compile( self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[CompileProceduresResponseModel]: """ Compile procedure drafts into a workflow. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CompileProceduresResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/compile", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CompileProceduresResponseModel, construct_type( type_=CompileProceduresResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, agent_id: str, branch_id: str, procedure_id: str, *, version_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ProcedureAtVersionResponseModel]: """ Retrieve a procedure at a specific version or the current branch HEAD. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID version_id : typing.Optional[str] The version ID to retrieve. If omitted, returns the version at branch HEAD. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProcedureAtVersionResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}", method="GET", params={ "version_id": version_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProcedureAtVersionResponseModel, construct_type( type_=ProcedureAtVersionResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def remove( self, agent_id: str, branch_id: str, procedure_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Remove a procedure from the agent's draft working set. Parameters ---------- agent_id : str Agent ID to get the procedure draft from branch_id : str Branch ID to get the procedure draft from procedure_id : str The procedure ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/procedures/{jsonable_encoder(procedure_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/raw_client.py000066400000000000000000001751441523660243400322370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel from ...types.agent_platform_settings_request_model import AgentPlatformSettingsRequestModel from ...types.agent_simulated_chat_test_response_model import AgentSimulatedChatTestResponseModel from ...types.agent_sort_by import AgentSortBy from ...types.agent_workflow_request_model import AgentWorkflowRequestModel from ...types.conversation_simulation_specification import ConversationSimulationSpecification from ...types.conversational_config import ConversationalConfig from ...types.create_agent_response_model import CreateAgentResponseModel from ...types.get_agent_response_model import GetAgentResponseModel from ...types.get_agents_page_response_model import GetAgentsPageResponseModel from ...types.get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel from ...types.prompt_evaluation_criteria import PromptEvaluationCriteria from ...types.single_test_run_request_model import SingleTestRunRequestModel from ...types.sort_direction import SortDirection from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAgentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, conversation_config: ConversationalConfig, enable_versioning: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateAgentResponseModel]: """ Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent enable_versioning : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateAgentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agents/create", method="POST", params={ "enable_versioning": enable_versioning, }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, annotation=ConversationalConfig, direction="write" ), "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentResponseModel, construct_type( type_=CreateAgentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, agent_id: str, *, version_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentResponseModel]: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : typing.Optional[str] The ID of the agent version to use branch_id : typing.Optional[str] The ID of the branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="GET", params={ "version_id": version_id, "branch_id": branch_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentResponseModel, construct_type( type_=GetAgentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, agent_id: str, *, enable_versioning_if_not_enabled: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, version_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentResponseModel]: """ Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. enable_versioning_if_not_enabled : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. branch_id : typing.Optional[str] The ID of the branch to use conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent version_description : typing.Optional[str] Description for this version when publishing changes (only applicable for versioned agents) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="PATCH", params={ "enable_versioning_if_not_enabled": enable_versioning_if_not_enabled, "branch_id": branch_id, }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, annotation=ConversationalConfig, direction="write" ), "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, "version_description": version_description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentResponseModel, construct_type( type_=GetAgentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, archived: typing.Optional[bool] = None, show_only_owned_agents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentsPageResponseModel]: """ Returns a list of your agents and their metadata. Parameters ---------- page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search by agents name. archived : typing.Optional[bool] Filter agents by archived status show_only_owned_agents : typing.Optional[bool] If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agents", method="GET", params={ "page_size": page_size, "search": search, "archived": archived, "show_only_owned_agents": show_only_owned_agents, "created_by_user_id": created_by_user_id, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentsPageResponseModel, construct_type( type_=GetAgentsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def duplicate( self, agent_id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateAgentResponseModel]: """ Create a new agent by duplicating an existing one Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. name : typing.Optional[str] A name to make the agent easier to find request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateAgentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/duplicate", method="POST", json={ "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentResponseModel, construct_type( type_=CreateAgentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AgentSimulatedChatTestResponseModel]: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AgentSimulatedChatTestResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation", method="POST", json={ "simulation_specification": convert_and_respect_annotation_metadata( object_=simulation_specification, annotation=ConversationSimulationSpecification, direction="write" ), "extra_evaluation_criteria": convert_and_respect_annotation_metadata( object_=extra_evaluation_criteria, annotation=typing.Sequence[PromptEvaluationCriteria], direction="write", ), "new_turns_limit": new_turns_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentSimulatedChatTestResponseModel, construct_type( type_=AgentSimulatedChatTestResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation/stream", method="POST", json={ "simulation_specification": convert_and_respect_annotation_metadata( object_=simulation_specification, annotation=ConversationSimulationSpecification, direction="write" ), "extra_evaluation_criteria": convert_and_respect_annotation_metadata( object_=extra_evaluation_criteria, annotation=typing.Sequence[PromptEvaluationCriteria], direction="write", ), "new_turns_limit": new_turns_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def run_tests( self, agent_id: str, *, tests: typing.Sequence[SingleTestRunRequestModel], agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, repeat_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetTestSuiteInvocationResponseModel]: """ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. tests : typing.Sequence[SingleTestRunRequestModel] List of tests to run on the agent agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. repeat_count : typing.Optional[int] Number of times to run each test. When greater than 1, results are grouped and summarized. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetTestSuiteInvocationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/run-tests", method="POST", json={ "tests": convert_and_respect_annotation_metadata( object_=tests, annotation=typing.Sequence[SingleTestRunRequestModel], direction="write" ), "agent_config_override": convert_and_respect_annotation_metadata( object_=agent_config_override, annotation=AdhocAgentConfigOverrideForTestRequestModel, direction="write", ), "branch_id": branch_id, "repeat_count": repeat_count, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestSuiteInvocationResponseModel, construct_type( type_=GetTestSuiteInvocationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAgentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, conversation_config: ConversationalConfig, enable_versioning: typing.Optional[bool] = None, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateAgentResponseModel]: """ Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent enable_versioning : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateAgentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agents/create", method="POST", params={ "enable_versioning": enable_versioning, }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, annotation=ConversationalConfig, direction="write" ), "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentResponseModel, construct_type( type_=CreateAgentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, agent_id: str, *, version_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAgentResponseModel]: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : typing.Optional[str] The ID of the agent version to use branch_id : typing.Optional[str] The ID of the branch to use request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="GET", params={ "version_id": version_id, "branch_id": branch_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentResponseModel, construct_type( type_=GetAgentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, agent_id: str, *, enable_versioning_if_not_enabled: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, version_description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAgentResponseModel]: """ Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. enable_versioning_if_not_enabled : typing.Optional[bool] Deprecated: all agents are versioned. This parameter is ignored. branch_id : typing.Optional[str] The ID of the branch to use conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. workflow : typing.Optional[AgentWorkflowRequestModel] Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools. name : typing.Optional[str] A name to make the agent easier to find tags : typing.Optional[typing.Sequence[str]] Tags to help classify and filter the agent version_description : typing.Optional[str] Description for this version when publishing changes (only applicable for versioned agents) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}", method="PATCH", params={ "enable_versioning_if_not_enabled": enable_versioning_if_not_enabled, "branch_id": branch_id, }, json={ "conversation_config": convert_and_respect_annotation_metadata( object_=conversation_config, annotation=ConversationalConfig, direction="write" ), "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), "workflow": convert_and_respect_annotation_metadata( object_=workflow, annotation=AgentWorkflowRequestModel, direction="write" ), "name": name, "tags": tags, "version_description": version_description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentResponseModel, construct_type( type_=GetAgentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, archived: typing.Optional[bool] = None, show_only_owned_agents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAgentsPageResponseModel]: """ Returns a list of your agents and their metadata. Parameters ---------- page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search by agents name. archived : typing.Optional[bool] Filter agents by archived status show_only_owned_agents : typing.Optional[bool] If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agents", method="GET", params={ "page_size": page_size, "search": search, "archived": archived, "show_only_owned_agents": show_only_owned_agents, "created_by_user_id": created_by_user_id, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentsPageResponseModel, construct_type( type_=GetAgentsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def duplicate( self, agent_id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateAgentResponseModel]: """ Create a new agent by duplicating an existing one Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. name : typing.Optional[str] A name to make the agent easier to find request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateAgentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/duplicate", method="POST", json={ "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentResponseModel, construct_type( type_=CreateAgentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AgentSimulatedChatTestResponseModel]: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AgentSimulatedChatTestResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation", method="POST", json={ "simulation_specification": convert_and_respect_annotation_metadata( object_=simulation_specification, annotation=ConversationSimulationSpecification, direction="write" ), "extra_evaluation_criteria": convert_and_respect_annotation_metadata( object_=extra_evaluation_criteria, annotation=typing.Sequence[PromptEvaluationCriteria], direction="write", ), "new_turns_limit": new_turns_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentSimulatedChatTestResponseModel, construct_type( type_=AgentSimulatedChatTestResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, new_turns_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ Deprecated. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conversation should be simulated extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] A list of evaluation criteria to test new_turns_limit : typing.Optional[int] Maximum number of new turns to generate in the conversation simulation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation/stream", method="POST", json={ "simulation_specification": convert_and_respect_annotation_metadata( object_=simulation_specification, annotation=ConversationSimulationSpecification, direction="write" ), "extra_evaluation_criteria": convert_and_respect_annotation_metadata( object_=extra_evaluation_criteria, annotation=typing.Sequence[PromptEvaluationCriteria], direction="write", ), "new_turns_limit": new_turns_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def run_tests( self, agent_id: str, *, tests: typing.Sequence[SingleTestRunRequestModel], agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, repeat_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetTestSuiteInvocationResponseModel]: """ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. tests : typing.Sequence[SingleTestRunRequestModel] List of tests to run on the agent agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. repeat_count : typing.Optional[int] Number of times to run each test. When greater than 1, results are grouped and summarized. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetTestSuiteInvocationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/run-tests", method="POST", json={ "tests": convert_and_respect_annotation_metadata( object_=tests, annotation=typing.Sequence[SingleTestRunRequestModel], direction="write" ), "agent_config_override": convert_and_respect_annotation_metadata( object_=agent_config_override, annotation=AdhocAgentConfigOverrideForTestRequestModel, direction="write", ), "branch_id": branch_id, "repeat_count": repeat_count, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestSuiteInvocationResponseModel, construct_type( type_=GetTestSuiteInvocationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/000077500000000000000000000000001523660243400315275ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/__init__.py000066400000000000000000000025041523660243400336410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success _dynamic_imports: typing.Dict[str, str] = { "SummariesGetResponseValue": ".types", "SummariesGetResponseValue_Failure": ".types", "SummariesGetResponseValue_Success": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/client.py000066400000000000000000000067211523660243400333650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from .raw_client import AsyncRawSummariesClient, RawSummariesClient from .types.summaries_get_response_value import SummariesGetResponseValue class SummariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSummariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSummariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSummariesClient """ return self._raw_client def get( self, *, agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, SummariesGetResponseValue]: """ Returns summaries for the specified agents. Parameters ---------- agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] List of agent IDs to fetch summaries for request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, SummariesGetResponseValue] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.summaries.get( agent_ids=["agent_ids"], ) """ _response = self._raw_client.get(agent_ids=agent_ids, request_options=request_options) return _response.data class AsyncSummariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSummariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSummariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSummariesClient """ return self._raw_client async def get( self, *, agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, SummariesGetResponseValue]: """ Returns summaries for the specified agents. Parameters ---------- agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] List of agent IDs to fetch summaries for request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, SummariesGetResponseValue] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.summaries.get( agent_ids=["agent_ids"], ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_ids=agent_ids, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/raw_client.py000066400000000000000000000131561523660243400342360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from .types.summaries_get_response_value import SummariesGetResponseValue from pydantic import ValidationError class RawSummariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Dict[str, SummariesGetResponseValue]]: """ Returns summaries for the specified agents. Parameters ---------- agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] List of agent IDs to fetch summaries for request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Dict[str, SummariesGetResponseValue]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agents/summaries", method="GET", params={ "agent_ids": agent_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, SummariesGetResponseValue], construct_type( type_=typing.Dict[str, SummariesGetResponseValue], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSummariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Dict[str, SummariesGetResponseValue]]: """ Returns summaries for the specified agents. Parameters ---------- agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] List of agent IDs to fetch summaries for request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Dict[str, SummariesGetResponseValue]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agents/summaries", method="GET", params={ "agent_ids": agent_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, SummariesGetResponseValue], construct_type( type_=typing.Dict[str, SummariesGetResponseValue], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/types/000077500000000000000000000000001523660243400326735ustar00rootroot00000000000000__init__.py000066400000000000000000000027011523660243400347250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .summaries_get_response_value import ( SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success, ) _dynamic_imports: typing.Dict[str, str] = { "SummariesGetResponseValue": ".summaries_get_response_value", "SummariesGetResponseValue_Failure": ".summaries_get_response_value", "SummariesGetResponseValue_Success": ".summaries_get_response_value", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success"] summaries_get_response_value.py000066400000000000000000000027021523660243400411450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/summaries/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.agent_summary_response_model import AgentSummaryResponseModel class SummariesGetResponseValue_Success(UncheckedBaseModel): status: typing.Literal["success"] = "success" data: AgentSummaryResponseModel 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 SummariesGetResponseValue_Failure(UncheckedBaseModel): status: typing.Literal["failure"] = "failure" error_code: int error_status: str error_message: 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 SummariesGetResponseValue = typing_extensions.Annotated[ typing.Union[SummariesGetResponseValue_Success, SummariesGetResponseValue_Failure], UnionMetadata(discriminant="status"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/versions/000077500000000000000000000000001523660243400313725ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/versions/__init__.py000066400000000000000000000001251523660243400335010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/versions/client.py000066400000000000000000000067071523660243400332340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.agent_version_metadata import AgentVersionMetadata from .raw_client import AsyncRawVersionsClient, RawVersionsClient class VersionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawVersionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawVersionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawVersionsClient """ return self._raw_client def get( self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentVersionMetadata: """ Get metadata for a specific agent version Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : str Unique identifier for the version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentVersionMetadata Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.versions.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="agtvrsn_0901k4aafjxxfxt93gd841r7tv5t", ) """ _response = self._raw_client.get(agent_id, version_id, request_options=request_options) return _response.data class AsyncVersionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawVersionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawVersionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawVersionsClient """ return self._raw_client async def get( self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentVersionMetadata: """ Get metadata for a specific agent version Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : str Unique identifier for the version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AgentVersionMetadata Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.versions.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", version_id="agtvrsn_0901k4aafjxxfxt93gd841r7tv5t", ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_id, version_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/versions/raw_client.py000066400000000000000000000125711523660243400341010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.agent_version_metadata import AgentVersionMetadata from pydantic import ValidationError class RawVersionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[AgentVersionMetadata]: """ Get metadata for a specific agent version Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : str Unique identifier for the version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AgentVersionMetadata] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/versions/{jsonable_encoder(version_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentVersionMetadata, construct_type( type_=AgentVersionMetadata, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawVersionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[AgentVersionMetadata]: """ Get metadata for a specific agent version Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. version_id : str Unique identifier for the version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AgentVersionMetadata] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/versions/{jsonable_encoder(version_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AgentVersionMetadata, construct_type( type_=AgentVersionMetadata, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/000077500000000000000000000000001523660243400310055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/__init__.py000066400000000000000000000020121523660243400331110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import avatar _dynamic_imports: typing.Dict[str, str] = {"avatar": ".avatar"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["avatar"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/avatar/000077500000000000000000000000001523660243400322635ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400343130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/avatar# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/avatar/client.py000066400000000000000000000071121523660243400341140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..... import core from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.post_agent_avatar_response_model import PostAgentAvatarResponseModel from .raw_client import AsyncRawAvatarClient, RawAvatarClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AvatarClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAvatarClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAvatarClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAvatarClient """ return self._raw_client def create( self, agent_id: str, *, avatar_file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> PostAgentAvatarResponseModel: """ Sets the avatar for an agent displayed in the widget Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. avatar_file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostAgentAvatarResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.widget.avatar.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.create(agent_id, avatar_file=avatar_file, request_options=request_options) return _response.data class AsyncAvatarClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAvatarClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAvatarClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAvatarClient """ return self._raw_client async def create( self, agent_id: str, *, avatar_file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> PostAgentAvatarResponseModel: """ Sets the avatar for an agent displayed in the widget Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. avatar_file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostAgentAvatarResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.widget.avatar.create( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.create(agent_id, avatar_file=avatar_file, request_options=request_options) return _response.data raw_client.py000066400000000000000000000135761523660243400347210ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/avatar# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..... import core from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.post_agent_avatar_response_model import PostAgentAvatarResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAvatarClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, agent_id: str, *, avatar_file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[PostAgentAvatarResponseModel]: """ Sets the avatar for an agent displayed in the widget Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. avatar_file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PostAgentAvatarResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/avatar", method="POST", data={}, files={ "avatar_file": avatar_file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostAgentAvatarResponseModel, construct_type( type_=PostAgentAvatarResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAvatarClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, agent_id: str, *, avatar_file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[PostAgentAvatarResponseModel]: """ Sets the avatar for an agent displayed in the widget Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. avatar_file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PostAgentAvatarResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/avatar", method="POST", data={}, files={ "avatar_file": avatar_file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostAgentAvatarResponseModel, construct_type( type_=PostAgentAvatarResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/client.py000066400000000000000000000115151523660243400326400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_agent_embed_response_model import GetAgentEmbedResponseModel from .raw_client import AsyncRawWidgetClient, RawWidgetClient if typing.TYPE_CHECKING: from .avatar.client import AsyncAvatarClient, AvatarClient class WidgetClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWidgetClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._avatar: typing.Optional[AvatarClient] = None @property def with_raw_response(self) -> RawWidgetClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWidgetClient """ return self._raw_client def get( self, agent_id: str, *, conversation_signature: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentEmbedResponseModel: """ Retrieve the widget configuration for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentEmbedResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.widget.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", conversation_signature="conversation_signature", ) """ _response = self._raw_client.get( agent_id, conversation_signature=conversation_signature, request_options=request_options ) return _response.data @property def avatar(self): if self._avatar is None: from .avatar.client import AvatarClient # noqa: E402 self._avatar = AvatarClient(client_wrapper=self._client_wrapper) return self._avatar class AsyncWidgetClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWidgetClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._avatar: typing.Optional[AsyncAvatarClient] = None @property def with_raw_response(self) -> AsyncRawWidgetClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWidgetClient """ return self._raw_client async def get( self, agent_id: str, *, conversation_signature: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentEmbedResponseModel: """ Retrieve the widget configuration for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentEmbedResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.agents.widget.get( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", conversation_signature="conversation_signature", ) asyncio.run(main()) """ _response = await self._raw_client.get( agent_id, conversation_signature=conversation_signature, request_options=request_options ) return _response.data @property def avatar(self): if self._avatar is None: from .avatar.client import AsyncAvatarClient # noqa: E402 self._avatar = AsyncAvatarClient(client_wrapper=self._client_wrapper) return self._avatar elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/agents/widget/raw_client.py000066400000000000000000000140051523660243400335060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_agent_embed_response_model import GetAgentEmbedResponseModel from pydantic import ValidationError class RawWidgetClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, agent_id: str, *, conversation_signature: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentEmbedResponseModel]: """ Retrieve the widget configuration for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentEmbedResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/widget", method="GET", params={ "conversation_signature": conversation_signature, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentEmbedResponseModel, construct_type( type_=GetAgentEmbedResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWidgetClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, agent_id: str, *, conversation_signature: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAgentEmbedResponseModel]: """ Retrieve the widget configuration for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentEmbedResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/widget", method="GET", params={ "conversation_signature": conversation_signature, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentEmbedResponseModel, construct_type( type_=GetAgentEmbedResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/000077500000000000000000000000001523660243400302305ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/__init__.py000066400000000000000000000020321523660243400323360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import live_count _dynamic_imports: typing.Dict[str, str] = {"live_count": ".live_count"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["live_count"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/client.py000066400000000000000000000037401523660243400320640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawAnalyticsClient, RawAnalyticsClient if typing.TYPE_CHECKING: from .live_count.client import AsyncLiveCountClient, LiveCountClient class AnalyticsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAnalyticsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._live_count: typing.Optional[LiveCountClient] = None @property def with_raw_response(self) -> RawAnalyticsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAnalyticsClient """ return self._raw_client @property def live_count(self): if self._live_count is None: from .live_count.client import LiveCountClient # noqa: E402 self._live_count = LiveCountClient(client_wrapper=self._client_wrapper) return self._live_count class AsyncAnalyticsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAnalyticsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._live_count: typing.Optional[AsyncLiveCountClient] = None @property def with_raw_response(self) -> AsyncRawAnalyticsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAnalyticsClient """ return self._raw_client @property def live_count(self): if self._live_count is None: from .live_count.client import AsyncLiveCountClient # noqa: E402 self._live_count = AsyncLiveCountClient(client_wrapper=self._client_wrapper) return self._live_count elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/live_count/000077500000000000000000000000001523660243400323775ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400344270ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/live_count# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/live_count/client.py000066400000000000000000000062761523660243400342420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_live_count_response import GetLiveCountResponse from .raw_client import AsyncRawLiveCountClient, RawLiveCountClient class LiveCountClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLiveCountClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLiveCountClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLiveCountClient """ return self._raw_client def get( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetLiveCountResponse: """ Get the live count of the ongoing conversations. Parameters ---------- agent_id : typing.Optional[str] The id of an agent to restrict the analytics to. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLiveCountResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.analytics.live_count.get( agent_id="agent_id", ) """ _response = self._raw_client.get(agent_id=agent_id, request_options=request_options) return _response.data class AsyncLiveCountClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLiveCountClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLiveCountClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLiveCountClient """ return self._raw_client async def get( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetLiveCountResponse: """ Get the live count of the ongoing conversations. Parameters ---------- agent_id : typing.Optional[str] The id of an agent to restrict the analytics to. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLiveCountResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.analytics.live_count.get( agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(agent_id=agent_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000124071523660243400350250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/live_count# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_live_count_response import GetLiveCountResponse from pydantic import ValidationError class RawLiveCountClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetLiveCountResponse]: """ Get the live count of the ongoing conversations. Parameters ---------- agent_id : typing.Optional[str] The id of an agent to restrict the analytics to. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetLiveCountResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/analytics/live-count", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLiveCountResponse, construct_type( type_=GetLiveCountResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLiveCountClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetLiveCountResponse]: """ Get the live count of the ongoing conversations. Parameters ---------- agent_id : typing.Optional[str] The id of an agent to restrict the analytics to. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetLiveCountResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/analytics/live-count", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLiveCountResponse, construct_type( type_=GetLiveCountResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/analytics/raw_client.py000066400000000000000000000006401523660243400327310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawAnalyticsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawAnalyticsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/batch_calls/000077500000000000000000000000001523660243400305005ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/batch_calls/__init__.py000066400000000000000000000001251523660243400326070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/batch_calls/client.py000066400000000000000000000455311523660243400323400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.batch_call_detailed_response import BatchCallDetailedResponse from ...types.batch_call_response import BatchCallResponse from ...types.batch_call_whats_app_params import BatchCallWhatsAppParams from ...types.outbound_call_recipient import OutboundCallRecipient from ...types.telephony_call_config import TelephonyCallConfig from ...types.workspace_batch_calls_response import WorkspaceBatchCallsResponse from .raw_client import AsyncRawBatchCallsClient, RawBatchCallsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class BatchCallsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawBatchCallsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawBatchCallsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawBatchCallsClient """ return self._raw_client def create( self, *, call_name: str, agent_id: str, recipients: typing.Sequence[OutboundCallRecipient], scheduled_time_unix: typing.Optional[int] = OMIT, agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, environment: typing.Optional[str] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, target_concurrency_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BatchCallResponse: """ Submit a batch call request to schedule calls for multiple recipients. Parameters ---------- call_name : str agent_id : str recipients : typing.Sequence[OutboundCallRecipient] scheduled_time_unix : typing.Optional[int] agent_phone_number_id : typing.Optional[str] whatsapp_params : typing.Optional[BatchCallWhatsAppParams] timezone : typing.Optional[str] branch_id : typing.Optional[str] environment : typing.Optional[str] telephony_call_config : typing.Optional[TelephonyCallConfig] target_concurrency_limit : typing.Optional[int] Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs, OutboundCallRecipient client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.create( call_name="call_name", agent_id="agent_id", recipients=[OutboundCallRecipient()], ) """ _response = self._raw_client.create( call_name=call_name, agent_id=agent_id, recipients=recipients, scheduled_time_unix=scheduled_time_unix, agent_phone_number_id=agent_phone_number_id, whatsapp_params=whatsapp_params, timezone=timezone, branch_id=branch_id, environment=environment, telephony_call_config=telephony_call_config, target_concurrency_limit=target_concurrency_limit, request_options=request_options, ) return _response.data def list( self, *, limit: typing.Optional[int] = None, last_doc: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceBatchCallsResponse: """ Get all batch calls for the current workspace. Parameters ---------- limit : typing.Optional[int] last_doc : typing.Optional[str] agent_id : typing.Optional[str] Filter batch calls to a single agent. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceBatchCallsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.list( limit=1, last_doc="last_doc", agent_id="agent_id", ) """ _response = self._raw_client.list( limit=limit, last_doc=last_doc, agent_id=agent_id, request_options=request_options ) return _response.data def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> BatchCallDetailedResponse: """ Get detailed information about a batch call including all recipients. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallDetailedResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.get( batch_id="batch_id", ) """ _response = self._raw_client.get(batch_id, request_options=request_options) return _response.data def delete(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Permanently delete a batch call and all recipient records. Conversations remain in history. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.delete( batch_id="batch_id", ) """ _response = self._raw_client.delete(batch_id, request_options=request_options) return _response.data def cancel(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchCallResponse: """ Cancel a running batch call and set all recipients to cancelled status. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.cancel( batch_id="batch_id", ) """ _response = self._raw_client.cancel(batch_id, request_options=request_options) return _response.data def retry(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchCallResponse: """ Retry a batch call, calling failed and no-response recipients again. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.retry( batch_id="batch_id", ) """ _response = self._raw_client.retry(batch_id, request_options=request_options) return _response.data def export( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Download all recipients and conversation results for a terminal batch call as CSV. Parameters ---------- batch_id : str 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. Returns ------- typing.Iterator[bytes] Batch call results CSV. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.batch_calls.export( batch_id="batch_id", ) """ with self._raw_client.export(batch_id, request_options=request_options) as r: yield from r.data class AsyncBatchCallsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawBatchCallsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawBatchCallsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawBatchCallsClient """ return self._raw_client async def create( self, *, call_name: str, agent_id: str, recipients: typing.Sequence[OutboundCallRecipient], scheduled_time_unix: typing.Optional[int] = OMIT, agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, environment: typing.Optional[str] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, target_concurrency_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BatchCallResponse: """ Submit a batch call request to schedule calls for multiple recipients. Parameters ---------- call_name : str agent_id : str recipients : typing.Sequence[OutboundCallRecipient] scheduled_time_unix : typing.Optional[int] agent_phone_number_id : typing.Optional[str] whatsapp_params : typing.Optional[BatchCallWhatsAppParams] timezone : typing.Optional[str] branch_id : typing.Optional[str] environment : typing.Optional[str] telephony_call_config : typing.Optional[TelephonyCallConfig] target_concurrency_limit : typing.Optional[int] Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, OutboundCallRecipient client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.create( call_name="call_name", agent_id="agent_id", recipients=[OutboundCallRecipient()], ) asyncio.run(main()) """ _response = await self._raw_client.create( call_name=call_name, agent_id=agent_id, recipients=recipients, scheduled_time_unix=scheduled_time_unix, agent_phone_number_id=agent_phone_number_id, whatsapp_params=whatsapp_params, timezone=timezone, branch_id=branch_id, environment=environment, telephony_call_config=telephony_call_config, target_concurrency_limit=target_concurrency_limit, request_options=request_options, ) return _response.data async def list( self, *, limit: typing.Optional[int] = None, last_doc: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceBatchCallsResponse: """ Get all batch calls for the current workspace. Parameters ---------- limit : typing.Optional[int] last_doc : typing.Optional[str] agent_id : typing.Optional[str] Filter batch calls to a single agent. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceBatchCallsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.list( limit=1, last_doc="last_doc", agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.list( limit=limit, last_doc=last_doc, agent_id=agent_id, request_options=request_options ) return _response.data async def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> BatchCallDetailedResponse: """ Get detailed information about a batch call including all recipients. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallDetailedResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.get( batch_id="batch_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(batch_id, request_options=request_options) return _response.data async def delete(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Permanently delete a batch call and all recipient records. Conversations remain in history. Parameters ---------- batch_id : str 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.conversational_ai.batch_calls.delete( batch_id="batch_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(batch_id, request_options=request_options) return _response.data async def cancel( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> BatchCallResponse: """ Cancel a running batch call and set all recipients to cancelled status. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.cancel( batch_id="batch_id", ) asyncio.run(main()) """ _response = await self._raw_client.cancel(batch_id, request_options=request_options) return _response.data async def retry( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> BatchCallResponse: """ Retry a batch call, calling failed and no-response recipients again. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- BatchCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.retry( batch_id="batch_id", ) asyncio.run(main()) """ _response = await self._raw_client.retry(batch_id, request_options=request_options) return _response.data async def export( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Download all recipients and conversation results for a terminal batch call as CSV. Parameters ---------- batch_id : str 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. Returns ------- typing.AsyncIterator[bytes] Batch call results CSV. Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.batch_calls.export( batch_id="batch_id", ) asyncio.run(main()) """ async with self._raw_client.export(batch_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/batch_calls/raw_client.py000066400000000000000000001104621523660243400332050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.batch_call_detailed_response import BatchCallDetailedResponse from ...types.batch_call_response import BatchCallResponse from ...types.batch_call_whats_app_params import BatchCallWhatsAppParams from ...types.outbound_call_recipient import OutboundCallRecipient from ...types.telephony_call_config import TelephonyCallConfig from ...types.workspace_batch_calls_response import WorkspaceBatchCallsResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawBatchCallsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, call_name: str, agent_id: str, recipients: typing.Sequence[OutboundCallRecipient], scheduled_time_unix: typing.Optional[int] = OMIT, agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, environment: typing.Optional[str] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, target_concurrency_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[BatchCallResponse]: """ Submit a batch call request to schedule calls for multiple recipients. Parameters ---------- call_name : str agent_id : str recipients : typing.Sequence[OutboundCallRecipient] scheduled_time_unix : typing.Optional[int] agent_phone_number_id : typing.Optional[str] whatsapp_params : typing.Optional[BatchCallWhatsAppParams] timezone : typing.Optional[str] branch_id : typing.Optional[str] environment : typing.Optional[str] telephony_call_config : typing.Optional[TelephonyCallConfig] target_concurrency_limit : typing.Optional[int] Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[BatchCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/batch-calling/submit", method="POST", json={ "call_name": call_name, "agent_id": agent_id, "recipients": convert_and_respect_annotation_metadata( object_=recipients, annotation=typing.Sequence[OutboundCallRecipient], direction="write" ), "scheduled_time_unix": scheduled_time_unix, "agent_phone_number_id": agent_phone_number_id, "whatsapp_params": convert_and_respect_annotation_metadata( object_=whatsapp_params, annotation=BatchCallWhatsAppParams, direction="write" ), "timezone": timezone, "branch_id": branch_id, "environment": environment, "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), "target_concurrency_limit": target_concurrency_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, limit: typing.Optional[int] = None, last_doc: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceBatchCallsResponse]: """ Get all batch calls for the current workspace. Parameters ---------- limit : typing.Optional[int] last_doc : typing.Optional[str] agent_id : typing.Optional[str] Filter batch calls to a single agent. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceBatchCallsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/batch-calling/workspace", method="GET", params={ "limit": limit, "last_doc": last_doc, "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceBatchCallsResponse, construct_type( type_=WorkspaceBatchCallsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[BatchCallDetailedResponse]: """ Get detailed information about a batch call including all recipients. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[BatchCallDetailedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallDetailedResponse, construct_type( type_=BatchCallDetailedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Permanently delete a batch call and all recipient records. Conversations remain in history. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def cancel( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[BatchCallResponse]: """ Cancel a running batch call and set all recipients to cancelled status. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[BatchCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/cancel", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def retry( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[BatchCallResponse]: """ Retry a batch call, calling failed and no-response recipients again. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[BatchCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/retry", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def export( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Download all recipients and conversation results for a terminal batch call as CSV. Parameters ---------- batch_id : str 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Batch call results CSV. """ with self._client_wrapper.httpx_client.stream( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/export", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawBatchCallsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, call_name: str, agent_id: str, recipients: typing.Sequence[OutboundCallRecipient], scheduled_time_unix: typing.Optional[int] = OMIT, agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, environment: typing.Optional[str] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, target_concurrency_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[BatchCallResponse]: """ Submit a batch call request to schedule calls for multiple recipients. Parameters ---------- call_name : str agent_id : str recipients : typing.Sequence[OutboundCallRecipient] scheduled_time_unix : typing.Optional[int] agent_phone_number_id : typing.Optional[str] whatsapp_params : typing.Optional[BatchCallWhatsAppParams] timezone : typing.Optional[str] branch_id : typing.Optional[str] environment : typing.Optional[str] telephony_call_config : typing.Optional[TelephonyCallConfig] target_concurrency_limit : typing.Optional[int] Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[BatchCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/batch-calling/submit", method="POST", json={ "call_name": call_name, "agent_id": agent_id, "recipients": convert_and_respect_annotation_metadata( object_=recipients, annotation=typing.Sequence[OutboundCallRecipient], direction="write" ), "scheduled_time_unix": scheduled_time_unix, "agent_phone_number_id": agent_phone_number_id, "whatsapp_params": convert_and_respect_annotation_metadata( object_=whatsapp_params, annotation=BatchCallWhatsAppParams, direction="write" ), "timezone": timezone, "branch_id": branch_id, "environment": environment, "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), "target_concurrency_limit": target_concurrency_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, limit: typing.Optional[int] = None, last_doc: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceBatchCallsResponse]: """ Get all batch calls for the current workspace. Parameters ---------- limit : typing.Optional[int] last_doc : typing.Optional[str] agent_id : typing.Optional[str] Filter batch calls to a single agent. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceBatchCallsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/batch-calling/workspace", method="GET", params={ "limit": limit, "last_doc": last_doc, "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceBatchCallsResponse, construct_type( type_=WorkspaceBatchCallsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[BatchCallDetailedResponse]: """ Get detailed information about a batch call including all recipients. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[BatchCallDetailedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallDetailedResponse, construct_type( type_=BatchCallDetailedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Permanently delete a batch call and all recipient records. Conversations remain in history. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def cancel( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[BatchCallResponse]: """ Cancel a running batch call and set all recipients to cancelled status. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[BatchCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/cancel", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def retry( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[BatchCallResponse]: """ Retry a batch call, calling failed and no-response recipients again. Parameters ---------- batch_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[BatchCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/retry", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( BatchCallResponse, construct_type( type_=BatchCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def export( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Download all recipients and conversation results for a terminal batch call as CSV. Parameters ---------- batch_id : str 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Batch call results CSV. """ async with self._client_wrapper.httpx_client.stream( f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}/export", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/client.py000066400000000000000000000640431523660243400301000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from ..types.rag_document_index_response_model import RagDocumentIndexResponseModel from ..types.rag_document_indexes_response_model import RagDocumentIndexesResponseModel from ..types.rag_index_overview_response_model import RagIndexOverviewResponseModel from .raw_client import AsyncRawConversationalAiClient, RawConversationalAiClient if typing.TYPE_CHECKING: from .agents.client import AgentsClient, AsyncAgentsClient from .analytics.client import AnalyticsClient, AsyncAnalyticsClient from .batch_calls.client import AsyncBatchCallsClient, BatchCallsClient from .conversations.client import AsyncConversationsClient, ConversationsClient from .dashboard.client import AsyncDashboardClient, DashboardClient from .exotel.client import AsyncExotelClient, ExotelClient from .knowledge_base.client import AsyncKnowledgeBaseClient, KnowledgeBaseClient from .llm.client import AsyncLlmClient, LlmClient from .llm_usage.client import AsyncLlmUsageClient, LlmUsageClient from .mcp_servers.client import AsyncMcpServersClient, McpServersClient from .phone_numbers.client import AsyncPhoneNumbersClient, PhoneNumbersClient from .secrets.client import AsyncSecretsClient, SecretsClient from .settings.client import AsyncSettingsClient, SettingsClient from .sip_trunk.client import AsyncSipTrunkClient, SipTrunkClient from .tests.client import AsyncTestsClient, TestsClient from .tools.client import AsyncToolsClient, ToolsClient from .twilio.client import AsyncTwilioClient, TwilioClient from .users.client import AsyncUsersClient, UsersClient from .whatsapp.client import AsyncWhatsappClient, WhatsappClient from .whatsapp_accounts.client import AsyncWhatsappAccountsClient, WhatsappAccountsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ConversationalAiClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawConversationalAiClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._conversations: typing.Optional[ConversationsClient] = None self._twilio: typing.Optional[TwilioClient] = None self._exotel: typing.Optional[ExotelClient] = None self._whatsapp: typing.Optional[WhatsappClient] = None self._agents: typing.Optional[AgentsClient] = None self._tests: typing.Optional[TestsClient] = None self._users: typing.Optional[UsersClient] = None self._phone_numbers: typing.Optional[PhoneNumbersClient] = None self._llm_usage: typing.Optional[LlmUsageClient] = None self._llm: typing.Optional[LlmClient] = None self._knowledge_base: typing.Optional[KnowledgeBaseClient] = None self._tools: typing.Optional[ToolsClient] = None self._settings: typing.Optional[SettingsClient] = None self._secrets: typing.Optional[SecretsClient] = None self._batch_calls: typing.Optional[BatchCallsClient] = None self._sip_trunk: typing.Optional[SipTrunkClient] = None self._mcp_servers: typing.Optional[McpServersClient] = None self._whatsapp_accounts: typing.Optional[WhatsappAccountsClient] = None self._analytics: typing.Optional[AnalyticsClient] = None self._dashboard: typing.Optional[DashboardClient] = None @property def with_raw_response(self) -> RawConversationalAiClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawConversationalAiClient """ return self._raw_client def add_to_knowledge_base( self, *, agent_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). Parameters ---------- agent_id : typing.Optional[str] name : typing.Optional[str] A custom, human-readable name for the document. url : typing.Optional[str] URL to a page of documentation that the agent will have access to in order to interact with users. file : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.add_to_knowledge_base( agent_id="agent_id", ) """ _response = self._raw_client.add_to_knowledge_base( agent_id=agent_id, name=name, url=url, file=file, request_options=request_options ) return _response.data def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> RagIndexOverviewResponseModel: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagIndexOverviewResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.rag_index_overview() """ _response = self._raw_client.rag_index_overview(request_options=request_options) return _response.data def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexesResponseModel: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexesResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.get_document_rag_indexes( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get_document_rag_indexes(documentation_id, request_options=request_options) return _response.data def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexResponseModel: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.delete_document_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", rag_index_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.delete_document_rag_index( documentation_id, rag_index_id, request_options=request_options ) return _response.data @property def conversations(self): if self._conversations is None: from .conversations.client import ConversationsClient # noqa: E402 self._conversations = ConversationsClient(client_wrapper=self._client_wrapper) return self._conversations @property def twilio(self): if self._twilio is None: from .twilio.client import TwilioClient # noqa: E402 self._twilio = TwilioClient(client_wrapper=self._client_wrapper) return self._twilio @property def exotel(self): if self._exotel is None: from .exotel.client import ExotelClient # noqa: E402 self._exotel = ExotelClient(client_wrapper=self._client_wrapper) return self._exotel @property def whatsapp(self): if self._whatsapp is None: from .whatsapp.client import WhatsappClient # noqa: E402 self._whatsapp = WhatsappClient(client_wrapper=self._client_wrapper) return self._whatsapp @property def agents(self): if self._agents is None: from .agents.client import AgentsClient # noqa: E402 self._agents = AgentsClient(client_wrapper=self._client_wrapper) return self._agents @property def tests(self): if self._tests is None: from .tests.client import TestsClient # noqa: E402 self._tests = TestsClient(client_wrapper=self._client_wrapper) return self._tests @property def users(self): if self._users is None: from .users.client import UsersClient # noqa: E402 self._users = UsersClient(client_wrapper=self._client_wrapper) return self._users @property def phone_numbers(self): if self._phone_numbers is None: from .phone_numbers.client import PhoneNumbersClient # noqa: E402 self._phone_numbers = PhoneNumbersClient(client_wrapper=self._client_wrapper) return self._phone_numbers @property def llm_usage(self): if self._llm_usage is None: from .llm_usage.client import LlmUsageClient # noqa: E402 self._llm_usage = LlmUsageClient(client_wrapper=self._client_wrapper) return self._llm_usage @property def llm(self): if self._llm is None: from .llm.client import LlmClient # noqa: E402 self._llm = LlmClient(client_wrapper=self._client_wrapper) return self._llm @property def knowledge_base(self): if self._knowledge_base is None: from .knowledge_base.client import KnowledgeBaseClient # noqa: E402 self._knowledge_base = KnowledgeBaseClient(client_wrapper=self._client_wrapper) return self._knowledge_base @property def tools(self): if self._tools is None: from .tools.client import ToolsClient # noqa: E402 self._tools = ToolsClient(client_wrapper=self._client_wrapper) return self._tools @property def settings(self): if self._settings is None: from .settings.client import SettingsClient # noqa: E402 self._settings = SettingsClient(client_wrapper=self._client_wrapper) return self._settings @property def secrets(self): if self._secrets is None: from .secrets.client import SecretsClient # noqa: E402 self._secrets = SecretsClient(client_wrapper=self._client_wrapper) return self._secrets @property def batch_calls(self): if self._batch_calls is None: from .batch_calls.client import BatchCallsClient # noqa: E402 self._batch_calls = BatchCallsClient(client_wrapper=self._client_wrapper) return self._batch_calls @property def sip_trunk(self): if self._sip_trunk is None: from .sip_trunk.client import SipTrunkClient # noqa: E402 self._sip_trunk = SipTrunkClient(client_wrapper=self._client_wrapper) return self._sip_trunk @property def mcp_servers(self): if self._mcp_servers is None: from .mcp_servers.client import McpServersClient # noqa: E402 self._mcp_servers = McpServersClient(client_wrapper=self._client_wrapper) return self._mcp_servers @property def whatsapp_accounts(self): if self._whatsapp_accounts is None: from .whatsapp_accounts.client import WhatsappAccountsClient # noqa: E402 self._whatsapp_accounts = WhatsappAccountsClient(client_wrapper=self._client_wrapper) return self._whatsapp_accounts @property def analytics(self): if self._analytics is None: from .analytics.client import AnalyticsClient # noqa: E402 self._analytics = AnalyticsClient(client_wrapper=self._client_wrapper) return self._analytics @property def dashboard(self): if self._dashboard is None: from .dashboard.client import DashboardClient # noqa: E402 self._dashboard = DashboardClient(client_wrapper=self._client_wrapper) return self._dashboard class AsyncConversationalAiClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawConversationalAiClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._conversations: typing.Optional[AsyncConversationsClient] = None self._twilio: typing.Optional[AsyncTwilioClient] = None self._exotel: typing.Optional[AsyncExotelClient] = None self._whatsapp: typing.Optional[AsyncWhatsappClient] = None self._agents: typing.Optional[AsyncAgentsClient] = None self._tests: typing.Optional[AsyncTestsClient] = None self._users: typing.Optional[AsyncUsersClient] = None self._phone_numbers: typing.Optional[AsyncPhoneNumbersClient] = None self._llm_usage: typing.Optional[AsyncLlmUsageClient] = None self._llm: typing.Optional[AsyncLlmClient] = None self._knowledge_base: typing.Optional[AsyncKnowledgeBaseClient] = None self._tools: typing.Optional[AsyncToolsClient] = None self._settings: typing.Optional[AsyncSettingsClient] = None self._secrets: typing.Optional[AsyncSecretsClient] = None self._batch_calls: typing.Optional[AsyncBatchCallsClient] = None self._sip_trunk: typing.Optional[AsyncSipTrunkClient] = None self._mcp_servers: typing.Optional[AsyncMcpServersClient] = None self._whatsapp_accounts: typing.Optional[AsyncWhatsappAccountsClient] = None self._analytics: typing.Optional[AsyncAnalyticsClient] = None self._dashboard: typing.Optional[AsyncDashboardClient] = None @property def with_raw_response(self) -> AsyncRawConversationalAiClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawConversationalAiClient """ return self._raw_client async def add_to_knowledge_base( self, *, agent_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). Parameters ---------- agent_id : typing.Optional[str] name : typing.Optional[str] A custom, human-readable name for the document. url : typing.Optional[str] URL to a page of documentation that the agent will have access to in order to interact with users. file : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.add_to_knowledge_base( agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.add_to_knowledge_base( agent_id=agent_id, name=name, url=url, file=file, request_options=request_options ) return _response.data async def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> RagIndexOverviewResponseModel: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagIndexOverviewResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.rag_index_overview() asyncio.run(main()) """ _response = await self._raw_client.rag_index_overview(request_options=request_options) return _response.data async def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexesResponseModel: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexesResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.get_document_rag_indexes( documentation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get_document_rag_indexes(documentation_id, request_options=request_options) return _response.data async def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexResponseModel: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.delete_document_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", rag_index_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.delete_document_rag_index( documentation_id, rag_index_id, request_options=request_options ) return _response.data @property def conversations(self): if self._conversations is None: from .conversations.client import AsyncConversationsClient # noqa: E402 self._conversations = AsyncConversationsClient(client_wrapper=self._client_wrapper) return self._conversations @property def twilio(self): if self._twilio is None: from .twilio.client import AsyncTwilioClient # noqa: E402 self._twilio = AsyncTwilioClient(client_wrapper=self._client_wrapper) return self._twilio @property def exotel(self): if self._exotel is None: from .exotel.client import AsyncExotelClient # noqa: E402 self._exotel = AsyncExotelClient(client_wrapper=self._client_wrapper) return self._exotel @property def whatsapp(self): if self._whatsapp is None: from .whatsapp.client import AsyncWhatsappClient # noqa: E402 self._whatsapp = AsyncWhatsappClient(client_wrapper=self._client_wrapper) return self._whatsapp @property def agents(self): if self._agents is None: from .agents.client import AsyncAgentsClient # noqa: E402 self._agents = AsyncAgentsClient(client_wrapper=self._client_wrapper) return self._agents @property def tests(self): if self._tests is None: from .tests.client import AsyncTestsClient # noqa: E402 self._tests = AsyncTestsClient(client_wrapper=self._client_wrapper) return self._tests @property def users(self): if self._users is None: from .users.client import AsyncUsersClient # noqa: E402 self._users = AsyncUsersClient(client_wrapper=self._client_wrapper) return self._users @property def phone_numbers(self): if self._phone_numbers is None: from .phone_numbers.client import AsyncPhoneNumbersClient # noqa: E402 self._phone_numbers = AsyncPhoneNumbersClient(client_wrapper=self._client_wrapper) return self._phone_numbers @property def llm_usage(self): if self._llm_usage is None: from .llm_usage.client import AsyncLlmUsageClient # noqa: E402 self._llm_usage = AsyncLlmUsageClient(client_wrapper=self._client_wrapper) return self._llm_usage @property def llm(self): if self._llm is None: from .llm.client import AsyncLlmClient # noqa: E402 self._llm = AsyncLlmClient(client_wrapper=self._client_wrapper) return self._llm @property def knowledge_base(self): if self._knowledge_base is None: from .knowledge_base.client import AsyncKnowledgeBaseClient # noqa: E402 self._knowledge_base = AsyncKnowledgeBaseClient(client_wrapper=self._client_wrapper) return self._knowledge_base @property def tools(self): if self._tools is None: from .tools.client import AsyncToolsClient # noqa: E402 self._tools = AsyncToolsClient(client_wrapper=self._client_wrapper) return self._tools @property def settings(self): if self._settings is None: from .settings.client import AsyncSettingsClient # noqa: E402 self._settings = AsyncSettingsClient(client_wrapper=self._client_wrapper) return self._settings @property def secrets(self): if self._secrets is None: from .secrets.client import AsyncSecretsClient # noqa: E402 self._secrets = AsyncSecretsClient(client_wrapper=self._client_wrapper) return self._secrets @property def batch_calls(self): if self._batch_calls is None: from .batch_calls.client import AsyncBatchCallsClient # noqa: E402 self._batch_calls = AsyncBatchCallsClient(client_wrapper=self._client_wrapper) return self._batch_calls @property def sip_trunk(self): if self._sip_trunk is None: from .sip_trunk.client import AsyncSipTrunkClient # noqa: E402 self._sip_trunk = AsyncSipTrunkClient(client_wrapper=self._client_wrapper) return self._sip_trunk @property def mcp_servers(self): if self._mcp_servers is None: from .mcp_servers.client import AsyncMcpServersClient # noqa: E402 self._mcp_servers = AsyncMcpServersClient(client_wrapper=self._client_wrapper) return self._mcp_servers @property def whatsapp_accounts(self): if self._whatsapp_accounts is None: from .whatsapp_accounts.client import AsyncWhatsappAccountsClient # noqa: E402 self._whatsapp_accounts = AsyncWhatsappAccountsClient(client_wrapper=self._client_wrapper) return self._whatsapp_accounts @property def analytics(self): if self._analytics is None: from .analytics.client import AsyncAnalyticsClient # noqa: E402 self._analytics = AsyncAnalyticsClient(client_wrapper=self._client_wrapper) return self._analytics @property def dashboard(self): if self._dashboard is None: from .dashboard.client import AsyncDashboardClient # noqa: E402 self._dashboard = AsyncDashboardClient(client_wrapper=self._client_wrapper) return self._dashboard elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversation.py000066400000000000000000001500041523660243400313250ustar00rootroot00000000000000from abc import ABC, abstractmethod import asyncio import base64 from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass from enum import Enum import json import logging import threading from typing import Any, Awaitable, Callable, Dict, List, Literal, Optional, Tuple, Union import urllib.parse import websockets from websockets.exceptions import ConnectionClosedOK from websockets.sync.client import Connection, connect from ..base_client import BaseElevenLabs from ..url_utils import build_ws_url from ..version import __version__ logger = logging.getLogger(__name__) class ClientToOrchestratorEvent(str, Enum): """Event types that can be sent from client to orchestrator.""" # Response to a ping request. PONG = "pong" CLIENT_TOOL_RESULT = "client_tool_result" CONVERSATION_INITIATION_CLIENT_DATA = "conversation_initiation_client_data" FEEDBACK = "feedback" # Non-interrupting content that is sent to the server to update the conversation state. CONTEXTUAL_UPDATE = "contextual_update" # User text message. USER_MESSAGE = "user_message" USER_ACTIVITY = "user_activity" MULTIMODAL_MESSAGE = "multimodal_message" class AgentChatResponsePartType(str, Enum): START = "start" DELTA = "delta" STOP = "stop" class UserMessageClientToOrchestratorEvent: """Event for sending user text messages.""" def __init__(self, text: Optional[str] = None): self.type: Literal[ClientToOrchestratorEvent.USER_MESSAGE] = ClientToOrchestratorEvent.USER_MESSAGE self.text = text def to_dict(self) -> dict: return {"type": self.type, "text": self.text} class UserActivityClientToOrchestratorEvent: """Event for registering user activity (ping to prevent timeout).""" def __init__(self) -> None: self.type: Literal[ClientToOrchestratorEvent.USER_ACTIVITY] = ClientToOrchestratorEvent.USER_ACTIVITY def to_dict(self) -> dict: return {"type": self.type} class ContextualUpdateClientToOrchestratorEvent: """Event for sending non-interrupting contextual updates to the conversation state.""" def __init__(self, text: str): self.type: Literal[ClientToOrchestratorEvent.CONTEXTUAL_UPDATE] = ClientToOrchestratorEvent.CONTEXTUAL_UPDATE self.text = text def to_dict(self) -> dict: return {"type": self.type, "text": self.text} class MultimodalMessageFile: """File component of a multimodal message.""" def __init__(self, file_id: str): self.type: Literal["file_input"] = "file_input" self.file_id = file_id def to_dict(self) -> dict: return {"type": self.type, "file_id": self.file_id} class MultimodalMessageClientToOrchestratorEvent: """Event for sending multimodal messages combining text and a file reference.""" def __init__( self, text: Optional[str] = None, file_id: Optional[str] = None, ): self.type: Literal[ClientToOrchestratorEvent.MULTIMODAL_MESSAGE] = ClientToOrchestratorEvent.MULTIMODAL_MESSAGE self.text = text self.file_id = file_id def to_dict(self) -> dict: result: Dict[str, Any] = {"type": self.type} if self.text: result["text"] = UserMessageClientToOrchestratorEvent(text=self.text).to_dict() if self.file_id: result["file"] = MultimodalMessageFile(file_id=self.file_id).to_dict() return result class AudioInterface(ABC): """AudioInterface provides an abstraction for handling audio input and output.""" @abstractmethod def start(self, input_callback: Callable[[bytes], None]): """Starts the audio interface. Called one time before the conversation starts. The `input_callback` should be called regularly with input audio chunks from the user. The audio should be in 16-bit PCM mono format at 16kHz. Recommended chunk size is 4000 samples (250 milliseconds). """ pass @abstractmethod def stop(self): """Stops the audio interface. Called one time after the conversation ends. Should clean up any resources used by the audio interface and stop any audio streams. Do not call the `input_callback` from `start` after this method is called. """ pass @abstractmethod def output(self, audio: bytes): """Output audio to the user. The `audio` input is in 16-bit PCM mono format at 16kHz. Implementations can choose to do additional buffering. This method should return quickly and not block the calling thread. """ pass @abstractmethod def interrupt(self): """Interruption signal to stop any audio output. User has interrupted the agent and all previosly buffered audio output should be stopped. """ pass class AsyncAudioInterface(ABC): """AsyncAudioInterface provides an async abstraction for handling audio input and output.""" @abstractmethod async def start(self, input_callback: Callable[[bytes], Awaitable[None]]): """Starts the audio interface. Called one time before the conversation starts. The `input_callback` should be called regularly with input audio chunks from the user. The audio should be in 16-bit PCM mono format at 16kHz. Recommended chunk size is 4000 samples (250 milliseconds). """ pass @abstractmethod async def stop(self): """Stops the audio interface. Called one time after the conversation ends. Should clean up any resources used by the audio interface and stop any audio streams. Do not call the `input_callback` from `start` after this method is called. """ pass @abstractmethod async def output(self, audio: bytes): """Output audio to the user. The `audio` input is in 16-bit PCM mono format at 16kHz. Implementations can choose to do additional buffering. This method should return quickly and not block the calling thread. """ pass @abstractmethod async def interrupt(self): """Interruption signal to stop any audio output. User has interrupted the agent and all previosly buffered audio output should be stopped. """ pass class ClientTools: """Handles registration and execution of client-side tools that can be called by the agent. Supports both synchronous and asynchronous tools running in a dedicated event loop, ensuring non-blocking operation of the main conversation thread. Args: loop: Optional custom asyncio event loop to use for tool execution. If not provided, a new event loop will be created and run in a separate thread. Using a custom loop prevents "different event loop" runtime errors and allows for better context propagation and resource management. """ def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None: self.tools: Dict[str, Tuple[Union[Callable[[dict], Any], Callable[[dict], Awaitable[Any]]], bool]] = {} self.lock = threading.Lock() self._custom_loop = loop self._loop = None self._thread = None self._running = threading.Event() self.thread_pool = ThreadPoolExecutor() def start(self): """Start the event loop in a separate thread for handling async operations.""" if self._running.is_set(): return if self._custom_loop is not None: # Use the provided custom event loop self._loop = self._custom_loop self._running.set() else: # Create and run our own event loop in a separate thread def run_event_loop(): self._loop = asyncio.new_event_loop() asyncio.set_event_loop(self._loop) self._running.set() try: self._loop.run_forever() finally: self._running.clear() self._loop.close() self._loop = None self._thread = threading.Thread(target=run_event_loop, daemon=True, name="ClientTools-EventLoop") self._thread.start() # Wait for loop to be ready self._running.wait() def stop(self): """Gracefully stop the event loop and clean up resources.""" if self._loop and self._running.is_set(): if self._custom_loop is not None: # For custom loops, we don't stop the loop itself, just clear our running flag self._running.clear() else: # For our own loop, stop it and join the thread self._loop.call_soon_threadsafe(self._loop.stop) if self._thread: self._thread.join() self.thread_pool.shutdown(wait=False) def register( self, tool_name: str, handler: Union[Callable[[dict], Any], Callable[[dict], Awaitable[Any]]], is_async: bool = False, ) -> None: """Register a new tool that can be called by the AI agent. Args: tool_name: Unique identifier for the tool handler: Function that implements the tool's logic is_async: Whether the handler is an async function """ with self.lock: if not callable(handler): raise ValueError("Handler must be callable") if tool_name in self.tools: raise ValueError(f"Tool '{tool_name}' is already registered") self.tools[tool_name] = (handler, is_async) async def handle(self, tool_name: str, parameters: dict) -> Any: """Execute a registered tool with the given parameters. Returns the result of the tool execution. """ with self.lock: if tool_name not in self.tools: raise ValueError(f"Tool '{tool_name}' is not registered") handler, is_async = self.tools[tool_name] if is_async: return await handler(parameters) else: return await asyncio.get_event_loop().run_in_executor(self.thread_pool, handler, parameters) def execute_tool(self, tool_name: str, parameters: dict, callback: Callable[[dict], None]): """Execute a tool and send its result via the provided callback. This method is non-blocking and handles both sync and async tools. """ if not self._running.is_set(): raise RuntimeError("ClientTools event loop is not running") if self._loop is None: raise RuntimeError("Event loop is not available") async def _execute_and_callback(): try: result = await self.handle(tool_name, parameters) response = { "type": "client_tool_result", "tool_call_id": parameters.get("tool_call_id"), "result": result or f"Client tool: {tool_name} called successfully.", "is_error": False, } except Exception as e: response = { "type": "client_tool_result", "tool_call_id": parameters.get("tool_call_id"), "result": str(e), "is_error": True, } callback(response) self._schedule_coroutine(_execute_and_callback()) def _schedule_coroutine(self, coro): """Schedule a coroutine on the appropriate event loop.""" if self._custom_loop is not None: return self._loop.create_task(coro) else: return asyncio.run_coroutine_threadsafe(coro, self._loop) class ConversationInitiationData: """Configuration options for the Conversation.""" def __init__( self, extra_body: Optional[dict] = None, conversation_config_override: Optional[dict] = None, dynamic_variables: Optional[dict] = None, user_id: Optional[str] = None, ): self.extra_body = extra_body or {} self.conversation_config_override = conversation_config_override or {} self.dynamic_variables = dynamic_variables or {} self.user_id = user_id @dataclass class PostCallWebhookConfig: """Post-call webhook destination for on-prem deployments. When ``hmac_secret`` is set, each delivery carries an ``ElevenLabs-Signature`` header: ``t=,v0=``. The orchestrator enforces a 16-character minimum on the secret and rejects the connection at setup otherwise. """ url: str hmac_secret: Optional[str] = None def to_dict(self) -> dict: message: dict = {"url": self.url} if self.hmac_secret is not None: message["hmac_secret"] = self.hmac_secret return message class OnPremInitiationData: """Configuration options for the Conversation in on-prem mode.""" def __init__( self, on_prem_conversation_url: str, post_call_transcription_webhook_url: Optional[str] = None, post_call_audio_webhook_url: Optional[str] = None, agent_config_dict: Optional[dict] = None, override_agent_config_list: Optional[List[dict]] = None, tools_config_list: Optional[List[dict]] = None, prompt_knowledge_base: Optional[List[str]] = None, post_call_transcription_webhook: Optional[PostCallWebhookConfig] = None, post_call_audio_webhook: Optional[PostCallWebhookConfig] = None, ): # Fail early: the server rejects the connection when both forms are set. # An empty legacy URL counts as unset server-side, hence truthiness here. if post_call_transcription_webhook is not None and post_call_transcription_webhook_url: raise ValueError( "Set either post_call_transcription_webhook or post_call_transcription_webhook_url, not both." ) if post_call_audio_webhook is not None and post_call_audio_webhook_url: raise ValueError( "Set either post_call_audio_webhook or post_call_audio_webhook_url, not both." ) self.on_prem_conversation_url = on_prem_conversation_url self.post_call_transcription_webhook_url = post_call_transcription_webhook_url self.post_call_audio_webhook_url = post_call_audio_webhook_url self.agent_config_dict = agent_config_dict self.override_agent_config_list = override_agent_config_list self.tools_config_list = tools_config_list self.prompt_knowledge_base = prompt_knowledge_base self.post_call_transcription_webhook = post_call_transcription_webhook self.post_call_audio_webhook = post_call_audio_webhook @dataclass class AudioEventAlignment: """Audio alignment data containing character-level timing information. d""" chars: List[str] char_start_times_ms: List[int] char_durations_ms: List[int] class BaseConversation: """Base class for conversation implementations with shared parameters and logic.""" def __init__( self, client: BaseElevenLabs, agent_id: str, user_id: Optional[str] = None, *, requires_auth: bool, audio_interface=None, config: Optional[ConversationInitiationData] = None, client_tools: Optional[ClientTools] = None, on_prem_config: Optional[OnPremInitiationData] = None, environment: Optional[str] = None, ): self.client = client self.agent_id = agent_id self.user_id = user_id self.requires_auth = requires_auth # Copy the config so we never mutate the caller's original object src = config or ConversationInitiationData() self.config = ConversationInitiationData( extra_body=dict(src.extra_body), conversation_config_override=dict(src.conversation_config_override), dynamic_variables=dict(src.dynamic_variables), user_id=src.user_id, ) if audio_interface is None: self.config.conversation_config_override.setdefault("text_only", True) self.client_tools = client_tools or ClientTools() self.on_prem_config = on_prem_config self.environment = environment self.client_tools.start() self._conversation_id = None self._last_interrupt_id = 0 def _get_wss_url(self): if self.on_prem_config: return self.on_prem_config.on_prem_conversation_url base_http_url = self.client._client_wrapper.get_base_url() params = [ ("agent_id", self.agent_id), ("source", "python_sdk"), ("version", __version__), ] if self.environment: params.append(("environment", self.environment)) return build_ws_url(base_http_url, ["v1", "convai", "conversation"], params) def _get_signed_url(self): response = self.client.conversational_ai.conversations.get_signed_url( agent_id=self.agent_id, environment=self.environment, ) signed_url = response.signed_url # Append source and version query parameters to the signed URL parsed = urllib.parse.urlparse(signed_url) existing_params = urllib.parse.parse_qsl(parsed.query, keep_blank_values=True) existing_params.extend([("source", "python_sdk"), ("version", __version__)]) return urllib.parse.urlunparse(parsed._replace(query=urllib.parse.urlencode(existing_params, quote_via=urllib.parse.quote))) def _create_on_prem_initiation_message(self): message = { "type": "enclave_setup_config", "agent_config_dict": self.on_prem_config.agent_config_dict, "override_agent_config_list": self.on_prem_config.override_agent_config_list, "tools_config_list": self.on_prem_config.tools_config_list, "post_call_transcription_webhook_url": self.on_prem_config.post_call_transcription_webhook_url, "post_call_audio_webhook_url": self.on_prem_config.post_call_audio_webhook_url, "prompt_knowledge_base": self.on_prem_config.prompt_knowledge_base, } if self.on_prem_config.post_call_transcription_webhook is not None: message["post_call_transcription_webhook"] = ( self.on_prem_config.post_call_transcription_webhook.to_dict() ) if self.on_prem_config.post_call_audio_webhook is not None: message["post_call_audio_webhook"] = ( self.on_prem_config.post_call_audio_webhook.to_dict() ) return json.dumps(message) def _create_initiation_message(self): return json.dumps( { "type": "conversation_initiation_client_data", "custom_llm_extra_body": self.config.extra_body, "conversation_config_override": self.config.conversation_config_override, "dynamic_variables": self.config.dynamic_variables, "source_info": { "source": "python_sdk", "version": __version__, }, **({"user_id": self.user_id} if self.user_id else {}), } ) def _handle_message_core(self, message, message_handler): """Core message handling logic shared between sync and async implementations. Args: message: The parsed message dictionary message_handler: Handler object with methods for different operations """ if message["type"] == "conversation_initiation_metadata": event = message["conversation_initiation_metadata_event"] assert self._conversation_id is None self._conversation_id = event["conversation_id"] elif message["type"] == "audio": event = message["audio_event"] if int(event["event_id"]) <= self._last_interrupt_id: return audio = base64.b64decode(event["audio_base_64"]) message_handler.handle_audio_output(audio) if message_handler.callback_audio_alignment and "alignment" in event: alignment_data = event["alignment"] alignment = AudioEventAlignment( chars=alignment_data.get("chars", []), char_start_times_ms=alignment_data.get("char_start_times_ms", []), char_durations_ms=alignment_data.get("char_durations_ms", []), ) message_handler.handle_audio_alignment(alignment) elif message["type"] == "agent_response": if message_handler.callback_agent_response: event = message["agent_response_event"] message_handler.handle_agent_response(event["agent_response"].strip()) elif message["type"] == "agent_chat_response_part": if message_handler.callback_agent_chat_response_part: event = message.get("text_response_part", {}) text = event.get("text", "") part_type_str = event.get("type", "delta") try: part_type = AgentChatResponsePartType(part_type_str) except ValueError: part_type = AgentChatResponsePartType.DELTA message_handler.handle_agent_chat_response_part(text, part_type) elif message["type"] == "agent_response_correction": if message_handler.callback_agent_response_correction: event = message["agent_response_correction_event"] message_handler.handle_agent_response_correction( event["original_agent_response"].strip(), event["corrected_agent_response"].strip() ) elif message["type"] == "user_transcript": if message_handler.callback_user_transcript: event = message["user_transcription_event"] message_handler.handle_user_transcript(event["user_transcript"].strip()) elif message["type"] == "interruption": event = message["interruption_event"] self._last_interrupt_id = int(event["event_id"]) message_handler.handle_interruption() elif message["type"] == "ping": event = message["ping_event"] message_handler.handle_ping(event) if message_handler.callback_latency_measurement and event["ping_ms"]: message_handler.handle_latency_measurement(int(event["ping_ms"])) elif message["type"] == "client_tool_call": tool_call = message.get("client_tool_call", {}) tool_name = tool_call.get("tool_name") parameters = {"tool_call_id": tool_call["tool_call_id"], **tool_call.get("parameters", {})} message_handler.handle_client_tool_call(tool_name, parameters) else: pass # Ignore all other message types. async def _handle_message_core_async(self, message, message_handler): """Async wrapper for core message handling logic.""" if message["type"] == "conversation_initiation_metadata": event = message["conversation_initiation_metadata_event"] assert self._conversation_id is None self._conversation_id = event["conversation_id"] elif message["type"] == "audio": event = message["audio_event"] if int(event["event_id"]) <= self._last_interrupt_id: return audio = base64.b64decode(event["audio_base_64"]) await message_handler.handle_audio_output(audio) if message_handler.callback_audio_alignment and "alignment" in event: alignment_data = event["alignment"] alignment = AudioEventAlignment( chars=alignment_data.get("chars", []), char_start_times_ms=alignment_data.get("char_start_times_ms", []), char_durations_ms=alignment_data.get("char_durations_ms", []), ) await message_handler.handle_audio_alignment(alignment) elif message["type"] == "agent_response": if message_handler.callback_agent_response: event = message["agent_response_event"] await message_handler.handle_agent_response(event["agent_response"].strip()) elif message["type"] == "agent_chat_response_part": if message_handler.callback_agent_chat_response_part: event = message.get("text_response_part", {}) text = event.get("text", "") part_type_str = event.get("type", "delta") try: part_type = AgentChatResponsePartType(part_type_str) except ValueError: part_type = AgentChatResponsePartType.DELTA await message_handler.handle_agent_chat_response_part(text, part_type) elif message["type"] == "agent_response_correction": if message_handler.callback_agent_response_correction: event = message["agent_response_correction_event"] await message_handler.handle_agent_response_correction( event["original_agent_response"].strip(), event["corrected_agent_response"].strip() ) elif message["type"] == "user_transcript": if message_handler.callback_user_transcript: event = message["user_transcription_event"] await message_handler.handle_user_transcript(event["user_transcript"].strip()) elif message["type"] == "interruption": event = message["interruption_event"] self._last_interrupt_id = int(event["event_id"]) await message_handler.handle_interruption() elif message["type"] == "ping": event = message["ping_event"] await message_handler.handle_ping(event) if message_handler.callback_latency_measurement and event["ping_ms"]: await message_handler.handle_latency_measurement(int(event["ping_ms"])) elif message["type"] == "client_tool_call": tool_call = message.get("client_tool_call", {}) tool_name = tool_call.get("tool_name") parameters = {"tool_call_id": tool_call["tool_call_id"], **tool_call.get("parameters", {})} message_handler.handle_client_tool_call(tool_name, parameters) else: pass # Ignore all other message types. class Conversation(BaseConversation): audio_interface: Optional[AudioInterface] callback_agent_response: Optional[Callable[[str], None]] callback_agent_response_correction: Optional[Callable[[str, str], None]] callback_agent_chat_response_part: Optional[Callable[[str, AgentChatResponsePartType], None]] callback_user_transcript: Optional[Callable[[str], None]] callback_latency_measurement: Optional[Callable[[int], None]] callback_audio_alignment: Optional[Callable[[AudioEventAlignment], None]] callback_end_session: Optional[Callable] _thread: Optional[threading.Thread] _should_stop: threading.Event _ws: Optional[Connection] def __init__( self, client: BaseElevenLabs, agent_id: str, user_id: Optional[str] = None, *, requires_auth: bool, audio_interface: Optional[AudioInterface] = None, config: Optional[ConversationInitiationData] = None, client_tools: Optional[ClientTools] = None, callback_agent_response: Optional[Callable[[str], None]] = None, callback_agent_response_correction: Optional[Callable[[str, str], None]] = None, callback_agent_chat_response_part: Optional[Callable[[str, AgentChatResponsePartType], None]] = None, callback_user_transcript: Optional[Callable[[str], None]] = None, callback_latency_measurement: Optional[Callable[[int], None]] = None, callback_audio_alignment: Optional[Callable[[AudioEventAlignment], None]] = None, callback_end_session: Optional[Callable] = None, on_prem_config: Optional[OnPremInitiationData] = None, environment: Optional[str] = None, ): """Conversational AI session. BETA: This API is subject to change without regard to backwards compatibility. Args: client: The ElevenLabs client to use for the conversation. agent_id: The ID of the agent to converse with. user_id: The ID of the user conversing with the agent. requires_auth: Whether the agent requires authentication. audio_interface: The audio interface to use for input and output. Can be omitted for text-only (chat) mode. client_tools: The client tools to use for the conversation. callback_agent_response: Callback for agent responses. callback_agent_response_correction: Callback for agent response corrections. First argument is the original response (previously given to callback_agent_response), second argument is the corrected response. callback_agent_chat_response_part: Callback for streaming text response chunks. First argument is the text chunk, second argument is the type (START, DELTA, STOP). callback_user_transcript: Callback for user transcripts. callback_latency_measurement: Callback for latency measurements (in milliseconds). callback_audio_alignment: Callback for audio alignment data with character-level timing. environment: The environment to use. Defaults to "production" on the server. """ super().__init__( client=client, agent_id=agent_id, user_id=user_id, requires_auth=requires_auth, audio_interface=audio_interface, config=config, client_tools=client_tools, on_prem_config=on_prem_config, environment=environment, ) self.audio_interface = audio_interface self.callback_agent_response = callback_agent_response self.callback_agent_response_correction = callback_agent_response_correction self.callback_agent_chat_response_part = callback_agent_chat_response_part self.callback_user_transcript = callback_user_transcript self.callback_latency_measurement = callback_latency_measurement self.callback_audio_alignment = callback_audio_alignment self.callback_end_session = callback_end_session self._thread = None self._ws: Optional[Connection] = None self._should_stop = threading.Event() def start_session(self): """Starts the conversation session. Will run in background thread until `end_session` is called. """ ws_url = self._get_signed_url() if self.requires_auth else self._get_wss_url() self._thread = threading.Thread(target=self._run, args=(ws_url,)) self._thread.start() def end_session(self): """Ends the conversation session and cleans up resources.""" if self.audio_interface is not None: self.audio_interface.stop() self.client_tools.stop() self._ws = None self._should_stop.set() if self.callback_end_session: self.callback_end_session() def wait_for_session_end(self) -> Optional[str]: """Waits for the conversation session to end. You must call `end_session` before calling this method, otherwise it will block. Returns the conversation ID, if available. """ if not self._thread: raise RuntimeError("Session not started.") self._thread.join() return self._conversation_id def send_user_message(self, text: str): """Send a text message from the user to the agent. Args: text: The text message to send to the agent. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = UserMessageClientToOrchestratorEvent(text=text) try: self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending user message: {e}") raise def register_user_activity(self): """Register user activity to prevent session timeout. This sends a ping to the orchestrator to reset the timeout timer. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = UserActivityClientToOrchestratorEvent() try: self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error registering user activity: {e}") raise def send_contextual_update(self, text: str): """Send a contextual update to the conversation. Contextual updates are non-interrupting content that is sent to the server to update the conversation state without directly prompting the agent. Args: content: The contextual information to send to the conversation. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = ContextualUpdateClientToOrchestratorEvent(text=text) try: self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending contextual update: {e}") raise def send_multimodal_message( self, text: Optional[str] = None, file_id: Optional[str] = None, ): """Send a multimodal message combining text and/or a file reference. Args: text: Optional text message to include. file_id: Optional file ID to include (must be a previously uploaded file). Raises: RuntimeError: If the session is not active or websocket is not connected. ValueError: If neither text nor file_id is provided. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") if not text and not file_id: raise ValueError("At least one of text or file_id must be provided.") event = MultimodalMessageClientToOrchestratorEvent(text=text, file_id=file_id) try: self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending multimodal message: {e}") raise def _run(self, ws_url: str): with connect(ws_url, max_size=16 * 1024 * 1024) as ws: self._ws = ws if self.on_prem_config: ws.send(self._create_on_prem_initiation_message()) ws.send(self._create_initiation_message()) self._ws = ws def input_callback(audio): try: ws.send( json.dumps( { "user_audio_chunk": base64.b64encode(audio).decode(), } ) ) except ConnectionClosedOK: self.end_session() except Exception as e: logger.error(f"Error sending user audio chunk: {e}") self.end_session() if self.audio_interface is not None: self.audio_interface.start(input_callback) while not self._should_stop.is_set(): try: message = json.loads(ws.recv(timeout=0.5)) if self._should_stop.is_set(): return self._handle_message(message, ws) except ConnectionClosedOK as e: self.end_session() except TimeoutError: pass except Exception as e: logger.error(f"Error receiving message: {e}") self.end_session() self._ws = None def _handle_message(self, message, ws): class SyncMessageHandler: def __init__(self, conversation, ws): self.conversation = conversation self.ws = ws self.callback_agent_response = conversation.callback_agent_response self.callback_agent_response_correction = conversation.callback_agent_response_correction self.callback_agent_chat_response_part = conversation.callback_agent_chat_response_part self.callback_user_transcript = conversation.callback_user_transcript self.callback_latency_measurement = conversation.callback_latency_measurement self.callback_audio_alignment = conversation.callback_audio_alignment def handle_audio_output(self, audio): if self.conversation.audio_interface is not None: self.conversation.audio_interface.output(audio) def handle_audio_alignment(self, alignment): self.conversation.callback_audio_alignment(alignment) def handle_agent_response(self, response): self.conversation.callback_agent_response(response) def handle_agent_response_correction(self, original, corrected): self.conversation.callback_agent_response_correction(original, corrected) def handle_agent_chat_response_part(self, text, part_type): self.conversation.callback_agent_chat_response_part(text, part_type) def handle_user_transcript(self, transcript): self.conversation.callback_user_transcript(transcript) def handle_interruption(self): if self.conversation.audio_interface is not None: self.conversation.audio_interface.interrupt() def handle_ping(self, event): self.ws.send( json.dumps( { "type": "pong", "event_id": event["event_id"], } ) ) def handle_latency_measurement(self, latency): self.conversation.callback_latency_measurement(latency) def handle_client_tool_call(self, tool_name, parameters): def send_response(response): if not self.conversation._should_stop.is_set(): self.ws.send(json.dumps(response)) self.conversation.client_tools.execute_tool(tool_name, parameters, send_response) handler = SyncMessageHandler(self, ws) self._handle_message_core(message, handler) class AsyncConversation(BaseConversation): audio_interface: Optional[AsyncAudioInterface] callback_agent_response: Optional[Callable[[str], Awaitable[None]]] callback_agent_response_correction: Optional[Callable[[str, str], Awaitable[None]]] callback_agent_chat_response_part: Optional[Callable[[str, AgentChatResponsePartType], Awaitable[None]]] callback_user_transcript: Optional[Callable[[str], Awaitable[None]]] callback_latency_measurement: Optional[Callable[[int], Awaitable[None]]] callback_audio_alignment: Optional[Callable[[AudioEventAlignment], Awaitable[None]]] callback_end_session: Optional[Callable[[], Awaitable[None]]] _task: Optional[asyncio.Task] _should_stop: asyncio.Event _ws: Optional[websockets.WebSocketClientProtocol] def __init__( self, client: BaseElevenLabs, agent_id: str, user_id: Optional[str] = None, *, requires_auth: bool, audio_interface: Optional[AsyncAudioInterface] = None, config: Optional[ConversationInitiationData] = None, client_tools: Optional[ClientTools] = None, callback_agent_response: Optional[Callable[[str], Awaitable[None]]] = None, callback_agent_response_correction: Optional[Callable[[str, str], Awaitable[None]]] = None, callback_agent_chat_response_part: Optional[Callable[[str, AgentChatResponsePartType], Awaitable[None]]] = None, callback_user_transcript: Optional[Callable[[str], Awaitable[None]]] = None, callback_latency_measurement: Optional[Callable[[int], Awaitable[None]]] = None, callback_audio_alignment: Optional[Callable[[AudioEventAlignment], Awaitable[None]]] = None, callback_end_session: Optional[Callable[[], Awaitable[None]]] = None, on_prem_config: Optional[OnPremInitiationData] = None, environment: Optional[str] = None, ): """Async Conversational AI session. BETA: This API is subject to change without regard to backwards compatibility. Args: client: The ElevenLabs client to use for the conversation. agent_id: The ID of the agent to converse with. user_id: The ID of the user conversing with the agent. requires_auth: Whether the agent requires authentication. audio_interface: The async audio interface to use for input and output. Can be omitted for text-only (chat) mode. client_tools: The client tools to use for the conversation. callback_agent_response: Async callback for agent responses. callback_agent_response_correction: Async callback for agent response corrections. First argument is the original response (previously given to callback_agent_response), second argument is the corrected response. callback_agent_chat_response_part: Async callback for streaming text response chunks. First argument is the text chunk, second argument is the type (START, DELTA, STOP). callback_user_transcript: Async callback for user transcripts. callback_latency_measurement: Async callback for latency measurements (in milliseconds). callback_audio_alignment: Async callback for audio alignment data with character-level timing. callback_end_session: Async callback for when session ends. environment: The environment to use. Defaults to "production" on the server. """ super().__init__( client=client, agent_id=agent_id, user_id=user_id, requires_auth=requires_auth, audio_interface=audio_interface, config=config, client_tools=client_tools, on_prem_config=on_prem_config, environment=environment, ) self.audio_interface = audio_interface self.callback_agent_response = callback_agent_response self.callback_agent_response_correction = callback_agent_response_correction self.callback_agent_chat_response_part = callback_agent_chat_response_part self.callback_user_transcript = callback_user_transcript self.callback_latency_measurement = callback_latency_measurement self.callback_audio_alignment = callback_audio_alignment self.callback_end_session = callback_end_session self._task = None self._ws = None self._should_stop = asyncio.Event() async def start_session(self): """Starts the conversation session. Will run in background task until `end_session` is called. """ if self.requires_auth: ws_url = await asyncio.get_running_loop().run_in_executor(None, self._get_signed_url) else: ws_url = self._get_wss_url() self._task = asyncio.create_task(self._run(ws_url)) async def end_session(self): """Ends the conversation session and cleans up resources.""" if self.audio_interface is not None: await self.audio_interface.stop() self.client_tools.stop() self._ws = None self._should_stop.set() if self.callback_end_session: await self.callback_end_session() async def wait_for_session_end(self) -> Optional[str]: """Waits for the conversation session to end. You must call `end_session` before calling this method, otherwise it will block. Returns the conversation ID, if available. """ if not self._task: raise RuntimeError("Session not started.") await self._task return self._conversation_id async def send_user_message(self, text: str): """Send a text message from the user to the agent. Args: text: The text message to send to the agent. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = UserMessageClientToOrchestratorEvent(text=text) try: await self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending user message: {e}") raise async def register_user_activity(self): """Register user activity to prevent session timeout. This sends a ping to the orchestrator to reset the timeout timer. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = UserActivityClientToOrchestratorEvent() try: await self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error registering user activity: {e}") raise async def send_contextual_update(self, text: str): """Send a contextual update to the conversation. Contextual updates are non-interrupting content that is sent to the server to update the conversation state without directly prompting the agent. Args: text: The contextual information to send to the conversation. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") event = ContextualUpdateClientToOrchestratorEvent(text=text) try: await self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending contextual update: {e}") raise async def send_multimodal_message( self, text: Optional[str] = None, file_id: Optional[str] = None, ): """Send a multimodal message combining text and/or a file reference. Args: text: Optional text message to include. file_id: Optional file ID to include (must be a previously uploaded file). Raises: RuntimeError: If the session is not active or websocket is not connected. ValueError: If neither text nor file_id is provided. """ if not self._ws: raise RuntimeError("Session not started or websocket not connected.") if not text and not file_id: raise ValueError("At least one of text or file_id must be provided.") event = MultimodalMessageClientToOrchestratorEvent(text=text, file_id=file_id) try: await self._ws.send(json.dumps(event.to_dict())) except Exception as e: logger.error(f"Error sending multimodal message: {e}") raise async def _run(self, ws_url: str): async with websockets.connect(ws_url, max_size=16 * 1024 * 1024) as ws: self._ws = ws if self.on_prem_config: await ws.send(self._create_on_prem_initiation_message()) await ws.send(self._create_initiation_message()) async def input_callback(audio): try: await ws.send( json.dumps( { "user_audio_chunk": base64.b64encode(audio).decode(), } ) ) except ConnectionClosedOK: await self.end_session() except Exception as e: logger.error(f"Error sending user audio chunk: {e}") await self.end_session() if self.audio_interface is not None: await self.audio_interface.start(input_callback) try: while not self._should_stop.is_set(): try: message_str = await asyncio.wait_for(ws.recv(), timeout=0.5) if self._should_stop.is_set(): return message = json.loads(message_str) await self._handle_message(message, ws) except asyncio.TimeoutError: pass except ConnectionClosedOK: await self.end_session() break except Exception as e: logger.error(f"Error receiving message: {e}") await self.end_session() break finally: self._ws = None async def _handle_message(self, message, ws): class AsyncMessageHandler: def __init__(self, conversation, ws): self.conversation = conversation self.ws = ws self.callback_agent_response = conversation.callback_agent_response self.callback_agent_response_correction = conversation.callback_agent_response_correction self.callback_agent_chat_response_part = conversation.callback_agent_chat_response_part self.callback_user_transcript = conversation.callback_user_transcript self.callback_latency_measurement = conversation.callback_latency_measurement self.callback_audio_alignment = conversation.callback_audio_alignment async def handle_audio_output(self, audio): if self.conversation.audio_interface is not None: await self.conversation.audio_interface.output(audio) async def handle_audio_alignment(self, alignment): await self.conversation.callback_audio_alignment(alignment) async def handle_agent_response(self, response): await self.conversation.callback_agent_response(response) async def handle_agent_response_correction(self, original, corrected): await self.conversation.callback_agent_response_correction(original, corrected) async def handle_agent_chat_response_part(self, text, part_type): await self.conversation.callback_agent_chat_response_part(text, part_type) async def handle_user_transcript(self, transcript): await self.conversation.callback_user_transcript(transcript) async def handle_interruption(self): if self.conversation.audio_interface is not None: await self.conversation.audio_interface.interrupt() async def handle_ping(self, event): await self.ws.send( json.dumps( { "type": "pong", "event_id": event["event_id"], } ) ) async def handle_latency_measurement(self, latency): await self.conversation.callback_latency_measurement(latency) def handle_client_tool_call(self, tool_name, parameters): def send_response(response): if not self.conversation._should_stop.is_set(): asyncio.create_task(self.ws.send(json.dumps(response))) self.conversation.client_tools.execute_tool(tool_name, parameters, send_response) handler = AsyncMessageHandler(self, ws) # Use the shared core message handling logic with async wrapper await self._handle_message_core_async(message, handler) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/000077500000000000000000000000001523660243400311365ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/__init__.py000066400000000000000000000041151523660243400332500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( ConversationsGetRequestFormat, ConversationsListRequestExcludeStatusesItem, ConversationsListRequestSummaryMode, ) from . import analysis, audio, feedback, files, messages, tags, topics from .messages import MessagesTextSearchRequestExcludeStatusesItem, MessagesTextSearchRequestSummaryMode _dynamic_imports: typing.Dict[str, str] = { "ConversationsGetRequestFormat": ".types", "ConversationsListRequestExcludeStatusesItem": ".types", "ConversationsListRequestSummaryMode": ".types", "MessagesTextSearchRequestExcludeStatusesItem": ".messages", "MessagesTextSearchRequestSummaryMode": ".messages", "analysis": ".analysis", "audio": ".audio", "feedback": ".feedback", "files": ".files", "messages": ".messages", "tags": ".tags", "topics": ".topics", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "ConversationsGetRequestFormat", "ConversationsListRequestExcludeStatusesItem", "ConversationsListRequestSummaryMode", "MessagesTextSearchRequestExcludeStatusesItem", "MessagesTextSearchRequestSummaryMode", "analysis", "audio", "feedback", "files", "messages", "tags", "topics", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/analysis/000077500000000000000000000000001523660243400327615ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400350110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/analysis# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000141601523660243400345340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/analysis# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.analysis_scope import AnalysisScope from ....types.get_conversation_response_model import GetConversationResponseModel from .raw_client import AsyncRawAnalysisClient, RawAnalysisClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AnalysisClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAnalysisClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAnalysisClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAnalysisClient """ return self._raw_client def run( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetConversationResponseModel: """ Run the analysis for a conversation using the agent's current evaluation criteria and data collection settings. Parameters ---------- conversation_id : str ID of the conversation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.analysis.run( conversation_id="conversation_id", ) """ _response = self._raw_client.run(conversation_id, request_options=request_options) return _response.data def run_evaluation( self, conversation_id: str, *, evaluation_id: str, scope: typing.Optional[AnalysisScope] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationResponseModel: """ Rerun a specific evaluation for a conversation. Parameters ---------- conversation_id : str ID of the conversation evaluation_id : str ID of the single evaluation criterion to rerun. scope : typing.Optional[AnalysisScope] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.analysis.run_evaluation( conversation_id="conversation_id", evaluation_id="evaluation_id", ) """ _response = self._raw_client.run_evaluation( conversation_id, evaluation_id=evaluation_id, scope=scope, request_options=request_options ) return _response.data class AsyncAnalysisClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAnalysisClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAnalysisClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAnalysisClient """ return self._raw_client async def run( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetConversationResponseModel: """ Run the analysis for a conversation using the agent's current evaluation criteria and data collection settings. Parameters ---------- conversation_id : str ID of the conversation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.analysis.run( conversation_id="conversation_id", ) asyncio.run(main()) """ _response = await self._raw_client.run(conversation_id, request_options=request_options) return _response.data async def run_evaluation( self, conversation_id: str, *, evaluation_id: str, scope: typing.Optional[AnalysisScope] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationResponseModel: """ Rerun a specific evaluation for a conversation. Parameters ---------- conversation_id : str ID of the conversation evaluation_id : str ID of the single evaluation criterion to rerun. scope : typing.Optional[AnalysisScope] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.analysis.run_evaluation( conversation_id="conversation_id", evaluation_id="evaluation_id", ) asyncio.run(main()) """ _response = await self._raw_client.run_evaluation( conversation_id, evaluation_id=evaluation_id, scope=scope, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000253371523660243400354150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/analysis# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.analysis_scope import AnalysisScope from ....types.get_conversation_response_model import GetConversationResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAnalysisClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def run( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetConversationResponseModel]: """ Run the analysis for a conversation using the agent's current evaluation criteria and data collection settings. Parameters ---------- conversation_id : str ID of the conversation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/analysis/run", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def run_evaluation( self, conversation_id: str, *, evaluation_id: str, scope: typing.Optional[AnalysisScope] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConversationResponseModel]: """ Rerun a specific evaluation for a conversation. Parameters ---------- conversation_id : str ID of the conversation evaluation_id : str ID of the single evaluation criterion to rerun. scope : typing.Optional[AnalysisScope] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/analysis/evaluations/run", method="POST", json={ "evaluation_id": evaluation_id, "scope": scope, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAnalysisClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def run( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetConversationResponseModel]: """ Run the analysis for a conversation using the agent's current evaluation criteria and data collection settings. Parameters ---------- conversation_id : str ID of the conversation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/analysis/run", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def run_evaluation( self, conversation_id: str, *, evaluation_id: str, scope: typing.Optional[AnalysisScope] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConversationResponseModel]: """ Rerun a specific evaluation for a conversation. Parameters ---------- conversation_id : str ID of the conversation evaluation_id : str ID of the single evaluation criterion to rerun. scope : typing.Optional[AnalysisScope] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/analysis/evaluations/run", method="POST", json={ "evaluation_id": evaluation_id, "scope": scope, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/audio/000077500000000000000000000000001523660243400322375ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400342670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/audio# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/audio/client.py000066400000000000000000000065101523660243400340710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from .raw_client import AsyncRawAudioClient, RawAudioClient class AudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioClient """ return self._raw_client def get( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Get the audio recording of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. 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. Returns ------- typing.Iterator[bytes] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.audio.get( conversation_id="conversation_id", ) """ with self._raw_client.get(conversation_id, request_options=request_options) as r: yield from r.data class AsyncAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioClient """ return self._raw_client async def get( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Get the audio recording of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. 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. Returns ------- typing.AsyncIterator[bytes] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.audio.get( conversation_id="conversation_id", ) asyncio.run(main()) """ async with self._raw_client.get(conversation_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk raw_client.py000066400000000000000000000145351523660243400346710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/audio# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError class RawAudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def get( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Get the audio recording of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Successful Response """ with self._client_wrapper.httpx_client.stream( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/audio", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def get( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Get the audio recording of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Successful Response """ async with self._client_wrapper.httpx_client.stream( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/audio", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/client.py000066400000000000000000001446201523660243400327750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conversation_initiation_source import ConversationInitiationSource from ...types.conversation_product import ConversationProduct from ...types.conversation_signed_url_response_model import ConversationSignedUrlResponseModel from ...types.evaluation_success_result import EvaluationSuccessResult from ...types.get_conversation_response_model import GetConversationResponseModel from ...types.get_conversations_page_response_model import GetConversationsPageResponseModel from ...types.get_sip_log_messages_response import GetSipLogMessagesResponse from ...types.guardrail_type import GuardrailType from ...types.token_response_model import TokenResponseModel from .raw_client import AsyncRawConversationsClient, RawConversationsClient from .types.conversations_get_request_format import ConversationsGetRequestFormat from .types.conversations_list_request_exclude_statuses_item import ConversationsListRequestExcludeStatusesItem from .types.conversations_list_request_summary_mode import ConversationsListRequestSummaryMode if typing.TYPE_CHECKING: from .analysis.client import AnalysisClient, AsyncAnalysisClient from .audio.client import AsyncAudioClient, AudioClient from .feedback.client import AsyncFeedbackClient, FeedbackClient from .files.client import AsyncFilesClient, FilesClient from .messages.client import AsyncMessagesClient, MessagesClient from .tags.client import AsyncTagsClient, TagsClient from .topics.client import AsyncTopicsClient, TopicsClient class ConversationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawConversationsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AudioClient] = None self._feedback: typing.Optional[FeedbackClient] = None self._messages: typing.Optional[MessagesClient] = None self._tags: typing.Optional[TagsClient] = None self._files: typing.Optional[FilesClient] = None self._topics: typing.Optional[TopicsClient] = None self._analysis: typing.Optional[AnalysisClient] = None @property def with_raw_response(self) -> RawConversationsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawConversationsClient """ return self._raw_client def get_signed_url( self, *, agent_id: str, include_conversation_id: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationSignedUrlResponseModel: """ Get a signed url to start a conversation with an agent with an agent that requires authorization Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. include_conversation_id : typing.Optional[bool] Whether to include a conversation_id with the response. If included, the conversation_signature cannot be used again. branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationSignedUrlResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.get_signed_url( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_conversation_id=True, branch_id="branch_id", environment="environment", ) """ _response = self._raw_client.get_signed_url( agent_id=agent_id, include_conversation_id=include_conversation_id, branch_id=branch_id, environment=environment, request_options=request_options, ) return _response.data def get_webrtc_token( self, *, agent_id: str, participant_name: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> TokenResponseModel: """ Get a WebRTC session token for real-time communication. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. participant_name : typing.Optional[str] Optional custom participant name. If not provided, user ID will be used branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TokenResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.get_webrtc_token( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", participant_name="participant_name", branch_id="branch_id", environment="environment", ) """ _response = self._raw_client.get_webrtc_token( agent_id=agent_id, participant_name=participant_name, branch_id=branch_id, environment=environment, request_options=request_options, ) return _response.data def list( self, *, cursor: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, evaluation_criteria_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[ConversationsListRequestSummaryMode] = None, search: typing.Optional[str] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, parent_conversation_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem], ] ] = None, tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, workflow_node_entered_id: typing.Optional[str] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, guardrail_types: typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] = None, custom_guardrail_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationsPageResponseModel: """ Get all conversations of agents that user owns. With option to restrict to a specific agent. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. data_collection_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection field IDs to include in each conversation summary. Repeat param. When omitted, data_collection_results is not returned. evaluation_criteria_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation criteria IDs to include in each conversation summary. Repeat param. When omitted, evaluation_criteria_results is not returned. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). page_size : typing.Optional[int] How many conversations to return at maximum. Can not exceed 100, defaults to 30. summary_mode : typing.Optional[ConversationsListRequestSummaryMode] Whether to include transcript summaries in the response. search : typing.Optional[str] Full-text or fuzzy search over transcript messages conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. parent_conversation_id : typing.Optional[str] Filter conversations by parent conversation ID for subagent conversations. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. exclude_statuses : typing.Optional[typing.Union[ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by conversation tag IDs assigned via the conversation-tags endpoints. workflow_node_entered_id : typing.Optional[str] Filter conversations to only those that entered the given node. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. guardrail_types : typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] Filter to conversations where a guardrail of any of these types triggered (metadata.triggered_guardrails.guardrail_type). Repeat param to match any of several. custom_guardrail_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter to conversations where a custom guardrail with any of these names triggered (metadata.triggered_guardrails.guardrail_name). Only custom guardrails carry a name. Repeat param to match any of several. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.list( cursor="cursor", agent_id="agent_id", visited_agent_ids=["visited_agent_ids"], visited_agent_branch_ids=["visited_agent_branch_ids"], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=["evaluation_params"], data_collection_params=["data_collection_params"], data_collection_ids=["data_collection_ids"], evaluation_criteria_ids=["evaluation_criteria_ids"], tool_names=["tool_names"], tool_names_successful=["tool_names_successful"], tool_names_errored=["tool_names_errored"], main_languages=["main_languages"], page_size=1, summary_mode="exclude", search="search", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", parent_conversation_id="parent_conversation_id", topic_ids=["topic_ids"], exclude_statuses=["initiated"], tag_ids=["tag_ids"], workflow_node_entered_id="workflow_node_entered_id", termination_reasons=["termination_reasons"], guardrail_types=["custom"], custom_guardrail_names=["custom_guardrail_names"], ) """ _response = self._raw_client.list( cursor=cursor, agent_id=agent_id, visited_agent_ids=visited_agent_ids, visited_agent_branch_ids=visited_agent_branch_ids, call_successful=call_successful, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, call_duration_min_secs=call_duration_min_secs, call_duration_max_secs=call_duration_max_secs, rating_max=rating_max, rating_min=rating_min, has_feedback_comment=has_feedback_comment, user_id=user_id, evaluation_params=evaluation_params, data_collection_params=data_collection_params, data_collection_ids=data_collection_ids, evaluation_criteria_ids=evaluation_criteria_ids, tool_names=tool_names, tool_names_successful=tool_names_successful, tool_names_errored=tool_names_errored, main_languages=main_languages, page_size=page_size, summary_mode=summary_mode, search=search, conversation_initiation_source=conversation_initiation_source, text_only=text_only, conversation_product_type=conversation_product_type, branch_id=branch_id, version_id=version_id, parent_conversation_id=parent_conversation_id, topic_ids=topic_ids, exclude_statuses=exclude_statuses, tag_ids=tag_ids, workflow_node_entered_id=workflow_node_entered_id, termination_reasons=termination_reasons, guardrail_types=guardrail_types, custom_guardrail_names=custom_guardrail_names, request_options=request_options, ) return _response.data def resolve( self, *, agent_id: str, reference: str, request_options: typing.Optional[RequestOptions] = None ) -> GetConversationResponseModel: """ Resolve a conversation URL (a Slack message URL or a Zendesk ticket URL) to the deterministic conversation ID for the given agent, then confirm the conversation exists. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. reference : str A Slack message URL or a Zendesk ticket URL. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.resolve( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", reference="https://your-domain.zendesk.com/agent/tickets/12345", ) """ _response = self._raw_client.resolve(agent_id=agent_id, reference=reference, request_options=request_options) return _response.data def get( self, conversation_id: str, *, format: typing.Optional[ConversationsGetRequestFormat] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationResponseModel: """ Get the details of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. format : typing.Optional[ConversationsGetRequestFormat] Response format. Defaults to 'json'. Set to 'opentelemetry' for an OTLP-compatible trace payload using the same structure as the post-call webhook. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.get( conversation_id="21m00Tcm4TlvDq8ikWAM", format="json", ) """ _response = self._raw_client.get(conversation_id, format=format, request_options=request_options) return _response.data def delete(self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.delete( conversation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.delete(conversation_id, request_options=request_options) return _response.data def get_sip_messages( self, conversation_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSipLogMessagesResponse: """ Get SIP messages associated with a conversation's phone call Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSipLogMessagesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.get_sip_messages( conversation_id="21m00Tcm4TlvDq8ikWAM", page_size=1, cursor="cursor", ) """ _response = self._raw_client.get_sip_messages( conversation_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AudioClient # noqa: E402 self._audio = AudioClient(client_wrapper=self._client_wrapper) return self._audio @property def feedback(self): if self._feedback is None: from .feedback.client import FeedbackClient # noqa: E402 self._feedback = FeedbackClient(client_wrapper=self._client_wrapper) return self._feedback @property def messages(self): if self._messages is None: from .messages.client import MessagesClient # noqa: E402 self._messages = MessagesClient(client_wrapper=self._client_wrapper) return self._messages @property def tags(self): if self._tags is None: from .tags.client import TagsClient # noqa: E402 self._tags = TagsClient(client_wrapper=self._client_wrapper) return self._tags @property def files(self): if self._files is None: from .files.client import FilesClient # noqa: E402 self._files = FilesClient(client_wrapper=self._client_wrapper) return self._files @property def topics(self): if self._topics is None: from .topics.client import TopicsClient # noqa: E402 self._topics = TopicsClient(client_wrapper=self._client_wrapper) return self._topics @property def analysis(self): if self._analysis is None: from .analysis.client import AnalysisClient # noqa: E402 self._analysis = AnalysisClient(client_wrapper=self._client_wrapper) return self._analysis class AsyncConversationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawConversationsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AsyncAudioClient] = None self._feedback: typing.Optional[AsyncFeedbackClient] = None self._messages: typing.Optional[AsyncMessagesClient] = None self._tags: typing.Optional[AsyncTagsClient] = None self._files: typing.Optional[AsyncFilesClient] = None self._topics: typing.Optional[AsyncTopicsClient] = None self._analysis: typing.Optional[AsyncAnalysisClient] = None @property def with_raw_response(self) -> AsyncRawConversationsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawConversationsClient """ return self._raw_client async def get_signed_url( self, *, agent_id: str, include_conversation_id: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationSignedUrlResponseModel: """ Get a signed url to start a conversation with an agent with an agent that requires authorization Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. include_conversation_id : typing.Optional[bool] Whether to include a conversation_id with the response. If included, the conversation_signature cannot be used again. branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationSignedUrlResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.get_signed_url( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", include_conversation_id=True, branch_id="branch_id", environment="environment", ) asyncio.run(main()) """ _response = await self._raw_client.get_signed_url( agent_id=agent_id, include_conversation_id=include_conversation_id, branch_id=branch_id, environment=environment, request_options=request_options, ) return _response.data async def get_webrtc_token( self, *, agent_id: str, participant_name: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> TokenResponseModel: """ Get a WebRTC session token for real-time communication. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. participant_name : typing.Optional[str] Optional custom participant name. If not provided, user ID will be used branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TokenResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.get_webrtc_token( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", participant_name="participant_name", branch_id="branch_id", environment="environment", ) asyncio.run(main()) """ _response = await self._raw_client.get_webrtc_token( agent_id=agent_id, participant_name=participant_name, branch_id=branch_id, environment=environment, request_options=request_options, ) return _response.data async def list( self, *, cursor: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, evaluation_criteria_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[ConversationsListRequestSummaryMode] = None, search: typing.Optional[str] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, parent_conversation_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem], ] ] = None, tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, workflow_node_entered_id: typing.Optional[str] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, guardrail_types: typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] = None, custom_guardrail_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationsPageResponseModel: """ Get all conversations of agents that user owns. With option to restrict to a specific agent. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. data_collection_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection field IDs to include in each conversation summary. Repeat param. When omitted, data_collection_results is not returned. evaluation_criteria_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation criteria IDs to include in each conversation summary. Repeat param. When omitted, evaluation_criteria_results is not returned. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). page_size : typing.Optional[int] How many conversations to return at maximum. Can not exceed 100, defaults to 30. summary_mode : typing.Optional[ConversationsListRequestSummaryMode] Whether to include transcript summaries in the response. search : typing.Optional[str] Full-text or fuzzy search over transcript messages conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. parent_conversation_id : typing.Optional[str] Filter conversations by parent conversation ID for subagent conversations. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. exclude_statuses : typing.Optional[typing.Union[ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by conversation tag IDs assigned via the conversation-tags endpoints. workflow_node_entered_id : typing.Optional[str] Filter conversations to only those that entered the given node. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. guardrail_types : typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] Filter to conversations where a guardrail of any of these types triggered (metadata.triggered_guardrails.guardrail_type). Repeat param to match any of several. custom_guardrail_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter to conversations where a custom guardrail with any of these names triggered (metadata.triggered_guardrails.guardrail_name). Only custom guardrails carry a name. Repeat param to match any of several. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.list( cursor="cursor", agent_id="agent_id", visited_agent_ids=["visited_agent_ids"], visited_agent_branch_ids=["visited_agent_branch_ids"], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=["evaluation_params"], data_collection_params=["data_collection_params"], data_collection_ids=["data_collection_ids"], evaluation_criteria_ids=["evaluation_criteria_ids"], tool_names=["tool_names"], tool_names_successful=["tool_names_successful"], tool_names_errored=["tool_names_errored"], main_languages=["main_languages"], page_size=1, summary_mode="exclude", search="search", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", parent_conversation_id="parent_conversation_id", topic_ids=["topic_ids"], exclude_statuses=["initiated"], tag_ids=["tag_ids"], workflow_node_entered_id="workflow_node_entered_id", termination_reasons=["termination_reasons"], guardrail_types=["custom"], custom_guardrail_names=["custom_guardrail_names"], ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, agent_id=agent_id, visited_agent_ids=visited_agent_ids, visited_agent_branch_ids=visited_agent_branch_ids, call_successful=call_successful, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, call_duration_min_secs=call_duration_min_secs, call_duration_max_secs=call_duration_max_secs, rating_max=rating_max, rating_min=rating_min, has_feedback_comment=has_feedback_comment, user_id=user_id, evaluation_params=evaluation_params, data_collection_params=data_collection_params, data_collection_ids=data_collection_ids, evaluation_criteria_ids=evaluation_criteria_ids, tool_names=tool_names, tool_names_successful=tool_names_successful, tool_names_errored=tool_names_errored, main_languages=main_languages, page_size=page_size, summary_mode=summary_mode, search=search, conversation_initiation_source=conversation_initiation_source, text_only=text_only, conversation_product_type=conversation_product_type, branch_id=branch_id, version_id=version_id, parent_conversation_id=parent_conversation_id, topic_ids=topic_ids, exclude_statuses=exclude_statuses, tag_ids=tag_ids, workflow_node_entered_id=workflow_node_entered_id, termination_reasons=termination_reasons, guardrail_types=guardrail_types, custom_guardrail_names=custom_guardrail_names, request_options=request_options, ) return _response.data async def resolve( self, *, agent_id: str, reference: str, request_options: typing.Optional[RequestOptions] = None ) -> GetConversationResponseModel: """ Resolve a conversation URL (a Slack message URL or a Zendesk ticket URL) to the deterministic conversation ID for the given agent, then confirm the conversation exists. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. reference : str A Slack message URL or a Zendesk ticket URL. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.resolve( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", reference="https://your-domain.zendesk.com/agent/tickets/12345", ) asyncio.run(main()) """ _response = await self._raw_client.resolve( agent_id=agent_id, reference=reference, request_options=request_options ) return _response.data async def get( self, conversation_id: str, *, format: typing.Optional[ConversationsGetRequestFormat] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationResponseModel: """ Get the details of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. format : typing.Optional[ConversationsGetRequestFormat] Response format. Defaults to 'json'. Set to 'opentelemetry' for an OTLP-compatible trace payload using the same structure as the post-call webhook. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.get( conversation_id="21m00Tcm4TlvDq8ikWAM", format="json", ) asyncio.run(main()) """ _response = await self._raw_client.get(conversation_id, format=format, request_options=request_options) return _response.data async def delete( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.delete( conversation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.delete(conversation_id, request_options=request_options) return _response.data async def get_sip_messages( self, conversation_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSipLogMessagesResponse: """ Get SIP messages associated with a conversation's phone call Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSipLogMessagesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.get_sip_messages( conversation_id="21m00Tcm4TlvDq8ikWAM", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.get_sip_messages( conversation_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AsyncAudioClient # noqa: E402 self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper) return self._audio @property def feedback(self): if self._feedback is None: from .feedback.client import AsyncFeedbackClient # noqa: E402 self._feedback = AsyncFeedbackClient(client_wrapper=self._client_wrapper) return self._feedback @property def messages(self): if self._messages is None: from .messages.client import AsyncMessagesClient # noqa: E402 self._messages = AsyncMessagesClient(client_wrapper=self._client_wrapper) return self._messages @property def tags(self): if self._tags is None: from .tags.client import AsyncTagsClient # noqa: E402 self._tags = AsyncTagsClient(client_wrapper=self._client_wrapper) return self._tags @property def files(self): if self._files is None: from .files.client import AsyncFilesClient # noqa: E402 self._files = AsyncFilesClient(client_wrapper=self._client_wrapper) return self._files @property def topics(self): if self._topics is None: from .topics.client import AsyncTopicsClient # noqa: E402 self._topics = AsyncTopicsClient(client_wrapper=self._client_wrapper) return self._topics @property def analysis(self): if self._analysis is None: from .analysis.client import AsyncAnalysisClient # noqa: E402 self._analysis = AsyncAnalysisClient(client_wrapper=self._client_wrapper) return self._analysis elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/feedback/000077500000000000000000000000001523660243400326625ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400347120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/feedback# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000074301523660243400344370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/feedback# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.user_feedback_score import UserFeedbackScore from .raw_client import AsyncRawFeedbackClient, RawFeedbackClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class FeedbackClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawFeedbackClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawFeedbackClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawFeedbackClient """ return self._raw_client def create( self, conversation_id: str, *, feedback: typing.Optional[UserFeedbackScore] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Send the feedback for the given conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. feedback : typing.Optional[UserFeedbackScore] Either 'like' or 'dislike' to indicate the feedback for the conversation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.feedback.create( conversation_id="21m00Tcm4TlvDq8ikWAM", feedback="like", ) """ _response = self._raw_client.create(conversation_id, feedback=feedback, request_options=request_options) return _response.data class AsyncFeedbackClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawFeedbackClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawFeedbackClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawFeedbackClient """ return self._raw_client async def create( self, conversation_id: str, *, feedback: typing.Optional[UserFeedbackScore] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Send the feedback for the given conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. feedback : typing.Optional[UserFeedbackScore] Either 'like' or 'dislike' to indicate the feedback for the conversation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.feedback.create( conversation_id="21m00Tcm4TlvDq8ikWAM", feedback="like", ) asyncio.run(main()) """ _response = await self._raw_client.create(conversation_id, feedback=feedback, request_options=request_options) return _response.data raw_client.py000066400000000000000000000144311523660243400353070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/feedback# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.user_feedback_score import UserFeedbackScore from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawFeedbackClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, conversation_id: str, *, feedback: typing.Optional[UserFeedbackScore] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Send the feedback for the given conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. feedback : typing.Optional[UserFeedbackScore] Either 'like' or 'dislike' to indicate the feedback for the conversation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/feedback", method="POST", json={ "feedback": feedback, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawFeedbackClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, conversation_id: str, *, feedback: typing.Optional[UserFeedbackScore] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Send the feedback for the given conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. feedback : typing.Optional[UserFeedbackScore] Either 'like' or 'dislike' to indicate the feedback for the conversation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/feedback", method="POST", json={ "feedback": feedback, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/files/000077500000000000000000000000001523660243400322405ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400342700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/files# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/files/client.py000066400000000000000000000133431523660243400340740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.conv_ai_file_upload_response_model import ConvAiFileUploadResponseModel from .raw_client import AsyncRawFilesClient, RawFilesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class FilesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawFilesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawFilesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawFilesClient """ return self._raw_client def create( self, conversation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiFileUploadResponseModel: """ Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation. Parameters ---------- conversation_id : str file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiFileUploadResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.files.create( conversation_id="conversation_id", ) """ _response = self._raw_client.create(conversation_id, file=file, request_options=request_options) return _response.data def delete( self, conversation_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiFileUploadResponseModel: """ Remove a file upload from a conversation. Only possible if the file hasn't already been used in the conversation. Parameters ---------- conversation_id : str file_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiFileUploadResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.files.delete( conversation_id="conversation_id", file_id="file_id", ) """ _response = self._raw_client.delete(conversation_id, file_id, request_options=request_options) return _response.data class AsyncFilesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawFilesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawFilesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawFilesClient """ return self._raw_client async def create( self, conversation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiFileUploadResponseModel: """ Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation. Parameters ---------- conversation_id : str file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiFileUploadResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.files.create( conversation_id="conversation_id", ) asyncio.run(main()) """ _response = await self._raw_client.create(conversation_id, file=file, request_options=request_options) return _response.data async def delete( self, conversation_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiFileUploadResponseModel: """ Remove a file upload from a conversation. Only possible if the file hasn't already been used in the conversation. Parameters ---------- conversation_id : str file_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiFileUploadResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.files.delete( conversation_id="conversation_id", file_id="file_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(conversation_id, file_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000245441523660243400346730ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/files# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.conv_ai_file_upload_response_model import ConvAiFileUploadResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawFilesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, conversation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvAiFileUploadResponseModel]: """ Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation. Parameters ---------- conversation_id : str file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvAiFileUploadResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/files", method="POST", data={}, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiFileUploadResponseModel, construct_type( type_=ConvAiFileUploadResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, conversation_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvAiFileUploadResponseModel]: """ Remove a file upload from a conversation. Only possible if the file hasn't already been used in the conversation. Parameters ---------- conversation_id : str file_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvAiFileUploadResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/files/{jsonable_encoder(file_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiFileUploadResponseModel, construct_type( type_=ConvAiFileUploadResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawFilesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, conversation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvAiFileUploadResponseModel]: """ Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation. Parameters ---------- conversation_id : str file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvAiFileUploadResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/files", method="POST", data={}, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiFileUploadResponseModel, construct_type( type_=ConvAiFileUploadResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, conversation_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvAiFileUploadResponseModel]: """ Remove a file upload from a conversation. Only possible if the file hasn't already been used in the conversation. Parameters ---------- conversation_id : str file_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvAiFileUploadResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/files/{jsonable_encoder(file_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiFileUploadResponseModel, construct_type( type_=ConvAiFileUploadResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages/000077500000000000000000000000001523660243400327455ustar00rootroot00000000000000__init__.py000066400000000000000000000024131523660243400347770ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import MessagesTextSearchRequestExcludeStatusesItem, MessagesTextSearchRequestSummaryMode _dynamic_imports: typing.Dict[str, str] = { "MessagesTextSearchRequestExcludeStatusesItem": ".types", "MessagesTextSearchRequestSummaryMode": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["MessagesTextSearchRequestExcludeStatusesItem", "MessagesTextSearchRequestSummaryMode"] client.py000066400000000000000000000631761523660243400345330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.conversation_product import ConversationProduct from ....types.evaluation_success_result import EvaluationSuccessResult from ....types.message_search_sort_by import MessageSearchSortBy from ....types.messages_search_response import MessagesSearchResponse from .raw_client import AsyncRawMessagesClient, RawMessagesClient from .types.messages_text_search_request_exclude_statuses_item import MessagesTextSearchRequestExcludeStatusesItem from .types.messages_text_search_request_summary_mode import MessagesTextSearchRequestSummaryMode class MessagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMessagesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawMessagesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMessagesClient """ return self._raw_client def text_search( self, *, text_query: str, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem], ] ] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[MessagesTextSearchRequestSummaryMode] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, sort_by: typing.Optional[MessageSearchSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MessagesSearchResponse: """ Search through conversation transcript messages by full-text and fuzzy search Parameters ---------- text_query : str The search query text for full-text and fuzzy matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). exclude_statuses : typing.Optional[typing.Union[MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. page_size : typing.Optional[int] Number of results per page. Max 50. summary_mode : typing.Optional[MessagesTextSearchRequestSummaryMode] Whether to include transcript summaries in the response. conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. sort_by : typing.Optional[MessageSearchSortBy] Sort order for search results. 'search_score' sorts by search score, 'created_at' sorts by conversation start time. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MessagesSearchResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.messages.text_search( text_query="refund policy", agent_id="agent_id", visited_agent_ids=["visited_agent_ids"], visited_agent_branch_ids=["visited_agent_branch_ids"], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=["evaluation_params"], data_collection_params=["data_collection_params"], tool_names=["tool_names"], tool_names_successful=["tool_names_successful"], tool_names_errored=["tool_names_errored"], main_languages=["main_languages"], exclude_statuses=["initiated"], termination_reasons=["termination_reasons"], page_size=1, summary_mode="exclude", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", topic_ids=["topic_ids"], sort_by="search_score", cursor="cursor", ) """ _response = self._raw_client.text_search( text_query=text_query, agent_id=agent_id, visited_agent_ids=visited_agent_ids, visited_agent_branch_ids=visited_agent_branch_ids, call_successful=call_successful, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, call_duration_min_secs=call_duration_min_secs, call_duration_max_secs=call_duration_max_secs, rating_max=rating_max, rating_min=rating_min, has_feedback_comment=has_feedback_comment, user_id=user_id, evaluation_params=evaluation_params, data_collection_params=data_collection_params, tool_names=tool_names, tool_names_successful=tool_names_successful, tool_names_errored=tool_names_errored, main_languages=main_languages, exclude_statuses=exclude_statuses, termination_reasons=termination_reasons, page_size=page_size, summary_mode=summary_mode, conversation_initiation_source=conversation_initiation_source, text_only=text_only, conversation_product_type=conversation_product_type, branch_id=branch_id, version_id=version_id, topic_ids=topic_ids, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data def search( self, *, text_query: str, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MessagesSearchResponse: """ Search conversation transcripts by semantic similarity to surface relevant messages based on meaning and intent, rather than exact keyword matches Parameters ---------- text_query : str The search query text for semantic similarity matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. page_size : typing.Optional[int] Number of results per page. Max 50. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MessagesSearchResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.messages.search( text_query="Customer asking to cancel and get money back", agent_id="agent_id", page_size=1, cursor="cursor", ) """ _response = self._raw_client.search( text_query=text_query, agent_id=agent_id, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data class AsyncMessagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMessagesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawMessagesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMessagesClient """ return self._raw_client async def text_search( self, *, text_query: str, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem], ] ] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[MessagesTextSearchRequestSummaryMode] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, sort_by: typing.Optional[MessageSearchSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MessagesSearchResponse: """ Search through conversation transcript messages by full-text and fuzzy search Parameters ---------- text_query : str The search query text for full-text and fuzzy matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). exclude_statuses : typing.Optional[typing.Union[MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. page_size : typing.Optional[int] Number of results per page. Max 50. summary_mode : typing.Optional[MessagesTextSearchRequestSummaryMode] Whether to include transcript summaries in the response. conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. sort_by : typing.Optional[MessageSearchSortBy] Sort order for search results. 'search_score' sorts by search score, 'created_at' sorts by conversation start time. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MessagesSearchResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.messages.text_search( text_query="refund policy", agent_id="agent_id", visited_agent_ids=["visited_agent_ids"], visited_agent_branch_ids=["visited_agent_branch_ids"], call_successful="success", call_start_before_unix=1, call_start_after_unix=1, call_duration_min_secs=1, call_duration_max_secs=1, rating_max=1, rating_min=1, has_feedback_comment=True, user_id="user_id", evaluation_params=["evaluation_params"], data_collection_params=["data_collection_params"], tool_names=["tool_names"], tool_names_successful=["tool_names_successful"], tool_names_errored=["tool_names_errored"], main_languages=["main_languages"], exclude_statuses=["initiated"], termination_reasons=["termination_reasons"], page_size=1, summary_mode="exclude", conversation_initiation_source="unknown", text_only=True, conversation_product_type="agents", branch_id="branch_id", version_id="version_id", topic_ids=["topic_ids"], sort_by="search_score", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.text_search( text_query=text_query, agent_id=agent_id, visited_agent_ids=visited_agent_ids, visited_agent_branch_ids=visited_agent_branch_ids, call_successful=call_successful, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, call_duration_min_secs=call_duration_min_secs, call_duration_max_secs=call_duration_max_secs, rating_max=rating_max, rating_min=rating_min, has_feedback_comment=has_feedback_comment, user_id=user_id, evaluation_params=evaluation_params, data_collection_params=data_collection_params, tool_names=tool_names, tool_names_successful=tool_names_successful, tool_names_errored=tool_names_errored, main_languages=main_languages, exclude_statuses=exclude_statuses, termination_reasons=termination_reasons, page_size=page_size, summary_mode=summary_mode, conversation_initiation_source=conversation_initiation_source, text_only=text_only, conversation_product_type=conversation_product_type, branch_id=branch_id, version_id=version_id, topic_ids=topic_ids, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data async def search( self, *, text_query: str, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MessagesSearchResponse: """ Search conversation transcripts by semantic similarity to surface relevant messages based on meaning and intent, rather than exact keyword matches Parameters ---------- text_query : str The search query text for semantic similarity matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. page_size : typing.Optional[int] Number of results per page. Max 50. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MessagesSearchResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.messages.search( text_query="Customer asking to cancel and get money back", agent_id="agent_id", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.search( text_query=text_query, agent_id=agent_id, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000000671321523660243400354000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.conversation_product import ConversationProduct from ....types.evaluation_success_result import EvaluationSuccessResult from ....types.message_search_sort_by import MessageSearchSortBy from ....types.messages_search_response import MessagesSearchResponse from .types.messages_text_search_request_exclude_statuses_item import MessagesTextSearchRequestExcludeStatusesItem from .types.messages_text_search_request_summary_mode import MessagesTextSearchRequestSummaryMode from pydantic import ValidationError class RawMessagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def text_search( self, *, text_query: str, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem], ] ] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[MessagesTextSearchRequestSummaryMode] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, sort_by: typing.Optional[MessageSearchSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MessagesSearchResponse]: """ Search through conversation transcript messages by full-text and fuzzy search Parameters ---------- text_query : str The search query text for full-text and fuzzy matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). exclude_statuses : typing.Optional[typing.Union[MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. page_size : typing.Optional[int] Number of results per page. Max 50. summary_mode : typing.Optional[MessagesTextSearchRequestSummaryMode] Whether to include transcript summaries in the response. conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. sort_by : typing.Optional[MessageSearchSortBy] Sort order for search results. 'search_score' sorts by search score, 'created_at' sorts by conversation start time. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MessagesSearchResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversations/messages/text-search", method="GET", params={ "text_query": text_query, "agent_id": agent_id, "visited_agent_ids": visited_agent_ids, "visited_agent_branch_ids": visited_agent_branch_ids, "call_successful": call_successful, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "call_duration_min_secs": call_duration_min_secs, "call_duration_max_secs": call_duration_max_secs, "rating_max": rating_max, "rating_min": rating_min, "has_feedback_comment": has_feedback_comment, "user_id": user_id, "evaluation_params": evaluation_params, "data_collection_params": data_collection_params, "tool_names": tool_names, "tool_names_successful": tool_names_successful, "tool_names_errored": tool_names_errored, "main_languages": main_languages, "exclude_statuses": exclude_statuses, "termination_reasons": termination_reasons, "page_size": page_size, "summary_mode": summary_mode, "conversation_initiation_source": conversation_initiation_source, "text_only": text_only, "conversation_product_type": conversation_product_type, "branch_id": branch_id, "version_id": version_id, "topic_ids": topic_ids, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MessagesSearchResponse, construct_type( type_=MessagesSearchResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def search( self, *, text_query: str, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MessagesSearchResponse]: """ Search conversation transcripts by semantic similarity to surface relevant messages based on meaning and intent, rather than exact keyword matches Parameters ---------- text_query : str The search query text for semantic similarity matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. page_size : typing.Optional[int] Number of results per page. Max 50. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MessagesSearchResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversations/messages/smart-search", method="GET", params={ "text_query": text_query, "agent_id": agent_id, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MessagesSearchResponse, construct_type( type_=MessagesSearchResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawMessagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def text_search( self, *, text_query: str, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem], ] ] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[MessagesTextSearchRequestSummaryMode] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, sort_by: typing.Optional[MessageSearchSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MessagesSearchResponse]: """ Search through conversation transcript messages by full-text and fuzzy search Parameters ---------- text_query : str The search query text for full-text and fuzzy matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). exclude_statuses : typing.Optional[typing.Union[MessagesTextSearchRequestExcludeStatusesItem, typing.Sequence[MessagesTextSearchRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. page_size : typing.Optional[int] Number of results per page. Max 50. summary_mode : typing.Optional[MessagesTextSearchRequestSummaryMode] Whether to include transcript summaries in the response. conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. sort_by : typing.Optional[MessageSearchSortBy] Sort order for search results. 'search_score' sorts by search score, 'created_at' sorts by conversation start time. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MessagesSearchResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversations/messages/text-search", method="GET", params={ "text_query": text_query, "agent_id": agent_id, "visited_agent_ids": visited_agent_ids, "visited_agent_branch_ids": visited_agent_branch_ids, "call_successful": call_successful, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "call_duration_min_secs": call_duration_min_secs, "call_duration_max_secs": call_duration_max_secs, "rating_max": rating_max, "rating_min": rating_min, "has_feedback_comment": has_feedback_comment, "user_id": user_id, "evaluation_params": evaluation_params, "data_collection_params": data_collection_params, "tool_names": tool_names, "tool_names_successful": tool_names_successful, "tool_names_errored": tool_names_errored, "main_languages": main_languages, "exclude_statuses": exclude_statuses, "termination_reasons": termination_reasons, "page_size": page_size, "summary_mode": summary_mode, "conversation_initiation_source": conversation_initiation_source, "text_only": text_only, "conversation_product_type": conversation_product_type, "branch_id": branch_id, "version_id": version_id, "topic_ids": topic_ids, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MessagesSearchResponse, construct_type( type_=MessagesSearchResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def search( self, *, text_query: str, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MessagesSearchResponse]: """ Search conversation transcripts by semantic similarity to surface relevant messages based on meaning and intent, rather than exact keyword matches Parameters ---------- text_query : str The search query text for semantic similarity matching agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. page_size : typing.Optional[int] Number of results per page. Max 50. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MessagesSearchResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversations/messages/smart-search", method="GET", params={ "text_query": text_query, "agent_id": agent_id, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MessagesSearchResponse, construct_type( type_=MessagesSearchResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages/types/000077500000000000000000000000001523660243400341115ustar00rootroot00000000000000__init__.py000066400000000000000000000027031523660243400361450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .messages_text_search_request_exclude_statuses_item import MessagesTextSearchRequestExcludeStatusesItem from .messages_text_search_request_summary_mode import MessagesTextSearchRequestSummaryMode _dynamic_imports: typing.Dict[str, str] = { "MessagesTextSearchRequestExcludeStatusesItem": ".messages_text_search_request_exclude_statuses_item", "MessagesTextSearchRequestSummaryMode": ".messages_text_search_request_summary_mode", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["MessagesTextSearchRequestExcludeStatusesItem", "MessagesTextSearchRequestSummaryMode"] messages_text_search_request_exclude_statuses_item.py000066400000000000000000000003521523660243400470360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages/types# This file was auto-generated by Fern from our API Definition. import typing MessagesTextSearchRequestExcludeStatusesItem = typing.Union[ typing.Literal["initiated", "in-progress", "processing", "done", "failed"], typing.Any ] messages_text_search_request_summary_mode.py000066400000000000000000000002661523660243400451410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/messages/types# This file was auto-generated by Fern from our API Definition. import typing MessagesTextSearchRequestSummaryMode = typing.Union[typing.Literal["exclude", "include"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/raw_client.py000066400000000000000000001644331523660243400336520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_source import ConversationInitiationSource from ...types.conversation_product import ConversationProduct from ...types.conversation_signed_url_response_model import ConversationSignedUrlResponseModel from ...types.evaluation_success_result import EvaluationSuccessResult from ...types.get_conversation_response_model import GetConversationResponseModel from ...types.get_conversations_page_response_model import GetConversationsPageResponseModel from ...types.get_sip_log_messages_response import GetSipLogMessagesResponse from ...types.guardrail_type import GuardrailType from ...types.token_response_model import TokenResponseModel from .types.conversations_get_request_format import ConversationsGetRequestFormat from .types.conversations_list_request_exclude_statuses_item import ConversationsListRequestExcludeStatusesItem from .types.conversations_list_request_summary_mode import ConversationsListRequestSummaryMode from pydantic import ValidationError class RawConversationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_signed_url( self, *, agent_id: str, include_conversation_id: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ConversationSignedUrlResponseModel]: """ Get a signed url to start a conversation with an agent with an agent that requires authorization Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. include_conversation_id : typing.Optional[bool] Whether to include a conversation_id with the response. If included, the conversation_signature cannot be used again. branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConversationSignedUrlResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversation/get-signed-url", method="GET", params={ "agent_id": agent_id, "include_conversation_id": include_conversation_id, "branch_id": branch_id, "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationSignedUrlResponseModel, construct_type( type_=ConversationSignedUrlResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_webrtc_token( self, *, agent_id: str, participant_name: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[TokenResponseModel]: """ Get a WebRTC session token for real-time communication. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. participant_name : typing.Optional[str] Optional custom participant name. If not provided, user ID will be used branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TokenResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversation/token", method="GET", params={ "agent_id": agent_id, "participant_name": participant_name, "branch_id": branch_id, "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TokenResponseModel, construct_type( type_=TokenResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, cursor: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, evaluation_criteria_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[ConversationsListRequestSummaryMode] = None, search: typing.Optional[str] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, parent_conversation_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem], ] ] = None, tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, workflow_node_entered_id: typing.Optional[str] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, guardrail_types: typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] = None, custom_guardrail_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConversationsPageResponseModel]: """ Get all conversations of agents that user owns. With option to restrict to a specific agent. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. data_collection_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection field IDs to include in each conversation summary. Repeat param. When omitted, data_collection_results is not returned. evaluation_criteria_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation criteria IDs to include in each conversation summary. Repeat param. When omitted, evaluation_criteria_results is not returned. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). page_size : typing.Optional[int] How many conversations to return at maximum. Can not exceed 100, defaults to 30. summary_mode : typing.Optional[ConversationsListRequestSummaryMode] Whether to include transcript summaries in the response. search : typing.Optional[str] Full-text or fuzzy search over transcript messages conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. parent_conversation_id : typing.Optional[str] Filter conversations by parent conversation ID for subagent conversations. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. exclude_statuses : typing.Optional[typing.Union[ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by conversation tag IDs assigned via the conversation-tags endpoints. workflow_node_entered_id : typing.Optional[str] Filter conversations to only those that entered the given node. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. guardrail_types : typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] Filter to conversations where a guardrail of any of these types triggered (metadata.triggered_guardrails.guardrail_type). Repeat param to match any of several. custom_guardrail_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter to conversations where a custom guardrail with any of these names triggered (metadata.triggered_guardrails.guardrail_name). Only custom guardrails carry a name. Repeat param to match any of several. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversations", method="GET", params={ "cursor": cursor, "agent_id": agent_id, "visited_agent_ids": visited_agent_ids, "visited_agent_branch_ids": visited_agent_branch_ids, "call_successful": call_successful, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "call_duration_min_secs": call_duration_min_secs, "call_duration_max_secs": call_duration_max_secs, "rating_max": rating_max, "rating_min": rating_min, "has_feedback_comment": has_feedback_comment, "user_id": user_id, "evaluation_params": evaluation_params, "data_collection_params": data_collection_params, "data_collection_ids": data_collection_ids, "evaluation_criteria_ids": evaluation_criteria_ids, "tool_names": tool_names, "tool_names_successful": tool_names_successful, "tool_names_errored": tool_names_errored, "main_languages": main_languages, "page_size": page_size, "summary_mode": summary_mode, "search": search, "conversation_initiation_source": conversation_initiation_source, "text_only": text_only, "conversation_product_type": conversation_product_type, "branch_id": branch_id, "version_id": version_id, "parent_conversation_id": parent_conversation_id, "topic_ids": topic_ids, "exclude_statuses": exclude_statuses, "tag_ids": tag_ids, "workflow_node_entered_id": workflow_node_entered_id, "termination_reasons": termination_reasons, "guardrail_types": guardrail_types, "custom_guardrail_names": custom_guardrail_names, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationsPageResponseModel, construct_type( type_=GetConversationsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def resolve( self, *, agent_id: str, reference: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetConversationResponseModel]: """ Resolve a conversation URL (a Slack message URL or a Zendesk ticket URL) to the deterministic conversation ID for the given agent, then confirm the conversation exists. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. reference : str A Slack message URL or a Zendesk ticket URL. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/conversations/resolve", method="GET", params={ "agent_id": agent_id, "reference": reference, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, conversation_id: str, *, format: typing.Optional[ConversationsGetRequestFormat] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConversationResponseModel]: """ Get the details of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. format : typing.Optional[ConversationsGetRequestFormat] Response format. Defaults to 'json'. Set to 'opentelemetry' for an OTLP-compatible trace payload using the same structure as the post-call webhook. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}", method="GET", params={ "format": format, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_sip_messages( self, conversation_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetSipLogMessagesResponse]: """ Get SIP messages associated with a conversation's phone call Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetSipLogMessagesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/sip-messages", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSipLogMessagesResponse, construct_type( type_=GetSipLogMessagesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawConversationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_signed_url( self, *, agent_id: str, include_conversation_id: typing.Optional[bool] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ConversationSignedUrlResponseModel]: """ Get a signed url to start a conversation with an agent with an agent that requires authorization Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. include_conversation_id : typing.Optional[bool] Whether to include a conversation_id with the response. If included, the conversation_signature cannot be used again. branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConversationSignedUrlResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversation/get-signed-url", method="GET", params={ "agent_id": agent_id, "include_conversation_id": include_conversation_id, "branch_id": branch_id, "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationSignedUrlResponseModel, construct_type( type_=ConversationSignedUrlResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_webrtc_token( self, *, agent_id: str, participant_name: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[TokenResponseModel]: """ Get a WebRTC session token for real-time communication. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. participant_name : typing.Optional[str] Optional custom participant name. If not provided, user ID will be used branch_id : typing.Optional[str] The ID of the branch to use environment : typing.Optional[str] The environment to use for resolving environment variables (e.g. 'production', 'staging'). Defaults to 'production'. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TokenResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversation/token", method="GET", params={ "agent_id": agent_id, "participant_name": participant_name, "branch_id": branch_id, "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TokenResponseModel, construct_type( type_=TokenResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, cursor: typing.Optional[str] = None, agent_id: typing.Optional[str] = None, visited_agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, visited_agent_branch_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, call_successful: typing.Optional[EvaluationSuccessResult] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, call_duration_min_secs: typing.Optional[int] = None, call_duration_max_secs: typing.Optional[int] = None, rating_max: typing.Optional[int] = None, rating_min: typing.Optional[int] = None, has_feedback_comment: typing.Optional[bool] = None, user_id: typing.Optional[str] = None, evaluation_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_params: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, data_collection_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, evaluation_criteria_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_successful: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, tool_names_errored: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, main_languages: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, summary_mode: typing.Optional[ConversationsListRequestSummaryMode] = None, search: typing.Optional[str] = None, conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None, text_only: typing.Optional[bool] = None, conversation_product_type: typing.Optional[ConversationProduct] = None, branch_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, parent_conversation_id: typing.Optional[str] = None, topic_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, exclude_statuses: typing.Optional[ typing.Union[ ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem], ] ] = None, tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, workflow_node_entered_id: typing.Optional[str] = None, termination_reasons: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, guardrail_types: typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] = None, custom_guardrail_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConversationsPageResponseModel]: """ Get all conversations of agents that user owns. With option to restrict to a specific agent. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. visited_agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agents participated. Can not exceed 50 values. visited_agent_branch_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations where any of these agent branches participated. Can not exceed 50 values. call_successful : typing.Optional[EvaluationSuccessResult] The result of the success evaluation call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. call_duration_min_secs : typing.Optional[int] Minimum call duration in seconds. call_duration_max_secs : typing.Optional[int] Maximum call duration in seconds. rating_max : typing.Optional[int] Maximum overall rating (1-5). rating_min : typing.Optional[int] Minimum overall rating (1-5). has_feedback_comment : typing.Optional[bool] Filter conversations with user feedback comments. user_id : typing.Optional[str] Filter conversations by the user ID who initiated them. evaluation_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation filters. Repeat param. Format: criteria_id:result. Example: eval=value_framing:success data_collection_params : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection filters. Repeat param. Format: id:op:value where op is one of eq|neq|gt|gte|lt|lte|in|exists|missing. For in, pipe-delimit values. data_collection_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Data collection field IDs to include in each conversation summary. Repeat param. When omitted, data_collection_results is not returned. evaluation_criteria_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Evaluation criteria IDs to include in each conversation summary. Repeat param. When omitted, evaluation_criteria_results is not returned. tool_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names used during the call. tool_names_successful : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had successful calls. tool_names_errored : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by tool names that had errored calls. main_languages : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by detected main language (language code). page_size : typing.Optional[int] How many conversations to return at maximum. Can not exceed 100, defaults to 30. summary_mode : typing.Optional[ConversationsListRequestSummaryMode] Whether to include transcript summaries in the response. search : typing.Optional[str] Full-text or fuzzy search over transcript messages conversation_initiation_source : typing.Optional[ConversationInitiationSource] text_only : typing.Optional[bool] conversation_product_type : typing.Optional[ConversationProduct] Restrict results to a single conversation product surface. branch_id : typing.Optional[str] Filter conversations by branch ID. version_id : typing.Optional[str] Filter conversations by version ID. parent_conversation_id : typing.Optional[str] Filter conversations by parent conversation ID for subagent conversations. topic_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by topic IDs assigned during topic discovery. exclude_statuses : typing.Optional[typing.Union[ConversationsListRequestExcludeStatusesItem, typing.Sequence[ConversationsListRequestExcludeStatusesItem]]] Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views. tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by conversation tag IDs assigned via the conversation-tags endpoints. workflow_node_entered_id : typing.Optional[str] Filter conversations to only those that entered the given node. termination_reasons : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several. guardrail_types : typing.Optional[typing.Union[GuardrailType, typing.Sequence[GuardrailType]]] Filter to conversations where a guardrail of any of these types triggered (metadata.triggered_guardrails.guardrail_type). Repeat param to match any of several. custom_guardrail_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter to conversations where a custom guardrail with any of these names triggered (metadata.triggered_guardrails.guardrail_name). Only custom guardrails carry a name. Repeat param to match any of several. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversations", method="GET", params={ "cursor": cursor, "agent_id": agent_id, "visited_agent_ids": visited_agent_ids, "visited_agent_branch_ids": visited_agent_branch_ids, "call_successful": call_successful, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "call_duration_min_secs": call_duration_min_secs, "call_duration_max_secs": call_duration_max_secs, "rating_max": rating_max, "rating_min": rating_min, "has_feedback_comment": has_feedback_comment, "user_id": user_id, "evaluation_params": evaluation_params, "data_collection_params": data_collection_params, "data_collection_ids": data_collection_ids, "evaluation_criteria_ids": evaluation_criteria_ids, "tool_names": tool_names, "tool_names_successful": tool_names_successful, "tool_names_errored": tool_names_errored, "main_languages": main_languages, "page_size": page_size, "summary_mode": summary_mode, "search": search, "conversation_initiation_source": conversation_initiation_source, "text_only": text_only, "conversation_product_type": conversation_product_type, "branch_id": branch_id, "version_id": version_id, "parent_conversation_id": parent_conversation_id, "topic_ids": topic_ids, "exclude_statuses": exclude_statuses, "tag_ids": tag_ids, "workflow_node_entered_id": workflow_node_entered_id, "termination_reasons": termination_reasons, "guardrail_types": guardrail_types, "custom_guardrail_names": custom_guardrail_names, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationsPageResponseModel, construct_type( type_=GetConversationsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def resolve( self, *, agent_id: str, reference: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetConversationResponseModel]: """ Resolve a conversation URL (a Slack message URL or a Zendesk ticket URL) to the deterministic conversation ID for the given agent, then confirm the conversation exists. Parameters ---------- agent_id : str Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. reference : str A Slack message URL or a Zendesk ticket URL. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/conversations/resolve", method="GET", params={ "agent_id": agent_id, "reference": reference, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, conversation_id: str, *, format: typing.Optional[ConversationsGetRequestFormat] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConversationResponseModel]: """ Get the details of a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. format : typing.Optional[ConversationsGetRequestFormat] Response format. Defaults to 'json'. Set to 'opentelemetry' for an OTLP-compatible trace payload using the same structure as the post-call webhook. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}", method="GET", params={ "format": format, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationResponseModel, construct_type( type_=GetConversationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, conversation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete a particular conversation Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_sip_messages( self, conversation_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetSipLogMessagesResponse]: """ Get SIP messages associated with a conversation's phone call Parameters ---------- conversation_id : str The id of the conversation you're taking the action on. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetSipLogMessagesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/sip-messages", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSipLogMessagesResponse, construct_type( type_=GetSipLogMessagesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/tags/000077500000000000000000000000001523660243400320745ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/tags/__init__.py000066400000000000000000000001251523660243400342030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/tags/client.py000066400000000000000000000411241523660243400337260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.conversation_tag_response_model import ConversationTagResponseModel from ....types.get_conversation_tags_page_response_model import GetConversationTagsPageResponseModel from .raw_client import AsyncRawTagsClient, RawTagsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TagsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTagsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTagsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTagsClient """ return self._raw_client def assign( self, conversation_id: str, *, tag_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Assign one or more conversation tags to a conversation. Tags that are already assigned are ignored. Tags must belong to the same workspace. Parameters ---------- conversation_id : str tag_ids : typing.Sequence[str] Tag IDs to add to the conversation. Re-assigning an existing tag is a no-op. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.assign( conversation_id="conversation_id", tag_ids=["tag_ids"], ) """ _response = self._raw_client.assign(conversation_id, tag_ids=tag_ids, request_options=request_options) return _response.data def unassign( self, conversation_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Remove a single conversation tag from a conversation. Parameters ---------- conversation_id : str tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.unassign( conversation_id="conversation_id", tag_id="tag_id", ) """ _response = self._raw_client.unassign(conversation_id, tag_id, request_options=request_options) return _response.data def list( self, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationTagsPageResponseModel: """ List conversation tags for the workspace, ordered by most recently created first. Parameters ---------- page_size : typing.Optional[int] How many conversation tags to return. Can not exceed 100. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationTagsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.list( page_size=1, cursor="cursor", ) """ _response = self._raw_client.list(page_size=page_size, cursor=cursor, request_options=request_options) return _response.data def create( self, *, title: str, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationTagResponseModel: """ Create a new conversation tag for the workspace. Parameters ---------- title : str Display title of the tag. description : typing.Optional[str] Optional free-text description. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.create( title="title", ) """ _response = self._raw_client.create(title=title, description=description, request_options=request_options) return _response.data def get( self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConversationTagResponseModel: """ Get a conversation tag by ID. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.get( tag_id="tag_id", ) """ _response = self._raw_client.get(tag_id, request_options=request_options) return _response.data def delete(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a conversation tag. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.delete( tag_id="tag_id", ) """ _response = self._raw_client.delete(tag_id, request_options=request_options) return _response.data def update( self, tag_id: str, *, title: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationTagResponseModel: """ Update a conversation tag's title and/or description. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str title : typing.Optional[str] If provided, replaces the tag title. Omit to leave unchanged. description : typing.Optional[str] If provided, replaces the tag description. Omit to leave unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.tags.update( tag_id="tag_id", ) """ _response = self._raw_client.update( tag_id, title=title, description=description, request_options=request_options ) return _response.data class AsyncTagsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTagsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTagsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTagsClient """ return self._raw_client async def assign( self, conversation_id: str, *, tag_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Assign one or more conversation tags to a conversation. Tags that are already assigned are ignored. Tags must belong to the same workspace. Parameters ---------- conversation_id : str tag_ids : typing.Sequence[str] Tag IDs to add to the conversation. Re-assigning an existing tag is a no-op. 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.conversational_ai.conversations.tags.assign( conversation_id="conversation_id", tag_ids=["tag_ids"], ) asyncio.run(main()) """ _response = await self._raw_client.assign(conversation_id, tag_ids=tag_ids, request_options=request_options) return _response.data async def unassign( self, conversation_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Remove a single conversation tag from a conversation. Parameters ---------- conversation_id : str tag_id : str 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.conversational_ai.conversations.tags.unassign( conversation_id="conversation_id", tag_id="tag_id", ) asyncio.run(main()) """ _response = await self._raw_client.unassign(conversation_id, tag_id, request_options=request_options) return _response.data async def list( self, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationTagsPageResponseModel: """ List conversation tags for the workspace, ordered by most recently created first. Parameters ---------- page_size : typing.Optional[int] How many conversation tags to return. Can not exceed 100. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationTagsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.tags.list( page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list(page_size=page_size, cursor=cursor, request_options=request_options) return _response.data async def create( self, *, title: str, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationTagResponseModel: """ Create a new conversation tag for the workspace. Parameters ---------- title : str Display title of the tag. description : typing.Optional[str] Optional free-text description. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.tags.create( title="title", ) asyncio.run(main()) """ _response = await self._raw_client.create(title=title, description=description, request_options=request_options) return _response.data async def get( self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConversationTagResponseModel: """ Get a conversation tag by ID. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.tags.get( tag_id="tag_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(tag_id, request_options=request_options) return _response.data async def delete(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a conversation tag. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str 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.conversational_ai.conversations.tags.delete( tag_id="tag_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(tag_id, request_options=request_options) return _response.data async def update( self, tag_id: str, *, title: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ConversationTagResponseModel: """ Update a conversation tag's title and/or description. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str title : typing.Optional[str] If provided, replaces the tag title. Omit to leave unchanged. description : typing.Optional[str] If provided, replaces the tag description. Omit to leave unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConversationTagResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.tags.update( tag_id="tag_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( tag_id, title=title, description=description, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000774661523660243400345420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/tags# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.conversation_tag_response_model import ConversationTagResponseModel from ....types.get_conversation_tags_page_response_model import GetConversationTagsPageResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTagsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def assign( self, conversation_id: str, *, tag_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ Assign one or more conversation tags to a conversation. Tags that are already assigned are ignored. Tags must belong to the same workspace. Parameters ---------- conversation_id : str tag_ids : typing.Sequence[str] Tag IDs to add to the conversation. Re-assigning an existing tag is a no-op. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/tags", method="POST", json={ "tag_ids": tag_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def unassign( self, conversation_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Remove a single conversation tag from a conversation. Parameters ---------- conversation_id : str tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/tags/{jsonable_encoder(tag_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConversationTagsPageResponseModel]: """ List conversation tags for the workspace, ordered by most recently created first. Parameters ---------- page_size : typing.Optional[int] How many conversation tags to return. Can not exceed 100. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationTagsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/tags", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationTagsPageResponseModel, construct_type( type_=GetConversationTagsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, title: str, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ConversationTagResponseModel]: """ Create a new conversation tag for the workspace. Parameters ---------- title : str Display title of the tag. description : typing.Optional[str] Optional free-text description. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConversationTagResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/tags", method="POST", json={ "title": title, "description": description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConversationTagResponseModel]: """ Get a conversation tag by ID. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConversationTagResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete a conversation tag. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, tag_id: str, *, title: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ConversationTagResponseModel]: """ Update a conversation tag's title and/or description. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str title : typing.Optional[str] If provided, replaces the tag title. Omit to leave unchanged. description : typing.Optional[str] If provided, replaces the tag description. Omit to leave unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConversationTagResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="PATCH", json={ "title": title, "description": description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTagsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def assign( self, conversation_id: str, *, tag_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ Assign one or more conversation tags to a conversation. Tags that are already assigned are ignored. Tags must belong to the same workspace. Parameters ---------- conversation_id : str tag_ids : typing.Sequence[str] Tag IDs to add to the conversation. Re-assigning an existing tag is a no-op. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/tags", method="POST", json={ "tag_ids": tag_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def unassign( self, conversation_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Remove a single conversation tag from a conversation. Parameters ---------- conversation_id : str tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/conversations/{jsonable_encoder(conversation_id)}/tags/{jsonable_encoder(tag_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConversationTagsPageResponseModel]: """ List conversation tags for the workspace, ordered by most recently created first. Parameters ---------- page_size : typing.Optional[int] How many conversation tags to return. Can not exceed 100. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationTagsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/tags", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationTagsPageResponseModel, construct_type( type_=GetConversationTagsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, title: str, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ConversationTagResponseModel]: """ Create a new conversation tag for the workspace. Parameters ---------- title : str Display title of the tag. description : typing.Optional[str] Optional free-text description. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConversationTagResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/tags", method="POST", json={ "title": title, "description": description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConversationTagResponseModel]: """ Get a conversation tag by ID. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConversationTagResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a conversation tag. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, tag_id: str, *, title: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ConversationTagResponseModel]: """ Update a conversation tag's title and/or description. Restricted to the tag owner or a workspace admin. Parameters ---------- tag_id : str title : typing.Optional[str] If provided, replaces the tag title. Omit to leave unchanged. description : typing.Optional[str] If provided, replaces the tag description. Omit to leave unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConversationTagResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tags/{jsonable_encoder(tag_id)}", method="PATCH", json={ "title": title, "description": description, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConversationTagResponseModel, construct_type( type_=ConversationTagResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/topics/000077500000000000000000000000001523660243400324375ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400344670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/topics# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/topics/client.py000066400000000000000000000102131523660243400342640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_agent_topics_response_model import GetAgentTopicsResponseModel from .raw_client import AsyncRawTopicsClient, RawTopicsClient class TopicsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTopicsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTopicsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTopicsClient """ return self._raw_client def get( self, agent_id: str, *, from_unix_secs: typing.Optional[int] = None, to_unix_secs: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentTopicsResponseModel: """ Returns the latest topic discovery run results for a given agent. Parameters ---------- agent_id : str ID of the agent from_unix_secs : typing.Optional[int] Start of the window to view topics for. When set with to_unix_secs, per-day topics in the range are aggregated together. to_unix_secs : typing.Optional[int] End of the window to view topics for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTopicsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.conversations.topics.get( agent_id="agent_id", from_unix_secs=1, to_unix_secs=1, ) """ _response = self._raw_client.get( agent_id, from_unix_secs=from_unix_secs, to_unix_secs=to_unix_secs, request_options=request_options ) return _response.data class AsyncTopicsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTopicsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTopicsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTopicsClient """ return self._raw_client async def get( self, agent_id: str, *, from_unix_secs: typing.Optional[int] = None, to_unix_secs: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentTopicsResponseModel: """ Returns the latest topic discovery run results for a given agent. Parameters ---------- agent_id : str ID of the agent from_unix_secs : typing.Optional[int] Start of the window to view topics for. When set with to_unix_secs, per-day topics in the range are aggregated together. to_unix_secs : typing.Optional[int] End of the window to view topics for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTopicsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.conversations.topics.get( agent_id="agent_id", from_unix_secs=1, to_unix_secs=1, ) asyncio.run(main()) """ _response = await self._raw_client.get( agent_id, from_unix_secs=from_unix_secs, to_unix_secs=to_unix_secs, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000143271523660243400350700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/topics# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_agent_topics_response_model import GetAgentTopicsResponseModel from pydantic import ValidationError class RawTopicsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, agent_id: str, *, from_unix_secs: typing.Optional[int] = None, to_unix_secs: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentTopicsResponseModel]: """ Returns the latest topic discovery run results for a given agent. Parameters ---------- agent_id : str ID of the agent from_unix_secs : typing.Optional[int] Start of the window to view topics for. When set with to_unix_secs, per-day topics in the range are aggregated together. to_unix_secs : typing.Optional[int] End of the window to view topics for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentTopicsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/topics", method="GET", params={ "from_unix_secs": from_unix_secs, "to_unix_secs": to_unix_secs, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTopicsResponseModel, construct_type( type_=GetAgentTopicsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTopicsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, agent_id: str, *, from_unix_secs: typing.Optional[int] = None, to_unix_secs: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetAgentTopicsResponseModel]: """ Returns the latest topic discovery run results for a given agent. Parameters ---------- agent_id : str ID of the agent from_unix_secs : typing.Optional[int] Start of the window to view topics for. When set with to_unix_secs, per-day topics in the range are aggregated together. to_unix_secs : typing.Optional[int] End of the window to view topics for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentTopicsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agents/{jsonable_encoder(agent_id)}/topics", method="GET", params={ "from_unix_secs": from_unix_secs, "to_unix_secs": to_unix_secs, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTopicsResponseModel, construct_type( type_=GetAgentTopicsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/types/000077500000000000000000000000001523660243400323025ustar00rootroot00000000000000__init__.py000066400000000000000000000031771523660243400343440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .conversations_get_request_format import ConversationsGetRequestFormat from .conversations_list_request_exclude_statuses_item import ConversationsListRequestExcludeStatusesItem from .conversations_list_request_summary_mode import ConversationsListRequestSummaryMode _dynamic_imports: typing.Dict[str, str] = { "ConversationsGetRequestFormat": ".conversations_get_request_format", "ConversationsListRequestExcludeStatusesItem": ".conversations_list_request_exclude_statuses_item", "ConversationsListRequestSummaryMode": ".conversations_list_request_summary_mode", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "ConversationsGetRequestFormat", "ConversationsListRequestExcludeStatusesItem", "ConversationsListRequestSummaryMode", ] conversations_get_request_format.py000066400000000000000000000002621523660243400414510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/types# This file was auto-generated by Fern from our API Definition. import typing ConversationsGetRequestFormat = typing.Union[typing.Literal["json", "opentelemetry"], typing.Any] conversations_list_request_exclude_statuses_item.py000066400000000000000000000003511523660243400447560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/types# This file was auto-generated by Fern from our API Definition. import typing ConversationsListRequestExcludeStatusesItem = typing.Union[ typing.Literal["initiated", "in-progress", "processing", "done", "failed"], typing.Any ] conversations_list_request_summary_mode.py000066400000000000000000000002651523660243400430610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/conversations/types# This file was auto-generated by Fern from our API Definition. import typing ConversationsListRequestSummaryMode = typing.Union[typing.Literal["exclude", "include"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/000077500000000000000000000000001523660243400301705ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/__init__.py000066400000000000000000000035461523660243400323110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import settings from .settings import ( PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) _dynamic_imports: typing.Dict[str, str] = { "PatchConvAiDashboardSettingsRequestChartsItem": ".settings", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess": ".settings", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria": ".settings", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection": ".settings", "settings": ".settings", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", "settings", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/client.py000066400000000000000000000036761523660243400320340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawDashboardClient, RawDashboardClient if typing.TYPE_CHECKING: from .settings.client import AsyncSettingsClient, SettingsClient class DashboardClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDashboardClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._settings: typing.Optional[SettingsClient] = None @property def with_raw_response(self) -> RawDashboardClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDashboardClient """ return self._raw_client @property def settings(self): if self._settings is None: from .settings.client import SettingsClient # noqa: E402 self._settings = SettingsClient(client_wrapper=self._client_wrapper) return self._settings class AsyncDashboardClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDashboardClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._settings: typing.Optional[AsyncSettingsClient] = None @property def with_raw_response(self) -> AsyncRawDashboardClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDashboardClient """ return self._raw_client @property def settings(self): if self._settings is None: from .settings.client import AsyncSettingsClient # noqa: E402 self._settings = AsyncSettingsClient(client_wrapper=self._client_wrapper) return self._settings elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/raw_client.py000066400000000000000000000006401523660243400326710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawDashboardClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawDashboardClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/000077500000000000000000000000001523660243400320305ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/__init__.py000066400000000000000000000034171523660243400341460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) _dynamic_imports: typing.Dict[str, str] = { "PatchConvAiDashboardSettingsRequestChartsItem": ".types", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess": ".types", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria": ".types", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/client.py000066400000000000000000000123621523660243400336640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_conv_ai_dashboard_settings_response_model import GetConvAiDashboardSettingsResponseModel from .raw_client import AsyncRawSettingsClient, RawSettingsClient from .types.patch_conv_ai_dashboard_settings_request_charts_item import PatchConvAiDashboardSettingsRequestChartsItem # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSettingsClient """ return self._raw_client def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetConvAiDashboardSettingsResponseModel: """ Retrieve Convai dashboard settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiDashboardSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.dashboard.settings.get() """ _response = self._raw_client.get(request_options=request_options) return _response.data def update( self, *, charts: typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiDashboardSettingsResponseModel: """ Update Convai dashboard settings for the workspace Parameters ---------- charts : typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiDashboardSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.dashboard.settings.update() """ _response = self._raw_client.update(charts=charts, request_options=request_options) return _response.data class AsyncSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSettingsClient """ return self._raw_client async def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetConvAiDashboardSettingsResponseModel: """ Retrieve Convai dashboard settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiDashboardSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.dashboard.settings.get() asyncio.run(main()) """ _response = await self._raw_client.get(request_options=request_options) return _response.data async def update( self, *, charts: typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiDashboardSettingsResponseModel: """ Update Convai dashboard settings for the workspace Parameters ---------- charts : typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiDashboardSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.dashboard.settings.update() asyncio.run(main()) """ _response = await self._raw_client.update(charts=charts, request_options=request_options) return _response.data raw_client.py000066400000000000000000000252011523660243400344520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_conv_ai_dashboard_settings_response_model import GetConvAiDashboardSettingsResponseModel from .types.patch_conv_ai_dashboard_settings_request_charts_item import PatchConvAiDashboardSettingsRequestChartsItem from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetConvAiDashboardSettingsResponseModel]: """ Retrieve Convai dashboard settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConvAiDashboardSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/settings/dashboard", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiDashboardSettingsResponseModel, construct_type( type_=GetConvAiDashboardSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, *, charts: typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConvAiDashboardSettingsResponseModel]: """ Update Convai dashboard settings for the workspace Parameters ---------- charts : typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConvAiDashboardSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/settings/dashboard", method="PATCH", json={ "charts": convert_and_respect_annotation_metadata( object_=charts, annotation=typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiDashboardSettingsResponseModel, construct_type( type_=GetConvAiDashboardSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetConvAiDashboardSettingsResponseModel]: """ Retrieve Convai dashboard settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConvAiDashboardSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/settings/dashboard", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiDashboardSettingsResponseModel, construct_type( type_=GetConvAiDashboardSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, *, charts: typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConvAiDashboardSettingsResponseModel]: """ Update Convai dashboard settings for the workspace Parameters ---------- charts : typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConvAiDashboardSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/settings/dashboard", method="PATCH", json={ "charts": convert_and_respect_annotation_metadata( object_=charts, annotation=typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiDashboardSettingsResponseModel, construct_type( type_=GetConvAiDashboardSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/types/000077500000000000000000000000001523660243400331745ustar00rootroot00000000000000__init__.py000066400000000000000000000037721523660243400352370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .patch_conv_ai_dashboard_settings_request_charts_item import ( PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) _dynamic_imports: typing.Dict[str, str] = { "PatchConvAiDashboardSettingsRequestChartsItem": ".patch_conv_ai_dashboard_settings_request_charts_item", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess": ".patch_conv_ai_dashboard_settings_request_charts_item", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria": ".patch_conv_ai_dashboard_settings_request_charts_item", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection": ".patch_conv_ai_dashboard_settings_request_charts_item", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", ] patch_conv_ai_dashboard_settings_request_charts_item.py000066400000000000000000000037731523660243400463570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/dashboard/settings/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess(UncheckedBaseModel): type: typing.Literal["call_success"] = "call_success" name: 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 PatchConvAiDashboardSettingsRequestChartsItem_Criteria(UncheckedBaseModel): type: typing.Literal["criteria"] = "criteria" name: str criteria_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 class PatchConvAiDashboardSettingsRequestChartsItem_DataCollection(UncheckedBaseModel): type: typing.Literal["data_collection"] = "data_collection" name: str data_collection_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 PatchConvAiDashboardSettingsRequestChartsItem = typing_extensions.Annotated[ typing.Union[ PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/default_audio_interface.py000066400000000000000000000135151523660243400334450ustar00rootroot00000000000000from typing import Callable, Awaitable import queue import threading import asyncio from .conversation import AudioInterface, AsyncAudioInterface class DefaultAudioInterface(AudioInterface): INPUT_FRAMES_PER_BUFFER = 4000 # 250ms @ 16kHz OUTPUT_FRAMES_PER_BUFFER = 1000 # 62.5ms @ 16kHz def __init__(self): try: import pyaudio except ImportError: raise ImportError("To use DefaultAudioInterface you must install pyaudio.") self.pyaudio = pyaudio def start(self, input_callback: Callable[[bytes], None]): # Audio input is using callbacks from pyaudio which we simply pass through. self.input_callback = input_callback # Audio output is buffered so we can handle interruptions. # Start a separate thread to handle writing to the output stream. self.output_queue: queue.Queue[bytes] = queue.Queue() self.should_stop = threading.Event() self.output_thread = threading.Thread(target=self._output_thread) self.p = self.pyaudio.PyAudio() self.in_stream = self.p.open( format=self.pyaudio.paInt16, channels=1, rate=16000, input=True, stream_callback=self._in_callback, frames_per_buffer=self.INPUT_FRAMES_PER_BUFFER, start=True, ) self.out_stream = self.p.open( format=self.pyaudio.paInt16, channels=1, rate=16000, output=True, frames_per_buffer=self.OUTPUT_FRAMES_PER_BUFFER, start=True, ) self.output_thread.start() def stop(self): self.should_stop.set() self.output_thread.join() self.in_stream.stop_stream() self.in_stream.close() self.out_stream.close() self.p.terminate() def output(self, audio: bytes): self.output_queue.put(audio) def interrupt(self): # Clear the output queue to stop any audio that is currently playing. # Note: We can't atomically clear the whole queue, but we are doing # it from the message handling thread so no new audio will be added # while we are clearing. try: while True: _ = self.output_queue.get(block=False) except queue.Empty: pass def _output_thread(self): while not self.should_stop.is_set(): try: audio = self.output_queue.get(timeout=0.25) self.out_stream.write(audio) except queue.Empty: pass def _in_callback(self, in_data, frame_count, time_info, status): if self.input_callback: self.input_callback(in_data) return (None, self.pyaudio.paContinue) class AsyncDefaultAudioInterface(AsyncAudioInterface): INPUT_FRAMES_PER_BUFFER = 4000 # 250ms @ 16kHz OUTPUT_FRAMES_PER_BUFFER = 1000 # 62.5ms @ 16kHz def __init__(self): try: import pyaudio except ImportError: raise ImportError("To use AsyncDefaultAudioInterface you must install pyaudio.") self.pyaudio = pyaudio async def start(self, input_callback: Callable[[bytes], Awaitable[None]]): # Audio input is using callbacks from pyaudio which we adapt to async self.input_callback = input_callback # Audio output is buffered so we can handle interruptions. # Start a separate task to handle writing to the output stream. self.output_queue: asyncio.Queue[bytes] = asyncio.Queue() self.should_stop = asyncio.Event() self.p = self.pyaudio.PyAudio() self.in_stream = self.p.open( format=self.pyaudio.paInt16, channels=1, rate=16000, input=True, stream_callback=self._in_callback, frames_per_buffer=self.INPUT_FRAMES_PER_BUFFER, start=True, ) self.out_stream = self.p.open( format=self.pyaudio.paInt16, channels=1, rate=16000, output=True, frames_per_buffer=self.OUTPUT_FRAMES_PER_BUFFER, start=True, ) # Start the output task self.output_task = asyncio.create_task(self._output_task()) async def stop(self): self.should_stop.set() await self.output_task self.in_stream.stop_stream() self.in_stream.close() self.out_stream.close() self.p.terminate() async def output(self, audio: bytes): await self.output_queue.put(audio) async def interrupt(self): # Clear the output queue to stop any audio that is currently playing. try: while True: try: _ = self.output_queue.get_nowait() except asyncio.QueueEmpty: break except AttributeError: # In Python 3.8, it's asyncio.QueueEmpty, in 3.10+ it's asyncio.QueueEmpty while not self.output_queue.empty(): try: _ = self.output_queue.get_nowait() except: break async def _output_task(self): while not self.should_stop.is_set(): try: audio = await asyncio.wait_for(self.output_queue.get(), timeout=0.25) self.out_stream.write(audio) except asyncio.TimeoutError: pass def _in_callback(self, in_data, frame_count, time_info, status): if self.input_callback: # Schedule the async callback to run in the event loop try: loop = asyncio.get_event_loop() asyncio.run_coroutine_threadsafe(self.input_callback(in_data), loop) except RuntimeError: # No event loop running, ignore pass return (None, self.pyaudio.paContinue) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/exotel/000077500000000000000000000000001523660243400275415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/exotel/__init__.py000066400000000000000000000001251523660243400316500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/exotel/client.py000066400000000000000000000120111523660243400313640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.exotel_outbound_call_response import ExotelOutboundCallResponse from ...types.telephony_call_config import TelephonyCallConfig from .raw_client import AsyncRawExotelClient, RawExotelClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ExotelClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawExotelClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawExotelClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawExotelClient """ return self._raw_client def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ExotelOutboundCallResponse: """ Handle an outbound call via Exotel Connect API Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ExotelOutboundCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.exotel.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) """ _response = self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data class AsyncExotelClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawExotelClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawExotelClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawExotelClient """ return self._raw_client async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ExotelOutboundCallResponse: """ Handle an outbound call via Exotel Connect API Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ExotelOutboundCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.exotel.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) asyncio.run(main()) """ _response = await self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/exotel/raw_client.py000066400000000000000000000175631523660243400322560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.exotel_outbound_call_response import ExotelOutboundCallResponse from ...types.telephony_call_config import TelephonyCallConfig from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawExotelClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ExotelOutboundCallResponse]: """ Handle an outbound call via Exotel Connect API Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ExotelOutboundCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/exotel/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ExotelOutboundCallResponse, construct_type( type_=ExotelOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawExotelClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ExotelOutboundCallResponse]: """ Handle an outbound call via Exotel Connect API Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ExotelOutboundCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/exotel/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ExotelOutboundCallResponse, construct_type( type_=ExotelOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/000077500000000000000000000000001523660243400312125ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/__init__.py000066400000000000000000000111771523660243400333320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( KnowledgeBaseGetOrCreateRagIndexesResponseValue, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success, ) from . import crawl_jobs, document, documents from .document import ( DocumentRefreshResponse, DocumentRefreshResponse_File, DocumentRefreshResponse_Folder, DocumentRefreshResponse_Text, DocumentRefreshResponse_Url, DocumentUpdateFileResponse, DocumentUpdateFileResponse_File, DocumentUpdateFileResponse_Folder, DocumentUpdateFileResponse_Text, DocumentUpdateFileResponse_Url, ) from .documents import ( DocumentsBulkDeleteResponseValue, DocumentsBulkDeleteResponseValue_Failure, DocumentsBulkDeleteResponseValue_Success, DocumentsGetResponse, DocumentsGetResponse_File, DocumentsGetResponse_Folder, DocumentsGetResponse_Text, DocumentsGetResponse_Url, DocumentsUpdateResponse, DocumentsUpdateResponse_File, DocumentsUpdateResponse_Folder, DocumentsUpdateResponse_Text, DocumentsUpdateResponse_Url, ) _dynamic_imports: typing.Dict[str, str] = { "DocumentRefreshResponse": ".document", "DocumentRefreshResponse_File": ".document", "DocumentRefreshResponse_Folder": ".document", "DocumentRefreshResponse_Text": ".document", "DocumentRefreshResponse_Url": ".document", "DocumentUpdateFileResponse": ".document", "DocumentUpdateFileResponse_File": ".document", "DocumentUpdateFileResponse_Folder": ".document", "DocumentUpdateFileResponse_Text": ".document", "DocumentUpdateFileResponse_Url": ".document", "DocumentsBulkDeleteResponseValue": ".documents", "DocumentsBulkDeleteResponseValue_Failure": ".documents", "DocumentsBulkDeleteResponseValue_Success": ".documents", "DocumentsGetResponse": ".documents", "DocumentsGetResponse_File": ".documents", "DocumentsGetResponse_Folder": ".documents", "DocumentsGetResponse_Text": ".documents", "DocumentsGetResponse_Url": ".documents", "DocumentsUpdateResponse": ".documents", "DocumentsUpdateResponse_File": ".documents", "DocumentsUpdateResponse_Folder": ".documents", "DocumentsUpdateResponse_Text": ".documents", "DocumentsUpdateResponse_Url": ".documents", "KnowledgeBaseGetOrCreateRagIndexesResponseValue": ".types", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure": ".types", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success": ".types", "crawl_jobs": ".crawl_jobs", "document": ".document", "documents": ".documents", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DocumentRefreshResponse", "DocumentRefreshResponse_File", "DocumentRefreshResponse_Folder", "DocumentRefreshResponse_Text", "DocumentRefreshResponse_Url", "DocumentUpdateFileResponse", "DocumentUpdateFileResponse_File", "DocumentUpdateFileResponse_Folder", "DocumentUpdateFileResponse_Text", "DocumentUpdateFileResponse_Url", "DocumentsBulkDeleteResponseValue", "DocumentsBulkDeleteResponseValue_Failure", "DocumentsBulkDeleteResponseValue_Success", "DocumentsGetResponse", "DocumentsGetResponse_File", "DocumentsGetResponse_Folder", "DocumentsGetResponse_Text", "DocumentsGetResponse_Url", "DocumentsUpdateResponse", "DocumentsUpdateResponse_File", "DocumentsUpdateResponse_Folder", "DocumentsUpdateResponse_Text", "DocumentsUpdateResponse_Url", "KnowledgeBaseGetOrCreateRagIndexesResponseValue", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success", "crawl_jobs", "document", "documents", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/client.py000066400000000000000000000460171523660243400330520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_knowledge_base_list_response_model import GetKnowledgeBaseListResponseModel from ...types.get_or_create_rag_index_request_model import GetOrCreateRagIndexRequestModel from ...types.knowledge_base_content_search_response_model import KnowledgeBaseContentSearchResponseModel from ...types.knowledge_base_document_type import KnowledgeBaseDocumentType from ...types.knowledge_base_sort_by import KnowledgeBaseSortBy from ...types.sort_direction import SortDirection from .raw_client import AsyncRawKnowledgeBaseClient, RawKnowledgeBaseClient from .types.knowledge_base_get_or_create_rag_indexes_response_value import ( KnowledgeBaseGetOrCreateRagIndexesResponseValue, ) if typing.TYPE_CHECKING: from .crawl_jobs.client import AsyncCrawlJobsClient, CrawlJobsClient from .document.client import AsyncDocumentClient, DocumentClient from .documents.client import AsyncDocumentsClient, DocumentsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class KnowledgeBaseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawKnowledgeBaseClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._documents: typing.Optional[DocumentsClient] = None self._crawl_jobs: typing.Optional[CrawlJobsClient] = None self._document: typing.Optional[DocumentClient] = None @property def with_raw_response(self) -> RawKnowledgeBaseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawKnowledgeBaseClient """ return self._raw_client def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, parent_folder_id: typing.Optional[str] = None, ancestor_folder_id: typing.Optional[str] = None, folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: """ Get a list of available knowledge base documents Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] If specified, the endpoint returns only such knowledge base documents whose names start with this string. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter documents by creator user ID. When set, only documents created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. parent_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are direct children of the given folder. ancestor_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are descendants of the given folder. folders_first : typing.Optional[bool] Whether folders should be returned first in the list of documents. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseListResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.list( page_size=1, search="search", show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=["file"], parent_folder_id="parent_folder_id", ancestor_folder_id="ancestor_folder_id", folders_first=True, sort_direction="asc", sort_by="name", cursor="cursor", ) """ _response = self._raw_client.list( page_size=page_size, search=search, show_only_owned_documents=show_only_owned_documents, created_by_user_id=created_by_user_id, types=types, parent_folder_id=parent_folder_id, ancestor_folder_id=ancestor_folder_id, folders_first=folders_first, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data def get_or_create_rag_indexes( self, *, items: typing.Sequence[GetOrCreateRagIndexRequestModel], request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]: """ Retrieves and/or creates RAG indexes for multiple knowledge base documents in a single request. Maximum 100 items per request. Parameters ---------- items : typing.Sequence[GetOrCreateRagIndexRequestModel] List of requested RAG indexes. Minimum 1, maximum 100 items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue] Successful Response Examples -------- from elevenlabs import ElevenLabs, GetOrCreateRagIndexRequestModel client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.get_or_create_rag_indexes( items=[ GetOrCreateRagIndexRequestModel( document_id="document_id", create_if_missing=True, model="e5_mistral_7b_instruct", ) ], ) """ _response = self._raw_client.get_or_create_rag_indexes(items=items, request_options=request_options) return _response.data def search( self, *, query: str, page_size: typing.Optional[int] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseContentSearchResponseModel: """ Fuzzy text search over knowledge base document content Parameters ---------- query : str The search query text page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseContentSearchResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.search( query="query", page_size=1, types=["file"], cursor="cursor", ) """ _response = self._raw_client.search( query=query, page_size=page_size, types=types, cursor=cursor, request_options=request_options ) return _response.data @property def documents(self): if self._documents is None: from .documents.client import DocumentsClient # noqa: E402 self._documents = DocumentsClient(client_wrapper=self._client_wrapper) return self._documents @property def crawl_jobs(self): if self._crawl_jobs is None: from .crawl_jobs.client import CrawlJobsClient # noqa: E402 self._crawl_jobs = CrawlJobsClient(client_wrapper=self._client_wrapper) return self._crawl_jobs @property def document(self): if self._document is None: from .document.client import DocumentClient # noqa: E402 self._document = DocumentClient(client_wrapper=self._client_wrapper) return self._document class AsyncKnowledgeBaseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawKnowledgeBaseClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._documents: typing.Optional[AsyncDocumentsClient] = None self._crawl_jobs: typing.Optional[AsyncCrawlJobsClient] = None self._document: typing.Optional[AsyncDocumentClient] = None @property def with_raw_response(self) -> AsyncRawKnowledgeBaseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawKnowledgeBaseClient """ return self._raw_client async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, parent_folder_id: typing.Optional[str] = None, ancestor_folder_id: typing.Optional[str] = None, folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: """ Get a list of available knowledge base documents Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] If specified, the endpoint returns only such knowledge base documents whose names start with this string. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter documents by creator user ID. When set, only documents created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. parent_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are direct children of the given folder. ancestor_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are descendants of the given folder. folders_first : typing.Optional[bool] Whether folders should be returned first in the list of documents. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseListResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.list( page_size=1, search="search", show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=["file"], parent_folder_id="parent_folder_id", ancestor_folder_id="ancestor_folder_id", folders_first=True, sort_direction="asc", sort_by="name", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, search=search, show_only_owned_documents=show_only_owned_documents, created_by_user_id=created_by_user_id, types=types, parent_folder_id=parent_folder_id, ancestor_folder_id=ancestor_folder_id, folders_first=folders_first, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data async def get_or_create_rag_indexes( self, *, items: typing.Sequence[GetOrCreateRagIndexRequestModel], request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]: """ Retrieves and/or creates RAG indexes for multiple knowledge base documents in a single request. Maximum 100 items per request. Parameters ---------- items : typing.Sequence[GetOrCreateRagIndexRequestModel] List of requested RAG indexes. Minimum 1, maximum 100 items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, GetOrCreateRagIndexRequestModel client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.get_or_create_rag_indexes( items=[ GetOrCreateRagIndexRequestModel( document_id="document_id", create_if_missing=True, model="e5_mistral_7b_instruct", ) ], ) asyncio.run(main()) """ _response = await self._raw_client.get_or_create_rag_indexes(items=items, request_options=request_options) return _response.data async def search( self, *, query: str, page_size: typing.Optional[int] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseContentSearchResponseModel: """ Fuzzy text search over knowledge base document content Parameters ---------- query : str The search query text page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseContentSearchResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.search( query="query", page_size=1, types=["file"], cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.search( query=query, page_size=page_size, types=types, cursor=cursor, request_options=request_options ) return _response.data @property def documents(self): if self._documents is None: from .documents.client import AsyncDocumentsClient # noqa: E402 self._documents = AsyncDocumentsClient(client_wrapper=self._client_wrapper) return self._documents @property def crawl_jobs(self): if self._crawl_jobs is None: from .crawl_jobs.client import AsyncCrawlJobsClient # noqa: E402 self._crawl_jobs = AsyncCrawlJobsClient(client_wrapper=self._client_wrapper) return self._crawl_jobs @property def document(self): if self._document is None: from .document.client import AsyncDocumentClient # noqa: E402 self._document = AsyncDocumentClient(client_wrapper=self._client_wrapper) return self._document elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/crawl_jobs/000077500000000000000000000000001523660243400333375ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400353670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/crawl_jobs# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000333621523660243400351170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/crawl_jobs# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.create_crawl_job_response_model import CreateCrawlJobResponseModel from ....types.get_crawl_job_response_model import GetCrawlJobResponseModel from ....types.list_crawl_jobs_response_model import ListCrawlJobsResponseModel from .raw_client import AsyncRawCrawlJobsClient, RawCrawlJobsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class CrawlJobsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCrawlJobsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCrawlJobsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawCrawlJobsClient """ return self._raw_client def list( self, *, include_job_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListCrawlJobsResponseModel: """ Get a list of ongoing and recent crawl jobs for the user. Parameters ---------- include_job_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Ids of additional crawl jobs to retrieve page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListCrawlJobsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.crawl_jobs.list( include_job_ids=["include_job_ids"], page_size=1, cursor="cursor", ) """ _response = self._raw_client.list( include_job_ids=include_job_ids, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data def create( self, *, url: str, max_depth: typing.Optional[int] = OMIT, max_pages: typing.Optional[int] = OMIT, pattern: typing.Optional[str] = OMIT, sitemap_urls: typing.Optional[typing.Sequence[str]] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateCrawlJobResponseModel: """ Create a crawl job to crawl the given URL with specified depth and page limits. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. max_depth : typing.Optional[int] Maximum depth for crawling (1-5), defaults to 3. max_pages : typing.Optional[int] Maximum number of pages to crawl (1-10,000), defaults to 1000. pattern : typing.Optional[str] If set, only URLs that match this pattern are included. sitemap_urls : typing.Optional[typing.Sequence[str]] List of URLs to crawl from sitemap (optional, overrides automatic URL discovery). parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateCrawlJobResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.crawl_jobs.create( url="url", ) """ _response = self._raw_client.create( url=url, max_depth=max_depth, max_pages=max_pages, pattern=pattern, sitemap_urls=sitemap_urls, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data def get( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetCrawlJobResponseModel: """ Get details about a specific crawl job including status and progress. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetCrawlJobResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.crawl_jobs.get( crawl_job_id="crawl_job_id", ) """ _response = self._raw_client.get(crawl_job_id, request_options=request_options) return _response.data def cancel(self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Cancel a crawl job and delete all associated documents and folders. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.crawl_jobs.cancel( crawl_job_id="crawl_job_id", ) """ _response = self._raw_client.cancel(crawl_job_id, request_options=request_options) return _response.data class AsyncCrawlJobsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCrawlJobsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCrawlJobsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawCrawlJobsClient """ return self._raw_client async def list( self, *, include_job_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListCrawlJobsResponseModel: """ Get a list of ongoing and recent crawl jobs for the user. Parameters ---------- include_job_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Ids of additional crawl jobs to retrieve page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListCrawlJobsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.crawl_jobs.list( include_job_ids=["include_job_ids"], page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( include_job_ids=include_job_ids, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data async def create( self, *, url: str, max_depth: typing.Optional[int] = OMIT, max_pages: typing.Optional[int] = OMIT, pattern: typing.Optional[str] = OMIT, sitemap_urls: typing.Optional[typing.Sequence[str]] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateCrawlJobResponseModel: """ Create a crawl job to crawl the given URL with specified depth and page limits. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. max_depth : typing.Optional[int] Maximum depth for crawling (1-5), defaults to 3. max_pages : typing.Optional[int] Maximum number of pages to crawl (1-10,000), defaults to 1000. pattern : typing.Optional[str] If set, only URLs that match this pattern are included. sitemap_urls : typing.Optional[typing.Sequence[str]] List of URLs to crawl from sitemap (optional, overrides automatic URL discovery). parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateCrawlJobResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.crawl_jobs.create( url="url", ) asyncio.run(main()) """ _response = await self._raw_client.create( url=url, max_depth=max_depth, max_pages=max_pages, pattern=pattern, sitemap_urls=sitemap_urls, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data async def get( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetCrawlJobResponseModel: """ Get details about a specific crawl job including status and progress. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetCrawlJobResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.crawl_jobs.get( crawl_job_id="crawl_job_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(crawl_job_id, request_options=request_options) return _response.data async def cancel(self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Cancel a crawl job and delete all associated documents and folders. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.crawl_jobs.cancel( crawl_job_id="crawl_job_id", ) asyncio.run(main()) """ _response = await self._raw_client.cancel(crawl_job_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000563621523660243400357750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/crawl_jobs# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.create_crawl_job_response_model import CreateCrawlJobResponseModel from ....types.get_crawl_job_response_model import GetCrawlJobResponseModel from ....types.list_crawl_jobs_response_model import ListCrawlJobsResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawCrawlJobsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, include_job_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListCrawlJobsResponseModel]: """ Get a list of ongoing and recent crawl jobs for the user. Parameters ---------- include_job_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Ids of additional crawl jobs to retrieve page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListCrawlJobsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/crawl", method="GET", params={ "include_job_ids": include_job_ids, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListCrawlJobsResponseModel, construct_type( type_=ListCrawlJobsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, url: str, max_depth: typing.Optional[int] = OMIT, max_pages: typing.Optional[int] = OMIT, pattern: typing.Optional[str] = OMIT, sitemap_urls: typing.Optional[typing.Sequence[str]] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateCrawlJobResponseModel]: """ Create a crawl job to crawl the given URL with specified depth and page limits. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. max_depth : typing.Optional[int] Maximum depth for crawling (1-5), defaults to 3. max_pages : typing.Optional[int] Maximum number of pages to crawl (1-10,000), defaults to 1000. pattern : typing.Optional[str] If set, only URLs that match this pattern are included. sitemap_urls : typing.Optional[typing.Sequence[str]] List of URLs to crawl from sitemap (optional, overrides automatic URL discovery). parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateCrawlJobResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/crawl", method="POST", json={ "url": url, "max_depth": max_depth, "max_pages": max_pages, "pattern": pattern, "sitemap_urls": sitemap_urls, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateCrawlJobResponseModel, construct_type( type_=CreateCrawlJobResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetCrawlJobResponseModel]: """ Get details about a specific crawl job including status and progress. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetCrawlJobResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/crawl/{jsonable_encoder(crawl_job_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetCrawlJobResponseModel, construct_type( type_=GetCrawlJobResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def cancel( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Cancel a crawl job and delete all associated documents and folders. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/crawl/{jsonable_encoder(crawl_job_id)}/cancel", method="POST", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawCrawlJobsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, include_job_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListCrawlJobsResponseModel]: """ Get a list of ongoing and recent crawl jobs for the user. Parameters ---------- include_job_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Ids of additional crawl jobs to retrieve page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListCrawlJobsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/crawl", method="GET", params={ "include_job_ids": include_job_ids, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListCrawlJobsResponseModel, construct_type( type_=ListCrawlJobsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, url: str, max_depth: typing.Optional[int] = OMIT, max_pages: typing.Optional[int] = OMIT, pattern: typing.Optional[str] = OMIT, sitemap_urls: typing.Optional[typing.Sequence[str]] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateCrawlJobResponseModel]: """ Create a crawl job to crawl the given URL with specified depth and page limits. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. max_depth : typing.Optional[int] Maximum depth for crawling (1-5), defaults to 3. max_pages : typing.Optional[int] Maximum number of pages to crawl (1-10,000), defaults to 1000. pattern : typing.Optional[str] If set, only URLs that match this pattern are included. sitemap_urls : typing.Optional[typing.Sequence[str]] List of URLs to crawl from sitemap (optional, overrides automatic URL discovery). parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateCrawlJobResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/crawl", method="POST", json={ "url": url, "max_depth": max_depth, "max_pages": max_pages, "pattern": pattern, "sitemap_urls": sitemap_urls, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateCrawlJobResponseModel, construct_type( type_=CreateCrawlJobResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetCrawlJobResponseModel]: """ Get details about a specific crawl job including status and progress. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetCrawlJobResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/crawl/{jsonable_encoder(crawl_job_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetCrawlJobResponseModel, construct_type( type_=GetCrawlJobResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def cancel( self, crawl_job_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Cancel a crawl job and delete all associated documents and folders. Parameters ---------- crawl_job_id : str The id of the crawl job to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/crawl/{jsonable_encoder(crawl_job_id)}/cancel", method="POST", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document/000077500000000000000000000000001523660243400330305ustar00rootroot00000000000000__init__.py000066400000000000000000000042741523660243400350710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( DocumentRefreshResponse, DocumentRefreshResponse_File, DocumentRefreshResponse_Folder, DocumentRefreshResponse_Text, DocumentRefreshResponse_Url, DocumentUpdateFileResponse, DocumentUpdateFileResponse_File, DocumentUpdateFileResponse_Folder, DocumentUpdateFileResponse_Text, DocumentUpdateFileResponse_Url, ) _dynamic_imports: typing.Dict[str, str] = { "DocumentRefreshResponse": ".types", "DocumentRefreshResponse_File": ".types", "DocumentRefreshResponse_Folder": ".types", "DocumentRefreshResponse_Text": ".types", "DocumentRefreshResponse_Url": ".types", "DocumentUpdateFileResponse": ".types", "DocumentUpdateFileResponse_File": ".types", "DocumentUpdateFileResponse_Folder": ".types", "DocumentUpdateFileResponse_Text": ".types", "DocumentUpdateFileResponse_Url": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DocumentRefreshResponse", "DocumentRefreshResponse_File", "DocumentRefreshResponse_Folder", "DocumentRefreshResponse_Text", "DocumentRefreshResponse_Url", "DocumentUpdateFileResponse", "DocumentUpdateFileResponse_File", "DocumentUpdateFileResponse_Folder", "DocumentUpdateFileResponse_Text", "DocumentUpdateFileResponse_Url", ] client.py000066400000000000000000000215551523660243400346110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document# This file was auto-generated by Fern from our API Definition. import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.embedding_model_enum import EmbeddingModelEnum from ....types.rag_document_index_response_model import RagDocumentIndexResponseModel from .raw_client import AsyncRawDocumentClient, RawDocumentClient from .types.document_refresh_response import DocumentRefreshResponse from .types.document_update_file_response import DocumentUpdateFileResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DocumentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDocumentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDocumentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDocumentClient """ return self._raw_client def update_file( self, documentation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> DocumentUpdateFileResponse: """ Update the source file of a file document. The document name, content, and metadata are updated to reflect the new file. Any manual content edits will be overwritten. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentUpdateFileResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.document.update_file( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update_file(documentation_id, file=file, request_options=request_options) return _response.data def refresh( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DocumentRefreshResponse: """ Manually refresh a URL document by re-fetching its content from the source URL. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentRefreshResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.document.refresh( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.refresh(documentation_id, request_options=request_options) return _response.data def compute_rag_index( self, documentation_id: str, *, model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, ) -> RagDocumentIndexResponseModel: """ In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. model : EmbeddingModelEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.document.compute_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", model="e5_mistral_7b_instruct", ) """ _response = self._raw_client.compute_rag_index(documentation_id, model=model, request_options=request_options) return _response.data class AsyncDocumentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDocumentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDocumentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDocumentClient """ return self._raw_client async def update_file( self, documentation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> DocumentUpdateFileResponse: """ Update the source file of a file document. The document name, content, and metadata are updated to reflect the new file. Any manual content edits will be overwritten. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentUpdateFileResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.document.update_file( documentation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update_file(documentation_id, file=file, request_options=request_options) return _response.data async def refresh( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DocumentRefreshResponse: """ Manually refresh a URL document by re-fetching its content from the source URL. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentRefreshResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.document.refresh( documentation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.refresh(documentation_id, request_options=request_options) return _response.data async def compute_rag_index( self, documentation_id: str, *, model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, ) -> RagDocumentIndexResponseModel: """ In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. model : EmbeddingModelEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagDocumentIndexResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.document.compute_rag_index( documentation_id="21m00Tcm4TlvDq8ikWAM", model="e5_mistral_7b_instruct", ) asyncio.run(main()) """ _response = await self._raw_client.compute_rag_index( documentation_id, model=model, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000375731523660243400354710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.embedding_model_enum import EmbeddingModelEnum from ....types.rag_document_index_response_model import RagDocumentIndexResponseModel from .types.document_refresh_response import DocumentRefreshResponse from .types.document_update_file_response import DocumentUpdateFileResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDocumentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def update_file( self, documentation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DocumentUpdateFileResponse]: """ Update the source file of a file document. The document name, content, and metadata are updated to reflect the new file. Any manual content edits will be overwritten. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DocumentUpdateFileResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/update-file", method="PATCH", data={}, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentUpdateFileResponse, construct_type( type_=DocumentUpdateFileResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def refresh( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DocumentRefreshResponse]: """ Manually refresh a URL document by re-fetching its content from the source URL. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DocumentRefreshResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/refresh", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentRefreshResponse, construct_type( type_=DocumentRefreshResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def compute_rag_index( self, documentation_id: str, *, model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[RagDocumentIndexResponseModel]: """ In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. model : EmbeddingModelEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RagDocumentIndexResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", method="POST", json={ "model": model, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexResponseModel, construct_type( type_=RagDocumentIndexResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDocumentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def update_file( self, documentation_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DocumentUpdateFileResponse]: """ Update the source file of a file document. The document name, content, and metadata are updated to reflect the new file. Any manual content edits will be overwritten. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. file : core.File See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DocumentUpdateFileResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/update-file", method="PATCH", data={}, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentUpdateFileResponse, construct_type( type_=DocumentUpdateFileResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def refresh( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DocumentRefreshResponse]: """ Manually refresh a URL document by re-fetching its content from the source URL. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DocumentRefreshResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/refresh", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentRefreshResponse, construct_type( type_=DocumentRefreshResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def compute_rag_index( self, documentation_id: str, *, model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[RagDocumentIndexResponseModel]: """ In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. model : EmbeddingModelEnum request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RagDocumentIndexResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", method="POST", json={ "model": model, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexResponseModel, construct_type( type_=RagDocumentIndexResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document/types/000077500000000000000000000000001523660243400341745ustar00rootroot00000000000000__init__.py000066400000000000000000000047431523660243400362360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .document_refresh_response import ( DocumentRefreshResponse, DocumentRefreshResponse_File, DocumentRefreshResponse_Folder, DocumentRefreshResponse_Text, DocumentRefreshResponse_Url, ) from .document_update_file_response import ( DocumentUpdateFileResponse, DocumentUpdateFileResponse_File, DocumentUpdateFileResponse_Folder, DocumentUpdateFileResponse_Text, DocumentUpdateFileResponse_Url, ) _dynamic_imports: typing.Dict[str, str] = { "DocumentRefreshResponse": ".document_refresh_response", "DocumentRefreshResponse_File": ".document_refresh_response", "DocumentRefreshResponse_Folder": ".document_refresh_response", "DocumentRefreshResponse_Text": ".document_refresh_response", "DocumentRefreshResponse_Url": ".document_refresh_response", "DocumentUpdateFileResponse": ".document_update_file_response", "DocumentUpdateFileResponse_File": ".document_update_file_response", "DocumentUpdateFileResponse_Folder": ".document_update_file_response", "DocumentUpdateFileResponse_Text": ".document_update_file_response", "DocumentUpdateFileResponse_Url": ".document_update_file_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DocumentRefreshResponse", "DocumentRefreshResponse_File", "DocumentRefreshResponse_Folder", "DocumentRefreshResponse_Text", "DocumentRefreshResponse_Url", "DocumentUpdateFileResponse", "DocumentUpdateFileResponse_File", "DocumentUpdateFileResponse_Folder", "DocumentUpdateFileResponse_Text", "DocumentUpdateFileResponse_Url", ] document_refresh_response.py000066400000000000000000000116571523660243400417530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.auto_sync_info import AutoSyncInfo from .....types.content_format import ContentFormat from .....types.document_usage_mode_enum import DocumentUsageModeEnum from .....types.external_file_sync_info import ExternalFileSyncInfo from .....types.external_folder_sync_info import ExternalFolderSyncInfo from .....types.file_refresh_status import FileRefreshStatus from .....types.kb_external_sync_job import KbExternalSyncJob from .....types.knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .....types.knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .....types.resource_access_info import ResourceAccessInfo class DocumentRefreshResponse_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None url: str extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None auto_sync_info: typing.Optional[AutoSyncInfo] = 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 class DocumentRefreshResponse_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None filename: str external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class DocumentRefreshResponse_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = 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 class DocumentRefreshResponse_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = None active_sync_job: typing.Optional[KbExternalSyncJob] = 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 DocumentRefreshResponse = typing_extensions.Annotated[ typing.Union[ DocumentRefreshResponse_Url, DocumentRefreshResponse_File, DocumentRefreshResponse_Text, DocumentRefreshResponse_Folder, ], UnionMetadata(discriminant="type"), ] document_update_file_response.py000066400000000000000000000117121523660243400425660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/document/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.auto_sync_info import AutoSyncInfo from .....types.content_format import ContentFormat from .....types.document_usage_mode_enum import DocumentUsageModeEnum from .....types.external_file_sync_info import ExternalFileSyncInfo from .....types.external_folder_sync_info import ExternalFolderSyncInfo from .....types.file_refresh_status import FileRefreshStatus from .....types.kb_external_sync_job import KbExternalSyncJob from .....types.knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .....types.knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .....types.resource_access_info import ResourceAccessInfo class DocumentUpdateFileResponse_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None url: str extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None auto_sync_info: typing.Optional[AutoSyncInfo] = 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 class DocumentUpdateFileResponse_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None filename: str external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class DocumentUpdateFileResponse_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = 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 class DocumentUpdateFileResponse_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = None active_sync_job: typing.Optional[KbExternalSyncJob] = 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 DocumentUpdateFileResponse = typing_extensions.Annotated[ typing.Union[ DocumentUpdateFileResponse_Url, DocumentUpdateFileResponse_File, DocumentUpdateFileResponse_Text, DocumentUpdateFileResponse_Folder, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/000077500000000000000000000000001523660243400332135ustar00rootroot00000000000000__init__.py000066400000000000000000000061601523660243400352500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( DocumentsBulkDeleteResponseValue, DocumentsBulkDeleteResponseValue_Failure, DocumentsBulkDeleteResponseValue_Success, DocumentsGetResponse, DocumentsGetResponse_File, DocumentsGetResponse_Folder, DocumentsGetResponse_Text, DocumentsGetResponse_Url, DocumentsUpdateResponse, DocumentsUpdateResponse_File, DocumentsUpdateResponse_Folder, DocumentsUpdateResponse_Text, DocumentsUpdateResponse_Url, ) from . import chunk, chunks, summaries from .summaries import ( SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success, ) _dynamic_imports: typing.Dict[str, str] = { "DocumentsBulkDeleteResponseValue": ".types", "DocumentsBulkDeleteResponseValue_Failure": ".types", "DocumentsBulkDeleteResponseValue_Success": ".types", "DocumentsGetResponse": ".types", "DocumentsGetResponse_File": ".types", "DocumentsGetResponse_Folder": ".types", "DocumentsGetResponse_Text": ".types", "DocumentsGetResponse_Url": ".types", "DocumentsUpdateResponse": ".types", "DocumentsUpdateResponse_File": ".types", "DocumentsUpdateResponse_Folder": ".types", "DocumentsUpdateResponse_Text": ".types", "DocumentsUpdateResponse_Url": ".types", "SummariesGetResponseValue": ".summaries", "SummariesGetResponseValue_Failure": ".summaries", "SummariesGetResponseValue_Success": ".summaries", "chunk": ".chunk", "chunks": ".chunks", "summaries": ".summaries", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DocumentsBulkDeleteResponseValue", "DocumentsBulkDeleteResponseValue_Failure", "DocumentsBulkDeleteResponseValue_Success", "DocumentsGetResponse", "DocumentsGetResponse_File", "DocumentsGetResponse_Folder", "DocumentsGetResponse_Text", "DocumentsGetResponse_Url", "DocumentsUpdateResponse", "DocumentsUpdateResponse_File", "DocumentsUpdateResponse_Folder", "DocumentsUpdateResponse_Text", "DocumentsUpdateResponse_Url", "SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success", "chunk", "chunks", "summaries", ] chunk/000077500000000000000000000000001523660243400342445ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents__init__.py000066400000000000000000000001251523660243400363530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunk# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000106041523660243400360750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunk# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.embedding_model_enum import EmbeddingModelEnum from .....types.knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel from .raw_client import AsyncRawChunkClient, RawChunkClient class ChunkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawChunkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawChunkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawChunkClient """ return self._raw_client def get( self, documentation_id: str, chunk_id: str, *, embedding_model: typing.Optional[EmbeddingModelEnum] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseDocumentChunkResponseModel: """ Get details about a specific documentation part used by RAG. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. chunk_id : str The id of a document RAG chunk from the knowledge base. embedding_model : typing.Optional[EmbeddingModelEnum] The embedding model used to retrieve the chunk. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseDocumentChunkResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.chunk.get( documentation_id="21m00Tcm4TlvDq8ikWAM", chunk_id="chunk_id", embedding_model="e5_mistral_7b_instruct", ) """ _response = self._raw_client.get( documentation_id, chunk_id, embedding_model=embedding_model, request_options=request_options ) return _response.data class AsyncChunkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawChunkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawChunkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawChunkClient """ return self._raw_client async def get( self, documentation_id: str, chunk_id: str, *, embedding_model: typing.Optional[EmbeddingModelEnum] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseDocumentChunkResponseModel: """ Get details about a specific documentation part used by RAG. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. chunk_id : str The id of a document RAG chunk from the knowledge base. embedding_model : typing.Optional[EmbeddingModelEnum] The embedding model used to retrieve the chunk. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseDocumentChunkResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.chunk.get( documentation_id="21m00Tcm4TlvDq8ikWAM", chunk_id="chunk_id", embedding_model="e5_mistral_7b_instruct", ) asyncio.run(main()) """ _response = await self._raw_client.get( documentation_id, chunk_id, embedding_model=embedding_model, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000146461523660243400367600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunk# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.embedding_model_enum import EmbeddingModelEnum from .....types.knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel from pydantic import ValidationError class RawChunkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, documentation_id: str, chunk_id: str, *, embedding_model: typing.Optional[EmbeddingModelEnum] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[KnowledgeBaseDocumentChunkResponseModel]: """ Get details about a specific documentation part used by RAG. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. chunk_id : str The id of a document RAG chunk from the knowledge base. embedding_model : typing.Optional[EmbeddingModelEnum] The embedding model used to retrieve the chunk. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[KnowledgeBaseDocumentChunkResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/chunk/{jsonable_encoder(chunk_id)}", method="GET", params={ "embedding_model": embedding_model, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseDocumentChunkResponseModel, construct_type( type_=KnowledgeBaseDocumentChunkResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawChunkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, documentation_id: str, chunk_id: str, *, embedding_model: typing.Optional[EmbeddingModelEnum] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[KnowledgeBaseDocumentChunkResponseModel]: """ Get details about a specific documentation part used by RAG. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. chunk_id : str The id of a document RAG chunk from the knowledge base. embedding_model : typing.Optional[EmbeddingModelEnum] The embedding model used to retrieve the chunk. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[KnowledgeBaseDocumentChunkResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/chunk/{jsonable_encoder(chunk_id)}", method="GET", params={ "embedding_model": embedding_model, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseDocumentChunkResponseModel, construct_type( type_=KnowledgeBaseDocumentChunkResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) chunks/000077500000000000000000000000001523660243400344275ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents__init__.py000066400000000000000000000001251523660243400365360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunks# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000117141523660243400362630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunks# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.embedding_model_enum import EmbeddingModelEnum from .....types.knowledge_base_document_chunks_response_model import KnowledgeBaseDocumentChunksResponseModel from .raw_client import AsyncRawChunksClient, RawChunksClient class ChunksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawChunksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawChunksClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawChunksClient """ return self._raw_client def list( self, documentation_id: str, *, embedding_model: EmbeddingModelEnum, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseDocumentChunksResponseModel: """ Get all RAG chunks for a specific knowledge base document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. embedding_model : EmbeddingModelEnum The embedding model used to retrieve the chunk. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseDocumentChunksResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.chunks.list( documentation_id="21m00Tcm4TlvDq8ikWAM", embedding_model="e5_mistral_7b_instruct", page_size=1, cursor="cursor", ) """ _response = self._raw_client.list( documentation_id, embedding_model=embedding_model, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data class AsyncChunksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawChunksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawChunksClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawChunksClient """ return self._raw_client async def list( self, documentation_id: str, *, embedding_model: EmbeddingModelEnum, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> KnowledgeBaseDocumentChunksResponseModel: """ Get all RAG chunks for a specific knowledge base document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. embedding_model : EmbeddingModelEnum The embedding model used to retrieve the chunk. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseDocumentChunksResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.chunks.list( documentation_id="21m00Tcm4TlvDq8ikWAM", embedding_model="e5_mistral_7b_instruct", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( documentation_id, embedding_model=embedding_model, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000000155741523660243400371440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/chunks# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.embedding_model_enum import EmbeddingModelEnum from .....types.knowledge_base_document_chunks_response_model import KnowledgeBaseDocumentChunksResponseModel from pydantic import ValidationError class RawChunksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, documentation_id: str, *, embedding_model: EmbeddingModelEnum, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[KnowledgeBaseDocumentChunksResponseModel]: """ Get all RAG chunks for a specific knowledge base document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. embedding_model : EmbeddingModelEnum The embedding model used to retrieve the chunk. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[KnowledgeBaseDocumentChunksResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/chunks", method="GET", params={ "embedding_model": embedding_model, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseDocumentChunksResponseModel, construct_type( type_=KnowledgeBaseDocumentChunksResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawChunksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, documentation_id: str, *, embedding_model: EmbeddingModelEnum, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[KnowledgeBaseDocumentChunksResponseModel]: """ Get all RAG chunks for a specific knowledge base document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. embedding_model : EmbeddingModelEnum The embedding model used to retrieve the chunk. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[KnowledgeBaseDocumentChunksResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/chunks", method="GET", params={ "embedding_model": embedding_model, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseDocumentChunksResponseModel, construct_type( type_=KnowledgeBaseDocumentChunksResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) client.py000066400000000000000000001325111523660243400347670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from ....types.get_knowledge_base_dependent_agents_response_model import GetKnowledgeBaseDependentAgentsResponseModel from ....types.knowledge_base_dependent_type import KnowledgeBaseDependentType from ....types.knowledge_base_source_file_url_response_model import KnowledgeBaseSourceFileUrlResponseModel from .raw_client import AsyncRawDocumentsClient, RawDocumentsClient from .types.documents_bulk_delete_response_value import DocumentsBulkDeleteResponseValue from .types.documents_get_response import DocumentsGetResponse from .types.documents_update_response import DocumentsUpdateResponse if typing.TYPE_CHECKING: from .chunk.client import AsyncChunkClient, ChunkClient from .chunks.client import AsyncChunksClient, ChunksClient from .summaries.client import AsyncSummariesClient, SummariesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DocumentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDocumentsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._summaries: typing.Optional[SummariesClient] = None self._chunk: typing.Optional[ChunkClient] = None self._chunks: typing.Optional[ChunksClient] = None @property def with_raw_response(self) -> RawDocumentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDocumentsClient """ return self._raw_client def create_from_url( self, *, url: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document generated by scraping the given webpage. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.create_from_url( url="url", ) """ _response = self._raw_client.create_from_url( url=url, name=name, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data def create_from_file( self, *, file: core.File, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document generated form the uploaded file. Parameters ---------- file : core.File See core.File for more documentation name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.create_from_file() """ _response = self._raw_client.create_from_file( file=file, name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data def create_from_text( self, *, text: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document containing the provided text. Parameters ---------- text : str Text content to be added to the knowledge base. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.create_from_text( text="text", ) """ _response = self._raw_client.create_from_text( text=text, name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data def create_folder( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a folder used for grouping documents together. Parameters ---------- name : str A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.create_folder( name="name", ) """ _response = self._raw_client.create_folder( name=name, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data def get( self, documentation_id: str, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DocumentsGetResponse: """ Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. agent_id : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentsGetResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.get( documentation_id="21m00Tcm4TlvDq8ikWAM", agent_id="agent_id", ) """ _response = self._raw_client.get(documentation_id, agent_id=agent_id, request_options=request_options) return _response.data def delete( self, documentation_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete a document or folder from the knowledge base. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. force : typing.Optional[bool] If set to true, the document or folder will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.delete( documentation_id="21m00Tcm4TlvDq8ikWAM", force=True, ) """ _response = self._raw_client.delete(documentation_id, force=force, request_options=request_options) return _response.data def update( self, documentation_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DocumentsUpdateResponse: """ Update the name and/or content of a document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. name : typing.Optional[str] A custom, human-readable name for the document. content : typing.Optional[str] Updated content for the document. Only supported for text documents, URL documents with auto-sync disabled, and file documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentsUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.update( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( documentation_id, name=name, content=content, request_options=request_options ) return _response.data def get_agents( self, documentation_id: str, *, dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseDependentAgentsResponseModel: """ Get a list of agents depending on this knowledge base document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseDependentAgentsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.get_agents( documentation_id="21m00Tcm4TlvDq8ikWAM", dependent_type="direct", page_size=1, cursor="cursor", ) """ _response = self._raw_client.get_agents( documentation_id, dependent_type=dependent_type, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data def get_bulk_agents( self, *, document_ids: typing.Sequence[str], dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseDependentAgentsResponseModel: """ Get a list of agents depending on any of the given knowledge base documents. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseDependentAgentsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.get_bulk_agents( dependent_type="direct", page_size=1, cursor="cursor", document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) """ _response = self._raw_client.get_bulk_agents( document_ids=document_ids, dependent_type=dependent_type, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data def get_content(self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: """ Get the entire content of a document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- str Streaming document content Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.get_content( documentation_id="documentation_id", ) """ _response = self._raw_client.get_content(documentation_id, request_options=request_options) return _response.data def get_source_file_url( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> KnowledgeBaseSourceFileUrlResponseModel: """ Get a signed URL to download the original source file of a file-type document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseSourceFileUrlResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.get_source_file_url( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get_source_file_url(documentation_id, request_options=request_options) return _response.data def move( self, document_id: str, *, move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Moves the entity from one folder to another. Parameters ---------- document_id : str The id of a document from the knowledge base. This is returned on document addition. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.move( document_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.move(document_id, move_to=move_to, request_options=request_options) return _response.data def bulk_move( self, *, document_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Moves multiple entities from one folder to another. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.bulk_move( document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) """ _response = self._raw_client.bulk_move( document_ids=document_ids, move_to=move_to, request_options=request_options ) return _response.data def bulk_delete( self, *, document_ids: typing.Sequence[str], force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, DocumentsBulkDeleteResponseValue]: """ Delete multiple documents or folders from the knowledge base. Each id succeeds or fails independently. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. force : typing.Optional[bool] If set to true, documents or folders will be deleted regardless of whether they are used by any agents and will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, DocumentsBulkDeleteResponseValue] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.bulk_delete( document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) """ _response = self._raw_client.bulk_delete( document_ids=document_ids, force=force, request_options=request_options ) return _response.data @property def summaries(self): if self._summaries is None: from .summaries.client import SummariesClient # noqa: E402 self._summaries = SummariesClient(client_wrapper=self._client_wrapper) return self._summaries @property def chunk(self): if self._chunk is None: from .chunk.client import ChunkClient # noqa: E402 self._chunk = ChunkClient(client_wrapper=self._client_wrapper) return self._chunk @property def chunks(self): if self._chunks is None: from .chunks.client import ChunksClient # noqa: E402 self._chunks = ChunksClient(client_wrapper=self._client_wrapper) return self._chunks class AsyncDocumentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDocumentsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._summaries: typing.Optional[AsyncSummariesClient] = None self._chunk: typing.Optional[AsyncChunkClient] = None self._chunks: typing.Optional[AsyncChunksClient] = None @property def with_raw_response(self) -> AsyncRawDocumentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDocumentsClient """ return self._raw_client async def create_from_url( self, *, url: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document generated by scraping the given webpage. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.create_from_url( url="url", ) asyncio.run(main()) """ _response = await self._raw_client.create_from_url( url=url, name=name, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data async def create_from_file( self, *, file: core.File, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document generated form the uploaded file. Parameters ---------- file : core.File See core.File for more documentation name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.create_from_file() asyncio.run(main()) """ _response = await self._raw_client.create_from_file( file=file, name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data async def create_from_text( self, *, text: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a knowledge base document containing the provided text. Parameters ---------- text : str Text content to be added to the knowledge base. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.create_from_text( text="text", ) asyncio.run(main()) """ _response = await self._raw_client.create_from_text( text=text, name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data async def create_folder( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Create a folder used for grouping documents together. Parameters ---------- name : str A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddKnowledgeBaseResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.create_folder( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create_folder( name=name, parent_folder_id=parent_folder_id, enable_auto_sync=enable_auto_sync, auto_remove=auto_remove, request_options=request_options, ) return _response.data async def get( self, documentation_id: str, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DocumentsGetResponse: """ Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. agent_id : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentsGetResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.get( documentation_id="21m00Tcm4TlvDq8ikWAM", agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(documentation_id, agent_id=agent_id, request_options=request_options) return _response.data async def delete( self, documentation_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete a document or folder from the knowledge base. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. force : typing.Optional[bool] If set to true, the document or folder will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.delete( documentation_id="21m00Tcm4TlvDq8ikWAM", force=True, ) asyncio.run(main()) """ _response = await self._raw_client.delete(documentation_id, force=force, request_options=request_options) return _response.data async def update( self, documentation_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DocumentsUpdateResponse: """ Update the name and/or content of a document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. name : typing.Optional[str] A custom, human-readable name for the document. content : typing.Optional[str] Updated content for the document. Only supported for text documents, URL documents with auto-sync disabled, and file documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DocumentsUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.update( documentation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( documentation_id, name=name, content=content, request_options=request_options ) return _response.data async def get_agents( self, documentation_id: str, *, dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseDependentAgentsResponseModel: """ Get a list of agents depending on this knowledge base document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseDependentAgentsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.get_agents( documentation_id="21m00Tcm4TlvDq8ikWAM", dependent_type="direct", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.get_agents( documentation_id, dependent_type=dependent_type, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data async def get_bulk_agents( self, *, document_ids: typing.Sequence[str], dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseDependentAgentsResponseModel: """ Get a list of agents depending on any of the given knowledge base documents. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetKnowledgeBaseDependentAgentsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.get_bulk_agents( dependent_type="direct", page_size=1, cursor="cursor", document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) asyncio.run(main()) """ _response = await self._raw_client.get_bulk_agents( document_ids=document_ids, dependent_type=dependent_type, page_size=page_size, cursor=cursor, request_options=request_options, ) return _response.data async def get_content( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> str: """ Get the entire content of a document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- str Streaming document content Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.get_content( documentation_id="documentation_id", ) asyncio.run(main()) """ _response = await self._raw_client.get_content(documentation_id, request_options=request_options) return _response.data async def get_source_file_url( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> KnowledgeBaseSourceFileUrlResponseModel: """ Get a signed URL to download the original source file of a file-type document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- KnowledgeBaseSourceFileUrlResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.get_source_file_url( documentation_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get_source_file_url(documentation_id, request_options=request_options) return _response.data async def move( self, document_id: str, *, move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Moves the entity from one folder to another. Parameters ---------- document_id : str The id of a document from the knowledge base. This is returned on document addition. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. 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.conversational_ai.knowledge_base.documents.move( document_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.move(document_id, move_to=move_to, request_options=request_options) return _response.data async def bulk_move( self, *, document_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Moves multiple entities from one folder to another. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. 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.conversational_ai.knowledge_base.documents.bulk_move( document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) asyncio.run(main()) """ _response = await self._raw_client.bulk_move( document_ids=document_ids, move_to=move_to, request_options=request_options ) return _response.data async def bulk_delete( self, *, document_ids: typing.Sequence[str], force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, DocumentsBulkDeleteResponseValue]: """ Delete multiple documents or folders from the knowledge base. Each id succeeds or fails independently. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. force : typing.Optional[bool] If set to true, documents or folders will be deleted regardless of whether they are used by any agents and will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, DocumentsBulkDeleteResponseValue] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.bulk_delete( document_ids=["21m00Tcm4TlvDq8ikWAM", "31m00Tcm4TlvDq8ikWBM"], ) asyncio.run(main()) """ _response = await self._raw_client.bulk_delete( document_ids=document_ids, force=force, request_options=request_options ) return _response.data @property def summaries(self): if self._summaries is None: from .summaries.client import AsyncSummariesClient # noqa: E402 self._summaries = AsyncSummariesClient(client_wrapper=self._client_wrapper) return self._summaries @property def chunk(self): if self._chunk is None: from .chunk.client import AsyncChunkClient # noqa: E402 self._chunk = AsyncChunkClient(client_wrapper=self._client_wrapper) return self._chunk @property def chunks(self): if self._chunks is None: from .chunks.client import AsyncChunksClient # noqa: E402 self._chunks = AsyncChunksClient(client_wrapper=self._client_wrapper) return self._chunks raw_client.py000066400000000000000000002277221523660243400356510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from ....types.get_knowledge_base_dependent_agents_response_model import GetKnowledgeBaseDependentAgentsResponseModel from ....types.knowledge_base_dependent_type import KnowledgeBaseDependentType from ....types.knowledge_base_source_file_url_response_model import KnowledgeBaseSourceFileUrlResponseModel from .types.documents_bulk_delete_response_value import DocumentsBulkDeleteResponseValue from .types.documents_get_response import DocumentsGetResponse from .types.documents_update_response import DocumentsUpdateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDocumentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create_from_url( self, *, url: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document generated by scraping the given webpage. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/url", method="POST", json={ "url": url, "name": name, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_from_file( self, *, file: core.File, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document generated form the uploaded file. Parameters ---------- file : core.File See core.File for more documentation name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/file", method="POST", data={ "name": name, "parent_folder_id": parent_folder_id, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_from_text( self, *, text: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document containing the provided text. Parameters ---------- text : str Text content to be added to the knowledge base. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/text", method="POST", json={ "text": text, "name": name, "parent_folder_id": parent_folder_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_folder( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ Create a folder used for grouping documents together. Parameters ---------- name : str A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/folder", method="POST", json={ "name": name, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, documentation_id: str, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DocumentsGetResponse]: """ Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. agent_id : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DocumentsGetResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentsGetResponse, construct_type( type_=DocumentsGetResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, documentation_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Delete a document or folder from the knowledge base. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. force : typing.Optional[bool] If set to true, the document or folder will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, documentation_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DocumentsUpdateResponse]: """ Update the name and/or content of a document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. name : typing.Optional[str] A custom, human-readable name for the document. content : typing.Optional[str] Updated content for the document. Only supported for text documents, URL documents with auto-sync disabled, and file documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DocumentsUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="PATCH", json={ "name": name, "content": content, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentsUpdateResponse, construct_type( type_=DocumentsUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_agents( self, documentation_id: str, *, dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetKnowledgeBaseDependentAgentsResponseModel]: """ Get a list of agents depending on this knowledge base document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetKnowledgeBaseDependentAgentsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/dependent-agents", method="GET", params={ "dependent_type": dependent_type, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseDependentAgentsResponseModel, construct_type( type_=GetKnowledgeBaseDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_bulk_agents( self, *, document_ids: typing.Sequence[str], dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetKnowledgeBaseDependentAgentsResponseModel]: """ Get a list of agents depending on any of the given knowledge base documents. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetKnowledgeBaseDependentAgentsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/dependent-agents", method="POST", params={ "dependent_type": dependent_type, "page_size": page_size, "cursor": cursor, }, json={ "document_ids": document_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseDependentAgentsResponseModel, construct_type( type_=GetKnowledgeBaseDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_content( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[str]: """ Get the entire content of a document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[str] Streaming document content """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/content", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=_response.text) # type: ignore if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_source_file_url( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[KnowledgeBaseSourceFileUrlResponseModel]: """ Get a signed URL to download the original source file of a file-type document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[KnowledgeBaseSourceFileUrlResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/source-file-url", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseSourceFileUrlResponseModel, construct_type( type_=KnowledgeBaseSourceFileUrlResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def move( self, document_id: str, *, move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ Moves the entity from one folder to another. Parameters ---------- document_id : str The id of a document from the knowledge base. This is returned on document addition. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(document_id)}/move", method="POST", json={ "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def bulk_move( self, *, document_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ Moves multiple entities from one folder to another. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/bulk-move", method="POST", json={ "document_ids": document_ids, "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def bulk_delete( self, *, document_ids: typing.Sequence[str], force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Dict[str, DocumentsBulkDeleteResponseValue]]: """ Delete multiple documents or folders from the knowledge base. Each id succeeds or fails independently. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. force : typing.Optional[bool] If set to true, documents or folders will be deleted regardless of whether they are used by any agents and will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Dict[str, DocumentsBulkDeleteResponseValue]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/bulk-delete", method="POST", json={ "document_ids": document_ids, "force": force, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, DocumentsBulkDeleteResponseValue], construct_type( type_=typing.Dict[str, DocumentsBulkDeleteResponseValue], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDocumentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create_from_url( self, *, url: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document generated by scraping the given webpage. Parameters ---------- url : str URL to a page of documentation that the agent will have access to in order to interact with users. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/url", method="POST", json={ "url": url, "name": name, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_from_file( self, *, file: core.File, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document generated form the uploaded file. Parameters ---------- file : core.File See core.File for more documentation name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/file", method="POST", data={ "name": name, "parent_folder_id": parent_folder_id, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_from_text( self, *, text: str, name: typing.Optional[str] = OMIT, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: """ Create a knowledge base document containing the provided text. Parameters ---------- text : str Text content to be added to the knowledge base. name : typing.Optional[str] A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/text", method="POST", json={ "text": text, "name": name, "parent_folder_id": parent_folder_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_folder( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, enable_auto_sync: typing.Optional[bool] = OMIT, auto_remove: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: """ Create a folder used for grouping documents together. Parameters ---------- name : str A custom, human-readable name for the document. parent_folder_id : typing.Optional[str] If set, the created document or folder will be placed inside the given folder. enable_auto_sync : typing.Optional[bool] Whether to enable auto-sync for this URL document. auto_remove : typing.Optional[bool] Whether to automatically remove the document if the URL becomes unavailable. Only applicable when auto-sync is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/folder", method="POST", json={ "name": name, "parent_folder_id": parent_folder_id, "enable_auto_sync": enable_auto_sync, "auto_remove": auto_remove, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, documentation_id: str, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DocumentsGetResponse]: """ Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. agent_id : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DocumentsGetResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentsGetResponse, construct_type( type_=DocumentsGetResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, documentation_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Delete a document or folder from the knowledge base. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. force : typing.Optional[bool] If set to true, the document or folder will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, documentation_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DocumentsUpdateResponse]: """ Update the name and/or content of a document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. name : typing.Optional[str] A custom, human-readable name for the document. content : typing.Optional[str] Updated content for the document. Only supported for text documents, URL documents with auto-sync disabled, and file documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DocumentsUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", method="PATCH", json={ "name": name, "content": content, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DocumentsUpdateResponse, construct_type( type_=DocumentsUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_agents( self, documentation_id: str, *, dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetKnowledgeBaseDependentAgentsResponseModel]: """ Get a list of agents depending on this knowledge base document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetKnowledgeBaseDependentAgentsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/dependent-agents", method="GET", params={ "dependent_type": dependent_type, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseDependentAgentsResponseModel, construct_type( type_=GetKnowledgeBaseDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_bulk_agents( self, *, document_ids: typing.Sequence[str], dependent_type: typing.Optional[KnowledgeBaseDependentType] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetKnowledgeBaseDependentAgentsResponseModel]: """ Get a list of agents depending on any of the given knowledge base documents. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. dependent_type : typing.Optional[KnowledgeBaseDependentType] Type of dependent agents to return. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetKnowledgeBaseDependentAgentsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/dependent-agents", method="POST", params={ "dependent_type": dependent_type, "page_size": page_size, "cursor": cursor, }, json={ "document_ids": document_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseDependentAgentsResponseModel, construct_type( type_=GetKnowledgeBaseDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_content( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[str]: """ Get the entire content of a document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[str] Streaming document content """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/content", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=_response.text) # type: ignore if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_source_file_url( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[KnowledgeBaseSourceFileUrlResponseModel]: """ Get a signed URL to download the original source file of a file-type document from the knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[KnowledgeBaseSourceFileUrlResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/source-file-url", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseSourceFileUrlResponseModel, construct_type( type_=KnowledgeBaseSourceFileUrlResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def move( self, document_id: str, *, move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ Moves the entity from one folder to another. Parameters ---------- document_id : str The id of a document from the knowledge base. This is returned on document addition. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(document_id)}/move", method="POST", json={ "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def bulk_move( self, *, document_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ Moves multiple entities from one folder to another. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/bulk-move", method="POST", json={ "document_ids": document_ids, "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def bulk_delete( self, *, document_ids: typing.Sequence[str], force: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Dict[str, DocumentsBulkDeleteResponseValue]]: """ Delete multiple documents or folders from the knowledge base. Each id succeeds or fails independently. Parameters ---------- document_ids : typing.Sequence[str] The ids of documents or folders from the knowledge base. force : typing.Optional[bool] If set to true, documents or folders will be deleted regardless of whether they are used by any agents and will be removed from the dependent agents. For non-empty folders, this will also delete all child documents and folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Dict[str, DocumentsBulkDeleteResponseValue]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/bulk-delete", method="POST", json={ "document_ids": document_ids, "force": force, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, DocumentsBulkDeleteResponseValue], construct_type( type_=typing.Dict[str, DocumentsBulkDeleteResponseValue], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) summaries/000077500000000000000000000000001523660243400351415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents__init__.py000066400000000000000000000025041523660243400372530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success _dynamic_imports: typing.Dict[str, str] = { "SummariesGetResponseValue": ".types", "SummariesGetResponseValue_Failure": ".types", "SummariesGetResponseValue_Success": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success"] client.py000066400000000000000000000071671523660243400370040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .raw_client import AsyncRawSummariesClient, RawSummariesClient from .types.summaries_get_response_value import SummariesGetResponseValue class SummariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSummariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSummariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSummariesClient """ return self._raw_client def get( self, *, document_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, SummariesGetResponseValue]: """ Gets multiple knowledge base document summaries by their IDs. Parameters ---------- document_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] The ids of knowledge base documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, SummariesGetResponseValue] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.knowledge_base.documents.summaries.get( document_ids=["21m00Tcm4TlvDq8ikWAM", "31n11Udm5UmwEr9jkXBN"], ) """ _response = self._raw_client.get(document_ids=document_ids, request_options=request_options) return _response.data class AsyncSummariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSummariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSummariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSummariesClient """ return self._raw_client async def get( self, *, document_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, SummariesGetResponseValue]: """ Gets multiple knowledge base document summaries by their IDs. Parameters ---------- document_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] The ids of knowledge base documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, SummariesGetResponseValue] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.knowledge_base.documents.summaries.get( document_ids=["21m00Tcm4TlvDq8ikWAM", "31n11Udm5UmwEr9jkXBN"], ) asyncio.run(main()) """ _response = await self._raw_client.get(document_ids=document_ids, request_options=request_options) return _response.data raw_client.py000066400000000000000000000132711523660243400376460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .types.summaries_get_response_value import SummariesGetResponseValue from pydantic import ValidationError class RawSummariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, document_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Dict[str, SummariesGetResponseValue]]: """ Gets multiple knowledge base document summaries by their IDs. Parameters ---------- document_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] The ids of knowledge base documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Dict[str, SummariesGetResponseValue]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/summaries", method="GET", params={ "document_ids": document_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, SummariesGetResponseValue], construct_type( type_=typing.Dict[str, SummariesGetResponseValue], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSummariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, document_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Dict[str, SummariesGetResponseValue]]: """ Gets multiple knowledge base document summaries by their IDs. Parameters ---------- document_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] The ids of knowledge base documents. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Dict[str, SummariesGetResponseValue]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/summaries", method="GET", params={ "document_ids": document_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, SummariesGetResponseValue], construct_type( type_=typing.Dict[str, SummariesGetResponseValue], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) types/000077500000000000000000000000001523660243400363055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries__init__.py000066400000000000000000000027011523660243400404160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .summaries_get_response_value import ( SummariesGetResponseValue, SummariesGetResponseValue_Failure, SummariesGetResponseValue_Success, ) _dynamic_imports: typing.Dict[str, str] = { "SummariesGetResponseValue": ".summaries_get_response_value", "SummariesGetResponseValue_Failure": ".summaries_get_response_value", "SummariesGetResponseValue_Success": ".summaries_get_response_value", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["SummariesGetResponseValue", "SummariesGetResponseValue_Failure", "SummariesGetResponseValue_Success"] summaries_get_response_value.py000066400000000000000000000030431523660243400446350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/summaries/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ......core.pydantic_utilities import IS_PYDANTIC_V2 from ......core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ......types.knowledge_base_summary_batch_successful_response_model_data import ( KnowledgeBaseSummaryBatchSuccessfulResponseModelData, ) class SummariesGetResponseValue_Success(UncheckedBaseModel): status: typing.Literal["success"] = "success" data: KnowledgeBaseSummaryBatchSuccessfulResponseModelData 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 SummariesGetResponseValue_Failure(UncheckedBaseModel): status: typing.Literal["failure"] = "failure" error_code: int error_status: str error_message: 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 SummariesGetResponseValue = typing_extensions.Annotated[ typing.Union[SummariesGetResponseValue_Success, SummariesGetResponseValue_Failure], UnionMetadata(discriminant="status"), ] types/000077500000000000000000000000001523660243400343005ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents__init__.py000066400000000000000000000056661523660243400364260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .documents_bulk_delete_response_value import ( DocumentsBulkDeleteResponseValue, DocumentsBulkDeleteResponseValue_Failure, DocumentsBulkDeleteResponseValue_Success, ) from .documents_get_response import ( DocumentsGetResponse, DocumentsGetResponse_File, DocumentsGetResponse_Folder, DocumentsGetResponse_Text, DocumentsGetResponse_Url, ) from .documents_update_response import ( DocumentsUpdateResponse, DocumentsUpdateResponse_File, DocumentsUpdateResponse_Folder, DocumentsUpdateResponse_Text, DocumentsUpdateResponse_Url, ) _dynamic_imports: typing.Dict[str, str] = { "DocumentsBulkDeleteResponseValue": ".documents_bulk_delete_response_value", "DocumentsBulkDeleteResponseValue_Failure": ".documents_bulk_delete_response_value", "DocumentsBulkDeleteResponseValue_Success": ".documents_bulk_delete_response_value", "DocumentsGetResponse": ".documents_get_response", "DocumentsGetResponse_File": ".documents_get_response", "DocumentsGetResponse_Folder": ".documents_get_response", "DocumentsGetResponse_Text": ".documents_get_response", "DocumentsGetResponse_Url": ".documents_get_response", "DocumentsUpdateResponse": ".documents_update_response", "DocumentsUpdateResponse_File": ".documents_update_response", "DocumentsUpdateResponse_Folder": ".documents_update_response", "DocumentsUpdateResponse_Text": ".documents_update_response", "DocumentsUpdateResponse_Url": ".documents_update_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DocumentsBulkDeleteResponseValue", "DocumentsBulkDeleteResponseValue_Failure", "DocumentsBulkDeleteResponseValue_Success", "DocumentsGetResponse", "DocumentsGetResponse_File", "DocumentsGetResponse_Folder", "DocumentsGetResponse_Text", "DocumentsGetResponse_Url", "DocumentsUpdateResponse", "DocumentsUpdateResponse_File", "DocumentsUpdateResponse_Folder", "DocumentsUpdateResponse_Text", "DocumentsUpdateResponse_Url", ] documents_bulk_delete_response_value.py000066400000000000000000000027761523660243400443400ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.knowledge_base_deleted_response_model import KnowledgeBaseDeletedResponseModel class DocumentsBulkDeleteResponseValue_Success(UncheckedBaseModel): status: typing.Literal["success"] = "success" data: KnowledgeBaseDeletedResponseModel 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 DocumentsBulkDeleteResponseValue_Failure(UncheckedBaseModel): status: typing.Literal["failure"] = "failure" error_code: int error_status: str error_message: 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 DocumentsBulkDeleteResponseValue = typing_extensions.Annotated[ typing.Union[DocumentsBulkDeleteResponseValue_Success, DocumentsBulkDeleteResponseValue_Failure], UnionMetadata(discriminant="status"), ] documents_get_response.py000066400000000000000000000115731523660243400414370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.auto_sync_info import AutoSyncInfo from .....types.content_format import ContentFormat from .....types.document_usage_mode_enum import DocumentUsageModeEnum from .....types.external_file_sync_info import ExternalFileSyncInfo from .....types.external_folder_sync_info import ExternalFolderSyncInfo from .....types.file_refresh_status import FileRefreshStatus from .....types.kb_external_sync_job import KbExternalSyncJob from .....types.knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .....types.knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .....types.resource_access_info import ResourceAccessInfo class DocumentsGetResponse_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None url: str extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None auto_sync_info: typing.Optional[AutoSyncInfo] = 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 class DocumentsGetResponse_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None filename: str external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class DocumentsGetResponse_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = 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 class DocumentsGetResponse_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = None active_sync_job: typing.Optional[KbExternalSyncJob] = 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 DocumentsGetResponse = typing_extensions.Annotated[ typing.Union[ DocumentsGetResponse_Url, DocumentsGetResponse_File, DocumentsGetResponse_Text, DocumentsGetResponse_Folder ], UnionMetadata(discriminant="type"), ] documents_update_response.py000066400000000000000000000116571523660243400421450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/documents/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.auto_sync_info import AutoSyncInfo from .....types.content_format import ContentFormat from .....types.document_usage_mode_enum import DocumentUsageModeEnum from .....types.external_file_sync_info import ExternalFileSyncInfo from .....types.external_folder_sync_info import ExternalFolderSyncInfo from .....types.file_refresh_status import FileRefreshStatus from .....types.kb_external_sync_job import KbExternalSyncJob from .....types.knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .....types.knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .....types.resource_access_info import ResourceAccessInfo class DocumentsUpdateResponse_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None url: str extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None auto_sync_info: typing.Optional[AutoSyncInfo] = 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 class DocumentsUpdateResponse_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None filename: str external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class DocumentsUpdateResponse_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None extracted_inner_html: str content_format: typing.Optional[ContentFormat] = 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 class DocumentsUpdateResponse_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = None children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = None active_sync_job: typing.Optional[KbExternalSyncJob] = 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 DocumentsUpdateResponse = typing_extensions.Annotated[ typing.Union[ DocumentsUpdateResponse_Url, DocumentsUpdateResponse_File, DocumentsUpdateResponse_Text, DocumentsUpdateResponse_Folder, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/raw_client.py000066400000000000000000000560531523660243400337240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.get_knowledge_base_list_response_model import GetKnowledgeBaseListResponseModel from ...types.get_or_create_rag_index_request_model import GetOrCreateRagIndexRequestModel from ...types.knowledge_base_content_search_response_model import KnowledgeBaseContentSearchResponseModel from ...types.knowledge_base_document_type import KnowledgeBaseDocumentType from ...types.knowledge_base_sort_by import KnowledgeBaseSortBy from ...types.sort_direction import SortDirection from .types.knowledge_base_get_or_create_rag_indexes_response_value import ( KnowledgeBaseGetOrCreateRagIndexesResponseValue, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawKnowledgeBaseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, parent_folder_id: typing.Optional[str] = None, ancestor_folder_id: typing.Optional[str] = None, folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetKnowledgeBaseListResponseModel]: """ Get a list of available knowledge base documents Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] If specified, the endpoint returns only such knowledge base documents whose names start with this string. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter documents by creator user ID. When set, only documents created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. parent_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are direct children of the given folder. ancestor_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are descendants of the given folder. folders_first : typing.Optional[bool] Whether folders should be returned first in the list of documents. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetKnowledgeBaseListResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base", method="GET", params={ "page_size": page_size, "search": search, "show_only_owned_documents": show_only_owned_documents, "created_by_user_id": created_by_user_id, "types": types, "parent_folder_id": parent_folder_id, "ancestor_folder_id": ancestor_folder_id, "folders_first": folders_first, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseListResponseModel, construct_type( type_=GetKnowledgeBaseListResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_or_create_rag_indexes( self, *, items: typing.Sequence[GetOrCreateRagIndexRequestModel], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]]: """ Retrieves and/or creates RAG indexes for multiple knowledge base documents in a single request. Maximum 100 items per request. Parameters ---------- items : typing.Sequence[GetOrCreateRagIndexRequestModel] List of requested RAG indexes. Minimum 1, maximum 100 items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/rag-index", method="POST", json={ "items": convert_and_respect_annotation_metadata( object_=items, annotation=typing.Sequence[GetOrCreateRagIndexRequestModel], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue], construct_type( type_=typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def search( self, *, query: str, page_size: typing.Optional[int] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[KnowledgeBaseContentSearchResponseModel]: """ Fuzzy text search over knowledge base document content Parameters ---------- query : str The search query text page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[KnowledgeBaseContentSearchResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/search", method="GET", params={ "query": query, "page_size": page_size, "types": types, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseContentSearchResponseModel, construct_type( type_=KnowledgeBaseContentSearchResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawKnowledgeBaseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, parent_folder_id: typing.Optional[str] = None, ancestor_folder_id: typing.Optional[str] = None, folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetKnowledgeBaseListResponseModel]: """ Get a list of available knowledge base documents Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] If specified, the endpoint returns only such knowledge base documents whose names start with this string. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter documents by creator user ID. When set, only documents created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. parent_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are direct children of the given folder. ancestor_folder_id : typing.Optional[str] If set, the endpoint will return only documents that are descendants of the given folder. folders_first : typing.Optional[bool] Whether folders should be returned first in the list of documents. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetKnowledgeBaseListResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base", method="GET", params={ "page_size": page_size, "search": search, "show_only_owned_documents": show_only_owned_documents, "created_by_user_id": created_by_user_id, "types": types, "parent_folder_id": parent_folder_id, "ancestor_folder_id": ancestor_folder_id, "folders_first": folders_first, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetKnowledgeBaseListResponseModel, construct_type( type_=GetKnowledgeBaseListResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_or_create_rag_indexes( self, *, items: typing.Sequence[GetOrCreateRagIndexRequestModel], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]]: """ Retrieves and/or creates RAG indexes for multiple knowledge base documents in a single request. Maximum 100 items per request. Parameters ---------- items : typing.Sequence[GetOrCreateRagIndexRequestModel] List of requested RAG indexes. Minimum 1, maximum 100 items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/rag-index", method="POST", json={ "items": convert_and_respect_annotation_metadata( object_=items, annotation=typing.Sequence[GetOrCreateRagIndexRequestModel], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue], construct_type( type_=typing.Dict[str, KnowledgeBaseGetOrCreateRagIndexesResponseValue], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def search( self, *, query: str, page_size: typing.Optional[int] = None, types: typing.Optional[ typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]] ] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[KnowledgeBaseContentSearchResponseModel]: """ Fuzzy text search over knowledge base document content Parameters ---------- query : str The search query text page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. types : typing.Optional[typing.Union[KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType]]] If present, the endpoint will return only documents of the given types. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[KnowledgeBaseContentSearchResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/search", method="GET", params={ "query": query, "page_size": page_size, "types": types, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( KnowledgeBaseContentSearchResponseModel, construct_type( type_=KnowledgeBaseContentSearchResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/types/000077500000000000000000000000001523660243400323565ustar00rootroot00000000000000__init__.py000066400000000000000000000034021523660243400344070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .knowledge_base_get_or_create_rag_indexes_response_value import ( KnowledgeBaseGetOrCreateRagIndexesResponseValue, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success, ) _dynamic_imports: typing.Dict[str, str] = { "KnowledgeBaseGetOrCreateRagIndexesResponseValue": ".knowledge_base_get_or_create_rag_indexes_response_value", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure": ".knowledge_base_get_or_create_rag_indexes_response_value", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success": ".knowledge_base_get_or_create_rag_indexes_response_value", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "KnowledgeBaseGetOrCreateRagIndexesResponseValue", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure", "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success", ] knowledge_base_get_or_create_rag_indexes_response_value.py000066400000000000000000000031101523660243400461610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/knowledge_base/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.rag_document_index_response_model import RagDocumentIndexResponseModel class KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success(UncheckedBaseModel): status: typing.Literal["success"] = "success" data: RagDocumentIndexResponseModel 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 KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure(UncheckedBaseModel): status: typing.Literal["failure"] = "failure" error_code: int error_status: str error_message: 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 KnowledgeBaseGetOrCreateRagIndexesResponseValue = typing_extensions.Annotated[ typing.Union[ KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success, KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure ], UnionMetadata(discriminant="status"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm/000077500000000000000000000000001523660243400270255ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm/__init__.py000066400000000000000000000001251523660243400311340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm/client.py000066400000000000000000000062121523660243400306560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.llm_list_response_model_input import LlmListResponseModelInput from .raw_client import AsyncRawLlmClient, RawLlmClient class LlmClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLlmClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLlmClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLlmClient """ return self._raw_client def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LlmListResponseModelInput: """ Returns a list of available LLM models that can be used with agents, including their capabilities and any deprecation status. The response is filtered based on the data residency of the deployment and any compliance requirements (e.g. HIPAA) of the workspace subscription. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmListResponseModelInput Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.llm.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data class AsyncLlmClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLlmClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLlmClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLlmClient """ return self._raw_client async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LlmListResponseModelInput: """ Returns a list of available LLM models that can be used with agents, including their capabilities and any deprecation status. The response is filtered based on the data residency of the deployment and any compliance requirements (e.g. HIPAA) of the workspace subscription. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmListResponseModelInput Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.llm.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm/raw_client.py000066400000000000000000000124421523660243400315310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.llm_list_response_model_input import LlmListResponseModelInput from pydantic import ValidationError class RawLlmClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[LlmListResponseModelInput]: """ Returns a list of available LLM models that can be used with agents, including their capabilities and any deprecation status. The response is filtered based on the data residency of the deployment and any compliance requirements (e.g. HIPAA) of the workspace subscription. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[LlmListResponseModelInput] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/llm/list", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmListResponseModelInput, construct_type( type_=LlmListResponseModelInput, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLlmClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[LlmListResponseModelInput]: """ Returns a list of available LLM models that can be used with agents, including their capabilities and any deprecation status. The response is filtered based on the data residency of the deployment and any compliance requirements (e.g. HIPAA) of the workspace subscription. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[LlmListResponseModelInput] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/llm/list", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmListResponseModelInput, construct_type( type_=LlmListResponseModelInput, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm_usage/000077500000000000000000000000001523660243400302115ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm_usage/__init__.py000066400000000000000000000001251523660243400323200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm_usage/client.py000066400000000000000000000103551523660243400320450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.llm_usage_calculator_response_model import LlmUsageCalculatorResponseModel from .raw_client import AsyncRawLlmUsageClient, RawLlmUsageClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class LlmUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLlmUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLlmUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLlmUsageClient """ return self._raw_client def calculate( self, *, prompt_length: int, number_of_pages: int, rag_enabled: bool, request_options: typing.Optional[RequestOptions] = None, ) -> LlmUsageCalculatorResponseModel: """ Returns a list of LLM models and the expected cost for using them based on the provided values. Parameters ---------- prompt_length : int Length of the prompt in characters. number_of_pages : int Pages of content in PDF documents or URLs in the agent's knowledge base. rag_enabled : bool Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmUsageCalculatorResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.llm_usage.calculate( prompt_length=1, number_of_pages=1, rag_enabled=True, ) """ _response = self._raw_client.calculate( prompt_length=prompt_length, number_of_pages=number_of_pages, rag_enabled=rag_enabled, request_options=request_options, ) return _response.data class AsyncLlmUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLlmUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLlmUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLlmUsageClient """ return self._raw_client async def calculate( self, *, prompt_length: int, number_of_pages: int, rag_enabled: bool, request_options: typing.Optional[RequestOptions] = None, ) -> LlmUsageCalculatorResponseModel: """ Returns a list of LLM models and the expected cost for using them based on the provided values. Parameters ---------- prompt_length : int Length of the prompt in characters. number_of_pages : int Pages of content in PDF documents or URLs in the agent's knowledge base. rag_enabled : bool Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LlmUsageCalculatorResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.llm_usage.calculate( prompt_length=1, number_of_pages=1, rag_enabled=True, ) asyncio.run(main()) """ _response = await self._raw_client.calculate( prompt_length=prompt_length, number_of_pages=number_of_pages, rag_enabled=rag_enabled, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/llm_usage/raw_client.py000066400000000000000000000146331523660243400327210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.llm_usage_calculator_response_model import LlmUsageCalculatorResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawLlmUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def calculate( self, *, prompt_length: int, number_of_pages: int, rag_enabled: bool, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[LlmUsageCalculatorResponseModel]: """ Returns a list of LLM models and the expected cost for using them based on the provided values. Parameters ---------- prompt_length : int Length of the prompt in characters. number_of_pages : int Pages of content in PDF documents or URLs in the agent's knowledge base. rag_enabled : bool Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[LlmUsageCalculatorResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/llm-usage/calculate", method="POST", json={ "prompt_length": prompt_length, "number_of_pages": number_of_pages, "rag_enabled": rag_enabled, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmUsageCalculatorResponseModel, construct_type( type_=LlmUsageCalculatorResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLlmUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def calculate( self, *, prompt_length: int, number_of_pages: int, rag_enabled: bool, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[LlmUsageCalculatorResponseModel]: """ Returns a list of LLM models and the expected cost for using them based on the provided values. Parameters ---------- prompt_length : int Length of the prompt in characters. number_of_pages : int Pages of content in PDF documents or URLs in the agent's knowledge base. rag_enabled : bool Whether RAG is enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[LlmUsageCalculatorResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/llm-usage/calculate", method="POST", json={ "prompt_length": prompt_length, "number_of_pages": number_of_pages, "rag_enabled": rag_enabled, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LlmUsageCalculatorResponseModel, construct_type( type_=LlmUsageCalculatorResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/000077500000000000000000000000001523660243400305715ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/__init__.py000066400000000000000000000110761523660243400327070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( McpServerConfigUpdateRequestModelAuthConnection, McpServerConfigUpdateRequestModelRequestHeadersValue, McpServerConfigUpdateRequestModelRequestMetaValue, ) from . import approval_policy, tool_approvals, tool_configs, tools from .tool_configs import ( McpToolConfigOverrideCreateRequestModelInputOverridesValue, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit, McpToolConfigOverrideCreateRequestModelToolCallSound, McpToolConfigOverrideUpdateRequestModelInputOverridesValue, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit, McpToolConfigOverrideUpdateRequestModelToolCallSound, ) _dynamic_imports: typing.Dict[str, str] = { "McpServerConfigUpdateRequestModelAuthConnection": ".types", "McpServerConfigUpdateRequestModelRequestHeadersValue": ".types", "McpServerConfigUpdateRequestModelRequestMetaValue": ".types", "McpToolConfigOverrideCreateRequestModelInputOverridesValue": ".tool_configs", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant": ".tool_configs", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable": ".tool_configs", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm": ".tool_configs", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit": ".tool_configs", "McpToolConfigOverrideCreateRequestModelToolCallSound": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit": ".tool_configs", "McpToolConfigOverrideUpdateRequestModelToolCallSound": ".tool_configs", "approval_policy": ".approval_policy", "tool_approvals": ".tool_approvals", "tool_configs": ".tool_configs", "tools": ".tools", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "McpServerConfigUpdateRequestModelAuthConnection", "McpServerConfigUpdateRequestModelRequestHeadersValue", "McpServerConfigUpdateRequestModelRequestMetaValue", "McpToolConfigOverrideCreateRequestModelInputOverridesValue", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideCreateRequestModelToolCallSound", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideUpdateRequestModelToolCallSound", "approval_policy", "tool_approvals", "tool_configs", "tools", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/approval_policy/000077500000000000000000000000001523660243400337745ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400360240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/approval_policy# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000100011523660243400355350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/approval_policy# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.mcp_approval_policy import McpApprovalPolicy from ....types.mcp_server_response_model import McpServerResponseModel from .raw_client import AsyncRawApprovalPolicyClient, RawApprovalPolicyClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ApprovalPolicyClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawApprovalPolicyClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawApprovalPolicyClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawApprovalPolicyClient """ return self._raw_client def update( self, mcp_server_id: str, *, approval_policy: McpApprovalPolicy, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update the approval policy configuration for an MCP server. DEPRECATED: Use PATCH /mcp-servers/{id} endpoint instead. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : McpApprovalPolicy The approval mode to set for the MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.approval_policy.update( mcp_server_id="mcp_server_id", approval_policy="auto_approve_all", ) """ _response = self._raw_client.update( mcp_server_id, approval_policy=approval_policy, request_options=request_options ) return _response.data class AsyncApprovalPolicyClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawApprovalPolicyClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawApprovalPolicyClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawApprovalPolicyClient """ return self._raw_client async def update( self, mcp_server_id: str, *, approval_policy: McpApprovalPolicy, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update the approval policy configuration for an MCP server. DEPRECATED: Use PATCH /mcp-servers/{id} endpoint instead. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : McpApprovalPolicy The approval mode to set for the MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.approval_policy.update( mcp_server_id="mcp_server_id", approval_policy="auto_approve_all", ) asyncio.run(main()) """ _response = await self._raw_client.update( mcp_server_id, approval_policy=approval_policy, request_options=request_options ) return _response.data raw_client.py000066400000000000000000000142711523660243400364230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/approval_policy# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.mcp_approval_policy import McpApprovalPolicy from ....types.mcp_server_response_model import McpServerResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawApprovalPolicyClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def update( self, mcp_server_id: str, *, approval_policy: McpApprovalPolicy, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[McpServerResponseModel]: """ Update the approval policy configuration for an MCP server. DEPRECATED: Use PATCH /mcp-servers/{id} endpoint instead. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : McpApprovalPolicy The approval mode to set for the MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/approval-policy", method="PATCH", json={ "approval_policy": approval_policy, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawApprovalPolicyClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def update( self, mcp_server_id: str, *, approval_policy: McpApprovalPolicy, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[McpServerResponseModel]: """ Update the approval policy configuration for an MCP server. DEPRECATED: Use PATCH /mcp-servers/{id} endpoint instead. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : McpApprovalPolicy The approval mode to set for the MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/approval-policy", method="PATCH", json={ "approval_policy": approval_policy, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/client.py000066400000000000000000000563611523660243400324340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conv_ai_secret_locator import ConvAiSecretLocator from ...types.mcp_approval_policy import McpApprovalPolicy from ...types.mcp_server_config_input import McpServerConfigInput from ...types.mcp_server_response_model import McpServerResponseModel from ...types.mcp_servers_response_model import McpServersResponseModel from ...types.pre_tool_speech_mode import PreToolSpeechMode from ...types.tool_call_sound_behavior import ToolCallSoundBehavior from ...types.tool_call_sound_type import ToolCallSoundType from ...types.tool_execution_mode import ToolExecutionMode from ...types.tool_interruption_mode import ToolInterruptionMode from .raw_client import AsyncRawMcpServersClient, RawMcpServersClient from .types.mcp_server_config_update_request_model_auth_connection import ( McpServerConfigUpdateRequestModelAuthConnection, ) from .types.mcp_server_config_update_request_model_request_headers_value import ( McpServerConfigUpdateRequestModelRequestHeadersValue, ) from .types.mcp_server_config_update_request_model_request_meta_value import ( McpServerConfigUpdateRequestModelRequestMetaValue, ) if typing.TYPE_CHECKING: from .approval_policy.client import ApprovalPolicyClient, AsyncApprovalPolicyClient from .tool_approvals.client import AsyncToolApprovalsClient, ToolApprovalsClient from .tool_configs.client import AsyncToolConfigsClient, ToolConfigsClient from .tools.client import AsyncToolsClient, ToolsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class McpServersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMcpServersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._tools: typing.Optional[ToolsClient] = None self._approval_policy: typing.Optional[ApprovalPolicyClient] = None self._tool_approvals: typing.Optional[ToolApprovalsClient] = None self._tool_configs: typing.Optional[ToolConfigsClient] = None @property def with_raw_response(self) -> RawMcpServersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMcpServersClient """ return self._raw_client def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> McpServersResponseModel: """ Retrieve all MCP server configurations available in the workspace. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServersResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def create( self, *, config: McpServerConfigInput, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Create a new MCP server configuration in the workspace. Parameters ---------- config : McpServerConfigInput Configuration details for the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs, McpServerConfigInput client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.create( config=McpServerConfigInput( url="url", name="name", ), ) """ _response = self._raw_client.create(config=config, request_options=request_options) return _response.data def get( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Retrieve a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.get( mcp_server_id="mcp_server_id", ) """ _response = self._raw_client.get(mcp_server_id, request_options=request_options) return _response.data def delete(self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.delete( mcp_server_id="mcp_server_id", ) """ _response = self._raw_client.delete(mcp_server_id, request_options=request_options) return _response.data def update( self, mcp_server_id: str, *, approval_policy: typing.Optional[McpApprovalPolicy] = OMIT, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, request_headers: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]] ] = OMIT, request_meta: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]] ] = OMIT, disable_compression: typing.Optional[bool] = OMIT, secret_token: typing.Optional[ConvAiSecretLocator] = OMIT, auth_connection: typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update the configuration settings for an MCP server. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : typing.Optional[McpApprovalPolicy] The approval mode to set for the MCP server force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[ToolCallSoundType] Predefined tool call sound type to play during tool execution for all tools from this MCP server tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] Determines when the tool call sound should play for all tools from this MCP server execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] The maximum time in seconds to wait for each MCP tool call to complete. request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]] The headers to include in requests to the MCP server request_meta : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]]] Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. disable_compression : typing.Optional[bool] Whether to disable HTTP compression for this MCP server secret_token : typing.Optional[ConvAiSecretLocator] Optional secret token for authentication with this MCP server auth_connection : typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] Optional auth connection to use for authentication with this MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.update( mcp_server_id="mcp_server_id", ) """ _response = self._raw_client.update( mcp_server_id, approval_policy=approval_policy, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, request_headers=request_headers, request_meta=request_meta, disable_compression=disable_compression, secret_token=secret_token, auth_connection=auth_connection, request_options=request_options, ) return _response.data @property def tools(self): if self._tools is None: from .tools.client import ToolsClient # noqa: E402 self._tools = ToolsClient(client_wrapper=self._client_wrapper) return self._tools @property def approval_policy(self): if self._approval_policy is None: from .approval_policy.client import ApprovalPolicyClient # noqa: E402 self._approval_policy = ApprovalPolicyClient(client_wrapper=self._client_wrapper) return self._approval_policy @property def tool_approvals(self): if self._tool_approvals is None: from .tool_approvals.client import ToolApprovalsClient # noqa: E402 self._tool_approvals = ToolApprovalsClient(client_wrapper=self._client_wrapper) return self._tool_approvals @property def tool_configs(self): if self._tool_configs is None: from .tool_configs.client import ToolConfigsClient # noqa: E402 self._tool_configs = ToolConfigsClient(client_wrapper=self._client_wrapper) return self._tool_configs class AsyncMcpServersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMcpServersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._tools: typing.Optional[AsyncToolsClient] = None self._approval_policy: typing.Optional[AsyncApprovalPolicyClient] = None self._tool_approvals: typing.Optional[AsyncToolApprovalsClient] = None self._tool_configs: typing.Optional[AsyncToolConfigsClient] = None @property def with_raw_response(self) -> AsyncRawMcpServersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMcpServersClient """ return self._raw_client async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> McpServersResponseModel: """ Retrieve all MCP server configurations available in the workspace. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServersResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def create( self, *, config: McpServerConfigInput, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Create a new MCP server configuration in the workspace. Parameters ---------- config : McpServerConfigInput Configuration details for the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, McpServerConfigInput client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.create( config=McpServerConfigInput( url="url", name="name", ), ) asyncio.run(main()) """ _response = await self._raw_client.create(config=config, request_options=request_options) return _response.data async def get( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Retrieve a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.get( mcp_server_id="mcp_server_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(mcp_server_id, request_options=request_options) return _response.data async def delete( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.delete( mcp_server_id="mcp_server_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(mcp_server_id, request_options=request_options) return _response.data async def update( self, mcp_server_id: str, *, approval_policy: typing.Optional[McpApprovalPolicy] = OMIT, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, request_headers: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]] ] = OMIT, request_meta: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]] ] = OMIT, disable_compression: typing.Optional[bool] = OMIT, secret_token: typing.Optional[ConvAiSecretLocator] = OMIT, auth_connection: typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update the configuration settings for an MCP server. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : typing.Optional[McpApprovalPolicy] The approval mode to set for the MCP server force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[ToolCallSoundType] Predefined tool call sound type to play during tool execution for all tools from this MCP server tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] Determines when the tool call sound should play for all tools from this MCP server execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] The maximum time in seconds to wait for each MCP tool call to complete. request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]] The headers to include in requests to the MCP server request_meta : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]]] Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. disable_compression : typing.Optional[bool] Whether to disable HTTP compression for this MCP server secret_token : typing.Optional[ConvAiSecretLocator] Optional secret token for authentication with this MCP server auth_connection : typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] Optional auth connection to use for authentication with this MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.update( mcp_server_id="mcp_server_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( mcp_server_id, approval_policy=approval_policy, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, request_headers=request_headers, request_meta=request_meta, disable_compression=disable_compression, secret_token=secret_token, auth_connection=auth_connection, request_options=request_options, ) return _response.data @property def tools(self): if self._tools is None: from .tools.client import AsyncToolsClient # noqa: E402 self._tools = AsyncToolsClient(client_wrapper=self._client_wrapper) return self._tools @property def approval_policy(self): if self._approval_policy is None: from .approval_policy.client import AsyncApprovalPolicyClient # noqa: E402 self._approval_policy = AsyncApprovalPolicyClient(client_wrapper=self._client_wrapper) return self._approval_policy @property def tool_approvals(self): if self._tool_approvals is None: from .tool_approvals.client import AsyncToolApprovalsClient # noqa: E402 self._tool_approvals = AsyncToolApprovalsClient(client_wrapper=self._client_wrapper) return self._tool_approvals @property def tool_configs(self): if self._tool_configs is None: from .tool_configs.client import AsyncToolConfigsClient # noqa: E402 self._tool_configs = AsyncToolConfigsClient(client_wrapper=self._client_wrapper) return self._tool_configs elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/raw_client.py000066400000000000000000001037571523660243400333070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conv_ai_secret_locator import ConvAiSecretLocator from ...types.mcp_approval_policy import McpApprovalPolicy from ...types.mcp_server_config_input import McpServerConfigInput from ...types.mcp_server_response_model import McpServerResponseModel from ...types.mcp_servers_response_model import McpServersResponseModel from ...types.pre_tool_speech_mode import PreToolSpeechMode from ...types.tool_call_sound_behavior import ToolCallSoundBehavior from ...types.tool_call_sound_type import ToolCallSoundType from ...types.tool_execution_mode import ToolExecutionMode from ...types.tool_interruption_mode import ToolInterruptionMode from .types.mcp_server_config_update_request_model_auth_connection import ( McpServerConfigUpdateRequestModelAuthConnection, ) from .types.mcp_server_config_update_request_model_request_headers_value import ( McpServerConfigUpdateRequestModelRequestHeadersValue, ) from .types.mcp_server_config_update_request_model_request_meta_value import ( McpServerConfigUpdateRequestModelRequestMetaValue, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMcpServersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[McpServersResponseModel]: """ Retrieve all MCP server configurations available in the workspace. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServersResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/mcp-servers", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServersResponseModel, construct_type( type_=McpServersResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, config: McpServerConfigInput, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[McpServerResponseModel]: """ Create a new MCP server configuration in the workspace. Parameters ---------- config : McpServerConfigInput Configuration details for the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/mcp-servers", method="POST", json={ "config": convert_and_respect_annotation_metadata( object_=config, annotation=McpServerConfigInput, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[McpServerResponseModel]: """ Retrieve a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, mcp_server_id: str, *, approval_policy: typing.Optional[McpApprovalPolicy] = OMIT, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, request_headers: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]] ] = OMIT, request_meta: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]] ] = OMIT, disable_compression: typing.Optional[bool] = OMIT, secret_token: typing.Optional[ConvAiSecretLocator] = OMIT, auth_connection: typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[McpServerResponseModel]: """ Update the configuration settings for an MCP server. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : typing.Optional[McpApprovalPolicy] The approval mode to set for the MCP server force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[ToolCallSoundType] Predefined tool call sound type to play during tool execution for all tools from this MCP server tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] Determines when the tool call sound should play for all tools from this MCP server execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] The maximum time in seconds to wait for each MCP tool call to complete. request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]] The headers to include in requests to the MCP server request_meta : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]]] Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. disable_compression : typing.Optional[bool] Whether to disable HTTP compression for this MCP server secret_token : typing.Optional[ConvAiSecretLocator] Optional secret token for authentication with this MCP server auth_connection : typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] Optional auth connection to use for authentication with this MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="PATCH", json={ "approval_policy": approval_policy, "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": tool_call_sound, "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "request_headers": convert_and_respect_annotation_metadata( object_=request_headers, annotation=typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]], direction="write", ), "request_meta": convert_and_respect_annotation_metadata( object_=request_meta, annotation=typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]], direction="write", ), "disable_compression": disable_compression, "secret_token": convert_and_respect_annotation_metadata( object_=secret_token, annotation=ConvAiSecretLocator, direction="write" ), "auth_connection": convert_and_respect_annotation_metadata( object_=auth_connection, annotation=McpServerConfigUpdateRequestModelAuthConnection, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawMcpServersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpServersResponseModel]: """ Retrieve all MCP server configurations available in the workspace. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServersResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/mcp-servers", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServersResponseModel, construct_type( type_=McpServersResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, config: McpServerConfigInput, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpServerResponseModel]: """ Create a new MCP server configuration in the workspace. Parameters ---------- config : McpServerConfigInput Configuration details for the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/mcp-servers", method="POST", json={ "config": convert_and_respect_annotation_metadata( object_=config, annotation=McpServerConfigInput, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpServerResponseModel]: """ Retrieve a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, mcp_server_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete a specific MCP server configuration from the workspace. Parameters ---------- mcp_server_id : str ID of the MCP Server. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, mcp_server_id: str, *, approval_policy: typing.Optional[McpApprovalPolicy] = OMIT, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, request_headers: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]] ] = OMIT, request_meta: typing.Optional[ typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]] ] = OMIT, disable_compression: typing.Optional[bool] = OMIT, secret_token: typing.Optional[ConvAiSecretLocator] = OMIT, auth_connection: typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[McpServerResponseModel]: """ Update the configuration settings for an MCP server. Parameters ---------- mcp_server_id : str ID of the MCP Server. approval_policy : typing.Optional[McpApprovalPolicy] The approval mode to set for the MCP server force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[ToolCallSoundType] Predefined tool call sound type to play during tool execution for all tools from this MCP server tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] Determines when the tool call sound should play for all tools from this MCP server execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] The maximum time in seconds to wait for each MCP tool call to complete. request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]] The headers to include in requests to the MCP server request_meta : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]]] Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. disable_compression : typing.Optional[bool] Whether to disable HTTP compression for this MCP server secret_token : typing.Optional[ConvAiSecretLocator] Optional secret token for authentication with this MCP server auth_connection : typing.Optional[McpServerConfigUpdateRequestModelAuthConnection] Optional auth connection to use for authentication with this MCP server request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}", method="PATCH", json={ "approval_policy": approval_policy, "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": tool_call_sound, "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "request_headers": convert_and_respect_annotation_metadata( object_=request_headers, annotation=typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]], direction="write", ), "request_meta": convert_and_respect_annotation_metadata( object_=request_meta, annotation=typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestMetaValue]], direction="write", ), "disable_compression": disable_compression, "secret_token": convert_and_respect_annotation_metadata( object_=secret_token, annotation=ConvAiSecretLocator, direction="write" ), "auth_connection": convert_and_respect_annotation_metadata( object_=auth_connection, annotation=McpServerConfigUpdateRequestModelAuthConnection, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_approvals/000077500000000000000000000000001523660243400336355ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400356650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_approvals# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000170061523660243400354120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_approvals# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.mcp_server_response_model import McpServerResponseModel from ....types.mcp_tool_approval_policy import McpToolApprovalPolicy from .raw_client import AsyncRawToolApprovalsClient, RawToolApprovalsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ToolApprovalsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawToolApprovalsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawToolApprovalsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawToolApprovalsClient """ return self._raw_client def create( self, mcp_server_id: str, *, tool_name: str, tool_description: str, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, approval_policy: typing.Optional[McpToolApprovalPolicy] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Add approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool tool_description : str The description of the MCP tool input_schema : typing.Optional[typing.Dict[str, typing.Any]] The input schema of the MCP tool (the schema defined on the MCP server before ElevenLabs does any extra processing) approval_policy : typing.Optional[McpToolApprovalPolicy] The tool-level approval policy request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_approvals.create( mcp_server_id="mcp_server_id", tool_name="tool_name", tool_description="tool_description", ) """ _response = self._raw_client.create( mcp_server_id, tool_name=tool_name, tool_description=tool_description, input_schema=input_schema, approval_policy=approval_policy, request_options=request_options, ) return _response.data def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Remove approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove approval for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_approvals.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) """ _response = self._raw_client.delete(mcp_server_id, tool_name, request_options=request_options) return _response.data class AsyncToolApprovalsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawToolApprovalsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawToolApprovalsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawToolApprovalsClient """ return self._raw_client async def create( self, mcp_server_id: str, *, tool_name: str, tool_description: str, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, approval_policy: typing.Optional[McpToolApprovalPolicy] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Add approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool tool_description : str The description of the MCP tool input_schema : typing.Optional[typing.Dict[str, typing.Any]] The input schema of the MCP tool (the schema defined on the MCP server before ElevenLabs does any extra processing) approval_policy : typing.Optional[McpToolApprovalPolicy] The tool-level approval policy request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_approvals.create( mcp_server_id="mcp_server_id", tool_name="tool_name", tool_description="tool_description", ) asyncio.run(main()) """ _response = await self._raw_client.create( mcp_server_id, tool_name=tool_name, tool_description=tool_description, input_schema=input_schema, approval_policy=approval_policy, request_options=request_options, ) return _response.data async def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Remove approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove approval for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_approvals.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) asyncio.run(main()) """ _response = await self._raw_client.delete(mcp_server_id, tool_name, request_options=request_options) return _response.data raw_client.py000066400000000000000000000275651523660243400362760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_approvals# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.mcp_server_response_model import McpServerResponseModel from ....types.mcp_tool_approval_policy import McpToolApprovalPolicy from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawToolApprovalsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, mcp_server_id: str, *, tool_name: str, tool_description: str, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, approval_policy: typing.Optional[McpToolApprovalPolicy] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[McpServerResponseModel]: """ Add approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool tool_description : str The description of the MCP tool input_schema : typing.Optional[typing.Dict[str, typing.Any]] The input schema of the MCP tool (the schema defined on the MCP server before ElevenLabs does any extra processing) approval_policy : typing.Optional[McpToolApprovalPolicy] The tool-level approval policy request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-approvals", method="POST", json={ "tool_name": tool_name, "tool_description": tool_description, "input_schema": input_schema, "approval_policy": approval_policy, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[McpServerResponseModel]: """ Remove approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove approval for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-approvals/{jsonable_encoder(tool_name)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawToolApprovalsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, mcp_server_id: str, *, tool_name: str, tool_description: str, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, approval_policy: typing.Optional[McpToolApprovalPolicy] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[McpServerResponseModel]: """ Add approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool tool_description : str The description of the MCP tool input_schema : typing.Optional[typing.Dict[str, typing.Any]] The input schema of the MCP tool (the schema defined on the MCP server before ElevenLabs does any extra processing) approval_policy : typing.Optional[McpToolApprovalPolicy] The tool-level approval policy request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-approvals", method="POST", json={ "tool_name": tool_name, "tool_description": tool_description, "input_schema": input_schema, "approval_policy": approval_policy, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpServerResponseModel]: """ Remove approval for a specific MCP tool when using per-tool approval mode. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove approval for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-approvals/{jsonable_encoder(tool_name)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/000077500000000000000000000000001523660243400332565ustar00rootroot00000000000000__init__.py000066400000000000000000000071671523660243400353230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( McpToolConfigOverrideCreateRequestModelInputOverridesValue, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit, McpToolConfigOverrideCreateRequestModelToolCallSound, McpToolConfigOverrideUpdateRequestModelInputOverridesValue, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit, McpToolConfigOverrideUpdateRequestModelToolCallSound, ) _dynamic_imports: typing.Dict[str, str] = { "McpToolConfigOverrideCreateRequestModelInputOverridesValue": ".types", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant": ".types", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable": ".types", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm": ".types", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit": ".types", "McpToolConfigOverrideCreateRequestModelToolCallSound": ".types", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue": ".types", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant": ".types", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable": ".types", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm": ".types", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit": ".types", "McpToolConfigOverrideUpdateRequestModelToolCallSound": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "McpToolConfigOverrideCreateRequestModelInputOverridesValue", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideCreateRequestModelToolCallSound", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideUpdateRequestModelToolCallSound", ] client.py000066400000000000000000000646451523660243400350460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.dynamic_variable_assignment import DynamicVariableAssignment from ....types.mcp_server_response_model import McpServerResponseModel from ....types.mcp_tool_config_override_output import McpToolConfigOverrideOutput from ....types.pre_tool_speech_mode import PreToolSpeechMode from ....types.tool_call_sound_behavior import ToolCallSoundBehavior from ....types.tool_execution_mode import ToolExecutionMode from ....types.tool_interruption_mode import ToolInterruptionMode from ....types.tool_response_mock_config_input import ToolResponseMockConfigInput from .raw_client import AsyncRawToolConfigsClient, RawToolConfigsClient from .types.mcp_tool_config_override_create_request_model_input_overrides_value import ( McpToolConfigOverrideCreateRequestModelInputOverridesValue, ) from .types.mcp_tool_config_override_create_request_model_tool_call_sound import ( McpToolConfigOverrideCreateRequestModelToolCallSound, ) from .types.mcp_tool_config_override_update_request_model_input_overrides_value import ( McpToolConfigOverrideUpdateRequestModelInputOverridesValue, ) from .types.mcp_tool_config_override_update_request_model_tool_call_sound import ( McpToolConfigOverrideUpdateRequestModelToolCallSound, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ToolConfigsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawToolConfigsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawToolConfigsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawToolConfigsClient """ return self._raw_client def create( self, mcp_server_id: str, *, tool_name: str, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Create configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_configs.create( mcp_server_id="mcp_server_id", environment="environment", tool_name="tool_name", ) """ _response = self._raw_client.create( mcp_server_id, tool_name=tool_name, environment=environment, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, assignments=assignments, input_overrides=input_overrides, response_mocks=response_mocks, request_options=request_options, ) return _response.data def get( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpToolConfigOverrideOutput: """ Retrieve configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to retrieve config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpToolConfigOverrideOutput Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_configs.get( mcp_server_id="mcp_server_id", tool_name="tool_name", ) """ _response = self._raw_client.get(mcp_server_id, tool_name, request_options=request_options) return _response.data def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Remove configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_configs.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) """ _response = self._raw_client.delete(mcp_server_id, tool_name, request_options=request_options) return _response.data def update( self, mcp_server_id: str, tool_name: str, *, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to update config overrides for. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tool_configs.update( mcp_server_id="mcp_server_id", tool_name="tool_name", environment="environment", ) """ _response = self._raw_client.update( mcp_server_id, tool_name, environment=environment, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, assignments=assignments, input_overrides=input_overrides, response_mocks=response_mocks, request_options=request_options, ) return _response.data class AsyncToolConfigsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawToolConfigsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawToolConfigsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawToolConfigsClient """ return self._raw_client async def create( self, mcp_server_id: str, *, tool_name: str, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Create configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_configs.create( mcp_server_id="mcp_server_id", environment="environment", tool_name="tool_name", ) asyncio.run(main()) """ _response = await self._raw_client.create( mcp_server_id, tool_name=tool_name, environment=environment, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, assignments=assignments, input_overrides=input_overrides, response_mocks=response_mocks, request_options=request_options, ) return _response.data async def get( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpToolConfigOverrideOutput: """ Retrieve configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to retrieve config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpToolConfigOverrideOutput Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_configs.get( mcp_server_id="mcp_server_id", tool_name="tool_name", ) asyncio.run(main()) """ _response = await self._raw_client.get(mcp_server_id, tool_name, request_options=request_options) return _response.data async def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> McpServerResponseModel: """ Remove configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_configs.delete( mcp_server_id="mcp_server_id", tool_name="tool_name", ) asyncio.run(main()) """ _response = await self._raw_client.delete(mcp_server_id, tool_name, request_options=request_options) return _response.data async def update( self, mcp_server_id: str, tool_name: str, *, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> McpServerResponseModel: """ Update configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to update config overrides for. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- McpServerResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tool_configs.update( mcp_server_id="mcp_server_id", tool_name="tool_name", environment="environment", ) asyncio.run(main()) """ _response = await self._raw_client.update( mcp_server_id, tool_name, environment=environment, force_pre_tool_speech=force_pre_tool_speech, pre_tool_speech=pre_tool_speech, disable_interruptions=disable_interruptions, interruption_mode=interruption_mode, tool_call_sound=tool_call_sound, tool_call_sound_behavior=tool_call_sound_behavior, execution_mode=execution_mode, response_timeout_secs=response_timeout_secs, assignments=assignments, input_overrides=input_overrides, response_mocks=response_mocks, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000001235521523660243400357100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.conflict_error import ConflictError from ....errors.not_found_error import NotFoundError from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.dynamic_variable_assignment import DynamicVariableAssignment from ....types.mcp_server_response_model import McpServerResponseModel from ....types.mcp_tool_config_override_output import McpToolConfigOverrideOutput from ....types.pre_tool_speech_mode import PreToolSpeechMode from ....types.tool_call_sound_behavior import ToolCallSoundBehavior from ....types.tool_execution_mode import ToolExecutionMode from ....types.tool_interruption_mode import ToolInterruptionMode from ....types.tool_response_mock_config_input import ToolResponseMockConfigInput from .types.mcp_tool_config_override_create_request_model_input_overrides_value import ( McpToolConfigOverrideCreateRequestModelInputOverridesValue, ) from .types.mcp_tool_config_override_create_request_model_tool_call_sound import ( McpToolConfigOverrideCreateRequestModelToolCallSound, ) from .types.mcp_tool_config_override_update_request_model_input_overrides_value import ( McpToolConfigOverrideUpdateRequestModelInputOverridesValue, ) from .types.mcp_tool_config_override_update_request_model_tool_call_sound import ( McpToolConfigOverrideUpdateRequestModelToolCallSound, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawToolConfigsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, mcp_server_id: str, *, tool_name: str, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[McpServerResponseModel]: """ Create configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs", method="POST", params={ "environment": environment, }, json={ "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": convert_and_respect_annotation_metadata( object_=tool_call_sound, annotation=McpToolConfigOverrideCreateRequestModelToolCallSound, direction="write", ), "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "assignments": convert_and_respect_annotation_metadata( object_=assignments, annotation=typing.Sequence[DynamicVariableAssignment], direction="write" ), "input_overrides": convert_and_respect_annotation_metadata( object_=input_overrides, annotation=typing.Dict[ str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue] ], direction="write", ), "response_mocks": convert_and_respect_annotation_metadata( object_=response_mocks, annotation=typing.Sequence[ToolResponseMockConfigInput], direction="write" ), "tool_name": tool_name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 409: raise ConflictError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[McpToolConfigOverrideOutput]: """ Retrieve configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to retrieve config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpToolConfigOverrideOutput] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpToolConfigOverrideOutput, construct_type( type_=McpToolConfigOverrideOutput, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[McpServerResponseModel]: """ Remove configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, mcp_server_id: str, tool_name: str, *, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[McpServerResponseModel]: """ Update configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to update config overrides for. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[McpServerResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="PATCH", params={ "environment": environment, }, json={ "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": convert_and_respect_annotation_metadata( object_=tool_call_sound, annotation=McpToolConfigOverrideUpdateRequestModelToolCallSound, direction="write", ), "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "assignments": convert_and_respect_annotation_metadata( object_=assignments, annotation=typing.Sequence[DynamicVariableAssignment], direction="write" ), "input_overrides": convert_and_respect_annotation_metadata( object_=input_overrides, annotation=typing.Dict[ str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue] ], direction="write", ), "response_mocks": convert_and_respect_annotation_metadata( object_=response_mocks, annotation=typing.Sequence[ToolResponseMockConfigInput], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawToolConfigsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, mcp_server_id: str, *, tool_name: str, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[McpServerResponseModel]: """ Create configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str The name of the MCP tool environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideCreateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs", method="POST", params={ "environment": environment, }, json={ "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": convert_and_respect_annotation_metadata( object_=tool_call_sound, annotation=McpToolConfigOverrideCreateRequestModelToolCallSound, direction="write", ), "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "assignments": convert_and_respect_annotation_metadata( object_=assignments, annotation=typing.Sequence[DynamicVariableAssignment], direction="write" ), "input_overrides": convert_and_respect_annotation_metadata( object_=input_overrides, annotation=typing.Dict[ str, typing.Optional[McpToolConfigOverrideCreateRequestModelInputOverridesValue] ], direction="write", ), "response_mocks": convert_and_respect_annotation_metadata( object_=response_mocks, annotation=typing.Sequence[ToolResponseMockConfigInput], direction="write" ), "tool_name": tool_name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 409: raise ConflictError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpToolConfigOverrideOutput]: """ Retrieve configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to retrieve config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpToolConfigOverrideOutput] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpToolConfigOverrideOutput, construct_type( type_=McpToolConfigOverrideOutput, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[McpServerResponseModel]: """ Remove configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to remove config overrides for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, mcp_server_id: str, tool_name: str, *, environment: typing.Optional[str] = None, force_pre_tool_speech: typing.Optional[bool] = OMIT, pre_tool_speech: typing.Optional[PreToolSpeechMode] = OMIT, disable_interruptions: typing.Optional[bool] = OMIT, interruption_mode: typing.Optional[ToolInterruptionMode] = OMIT, tool_call_sound: typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] = OMIT, tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT, execution_mode: typing.Optional[ToolExecutionMode] = OMIT, response_timeout_secs: typing.Optional[int] = OMIT, assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT, input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]] ] = OMIT, response_mocks: typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[McpServerResponseModel]: """ Update configuration overrides for a specific MCP tool. Parameters ---------- mcp_server_id : str ID of the MCP Server. tool_name : str Name of the MCP tool to update config overrides for. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. force_pre_tool_speech : typing.Optional[bool] DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. pre_tool_speech : typing.Optional[PreToolSpeechMode] If set, overrides the server's pre_tool_speech setting for this tool. disable_interruptions : typing.Optional[bool] DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. interruption_mode : typing.Optional[ToolInterruptionMode] If set, overrides the server's interruption_mode setting for this tool. tool_call_sound : typing.Optional[McpToolConfigOverrideUpdateRequestModelToolCallSound] Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior] If set, overrides the server's tool_call_sound_behavior setting for this tool execution_mode : typing.Optional[ToolExecutionMode] If set, overrides the server's execution_mode setting for this tool response_timeout_secs : typing.Optional[int] If set, overrides the server's response timeout for this MCP tool. assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]] Dynamic variable assignments for this MCP tool input_overrides : typing.Optional[typing.Dict[str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue]]] Mapping of json path to input override configuration response_mocks : typing.Optional[typing.Sequence[ToolResponseMockConfigInput]] Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[McpServerResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tool-configs/{jsonable_encoder(tool_name)}", method="PATCH", params={ "environment": environment, }, json={ "force_pre_tool_speech": force_pre_tool_speech, "pre_tool_speech": pre_tool_speech, "disable_interruptions": disable_interruptions, "interruption_mode": interruption_mode, "tool_call_sound": convert_and_respect_annotation_metadata( object_=tool_call_sound, annotation=McpToolConfigOverrideUpdateRequestModelToolCallSound, direction="write", ), "tool_call_sound_behavior": tool_call_sound_behavior, "execution_mode": execution_mode, "response_timeout_secs": response_timeout_secs, "assignments": convert_and_respect_annotation_metadata( object_=assignments, annotation=typing.Sequence[DynamicVariableAssignment], direction="write" ), "input_overrides": convert_and_respect_annotation_metadata( object_=input_overrides, annotation=typing.Dict[ str, typing.Optional[McpToolConfigOverrideUpdateRequestModelInputOverridesValue] ], direction="write", ), "response_mocks": convert_and_respect_annotation_metadata( object_=response_mocks, annotation=typing.Sequence[ToolResponseMockConfigInput], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( McpServerResponseModel, construct_type( type_=McpServerResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) types/000077500000000000000000000000001523660243400343435ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs__init__.py000066400000000000000000000112341523660243400364550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .mcp_tool_config_override_create_request_model_input_overrides_value import ( McpToolConfigOverrideCreateRequestModelInputOverridesValue, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit, ) from .mcp_tool_config_override_create_request_model_tool_call_sound import ( McpToolConfigOverrideCreateRequestModelToolCallSound, ) from .mcp_tool_config_override_update_request_model_input_overrides_value import ( McpToolConfigOverrideUpdateRequestModelInputOverridesValue, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit, ) from .mcp_tool_config_override_update_request_model_tool_call_sound import ( McpToolConfigOverrideUpdateRequestModelToolCallSound, ) _dynamic_imports: typing.Dict[str, str] = { "McpToolConfigOverrideCreateRequestModelInputOverridesValue": ".mcp_tool_config_override_create_request_model_input_overrides_value", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant": ".mcp_tool_config_override_create_request_model_input_overrides_value", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable": ".mcp_tool_config_override_create_request_model_input_overrides_value", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm": ".mcp_tool_config_override_create_request_model_input_overrides_value", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit": ".mcp_tool_config_override_create_request_model_input_overrides_value", "McpToolConfigOverrideCreateRequestModelToolCallSound": ".mcp_tool_config_override_create_request_model_tool_call_sound", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue": ".mcp_tool_config_override_update_request_model_input_overrides_value", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant": ".mcp_tool_config_override_update_request_model_input_overrides_value", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable": ".mcp_tool_config_override_update_request_model_input_overrides_value", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm": ".mcp_tool_config_override_update_request_model_input_overrides_value", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit": ".mcp_tool_config_override_update_request_model_input_overrides_value", "McpToolConfigOverrideUpdateRequestModelToolCallSound": ".mcp_tool_config_override_update_request_model_tool_call_sound", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "McpToolConfigOverrideCreateRequestModelInputOverridesValue", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideCreateRequestModelToolCallSound", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm", "McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit", "McpToolConfigOverrideUpdateRequestModelToolCallSound", ] mcp_tool_config_override_create_request_model_input_overrides_value.py000066400000000000000000000052721523660243400527330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 McpToolConfigOverrideCreateRequestModelInputOverridesValue = typing_extensions.Annotated[ typing.Union[ McpToolConfigOverrideCreateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideCreateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideCreateRequestModelInputOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] mcp_tool_config_override_create_request_model_tool_call_sound.py000066400000000000000000000003751523660243400514750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/types# This file was auto-generated by Fern from our API Definition. import typing from .....types.tool_call_sound_type import ToolCallSoundType McpToolConfigOverrideCreateRequestModelToolCallSound = typing.Union[ToolCallSoundType, typing.Literal["off"]] mcp_tool_config_override_update_request_model_input_overrides_value.py000066400000000000000000000052721523660243400527520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from .....core.pydantic_utilities import IS_PYDANTIC_V2 from .....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .....types.constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 McpToolConfigOverrideUpdateRequestModelInputOverridesValue = typing_extensions.Annotated[ typing.Union[ McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Constant, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_DynamicVariable, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Llm, McpToolConfigOverrideUpdateRequestModelInputOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] mcp_tool_config_override_update_request_model_tool_call_sound.py000066400000000000000000000003751523660243400515140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tool_configs/types# This file was auto-generated by Fern from our API Definition. import typing from .....types.tool_call_sound_type import ToolCallSoundType McpToolConfigOverrideUpdateRequestModelToolCallSound = typing.Union[ToolCallSoundType, typing.Literal["off"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tools/000077500000000000000000000000001523660243400317315ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tools/__init__.py000066400000000000000000000001251523660243400340400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tools/client.py000066400000000000000000000076131523660243400335700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.list_mcp_tools_response_model import ListMcpToolsResponseModel from .raw_client import AsyncRawToolsClient, RawToolsClient class ToolsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawToolsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawToolsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawToolsClient """ return self._raw_client def list( self, mcp_server_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListMcpToolsResponseModel: """ Retrieve all tools available for a specific MCP server configuration. Parameters ---------- mcp_server_id : str ID of the MCP Server. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListMcpToolsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.mcp_servers.tools.list( mcp_server_id="mcp_server_id", environment="environment", ) """ _response = self._raw_client.list(mcp_server_id, environment=environment, request_options=request_options) return _response.data class AsyncToolsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawToolsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawToolsClient """ return self._raw_client async def list( self, mcp_server_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListMcpToolsResponseModel: """ Retrieve all tools available for a specific MCP server configuration. Parameters ---------- mcp_server_id : str ID of the MCP Server. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListMcpToolsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.mcp_servers.tools.list( mcp_server_id="mcp_server_id", environment="environment", ) asyncio.run(main()) """ _response = await self._raw_client.list(mcp_server_id, environment=environment, request_options=request_options) return _response.data raw_client.py000066400000000000000000000137751523660243400343700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/tools# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.list_mcp_tools_response_model import ListMcpToolsResponseModel from pydantic import ValidationError class RawToolsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, mcp_server_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListMcpToolsResponseModel]: """ Retrieve all tools available for a specific MCP server configuration. Parameters ---------- mcp_server_id : str ID of the MCP Server. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListMcpToolsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tools", method="GET", params={ "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListMcpToolsResponseModel, construct_type( type_=ListMcpToolsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawToolsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, mcp_server_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListMcpToolsResponseModel]: """ Retrieve all tools available for a specific MCP server configuration. Parameters ---------- mcp_server_id : str ID of the MCP Server. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListMcpToolsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/mcp-servers/{jsonable_encoder(mcp_server_id)}/tools", method="GET", params={ "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListMcpToolsResponseModel, construct_type( type_=ListMcpToolsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/types/000077500000000000000000000000001523660243400317355ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/types/__init__.py000066400000000000000000000036041523660243400340510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .mcp_server_config_update_request_model_auth_connection import McpServerConfigUpdateRequestModelAuthConnection from .mcp_server_config_update_request_model_request_headers_value import ( McpServerConfigUpdateRequestModelRequestHeadersValue, ) from .mcp_server_config_update_request_model_request_meta_value import ( McpServerConfigUpdateRequestModelRequestMetaValue, ) _dynamic_imports: typing.Dict[str, str] = { "McpServerConfigUpdateRequestModelAuthConnection": ".mcp_server_config_update_request_model_auth_connection", "McpServerConfigUpdateRequestModelRequestHeadersValue": ".mcp_server_config_update_request_model_request_headers_value", "McpServerConfigUpdateRequestModelRequestMetaValue": ".mcp_server_config_update_request_model_request_meta_value", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "McpServerConfigUpdateRequestModelAuthConnection", "McpServerConfigUpdateRequestModelRequestHeadersValue", "McpServerConfigUpdateRequestModelRequestMetaValue", ] mcp_server_config_update_request_model_auth_connection.py000066400000000000000000000005501523660243400454540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.auth_connection_locator import AuthConnectionLocator from ....types.environment_auth_connection_locator import EnvironmentAuthConnectionLocator McpServerConfigUpdateRequestModelAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] mcp_server_config_update_request_model_request_headers_value.py000066400000000000000000000006511523660243400466550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.conv_ai_dynamic_variable import ConvAiDynamicVariable from ....types.conv_ai_env_var_locator import ConvAiEnvVarLocator from ....types.conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigUpdateRequestModelRequestHeadersValue = typing.Union[ str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] mcp_server_config_update_request_model_request_meta_value.py000066400000000000000000000006701523660243400461710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/mcp_servers/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.conv_ai_dynamic_variable import ConvAiDynamicVariable from ....types.conv_ai_env_var_locator import ConvAiEnvVarLocator from ....types.conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigUpdateRequestModelRequestMetaValue = typing.Union[ str, int, float, bool, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/000077500000000000000000000000001523660243400311055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/__init__.py000066400000000000000000000061031523660243400332160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( PhoneNumbersCreateRequestBody, PhoneNumbersCreateRequestBody_Exotel, PhoneNumbersCreateRequestBody_SipTrunk, PhoneNumbersCreateRequestBody_Twilio, PhoneNumbersGetResponse, PhoneNumbersGetResponse_Exotel, PhoneNumbersGetResponse_SipTrunk, PhoneNumbersGetResponse_Twilio, PhoneNumbersListResponseItem, PhoneNumbersListResponseItem_Exotel, PhoneNumbersListResponseItem_SipTrunk, PhoneNumbersListResponseItem_Twilio, PhoneNumbersUpdateResponse, PhoneNumbersUpdateResponse_Exotel, PhoneNumbersUpdateResponse_SipTrunk, PhoneNumbersUpdateResponse_Twilio, ) _dynamic_imports: typing.Dict[str, str] = { "PhoneNumbersCreateRequestBody": ".types", "PhoneNumbersCreateRequestBody_Exotel": ".types", "PhoneNumbersCreateRequestBody_SipTrunk": ".types", "PhoneNumbersCreateRequestBody_Twilio": ".types", "PhoneNumbersGetResponse": ".types", "PhoneNumbersGetResponse_Exotel": ".types", "PhoneNumbersGetResponse_SipTrunk": ".types", "PhoneNumbersGetResponse_Twilio": ".types", "PhoneNumbersListResponseItem": ".types", "PhoneNumbersListResponseItem_Exotel": ".types", "PhoneNumbersListResponseItem_SipTrunk": ".types", "PhoneNumbersListResponseItem_Twilio": ".types", "PhoneNumbersUpdateResponse": ".types", "PhoneNumbersUpdateResponse_Exotel": ".types", "PhoneNumbersUpdateResponse_SipTrunk": ".types", "PhoneNumbersUpdateResponse_Twilio": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "PhoneNumbersCreateRequestBody", "PhoneNumbersCreateRequestBody_Exotel", "PhoneNumbersCreateRequestBody_SipTrunk", "PhoneNumbersCreateRequestBody_Twilio", "PhoneNumbersGetResponse", "PhoneNumbersGetResponse_Exotel", "PhoneNumbersGetResponse_SipTrunk", "PhoneNumbersGetResponse_Twilio", "PhoneNumbersListResponseItem", "PhoneNumbersListResponseItem_Exotel", "PhoneNumbersListResponseItem_SipTrunk", "PhoneNumbersListResponseItem_Twilio", "PhoneNumbersUpdateResponse", "PhoneNumbersUpdateResponse_Exotel", "PhoneNumbersUpdateResponse_SipTrunk", "PhoneNumbersUpdateResponse_Twilio", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/client.py000066400000000000000000000461351523660243400327460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.create_phone_number_response_model import CreatePhoneNumberResponseModel from ...types.get_sip_log_messages_response import GetSipLogMessagesResponse from ...types.inbound_sip_trunk_config_request_model import InboundSipTrunkConfigRequestModel from ...types.livekit_stack_type import LivekitStackType from ...types.outbound_sip_trunk_config_request_model import OutboundSipTrunkConfigRequestModel from ...types.telephony_provider import TelephonyProvider from .raw_client import AsyncRawPhoneNumbersClient, RawPhoneNumbersClient from .types.phone_numbers_create_request_body import PhoneNumbersCreateRequestBody from .types.phone_numbers_get_response import PhoneNumbersGetResponse from .types.phone_numbers_list_response_item import PhoneNumbersListResponseItem from .types.phone_numbers_update_response import PhoneNumbersUpdateResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class PhoneNumbersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPhoneNumbersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawPhoneNumbersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPhoneNumbersClient """ return self._raw_client def list( self, *, provider: typing.Optional[TelephonyProvider] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[PhoneNumbersListResponseItem]: """ Retrieve all Phone Numbers Parameters ---------- provider : typing.Optional[TelephonyProvider] Filter by telephony provider agent_id : typing.Optional[str] Filter by assigned agent ID branch_id : typing.Optional[str] Filter by assigned branch ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[PhoneNumbersListResponseItem] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.list( provider="twilio", agent_id="agent_id", branch_id="branch_id", ) """ _response = self._raw_client.list( provider=provider, agent_id=agent_id, branch_id=branch_id, request_options=request_options ) return _response.data def create( self, *, request: PhoneNumbersCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> CreatePhoneNumberResponseModel: """ Import Phone Number from provider configuration (Twilio, Exotel, or SIP trunk) Parameters ---------- request : PhoneNumbersCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreatePhoneNumberResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.conversational_ai.phone_numbers import ( PhoneNumbersCreateRequestBody_Twilio, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.create( request=PhoneNumbersCreateRequestBody_Twilio( phone_number="phone_number", label="label", sid="sid", token="token", ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> PhoneNumbersGetResponse: """ Retrieve Phone Number details by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PhoneNumbersGetResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.get( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) """ _response = self._raw_client.get(phone_number_id, request_options=request_options) return _response.data def delete(self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete Phone Number by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.delete( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) """ _response = self._raw_client.delete(phone_number_id, request_options=request_options) return _response.data def update( self, phone_number_id: str, *, agent_id: typing.Optional[str] = OMIT, label: typing.Optional[str] = OMIT, inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = OMIT, outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = OMIT, livekit_stack: typing.Optional[LivekitStackType] = OMIT, store_sip_messages: typing.Optional[bool] = OMIT, environment: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PhoneNumbersUpdateResponse: """ Update assigned agent of a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. agent_id : typing.Optional[str] label : typing.Optional[str] inbound_trunk_config : typing.Optional[InboundSipTrunkConfigRequestModel] outbound_trunk_config : typing.Optional[OutboundSipTrunkConfigRequestModel] livekit_stack : typing.Optional[LivekitStackType] store_sip_messages : typing.Optional[bool] environment : typing.Optional[str] Environment to use for resolving environment variables on calls to this number. branch_id : typing.Optional[str] Agent branch to use for calls to this number. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PhoneNumbersUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.update( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) """ _response = self._raw_client.update( phone_number_id, agent_id=agent_id, label=label, inbound_trunk_config=inbound_trunk_config, outbound_trunk_config=outbound_trunk_config, livekit_stack=livekit_stack, store_sip_messages=store_sip_messages, environment=environment, branch_id=branch_id, request_options=request_options, ) return _response.data def get_sip_messages( self, phone_number_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSipLogMessagesResponse: """ Get SIP messages for a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSipLogMessagesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.phone_numbers.get_sip_messages( phone_number_id="TeaqRRdTcIfIu2i7BYfT", page_size=1, cursor="cursor", ) """ _response = self._raw_client.get_sip_messages( phone_number_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data class AsyncPhoneNumbersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPhoneNumbersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawPhoneNumbersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPhoneNumbersClient """ return self._raw_client async def list( self, *, provider: typing.Optional[TelephonyProvider] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.List[PhoneNumbersListResponseItem]: """ Retrieve all Phone Numbers Parameters ---------- provider : typing.Optional[TelephonyProvider] Filter by telephony provider agent_id : typing.Optional[str] Filter by assigned agent ID branch_id : typing.Optional[str] Filter by assigned branch ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[PhoneNumbersListResponseItem] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.list( provider="twilio", agent_id="agent_id", branch_id="branch_id", ) asyncio.run(main()) """ _response = await self._raw_client.list( provider=provider, agent_id=agent_id, branch_id=branch_id, request_options=request_options ) return _response.data async def create( self, *, request: PhoneNumbersCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> CreatePhoneNumberResponseModel: """ Import Phone Number from provider configuration (Twilio, Exotel, or SIP trunk) Parameters ---------- request : PhoneNumbersCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreatePhoneNumberResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.conversational_ai.phone_numbers import ( PhoneNumbersCreateRequestBody_Twilio, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.create( request=PhoneNumbersCreateRequestBody_Twilio( phone_number="phone_number", label="label", sid="sid", token="token", ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> PhoneNumbersGetResponse: """ Retrieve Phone Number details by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PhoneNumbersGetResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.get( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) asyncio.run(main()) """ _response = await self._raw_client.get(phone_number_id, request_options=request_options) return _response.data async def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete Phone Number by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.delete( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) asyncio.run(main()) """ _response = await self._raw_client.delete(phone_number_id, request_options=request_options) return _response.data async def update( self, phone_number_id: str, *, agent_id: typing.Optional[str] = OMIT, label: typing.Optional[str] = OMIT, inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = OMIT, outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = OMIT, livekit_stack: typing.Optional[LivekitStackType] = OMIT, store_sip_messages: typing.Optional[bool] = OMIT, environment: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PhoneNumbersUpdateResponse: """ Update assigned agent of a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. agent_id : typing.Optional[str] label : typing.Optional[str] inbound_trunk_config : typing.Optional[InboundSipTrunkConfigRequestModel] outbound_trunk_config : typing.Optional[OutboundSipTrunkConfigRequestModel] livekit_stack : typing.Optional[LivekitStackType] store_sip_messages : typing.Optional[bool] environment : typing.Optional[str] Environment to use for resolving environment variables on calls to this number. branch_id : typing.Optional[str] Agent branch to use for calls to this number. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PhoneNumbersUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.update( phone_number_id="TeaqRRdTcIfIu2i7BYfT", ) asyncio.run(main()) """ _response = await self._raw_client.update( phone_number_id, agent_id=agent_id, label=label, inbound_trunk_config=inbound_trunk_config, outbound_trunk_config=outbound_trunk_config, livekit_stack=livekit_stack, store_sip_messages=store_sip_messages, environment=environment, branch_id=branch_id, request_options=request_options, ) return _response.data async def get_sip_messages( self, phone_number_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSipLogMessagesResponse: """ Get SIP messages for a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSipLogMessagesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.phone_numbers.get_sip_messages( phone_number_id="TeaqRRdTcIfIu2i7BYfT", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.get_sip_messages( phone_number_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/raw_client.py000066400000000000000000001032671523660243400336170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.create_phone_number_response_model import CreatePhoneNumberResponseModel from ...types.get_sip_log_messages_response import GetSipLogMessagesResponse from ...types.inbound_sip_trunk_config_request_model import InboundSipTrunkConfigRequestModel from ...types.livekit_stack_type import LivekitStackType from ...types.outbound_sip_trunk_config_request_model import OutboundSipTrunkConfigRequestModel from ...types.telephony_provider import TelephonyProvider from .types.phone_numbers_create_request_body import PhoneNumbersCreateRequestBody from .types.phone_numbers_get_response import PhoneNumbersGetResponse from .types.phone_numbers_list_response_item import PhoneNumbersListResponseItem from .types.phone_numbers_update_response import PhoneNumbersUpdateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawPhoneNumbersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, provider: typing.Optional[TelephonyProvider] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.List[PhoneNumbersListResponseItem]]: """ Retrieve all Phone Numbers Parameters ---------- provider : typing.Optional[TelephonyProvider] Filter by telephony provider agent_id : typing.Optional[str] Filter by assigned agent ID branch_id : typing.Optional[str] Filter by assigned branch ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.List[PhoneNumbersListResponseItem]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/phone-numbers", method="GET", params={ "provider": provider, "agent_id": agent_id, "branch_id": branch_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[PhoneNumbersListResponseItem], construct_type( type_=typing.List[PhoneNumbersListResponseItem], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, request: PhoneNumbersCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[CreatePhoneNumberResponseModel]: """ Import Phone Number from provider configuration (Twilio, Exotel, or SIP trunk) Parameters ---------- request : PhoneNumbersCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreatePhoneNumberResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/phone-numbers", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=PhoneNumbersCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreatePhoneNumberResponseModel, construct_type( type_=CreatePhoneNumberResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[PhoneNumbersGetResponse]: """ Retrieve Phone Number details by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PhoneNumbersGetResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PhoneNumbersGetResponse, construct_type( type_=PhoneNumbersGetResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete Phone Number by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, phone_number_id: str, *, agent_id: typing.Optional[str] = OMIT, label: typing.Optional[str] = OMIT, inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = OMIT, outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = OMIT, livekit_stack: typing.Optional[LivekitStackType] = OMIT, store_sip_messages: typing.Optional[bool] = OMIT, environment: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PhoneNumbersUpdateResponse]: """ Update assigned agent of a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. agent_id : typing.Optional[str] label : typing.Optional[str] inbound_trunk_config : typing.Optional[InboundSipTrunkConfigRequestModel] outbound_trunk_config : typing.Optional[OutboundSipTrunkConfigRequestModel] livekit_stack : typing.Optional[LivekitStackType] store_sip_messages : typing.Optional[bool] environment : typing.Optional[str] Environment to use for resolving environment variables on calls to this number. branch_id : typing.Optional[str] Agent branch to use for calls to this number. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PhoneNumbersUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="PATCH", json={ "agent_id": agent_id, "label": label, "inbound_trunk_config": convert_and_respect_annotation_metadata( object_=inbound_trunk_config, annotation=InboundSipTrunkConfigRequestModel, direction="write" ), "outbound_trunk_config": convert_and_respect_annotation_metadata( object_=outbound_trunk_config, annotation=OutboundSipTrunkConfigRequestModel, direction="write" ), "livekit_stack": livekit_stack, "store_sip_messages": store_sip_messages, "environment": environment, "branch_id": branch_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PhoneNumbersUpdateResponse, construct_type( type_=PhoneNumbersUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_sip_messages( self, phone_number_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetSipLogMessagesResponse]: """ Get SIP messages for a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetSipLogMessagesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}/sip-messages", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSipLogMessagesResponse, construct_type( type_=GetSipLogMessagesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawPhoneNumbersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, provider: typing.Optional[TelephonyProvider] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.List[PhoneNumbersListResponseItem]]: """ Retrieve all Phone Numbers Parameters ---------- provider : typing.Optional[TelephonyProvider] Filter by telephony provider agent_id : typing.Optional[str] Filter by assigned agent ID branch_id : typing.Optional[str] Filter by assigned branch ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.List[PhoneNumbersListResponseItem]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/phone-numbers", method="GET", params={ "provider": provider, "agent_id": agent_id, "branch_id": branch_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[PhoneNumbersListResponseItem], construct_type( type_=typing.List[PhoneNumbersListResponseItem], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, request: PhoneNumbersCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[CreatePhoneNumberResponseModel]: """ Import Phone Number from provider configuration (Twilio, Exotel, or SIP trunk) Parameters ---------- request : PhoneNumbersCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreatePhoneNumberResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/phone-numbers", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=PhoneNumbersCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreatePhoneNumberResponseModel, construct_type( type_=CreatePhoneNumberResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[PhoneNumbersGetResponse]: """ Retrieve Phone Number details by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PhoneNumbersGetResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PhoneNumbersGetResponse, construct_type( type_=PhoneNumbersGetResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete Phone Number by ID Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, phone_number_id: str, *, agent_id: typing.Optional[str] = OMIT, label: typing.Optional[str] = OMIT, inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = OMIT, outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = OMIT, livekit_stack: typing.Optional[LivekitStackType] = OMIT, store_sip_messages: typing.Optional[bool] = OMIT, environment: typing.Optional[str] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PhoneNumbersUpdateResponse]: """ Update assigned agent of a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. agent_id : typing.Optional[str] label : typing.Optional[str] inbound_trunk_config : typing.Optional[InboundSipTrunkConfigRequestModel] outbound_trunk_config : typing.Optional[OutboundSipTrunkConfigRequestModel] livekit_stack : typing.Optional[LivekitStackType] store_sip_messages : typing.Optional[bool] environment : typing.Optional[str] Environment to use for resolving environment variables on calls to this number. branch_id : typing.Optional[str] Agent branch to use for calls to this number. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PhoneNumbersUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}", method="PATCH", json={ "agent_id": agent_id, "label": label, "inbound_trunk_config": convert_and_respect_annotation_metadata( object_=inbound_trunk_config, annotation=InboundSipTrunkConfigRequestModel, direction="write" ), "outbound_trunk_config": convert_and_respect_annotation_metadata( object_=outbound_trunk_config, annotation=OutboundSipTrunkConfigRequestModel, direction="write" ), "livekit_stack": livekit_stack, "store_sip_messages": store_sip_messages, "environment": environment, "branch_id": branch_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PhoneNumbersUpdateResponse, construct_type( type_=PhoneNumbersUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_sip_messages( self, phone_number_id: str, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetSipLogMessagesResponse]: """ Get SIP messages for a phone number Parameters ---------- phone_number_id : str The phone number ID. This is returned when a phone number is imported. page_size : typing.Optional[int] cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetSipLogMessagesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/phone-numbers/{jsonable_encoder(phone_number_id)}/sip-messages", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSipLogMessagesResponse, construct_type( type_=GetSipLogMessagesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types/000077500000000000000000000000001523660243400322515ustar00rootroot00000000000000__init__.py000066400000000000000000000072241523660243400343100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .phone_numbers_create_request_body import ( PhoneNumbersCreateRequestBody, PhoneNumbersCreateRequestBody_Exotel, PhoneNumbersCreateRequestBody_SipTrunk, PhoneNumbersCreateRequestBody_Twilio, ) from .phone_numbers_get_response import ( PhoneNumbersGetResponse, PhoneNumbersGetResponse_Exotel, PhoneNumbersGetResponse_SipTrunk, PhoneNumbersGetResponse_Twilio, ) from .phone_numbers_list_response_item import ( PhoneNumbersListResponseItem, PhoneNumbersListResponseItem_Exotel, PhoneNumbersListResponseItem_SipTrunk, PhoneNumbersListResponseItem_Twilio, ) from .phone_numbers_update_response import ( PhoneNumbersUpdateResponse, PhoneNumbersUpdateResponse_Exotel, PhoneNumbersUpdateResponse_SipTrunk, PhoneNumbersUpdateResponse_Twilio, ) _dynamic_imports: typing.Dict[str, str] = { "PhoneNumbersCreateRequestBody": ".phone_numbers_create_request_body", "PhoneNumbersCreateRequestBody_Exotel": ".phone_numbers_create_request_body", "PhoneNumbersCreateRequestBody_SipTrunk": ".phone_numbers_create_request_body", "PhoneNumbersCreateRequestBody_Twilio": ".phone_numbers_create_request_body", "PhoneNumbersGetResponse": ".phone_numbers_get_response", "PhoneNumbersGetResponse_Exotel": ".phone_numbers_get_response", "PhoneNumbersGetResponse_SipTrunk": ".phone_numbers_get_response", "PhoneNumbersGetResponse_Twilio": ".phone_numbers_get_response", "PhoneNumbersListResponseItem": ".phone_numbers_list_response_item", "PhoneNumbersListResponseItem_Exotel": ".phone_numbers_list_response_item", "PhoneNumbersListResponseItem_SipTrunk": ".phone_numbers_list_response_item", "PhoneNumbersListResponseItem_Twilio": ".phone_numbers_list_response_item", "PhoneNumbersUpdateResponse": ".phone_numbers_update_response", "PhoneNumbersUpdateResponse_Exotel": ".phone_numbers_update_response", "PhoneNumbersUpdateResponse_SipTrunk": ".phone_numbers_update_response", "PhoneNumbersUpdateResponse_Twilio": ".phone_numbers_update_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "PhoneNumbersCreateRequestBody", "PhoneNumbersCreateRequestBody_Exotel", "PhoneNumbersCreateRequestBody_SipTrunk", "PhoneNumbersCreateRequestBody_Twilio", "PhoneNumbersGetResponse", "PhoneNumbersGetResponse_Exotel", "PhoneNumbersGetResponse_SipTrunk", "PhoneNumbersGetResponse_Twilio", "PhoneNumbersListResponseItem", "PhoneNumbersListResponseItem_Exotel", "PhoneNumbersListResponseItem_SipTrunk", "PhoneNumbersListResponseItem_Twilio", "PhoneNumbersUpdateResponse", "PhoneNumbersUpdateResponse_Exotel", "PhoneNumbersUpdateResponse_SipTrunk", "PhoneNumbersUpdateResponse_Twilio", ] phone_numbers_create_request_body.py000066400000000000000000000063271523660243400415300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.exotel_api_subdomain import ExotelApiSubdomain from ....types.inbound_sip_trunk_config_request_model import InboundSipTrunkConfigRequestModel from ....types.outbound_sip_trunk_config_request_model import OutboundSipTrunkConfigRequestModel from ....types.region_config_request import RegionConfigRequest class PhoneNumbersCreateRequestBody_Twilio(UncheckedBaseModel): """ Create Phone Request Information """ provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None agent_id: typing.Optional[str] = None sid: str token: str region_config: typing.Optional[RegionConfigRequest] = None enable_sms: typing.Optional[bool] = 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 class PhoneNumbersCreateRequestBody_Exotel(UncheckedBaseModel): """ Create Phone Request Information """ provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None agent_id: typing.Optional[str] = None account_sid: str api_key: str api_token: str api_subdomain: ExotelApiSubdomain app_id: str applet_url: 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 class PhoneNumbersCreateRequestBody_SipTrunk(UncheckedBaseModel): """ Create Phone Request Information """ provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None agent_id: typing.Optional[str] = None inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = None outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = 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 PhoneNumbersCreateRequestBody = typing_extensions.Annotated[ typing.Union[ PhoneNumbersCreateRequestBody_Twilio, PhoneNumbersCreateRequestBody_Exotel, PhoneNumbersCreateRequestBody_SipTrunk, ], UnionMetadata(discriminant="provider"), ] phone_numbers_get_response.py000066400000000000000000000061641523660243400401740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.get_phone_number_inbound_sip_trunk_config_response_model import ( GetPhoneNumberInboundSipTrunkConfigResponseModel, ) from ....types.get_phone_number_outbound_sip_trunk_config_response_model import ( GetPhoneNumberOutboundSipTrunkConfigResponseModel, ) from ....types.livekit_stack_type import LivekitStackType from ....types.phone_number_agent_info import PhoneNumberAgentInfo class PhoneNumbersGetResponse_Twilio(UncheckedBaseModel): provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersGetResponse_Exotel(UncheckedBaseModel): provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersGetResponse_SipTrunk(UncheckedBaseModel): provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = None livekit_stack: LivekitStackType store_sip_messages: typing.Optional[bool] = 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 PhoneNumbersGetResponse = typing_extensions.Annotated[ typing.Union[PhoneNumbersGetResponse_Twilio, PhoneNumbersGetResponse_Exotel, PhoneNumbersGetResponse_SipTrunk], UnionMetadata(discriminant="provider"), ] phone_numbers_list_response_item.py000066400000000000000000000062451523660243400414060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.get_phone_number_inbound_sip_trunk_config_response_model import ( GetPhoneNumberInboundSipTrunkConfigResponseModel, ) from ....types.get_phone_number_outbound_sip_trunk_config_response_model import ( GetPhoneNumberOutboundSipTrunkConfigResponseModel, ) from ....types.livekit_stack_type import LivekitStackType from ....types.phone_number_agent_info import PhoneNumberAgentInfo class PhoneNumbersListResponseItem_Twilio(UncheckedBaseModel): provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersListResponseItem_Exotel(UncheckedBaseModel): provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersListResponseItem_SipTrunk(UncheckedBaseModel): provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = None livekit_stack: LivekitStackType store_sip_messages: typing.Optional[bool] = 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 PhoneNumbersListResponseItem = typing_extensions.Annotated[ typing.Union[ PhoneNumbersListResponseItem_Twilio, PhoneNumbersListResponseItem_Exotel, PhoneNumbersListResponseItem_SipTrunk ], UnionMetadata(discriminant="provider"), ] phone_numbers_update_response.py000066400000000000000000000062271523660243400406770ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/phone_numbers/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.get_phone_number_inbound_sip_trunk_config_response_model import ( GetPhoneNumberInboundSipTrunkConfigResponseModel, ) from ....types.get_phone_number_outbound_sip_trunk_config_response_model import ( GetPhoneNumberOutboundSipTrunkConfigResponseModel, ) from ....types.livekit_stack_type import LivekitStackType from ....types.phone_number_agent_info import PhoneNumberAgentInfo class PhoneNumbersUpdateResponse_Twilio(UncheckedBaseModel): provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersUpdateResponse_Exotel(UncheckedBaseModel): provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class PhoneNumbersUpdateResponse_SipTrunk(UncheckedBaseModel): provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = None livekit_stack: LivekitStackType store_sip_messages: typing.Optional[bool] = 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 PhoneNumbersUpdateResponse = typing_extensions.Annotated[ typing.Union[ PhoneNumbersUpdateResponse_Twilio, PhoneNumbersUpdateResponse_Exotel, PhoneNumbersUpdateResponse_SipTrunk ], UnionMetadata(discriminant="provider"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/raw_client.py000066400000000000000000000515031523660243400307460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from ..types.rag_document_index_response_model import RagDocumentIndexResponseModel from ..types.rag_document_indexes_response_model import RagDocumentIndexesResponseModel from ..types.rag_index_overview_response_model import RagIndexOverviewResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawConversationalAiClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def add_to_knowledge_base( self, *, agent_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). Parameters ---------- agent_id : typing.Optional[str] name : typing.Optional[str] A custom, human-readable name for the document. url : typing.Optional[str] URL to a page of documentation that the agent will have access to in order to interact with users. file : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base", method="POST", params={ "agent_id": agent_id, }, data={ "name": name, "url": url, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagIndexOverviewResponseModel]: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RagIndexOverviewResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/rag-index", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagIndexOverviewResponseModel, construct_type( type_=RagIndexOverviewResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagDocumentIndexesResponseModel]: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RagDocumentIndexesResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexesResponseModel, construct_type( type_=RagDocumentIndexesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagDocumentIndexResponseModel]: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RagDocumentIndexResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index/{jsonable_encoder(rag_index_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexResponseModel, construct_type( type_=RagDocumentIndexResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawConversationalAiClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def add_to_knowledge_base( self, *, agent_id: typing.Optional[str] = None, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: """ Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). Parameters ---------- agent_id : typing.Optional[str] name : typing.Optional[str] A custom, human-readable name for the document. url : typing.Optional[str] URL to a page of documentation that the agent will have access to in order to interact with users. file : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddKnowledgeBaseResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base", method="POST", params={ "agent_id": agent_id, }, data={ "name": name, "url": url, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddKnowledgeBaseResponseModel, construct_type( type_=AddKnowledgeBaseResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagIndexOverviewResponseModel]: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RagIndexOverviewResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/knowledge-base/rag-index", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagIndexOverviewResponseModel, construct_type( type_=RagIndexOverviewResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagDocumentIndexesResponseModel]: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RagDocumentIndexesResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexesResponseModel, construct_type( type_=RagDocumentIndexesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagDocumentIndexResponseModel]: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RagDocumentIndexResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index/{jsonable_encoder(rag_index_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RagDocumentIndexResponseModel, construct_type( type_=RagDocumentIndexResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/secrets/000077500000000000000000000000001523660243400277115ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/secrets/__init__.py000066400000000000000000000001251523660243400320200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/secrets/client.py000066400000000000000000000375611523660243400315550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conv_ai_workspace_stored_secret_config import ConvAiWorkspaceStoredSecretConfig from ...types.get_secret_dependencies_response_model import GetSecretDependenciesResponseModel from ...types.get_workspace_secrets_response_model import GetWorkspaceSecretsResponseModel from ...types.post_workspace_secret_response_model import PostWorkspaceSecretResponseModel from ...types.secret_dependency_resource_type import SecretDependencyResourceType from .raw_client import AsyncRawSecretsClient, RawSecretsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SecretsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSecretsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSecretsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSecretsClient """ return self._raw_client def list( self, *, page_size: typing.Optional[int] = None, dependency_limit: typing.Optional[int] = None, search: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetWorkspaceSecretsResponseModel: """ Get all workspace secrets for the user Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets. dependency_limit : typing.Optional[int] Maximum number of dependent resources (tools, agents, phone numbers) to return per secret. Can not exceed 100. search : typing.Optional[str] If specified, returns only secrets whose names start with this string. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetWorkspaceSecretsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.list( page_size=1, dependency_limit=1, search="search", cursor="cursor", ) """ _response = self._raw_client.list( page_size=page_size, dependency_limit=dependency_limit, search=search, cursor=cursor, request_options=request_options, ) return _response.data def create( self, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Create a new secret for the workspace Parameters ---------- name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecretResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.create( name="name", value="value", ) """ _response = self._raw_client.create(name=name, value=value, request_options=request_options) return _response.data def get( self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiWorkspaceStoredSecretConfig: """ Get a workspace secret by ID Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiWorkspaceStoredSecretConfig Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.get( secret_id="secret_id", ) """ _response = self._raw_client.get(secret_id, request_options=request_options) return _response.data def delete(self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a workspace secret if it's not in use Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.delete( secret_id="secret_id", ) """ _response = self._raw_client.delete(secret_id, request_options=request_options) return _response.data def update( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecretResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.update( secret_id="secret_id", name="name", value="value", ) """ _response = self._raw_client.update(secret_id, name=name, value=value, request_options=request_options) return _response.data def get_dependencies( self, secret_id: str, resource_type: SecretDependencyResourceType, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSecretDependenciesResponseModel: """ Get paginated list of resources that depend on a specific secret, filtered by resource type. Parameters ---------- secret_id : str resource_type : SecretDependencyResourceType page_size : typing.Optional[int] How many dependency items to return per page. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSecretDependenciesResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.secrets.get_dependencies( secret_id="secret_id", resource_type="tools", page_size=1, cursor="cursor", ) """ _response = self._raw_client.get_dependencies( secret_id, resource_type, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data class AsyncSecretsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSecretsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSecretsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSecretsClient """ return self._raw_client async def list( self, *, page_size: typing.Optional[int] = None, dependency_limit: typing.Optional[int] = None, search: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetWorkspaceSecretsResponseModel: """ Get all workspace secrets for the user Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets. dependency_limit : typing.Optional[int] Maximum number of dependent resources (tools, agents, phone numbers) to return per secret. Can not exceed 100. search : typing.Optional[str] If specified, returns only secrets whose names start with this string. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetWorkspaceSecretsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.secrets.list( page_size=1, dependency_limit=1, search="search", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, dependency_limit=dependency_limit, search=search, cursor=cursor, request_options=request_options, ) return _response.data async def create( self, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Create a new secret for the workspace Parameters ---------- name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecretResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.secrets.create( name="name", value="value", ) asyncio.run(main()) """ _response = await self._raw_client.create(name=name, value=value, request_options=request_options) return _response.data async def get( self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvAiWorkspaceStoredSecretConfig: """ Get a workspace secret by ID Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvAiWorkspaceStoredSecretConfig Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.secrets.get( secret_id="secret_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(secret_id, request_options=request_options) return _response.data async def delete(self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a workspace secret if it's not in use Parameters ---------- secret_id : str 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.conversational_ai.secrets.delete( secret_id="secret_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(secret_id, request_options=request_options) return _response.data async def update( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecretResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.secrets.update( secret_id="secret_id", name="name", value="value", ) asyncio.run(main()) """ _response = await self._raw_client.update(secret_id, name=name, value=value, request_options=request_options) return _response.data async def get_dependencies( self, secret_id: str, resource_type: SecretDependencyResourceType, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSecretDependenciesResponseModel: """ Get paginated list of resources that depend on a specific secret, filtered by resource type. Parameters ---------- secret_id : str resource_type : SecretDependencyResourceType page_size : typing.Optional[int] How many dependency items to return per page. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSecretDependenciesResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.secrets.get_dependencies( secret_id="secret_id", resource_type="tools", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.get_dependencies( secret_id, resource_type, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/secrets/raw_client.py000066400000000000000000000731441523660243400324230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conv_ai_workspace_stored_secret_config import ConvAiWorkspaceStoredSecretConfig from ...types.get_secret_dependencies_response_model import GetSecretDependenciesResponseModel from ...types.get_workspace_secrets_response_model import GetWorkspaceSecretsResponseModel from ...types.post_workspace_secret_response_model import PostWorkspaceSecretResponseModel from ...types.secret_dependency_resource_type import SecretDependencyResourceType from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSecretsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, page_size: typing.Optional[int] = None, dependency_limit: typing.Optional[int] = None, search: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetWorkspaceSecretsResponseModel]: """ Get all workspace secrets for the user Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets. dependency_limit : typing.Optional[int] Maximum number of dependent resources (tools, agents, phone numbers) to return per secret. Can not exceed 100. search : typing.Optional[str] If specified, returns only secrets whose names start with this string. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetWorkspaceSecretsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/secrets", method="GET", params={ "page_size": page_size, "dependency_limit": dependency_limit, "search": search, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetWorkspaceSecretsResponseModel, construct_type( type_=GetWorkspaceSecretsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[PostWorkspaceSecretResponseModel]: """ Create a new secret for the workspace Parameters ---------- name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PostWorkspaceSecretResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/secrets", method="POST", json={ "name": name, "value": value, "type": "new", }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostWorkspaceSecretResponseModel, construct_type( type_=PostWorkspaceSecretResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvAiWorkspaceStoredSecretConfig]: """ Get a workspace secret by ID Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvAiWorkspaceStoredSecretConfig] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiWorkspaceStoredSecretConfig, construct_type( type_=ConvAiWorkspaceStoredSecretConfig, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete a workspace secret if it's not in use Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[PostWorkspaceSecretResponseModel]: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PostWorkspaceSecretResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="PATCH", json={ "name": name, "value": value, "type": "update", }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostWorkspaceSecretResponseModel, construct_type( type_=PostWorkspaceSecretResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_dependencies( self, secret_id: str, resource_type: SecretDependencyResourceType, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetSecretDependenciesResponseModel]: """ Get paginated list of resources that depend on a specific secret, filtered by resource type. Parameters ---------- secret_id : str resource_type : SecretDependencyResourceType page_size : typing.Optional[int] How many dependency items to return per page. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetSecretDependenciesResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}/dependencies/{jsonable_encoder(resource_type)}", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSecretDependenciesResponseModel, construct_type( type_=GetSecretDependenciesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSecretsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, page_size: typing.Optional[int] = None, dependency_limit: typing.Optional[int] = None, search: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetWorkspaceSecretsResponseModel]: """ Get all workspace secrets for the user Parameters ---------- page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100. If not provided, returns all secrets. dependency_limit : typing.Optional[int] Maximum number of dependent resources (tools, agents, phone numbers) to return per secret. Can not exceed 100. search : typing.Optional[str] If specified, returns only secrets whose names start with this string. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetWorkspaceSecretsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/secrets", method="GET", params={ "page_size": page_size, "dependency_limit": dependency_limit, "search": search, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetWorkspaceSecretsResponseModel, construct_type( type_=GetWorkspaceSecretsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[PostWorkspaceSecretResponseModel]: """ Create a new secret for the workspace Parameters ---------- name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PostWorkspaceSecretResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/secrets", method="POST", json={ "name": name, "value": value, "type": "new", }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostWorkspaceSecretResponseModel, construct_type( type_=PostWorkspaceSecretResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvAiWorkspaceStoredSecretConfig]: """ Get a workspace secret by ID Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvAiWorkspaceStoredSecretConfig] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvAiWorkspaceStoredSecretConfig, construct_type( type_=ConvAiWorkspaceStoredSecretConfig, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a workspace secret if it's not in use Parameters ---------- secret_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[PostWorkspaceSecretResponseModel]: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PostWorkspaceSecretResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}", method="PATCH", json={ "name": name, "value": value, "type": "update", }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PostWorkspaceSecretResponseModel, construct_type( type_=PostWorkspaceSecretResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_dependencies( self, secret_id: str, resource_type: SecretDependencyResourceType, *, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetSecretDependenciesResponseModel]: """ Get paginated list of resources that depend on a specific secret, filtered by resource type. Parameters ---------- secret_id : str resource_type : SecretDependencyResourceType page_size : typing.Optional[int] How many dependency items to return per page. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetSecretDependenciesResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/secrets/{jsonable_encoder(secret_id)}/dependencies/{jsonable_encoder(resource_type)}", method="GET", params={ "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSecretDependenciesResponseModel, construct_type( type_=GetSecretDependenciesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/settings/000077500000000000000000000000001523660243400301015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/settings/__init__.py000066400000000000000000000001251523660243400322100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/settings/client.py000066400000000000000000000170031523660243400317320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conv_ai_webhooks import ConvAiWebhooks from ...types.conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook from ...types.get_conv_ai_settings_response_model import GetConvAiSettingsResponseModel from ...types.livekit_stack_type import LivekitStackType from .raw_client import AsyncRawSettingsClient, RawSettingsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSettingsClient """ return self._raw_client def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetConvAiSettingsResponseModel: """ Retrieve Convai settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.settings.get() """ _response = self._raw_client.get(request_options=request_options) return _response.data def update( self, *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, can_use_mcp_servers: typing.Optional[bool] = OMIT, rag_retention_period_days: typing.Optional[int] = OMIT, conversation_embedding_retention_days: typing.Optional[int] = OMIT, default_livekit_stack: typing.Optional[LivekitStackType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiSettingsResponseModel: """ Update Convai settings for the workspace Parameters ---------- conversation_initiation_client_data_webhook : typing.Optional[ConversationInitiationClientDataWebhook] webhooks : typing.Optional[ConvAiWebhooks] can_use_mcp_servers : typing.Optional[bool] Whether the workspace can use MCP servers rag_retention_period_days : typing.Optional[int] conversation_embedding_retention_days : typing.Optional[int] Days to retain conversation embeddings. None means use the system default (30 days). default_livekit_stack : typing.Optional[LivekitStackType] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.settings.update() """ _response = self._raw_client.update( conversation_initiation_client_data_webhook=conversation_initiation_client_data_webhook, webhooks=webhooks, can_use_mcp_servers=can_use_mcp_servers, rag_retention_period_days=rag_retention_period_days, conversation_embedding_retention_days=conversation_embedding_retention_days, default_livekit_stack=default_livekit_stack, request_options=request_options, ) return _response.data class AsyncSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSettingsClient """ return self._raw_client async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetConvAiSettingsResponseModel: """ Retrieve Convai settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.settings.get() asyncio.run(main()) """ _response = await self._raw_client.get(request_options=request_options) return _response.data async def update( self, *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, can_use_mcp_servers: typing.Optional[bool] = OMIT, rag_retention_period_days: typing.Optional[int] = OMIT, conversation_embedding_retention_days: typing.Optional[int] = OMIT, default_livekit_stack: typing.Optional[LivekitStackType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiSettingsResponseModel: """ Update Convai settings for the workspace Parameters ---------- conversation_initiation_client_data_webhook : typing.Optional[ConversationInitiationClientDataWebhook] webhooks : typing.Optional[ConvAiWebhooks] can_use_mcp_servers : typing.Optional[bool] Whether the workspace can use MCP servers rag_retention_period_days : typing.Optional[int] conversation_embedding_retention_days : typing.Optional[int] Days to retain conversation embeddings. None means use the system default (30 days). default_livekit_stack : typing.Optional[LivekitStackType] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConvAiSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.settings.update() asyncio.run(main()) """ _response = await self._raw_client.update( conversation_initiation_client_data_webhook=conversation_initiation_client_data_webhook, webhooks=webhooks, can_use_mcp_servers=can_use_mcp_servers, rag_retention_period_days=rag_retention_period_days, conversation_embedding_retention_days=conversation_embedding_retention_days, default_livekit_stack=default_livekit_stack, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/settings/raw_client.py000066400000000000000000000320741523660243400326100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conv_ai_webhooks import ConvAiWebhooks from ...types.conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook from ...types.get_conv_ai_settings_response_model import GetConvAiSettingsResponseModel from ...types.livekit_stack_type import LivekitStackType from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetConvAiSettingsResponseModel]: """ Retrieve Convai settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConvAiSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiSettingsResponseModel, construct_type( type_=GetConvAiSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, can_use_mcp_servers: typing.Optional[bool] = OMIT, rag_retention_period_days: typing.Optional[int] = OMIT, conversation_embedding_retention_days: typing.Optional[int] = OMIT, default_livekit_stack: typing.Optional[LivekitStackType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConvAiSettingsResponseModel]: """ Update Convai settings for the workspace Parameters ---------- conversation_initiation_client_data_webhook : typing.Optional[ConversationInitiationClientDataWebhook] webhooks : typing.Optional[ConvAiWebhooks] can_use_mcp_servers : typing.Optional[bool] Whether the workspace can use MCP servers rag_retention_period_days : typing.Optional[int] conversation_embedding_retention_days : typing.Optional[int] Days to retain conversation embeddings. None means use the system default (30 days). default_livekit_stack : typing.Optional[LivekitStackType] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConvAiSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/settings", method="PATCH", json={ "conversation_initiation_client_data_webhook": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data_webhook, annotation=ConversationInitiationClientDataWebhook, direction="write", ), "webhooks": convert_and_respect_annotation_metadata( object_=webhooks, annotation=ConvAiWebhooks, direction="write" ), "can_use_mcp_servers": can_use_mcp_servers, "rag_retention_period_days": rag_retention_period_days, "conversation_embedding_retention_days": conversation_embedding_retention_days, "default_livekit_stack": default_livekit_stack, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiSettingsResponseModel, construct_type( type_=GetConvAiSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetConvAiSettingsResponseModel]: """ Retrieve Convai settings for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConvAiSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiSettingsResponseModel, construct_type( type_=GetConvAiSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, can_use_mcp_servers: typing.Optional[bool] = OMIT, rag_retention_period_days: typing.Optional[int] = OMIT, conversation_embedding_retention_days: typing.Optional[int] = OMIT, default_livekit_stack: typing.Optional[LivekitStackType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConvAiSettingsResponseModel]: """ Update Convai settings for the workspace Parameters ---------- conversation_initiation_client_data_webhook : typing.Optional[ConversationInitiationClientDataWebhook] webhooks : typing.Optional[ConvAiWebhooks] can_use_mcp_servers : typing.Optional[bool] Whether the workspace can use MCP servers rag_retention_period_days : typing.Optional[int] conversation_embedding_retention_days : typing.Optional[int] Days to retain conversation embeddings. None means use the system default (30 days). default_livekit_stack : typing.Optional[LivekitStackType] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConvAiSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/settings", method="PATCH", json={ "conversation_initiation_client_data_webhook": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data_webhook, annotation=ConversationInitiationClientDataWebhook, direction="write", ), "webhooks": convert_and_respect_annotation_metadata( object_=webhooks, annotation=ConvAiWebhooks, direction="write" ), "can_use_mcp_servers": can_use_mcp_servers, "rag_retention_period_days": rag_retention_period_days, "conversation_embedding_retention_days": conversation_embedding_retention_days, "default_livekit_stack": default_livekit_stack, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConvAiSettingsResponseModel, construct_type( type_=GetConvAiSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/sip_trunk/000077500000000000000000000000001523660243400302575ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/sip_trunk/__init__.py000066400000000000000000000001251523660243400323660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/sip_trunk/client.py000066400000000000000000000120361523660243400321110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse from ...types.telephony_call_config import TelephonyCallConfig from .raw_client import AsyncRawSipTrunkClient, RawSipTrunkClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SipTrunkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSipTrunkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSipTrunkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSipTrunkClient """ return self._raw_client def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SipTrunkOutboundCallResponse: """ Handle an outbound call via SIP trunk Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SipTrunkOutboundCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.sip_trunk.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) """ _response = self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data class AsyncSipTrunkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSipTrunkClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSipTrunkClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSipTrunkClient """ return self._raw_client async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SipTrunkOutboundCallResponse: """ Handle an outbound call via SIP trunk Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SipTrunkOutboundCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.sip_trunk.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) asyncio.run(main()) """ _response = await self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/sip_trunk/raw_client.py000066400000000000000000000176001523660243400327640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse from ...types.telephony_call_config import TelephonyCallConfig from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSipTrunkClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SipTrunkOutboundCallResponse]: """ Handle an outbound call via SIP trunk Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SipTrunkOutboundCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/sip-trunk/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SipTrunkOutboundCallResponse, construct_type( type_=SipTrunkOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSipTrunkClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SipTrunkOutboundCallResponse]: """ Handle an outbound call via SIP trunk Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SipTrunkOutboundCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/sip-trunk/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SipTrunkOutboundCallResponse, construct_type( type_=SipTrunkOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/000077500000000000000000000000001523660243400274035ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/__init__.py000066400000000000000000000057161523660243400315250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( TestsCreateRequestBody, TestsCreateRequestBody_Llm, TestsCreateRequestBody_Simulation, TestsCreateRequestBody_Tool, TestsGetResponse, TestsGetResponse_Llm, TestsGetResponse_Simulation, TestsGetResponse_Tool, TestsListRequestSortMode, TestsUpdateRequestBody, TestsUpdateRequestBody_Llm, TestsUpdateRequestBody_Simulation, TestsUpdateRequestBody_Tool, TestsUpdateResponse, TestsUpdateResponse_Llm, TestsUpdateResponse_Simulation, TestsUpdateResponse_Tool, ) from . import folders, invocations _dynamic_imports: typing.Dict[str, str] = { "TestsCreateRequestBody": ".types", "TestsCreateRequestBody_Llm": ".types", "TestsCreateRequestBody_Simulation": ".types", "TestsCreateRequestBody_Tool": ".types", "TestsGetResponse": ".types", "TestsGetResponse_Llm": ".types", "TestsGetResponse_Simulation": ".types", "TestsGetResponse_Tool": ".types", "TestsListRequestSortMode": ".types", "TestsUpdateRequestBody": ".types", "TestsUpdateRequestBody_Llm": ".types", "TestsUpdateRequestBody_Simulation": ".types", "TestsUpdateRequestBody_Tool": ".types", "TestsUpdateResponse": ".types", "TestsUpdateResponse_Llm": ".types", "TestsUpdateResponse_Simulation": ".types", "TestsUpdateResponse_Tool": ".types", "folders": ".folders", "invocations": ".invocations", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "TestsCreateRequestBody", "TestsCreateRequestBody_Llm", "TestsCreateRequestBody_Simulation", "TestsCreateRequestBody_Tool", "TestsGetResponse", "TestsGetResponse_Llm", "TestsGetResponse_Simulation", "TestsGetResponse_Tool", "TestsListRequestSortMode", "TestsUpdateRequestBody", "TestsUpdateRequestBody_Llm", "TestsUpdateRequestBody_Simulation", "TestsUpdateRequestBody_Tool", "TestsUpdateResponse", "TestsUpdateResponse_Llm", "TestsUpdateResponse_Simulation", "TestsUpdateResponse_Tool", "folders", "invocations", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/client.py000066400000000000000000000544241523660243400312440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.create_agent_test_response_model import CreateAgentTestResponseModel from ...types.get_tests_page_response_model import GetTestsPageResponseModel from ...types.get_tests_summaries_by_ids_response_model import GetTestsSummariesByIdsResponseModel from ...types.test_sharing_mode import TestSharingMode from ...types.test_type import TestType from .raw_client import AsyncRawTestsClient, RawTestsClient from .types.tests_create_request_body import TestsCreateRequestBody from .types.tests_get_response import TestsGetResponse from .types.tests_list_request_sort_mode import TestsListRequestSortMode from .types.tests_update_request_body import TestsUpdateRequestBody from .types.tests_update_response import TestsUpdateResponse if typing.TYPE_CHECKING: from .folders.client import AsyncFoldersClient, FoldersClient from .invocations.client import AsyncInvocationsClient, InvocationsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TestsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTestsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._folders: typing.Optional[FoldersClient] = None self._invocations: typing.Optional[InvocationsClient] = None @property def with_raw_response(self) -> RawTestsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTestsClient """ return self._raw_client def create( self, *, request: TestsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> CreateAgentTestResponseModel: """ Creates a new agent response test. Parameters ---------- request : TestsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentTestResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.conversational_ai.tests import TestsCreateRequestBody_Llm client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.create( request=TestsCreateRequestBody_Llm( name="name", ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def move( self, *, entity_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Moves multiple tests or folders from one folder to another. Parameters ---------- entity_ids : typing.Sequence[str] The IDs of tests or folders to move. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Tests or folders successfully moved to another folder Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.move( entity_ids=["entity_ids"], ) """ _response = self._raw_client.move(entity_ids=entity_ids, move_to=move_to, request_options=request_options) return _response.data def get(self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TestsGetResponse: """ Gets an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TestsGetResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.get( test_id="TeaqRRdTcIfIu2i7BYfT", ) """ _response = self._raw_client.get(test_id, request_options=request_options) return _response.data def update( self, test_id: str, *, request: TestsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> TestsUpdateResponse: """ Updates an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request : TestsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TestsUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.conversational_ai.tests import TestsUpdateRequestBody_Llm client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.update( test_id="TeaqRRdTcIfIu2i7BYfT", request=TestsUpdateRequestBody_Llm( name="name", ), ) """ _response = self._raw_client.update(test_id, request=request, request_options=request_options) return _response.data def delete(self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Deletes an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.delete( test_id="TeaqRRdTcIfIu2i7BYfT", ) """ _response = self._raw_client.delete(test_id, request_options=request_options) return _response.data def summaries( self, *, test_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> GetTestsSummariesByIdsResponseModel: """ Gets agent response test summaries for the requested test IDs. Parameters ---------- test_ids : typing.Sequence[str] List of test IDs to fetch. No duplicates allowed. Prefer at most 1000 IDs per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestsSummariesByIdsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.summaries( test_ids=["test_id_1", "test_id_2"], ) """ _response = self._raw_client.summaries(test_ids=test_ids, request_options=request_options) return _response.data def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, parent_folder_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] = None, include_folders: typing.Optional[bool] = None, sort_mode: typing.Optional[TestsListRequestSortMode] = None, sharing_mode: typing.Optional[TestSharingMode] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestsPageResponseModel: """ Lists all agent response tests with pagination support and optional search filtering. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search query to filter tests by name. parent_folder_id : typing.Optional[str] Filter by parent folder ID. Use 'root' to get items in the root folder. types : typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] If present, the endpoint will return only tests/folders of the given types. include_folders : typing.Optional[bool] Deprecated. Use the `types` query param and include `folder` instead. sort_mode : typing.Optional[TestsListRequestSortMode] Sort mode for listing tests. Use 'folders_first' to place folders before tests. sharing_mode : typing.Optional[TestSharingMode] Filter test visibility. Use `shared_with_me` to return only tests/folders shared with the current user that they did not create. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.list( cursor="cursor", page_size=1, search="search", parent_folder_id="parent_folder_id", types=["llm"], include_folders=True, sort_mode="default", sharing_mode="all", ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, search=search, parent_folder_id=parent_folder_id, types=types, include_folders=include_folders, sort_mode=sort_mode, sharing_mode=sharing_mode, request_options=request_options, ) return _response.data @property def folders(self): if self._folders is None: from .folders.client import FoldersClient # noqa: E402 self._folders = FoldersClient(client_wrapper=self._client_wrapper) return self._folders @property def invocations(self): if self._invocations is None: from .invocations.client import InvocationsClient # noqa: E402 self._invocations = InvocationsClient(client_wrapper=self._client_wrapper) return self._invocations class AsyncTestsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTestsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._folders: typing.Optional[AsyncFoldersClient] = None self._invocations: typing.Optional[AsyncInvocationsClient] = None @property def with_raw_response(self) -> AsyncRawTestsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTestsClient """ return self._raw_client async def create( self, *, request: TestsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> CreateAgentTestResponseModel: """ Creates a new agent response test. Parameters ---------- request : TestsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentTestResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.conversational_ai.tests import TestsCreateRequestBody_Llm client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.create( request=TestsCreateRequestBody_Llm( name="name", ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def move( self, *, entity_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Moves multiple tests or folders from one folder to another. Parameters ---------- entity_ids : typing.Sequence[str] The IDs of tests or folders to move. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Tests or folders successfully moved to another folder Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.move( entity_ids=["entity_ids"], ) asyncio.run(main()) """ _response = await self._raw_client.move(entity_ids=entity_ids, move_to=move_to, request_options=request_options) return _response.data async def get(self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TestsGetResponse: """ Gets an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TestsGetResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.get( test_id="TeaqRRdTcIfIu2i7BYfT", ) asyncio.run(main()) """ _response = await self._raw_client.get(test_id, request_options=request_options) return _response.data async def update( self, test_id: str, *, request: TestsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> TestsUpdateResponse: """ Updates an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request : TestsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TestsUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.conversational_ai.tests import TestsUpdateRequestBody_Llm client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.update( test_id="TeaqRRdTcIfIu2i7BYfT", request=TestsUpdateRequestBody_Llm( name="name", ), ) asyncio.run(main()) """ _response = await self._raw_client.update(test_id, request=request, request_options=request_options) return _response.data async def delete(self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Deletes an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.delete( test_id="TeaqRRdTcIfIu2i7BYfT", ) asyncio.run(main()) """ _response = await self._raw_client.delete(test_id, request_options=request_options) return _response.data async def summaries( self, *, test_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> GetTestsSummariesByIdsResponseModel: """ Gets agent response test summaries for the requested test IDs. Parameters ---------- test_ids : typing.Sequence[str] List of test IDs to fetch. No duplicates allowed. Prefer at most 1000 IDs per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestsSummariesByIdsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.summaries( test_ids=["test_id_1", "test_id_2"], ) asyncio.run(main()) """ _response = await self._raw_client.summaries(test_ids=test_ids, request_options=request_options) return _response.data async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, parent_folder_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] = None, include_folders: typing.Optional[bool] = None, sort_mode: typing.Optional[TestsListRequestSortMode] = None, sharing_mode: typing.Optional[TestSharingMode] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestsPageResponseModel: """ Lists all agent response tests with pagination support and optional search filtering. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search query to filter tests by name. parent_folder_id : typing.Optional[str] Filter by parent folder ID. Use 'root' to get items in the root folder. types : typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] If present, the endpoint will return only tests/folders of the given types. include_folders : typing.Optional[bool] Deprecated. Use the `types` query param and include `folder` instead. sort_mode : typing.Optional[TestsListRequestSortMode] Sort mode for listing tests. Use 'folders_first' to place folders before tests. sharing_mode : typing.Optional[TestSharingMode] Filter test visibility. Use `shared_with_me` to return only tests/folders shared with the current user that they did not create. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.list( cursor="cursor", page_size=1, search="search", parent_folder_id="parent_folder_id", types=["llm"], include_folders=True, sort_mode="default", sharing_mode="all", ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, search=search, parent_folder_id=parent_folder_id, types=types, include_folders=include_folders, sort_mode=sort_mode, sharing_mode=sharing_mode, request_options=request_options, ) return _response.data @property def folders(self): if self._folders is None: from .folders.client import AsyncFoldersClient # noqa: E402 self._folders = AsyncFoldersClient(client_wrapper=self._client_wrapper) return self._folders @property def invocations(self): if self._invocations is None: from .invocations.client import AsyncInvocationsClient # noqa: E402 self._invocations = AsyncInvocationsClient(client_wrapper=self._client_wrapper) return self._invocations elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/folders/000077500000000000000000000000001523660243400310415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/folders/__init__.py000066400000000000000000000001251523660243400331500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/folders/client.py000066400000000000000000000245101523660243400326730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.create_agent_test_folder_response_model import CreateAgentTestFolderResponseModel from ....types.get_agent_test_folder_response_model import GetAgentTestFolderResponseModel from .raw_client import AsyncRawFoldersClient, RawFoldersClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class FoldersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawFoldersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawFoldersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawFoldersClient """ return self._raw_client def create( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentTestFolderResponseModel: """ Creates a folder for organizing agent tests. Parameters ---------- name : str The name of the folder to create parent_folder_id : typing.Optional[str] The ID of the parent folder. If not provided, the folder will be created at the root level. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentTestFolderResponseModel Folder successfully created Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.folders.create( name="name", ) """ _response = self._raw_client.create( name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data def get( self, folder_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentTestFolderResponseModel: """ Gets an agent test folder by ID, including its folder path. Parameters ---------- folder_id : str The folder ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTestFolderResponseModel Folder details retrieved successfully Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.folders.get( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", ) """ _response = self._raw_client.get(folder_id, request_options=request_options) return _response.data def delete( self, folder_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Deletes an agent test folder by ID. Use force=true to delete a non-empty folder and all its contents. Parameters ---------- folder_id : str The folder ID. force : typing.Optional[bool] Force delete. Required for deleting non-empty folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.folders.delete( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", force=True, ) """ _response = self._raw_client.delete(folder_id, force=force, request_options=request_options) return _response.data def update( self, folder_id: str, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentTestFolderResponseModel: """ Updates an agent test folder. Currently only supports updating the folder name. Parameters ---------- folder_id : str The folder ID. name : str The new name for the folder request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTestFolderResponseModel Folder successfully updated Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.folders.update( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", name="name", ) """ _response = self._raw_client.update(folder_id, name=name, request_options=request_options) return _response.data class AsyncFoldersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawFoldersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawFoldersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawFoldersClient """ return self._raw_client async def create( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentTestFolderResponseModel: """ Creates a folder for organizing agent tests. Parameters ---------- name : str The name of the folder to create parent_folder_id : typing.Optional[str] The ID of the parent folder. If not provided, the folder will be created at the root level. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateAgentTestFolderResponseModel Folder successfully created Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.folders.create( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, parent_folder_id=parent_folder_id, request_options=request_options ) return _response.data async def get( self, folder_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentTestFolderResponseModel: """ Gets an agent test folder by ID, including its folder path. Parameters ---------- folder_id : str The folder ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTestFolderResponseModel Folder details retrieved successfully Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.folders.get( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", ) asyncio.run(main()) """ _response = await self._raw_client.get(folder_id, request_options=request_options) return _response.data async def delete( self, folder_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> None: """ Deletes an agent test folder by ID. Use force=true to delete a non-empty folder and all its contents. Parameters ---------- folder_id : str The folder ID. force : typing.Optional[bool] Force delete. Required for deleting non-empty folders. 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.conversational_ai.tests.folders.delete( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", force=True, ) asyncio.run(main()) """ _response = await self._raw_client.delete(folder_id, force=force, request_options=request_options) return _response.data async def update( self, folder_id: str, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentTestFolderResponseModel: """ Updates an agent test folder. Currently only supports updating the folder name. Parameters ---------- folder_id : str The folder ID. name : str The new name for the folder request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgentTestFolderResponseModel Folder successfully updated Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.folders.update( folder_id="tfld_7301khxdkycse5f88fzjdtrterzm", name="name", ) asyncio.run(main()) """ _response = await self._raw_client.update(folder_id, name=name, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/folders/raw_client.py000066400000000000000000000466631523660243400335610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.create_agent_test_folder_response_model import CreateAgentTestFolderResponseModel from ....types.get_agent_test_folder_response_model import GetAgentTestFolderResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawFoldersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateAgentTestFolderResponseModel]: """ Creates a folder for organizing agent tests. Parameters ---------- name : str The name of the folder to create parent_folder_id : typing.Optional[str] The ID of the parent folder. If not provided, the folder will be created at the root level. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateAgentTestFolderResponseModel] Folder successfully created """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/folders", method="POST", json={ "name": name, "parent_folder_id": parent_folder_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentTestFolderResponseModel, construct_type( type_=CreateAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, folder_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAgentTestFolderResponseModel]: """ Gets an agent test folder by ID, including its folder path. Parameters ---------- folder_id : str The folder ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentTestFolderResponseModel] Folder details retrieved successfully """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTestFolderResponseModel, construct_type( type_=GetAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, folder_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ Deletes an agent test folder by ID. Use force=true to delete a non-empty folder and all its contents. Parameters ---------- folder_id : str The folder ID. force : typing.Optional[bool] Force delete. Required for deleting non-empty folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, folder_id: str, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAgentTestFolderResponseModel]: """ Updates an agent test folder. Currently only supports updating the folder name. Parameters ---------- folder_id : str The folder ID. name : str The new name for the folder request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetAgentTestFolderResponseModel] Folder successfully updated """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="PATCH", json={ "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTestFolderResponseModel, construct_type( type_=GetAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawFoldersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, name: str, parent_folder_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateAgentTestFolderResponseModel]: """ Creates a folder for organizing agent tests. Parameters ---------- name : str The name of the folder to create parent_folder_id : typing.Optional[str] The ID of the parent folder. If not provided, the folder will be created at the root level. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateAgentTestFolderResponseModel] Folder successfully created """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/folders", method="POST", json={ "name": name, "parent_folder_id": parent_folder_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentTestFolderResponseModel, construct_type( type_=CreateAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, folder_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAgentTestFolderResponseModel]: """ Gets an agent test folder by ID, including its folder path. Parameters ---------- folder_id : str The folder ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentTestFolderResponseModel] Folder details retrieved successfully """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTestFolderResponseModel, construct_type( type_=GetAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, folder_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ Deletes an agent test folder by ID. Use force=true to delete a non-empty folder and all its contents. Parameters ---------- folder_id : str The folder ID. force : typing.Optional[bool] Force delete. Required for deleting non-empty folders. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, folder_id: str, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAgentTestFolderResponseModel]: """ Updates an agent test folder. Currently only supports updating the folder name. Parameters ---------- folder_id : str The folder ID. name : str The new name for the folder request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetAgentTestFolderResponseModel] Folder successfully updated """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/folders/{jsonable_encoder(folder_id)}", method="PATCH", json={ "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetAgentTestFolderResponseModel, construct_type( type_=GetAgentTestFolderResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/invocations/000077500000000000000000000000001523660243400317375ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/invocations/__init__.py000066400000000000000000000001251523660243400340460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/invocations/client.py000066400000000000000000000252071523660243400335750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel from ....types.get_test_invocations_page_response_model import GetTestInvocationsPageResponseModel from ....types.get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel from .raw_client import AsyncRawInvocationsClient, RawInvocationsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class InvocationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawInvocationsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawInvocationsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawInvocationsClient """ return self._raw_client def list( self, *, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestInvocationsPageResponseModel: """ Lists all test invocations with pagination support and optional search filtering. Parameters ---------- agent_id : typing.Optional[str] Filter by agent ID page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestInvocationsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.invocations.list( agent_id="agent_id", page_size=1, cursor="cursor", ) """ _response = self._raw_client.list( agent_id=agent_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data def get( self, test_invocation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetTestSuiteInvocationResponseModel: """ Gets a test invocation by ID. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestSuiteInvocationResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.invocations.get( test_invocation_id="test_invocation_id", ) """ _response = self._raw_client.get(test_invocation_id, request_options=request_options) return _response.data def resubmit( self, test_invocation_id: str, *, test_run_ids: typing.Sequence[str], agent_id: str, agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Resubmits specific test runs from a test invocation. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. test_run_ids : typing.Sequence[str] List of test run IDs to resubmit agent_id : str Agent ID to resubmit tests for agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tests.invocations.resubmit( test_invocation_id="test_invocation_id", test_run_ids=["test_run_ids"], agent_id="agent_id", ) """ _response = self._raw_client.resubmit( test_invocation_id, test_run_ids=test_run_ids, agent_id=agent_id, agent_config_override=agent_config_override, branch_id=branch_id, request_options=request_options, ) return _response.data class AsyncInvocationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawInvocationsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawInvocationsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawInvocationsClient """ return self._raw_client async def list( self, *, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetTestInvocationsPageResponseModel: """ Lists all test invocations with pagination support and optional search filtering. Parameters ---------- agent_id : typing.Optional[str] Filter by agent ID page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestInvocationsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.invocations.list( agent_id="agent_id", page_size=1, cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( agent_id=agent_id, page_size=page_size, cursor=cursor, request_options=request_options ) return _response.data async def get( self, test_invocation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetTestSuiteInvocationResponseModel: """ Gets a test invocation by ID. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetTestSuiteInvocationResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.invocations.get( test_invocation_id="test_invocation_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(test_invocation_id, request_options=request_options) return _response.data async def resubmit( self, test_invocation_id: str, *, test_run_ids: typing.Sequence[str], agent_id: str, agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Resubmits specific test runs from a test invocation. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. test_run_ids : typing.Sequence[str] List of test run IDs to resubmit agent_id : str Agent ID to resubmit tests for agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tests.invocations.resubmit( test_invocation_id="test_invocation_id", test_run_ids=["test_run_ids"], agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.resubmit( test_invocation_id, test_run_ids=test_run_ids, agent_id=agent_id, agent_config_override=agent_config_override, branch_id=branch_id, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000000441611523660243400343670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/invocations# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel from ....types.get_test_invocations_page_response_model import GetTestInvocationsPageResponseModel from ....types.get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawInvocationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetTestInvocationsPageResponseModel]: """ Lists all test invocations with pagination support and optional search filtering. Parameters ---------- agent_id : typing.Optional[str] Filter by agent ID page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetTestInvocationsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/test-invocations", method="GET", params={ "agent_id": agent_id, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestInvocationsPageResponseModel, construct_type( type_=GetTestInvocationsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, test_invocation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTestSuiteInvocationResponseModel]: """ Gets a test invocation by ID. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetTestSuiteInvocationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/test-invocations/{jsonable_encoder(test_invocation_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestSuiteInvocationResponseModel, construct_type( type_=GetTestSuiteInvocationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def resubmit( self, test_invocation_id: str, *, test_run_ids: typing.Sequence[str], agent_id: str, agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Resubmits specific test runs from a test invocation. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. test_run_ids : typing.Sequence[str] List of test run IDs to resubmit agent_id : str Agent ID to resubmit tests for agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/test-invocations/{jsonable_encoder(test_invocation_id)}/resubmit", method="POST", json={ "test_run_ids": test_run_ids, "agent_config_override": convert_and_respect_annotation_metadata( object_=agent_config_override, annotation=AdhocAgentConfigOverrideForTestRequestModel, direction="write", ), "agent_id": agent_id, "branch_id": branch_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawInvocationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, agent_id: typing.Optional[str] = None, page_size: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetTestInvocationsPageResponseModel]: """ Lists all test invocations with pagination support and optional search filtering. Parameters ---------- agent_id : typing.Optional[str] Filter by agent ID page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetTestInvocationsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/test-invocations", method="GET", params={ "agent_id": agent_id, "page_size": page_size, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestInvocationsPageResponseModel, construct_type( type_=GetTestInvocationsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, test_invocation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTestSuiteInvocationResponseModel]: """ Gets a test invocation by ID. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetTestSuiteInvocationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/test-invocations/{jsonable_encoder(test_invocation_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestSuiteInvocationResponseModel, construct_type( type_=GetTestSuiteInvocationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def resubmit( self, test_invocation_id: str, *, test_run_ids: typing.Sequence[str], agent_id: str, agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT, branch_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Resubmits specific test runs from a test invocation. Parameters ---------- test_invocation_id : str The id of a test invocation. This is returned when tests are run. test_run_ids : typing.Sequence[str] List of test run IDs to resubmit agent_id : str Agent ID to resubmit tests for agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] Configuration overrides to use for testing. If not provided, the agent's default configuration will be used. branch_id : typing.Optional[str] ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/test-invocations/{jsonable_encoder(test_invocation_id)}/resubmit", method="POST", json={ "test_run_ids": test_run_ids, "agent_config_override": convert_and_respect_annotation_metadata( object_=agent_config_override, annotation=AdhocAgentConfigOverrideForTestRequestModel, direction="write", ), "agent_id": agent_id, "branch_id": branch_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/raw_client.py000066400000000000000000001134731523660243400321150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.create_agent_test_response_model import CreateAgentTestResponseModel from ...types.get_tests_page_response_model import GetTestsPageResponseModel from ...types.get_tests_summaries_by_ids_response_model import GetTestsSummariesByIdsResponseModel from ...types.test_sharing_mode import TestSharingMode from ...types.test_type import TestType from .types.tests_create_request_body import TestsCreateRequestBody from .types.tests_get_response import TestsGetResponse from .types.tests_list_request_sort_mode import TestsListRequestSortMode from .types.tests_update_request_body import TestsUpdateRequestBody from .types.tests_update_response import TestsUpdateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTestsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, request: TestsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[CreateAgentTestResponseModel]: """ Creates a new agent response test. Parameters ---------- request : TestsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateAgentTestResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/create", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=TestsCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentTestResponseModel, construct_type( type_=CreateAgentTestResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def move( self, *, entity_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Moves multiple tests or folders from one folder to another. Parameters ---------- entity_ids : typing.Sequence[str] The IDs of tests or folders to move. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Tests or folders successfully moved to another folder """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/bulk-move", method="POST", json={ "entity_ids": entity_ids, "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[TestsGetResponse]: """ Gets an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TestsGetResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TestsGetResponse, construct_type( type_=TestsGetResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, test_id: str, *, request: TestsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[TestsUpdateResponse]: """ Updates an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request : TestsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TestsUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="PUT", json=convert_and_respect_annotation_metadata( object_=request, annotation=TestsUpdateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TestsUpdateResponse, construct_type( type_=TestsUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Deletes an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def summaries( self, *, test_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTestsSummariesByIdsResponseModel]: """ Gets agent response test summaries for the requested test IDs. Parameters ---------- test_ids : typing.Sequence[str] List of test IDs to fetch. No duplicates allowed. Prefer at most 1000 IDs per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetTestsSummariesByIdsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/summaries", method="POST", json={ "test_ids": test_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestsSummariesByIdsResponseModel, construct_type( type_=GetTestsSummariesByIdsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, parent_folder_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] = None, include_folders: typing.Optional[bool] = None, sort_mode: typing.Optional[TestsListRequestSortMode] = None, sharing_mode: typing.Optional[TestSharingMode] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetTestsPageResponseModel]: """ Lists all agent response tests with pagination support and optional search filtering. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search query to filter tests by name. parent_folder_id : typing.Optional[str] Filter by parent folder ID. Use 'root' to get items in the root folder. types : typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] If present, the endpoint will return only tests/folders of the given types. include_folders : typing.Optional[bool] Deprecated. Use the `types` query param and include `folder` instead. sort_mode : typing.Optional[TestsListRequestSortMode] Sort mode for listing tests. Use 'folders_first' to place folders before tests. sharing_mode : typing.Optional[TestSharingMode] Filter test visibility. Use `shared_with_me` to return only tests/folders shared with the current user that they did not create. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetTestsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/agent-testing", method="GET", params={ "cursor": cursor, "page_size": page_size, "search": search, "parent_folder_id": parent_folder_id, "types": types, "include_folders": include_folders, "sort_mode": sort_mode, "sharing_mode": sharing_mode, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestsPageResponseModel, construct_type( type_=GetTestsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTestsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, request: TestsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[CreateAgentTestResponseModel]: """ Creates a new agent response test. Parameters ---------- request : TestsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateAgentTestResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/create", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=TestsCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateAgentTestResponseModel, construct_type( type_=CreateAgentTestResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def move( self, *, entity_ids: typing.Sequence[str], move_to: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Moves multiple tests or folders from one folder to another. Parameters ---------- entity_ids : typing.Sequence[str] The IDs of tests or folders to move. move_to : typing.Optional[str] The folder to move the entities to. If not set, the entities will be moved to the root folder. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Tests or folders successfully moved to another folder """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/bulk-move", method="POST", json={ "entity_ids": entity_ids, "move_to": move_to, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[TestsGetResponse]: """ Gets an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TestsGetResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TestsGetResponse, construct_type( type_=TestsGetResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, test_id: str, *, request: TestsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[TestsUpdateResponse]: """ Updates an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request : TestsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TestsUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="PUT", json=convert_and_respect_annotation_metadata( object_=request, annotation=TestsUpdateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TestsUpdateResponse, construct_type( type_=TestsUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, test_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Deletes an agent response test by ID. Parameters ---------- test_id : str The id of a chat response test. This is returned on test creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/agent-testing/{jsonable_encoder(test_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def summaries( self, *, test_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTestsSummariesByIdsResponseModel]: """ Gets agent response test summaries for the requested test IDs. Parameters ---------- test_ids : typing.Sequence[str] List of test IDs to fetch. No duplicates allowed. Prefer at most 1000 IDs per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetTestsSummariesByIdsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agent-testing/summaries", method="POST", json={ "test_ids": test_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestsSummariesByIdsResponseModel, construct_type( type_=GetTestsSummariesByIdsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, parent_folder_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] = None, include_folders: typing.Optional[bool] = None, sort_mode: typing.Optional[TestsListRequestSortMode] = None, sharing_mode: typing.Optional[TestSharingMode] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetTestsPageResponseModel]: """ Lists all agent response tests with pagination support and optional search filtering. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Tests to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search query to filter tests by name. parent_folder_id : typing.Optional[str] Filter by parent folder ID. Use 'root' to get items in the root folder. types : typing.Optional[typing.Union[TestType, typing.Sequence[TestType]]] If present, the endpoint will return only tests/folders of the given types. include_folders : typing.Optional[bool] Deprecated. Use the `types` query param and include `folder` instead. sort_mode : typing.Optional[TestsListRequestSortMode] Sort mode for listing tests. Use 'folders_first' to place folders before tests. sharing_mode : typing.Optional[TestSharingMode] Filter test visibility. Use `shared_with_me` to return only tests/folders shared with the current user that they did not create. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetTestsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/agent-testing", method="GET", params={ "cursor": cursor, "page_size": page_size, "search": search, "parent_folder_id": parent_folder_id, "types": types, "include_folders": include_folders, "sort_mode": sort_mode, "sharing_mode": sharing_mode, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetTestsPageResponseModel, construct_type( type_=GetTestsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types/000077500000000000000000000000001523660243400305475ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types/__init__.py000066400000000000000000000064711523660243400326700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .tests_create_request_body import ( TestsCreateRequestBody, TestsCreateRequestBody_Llm, TestsCreateRequestBody_Simulation, TestsCreateRequestBody_Tool, ) from .tests_get_response import ( TestsGetResponse, TestsGetResponse_Llm, TestsGetResponse_Simulation, TestsGetResponse_Tool, ) from .tests_list_request_sort_mode import TestsListRequestSortMode from .tests_update_request_body import ( TestsUpdateRequestBody, TestsUpdateRequestBody_Llm, TestsUpdateRequestBody_Simulation, TestsUpdateRequestBody_Tool, ) from .tests_update_response import ( TestsUpdateResponse, TestsUpdateResponse_Llm, TestsUpdateResponse_Simulation, TestsUpdateResponse_Tool, ) _dynamic_imports: typing.Dict[str, str] = { "TestsCreateRequestBody": ".tests_create_request_body", "TestsCreateRequestBody_Llm": ".tests_create_request_body", "TestsCreateRequestBody_Simulation": ".tests_create_request_body", "TestsCreateRequestBody_Tool": ".tests_create_request_body", "TestsGetResponse": ".tests_get_response", "TestsGetResponse_Llm": ".tests_get_response", "TestsGetResponse_Simulation": ".tests_get_response", "TestsGetResponse_Tool": ".tests_get_response", "TestsListRequestSortMode": ".tests_list_request_sort_mode", "TestsUpdateRequestBody": ".tests_update_request_body", "TestsUpdateRequestBody_Llm": ".tests_update_request_body", "TestsUpdateRequestBody_Simulation": ".tests_update_request_body", "TestsUpdateRequestBody_Tool": ".tests_update_request_body", "TestsUpdateResponse": ".tests_update_response", "TestsUpdateResponse_Llm": ".tests_update_response", "TestsUpdateResponse_Simulation": ".tests_update_response", "TestsUpdateResponse_Tool": ".tests_update_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "TestsCreateRequestBody", "TestsCreateRequestBody_Llm", "TestsCreateRequestBody_Simulation", "TestsCreateRequestBody_Tool", "TestsGetResponse", "TestsGetResponse_Llm", "TestsGetResponse_Simulation", "TestsGetResponse_Tool", "TestsListRequestSortMode", "TestsUpdateRequestBody", "TestsUpdateRequestBody_Llm", "TestsUpdateRequestBody_Simulation", "TestsUpdateRequestBody_Tool", "TestsUpdateResponse", "TestsUpdateResponse_Llm", "TestsUpdateResponse_Simulation", "TestsUpdateResponse_Tool", ] tests_create_request_body.py000066400000000000000000000116531523660243400363220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.agent_failure_response_example import AgentFailureResponseExample from ....types.agent_successful_response_example import AgentSuccessfulResponseExample from ....types.conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.llm import Llm from ....types.simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from ....types.test_from_conversation_metadata_input import TestFromConversationMetadataInput from ....types.tool_response_mock_config_input import ToolResponseMockConfigInput from ....types.unit_test_tool_call_evaluation_model_input import UnitTestToolCallEvaluationModelInput class TestsCreateRequestBody_Llm(UncheckedBaseModel): """ Create Chat Response Test Request Information """ type: typing.Literal["llm"] = "llm" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = None name: str parent_folder_id: 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 class TestsCreateRequestBody_Tool(UncheckedBaseModel): """ Create Chat Response Test Request Information """ type: typing.Literal["tool"] = "tool" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelInput] = None check_any_tool_matches: typing.Optional[bool] = None name: str parent_folder_id: 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 class TestsCreateRequestBody_Simulation(UncheckedBaseModel): """ Create Chat Response Test Request Information """ type: typing.Literal["simulation"] = "simulation" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_conditions: typing.Optional[typing.List[str]] = None simulation_scenario: typing.Optional[str] = None simulation_max_turns: typing.Optional[int] = None simulation_environment: typing.Optional[str] = None tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = None tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigInput]]] = None evaluation_model: typing.Optional[Llm] = None simulated_user_model: typing.Optional[Llm] = None name: str parent_folder_id: 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 TestsCreateRequestBody = typing_extensions.Annotated[ typing.Union[TestsCreateRequestBody_Llm, TestsCreateRequestBody_Tool, TestsCreateRequestBody_Simulation], UnionMetadata(discriminant="type"), ] update_forward_refs(TestsCreateRequestBody_Llm) update_forward_refs(TestsCreateRequestBody_Tool) update_forward_refs(TestsCreateRequestBody_Simulation) tests_get_response.py000066400000000000000000000111041523660243400347560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.agent_failure_response_example import AgentFailureResponseExample from ....types.agent_successful_response_example import AgentSuccessfulResponseExample from ....types.conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.llm import Llm from ....types.simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from ....types.test_from_conversation_metadata_output import TestFromConversationMetadataOutput from ....types.tool_response_mock_config_output import ToolResponseMockConfigOutput from ....types.unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput class TestsGetResponse_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = None id: str name: 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 TestsGetResponse_Tool(UncheckedBaseModel): type: typing.Literal["tool"] = "tool" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = None check_any_tool_matches: typing.Optional[bool] = None id: str name: 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 TestsGetResponse_Simulation(UncheckedBaseModel): type: typing.Literal["simulation"] = "simulation" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_conditions: typing.Optional[typing.List[str]] = None simulation_scenario: typing.Optional[str] = None simulation_max_turns: typing.Optional[int] = None simulation_environment: typing.Optional[str] = None tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = None tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = None evaluation_model: typing.Optional[Llm] = None simulated_user_model: typing.Optional[Llm] = None id: str name: 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 TestsGetResponse = typing_extensions.Annotated[ typing.Union[TestsGetResponse_Llm, TestsGetResponse_Tool, TestsGetResponse_Simulation], UnionMetadata(discriminant="type"), ] update_forward_refs(TestsGetResponse_Llm) update_forward_refs(TestsGetResponse_Tool) update_forward_refs(TestsGetResponse_Simulation) tests_list_request_sort_mode.py000066400000000000000000000002601523660243400370600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types# This file was auto-generated by Fern from our API Definition. import typing TestsListRequestSortMode = typing.Union[typing.Literal["default", "folders_first"], typing.Any] tests_update_request_body.py000066400000000000000000000115401523660243400363340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.agent_failure_response_example import AgentFailureResponseExample from ....types.agent_successful_response_example import AgentSuccessfulResponseExample from ....types.conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.llm import Llm from ....types.simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from ....types.test_from_conversation_metadata_input import TestFromConversationMetadataInput from ....types.tool_response_mock_config_input import ToolResponseMockConfigInput from ....types.unit_test_tool_call_evaluation_model_input import UnitTestToolCallEvaluationModelInput class TestsUpdateRequestBody_Llm(UncheckedBaseModel): """ Agent test to update """ type: typing.Literal["llm"] = "llm" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = None name: str parent_folder_id: 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 class TestsUpdateRequestBody_Tool(UncheckedBaseModel): """ Agent test to update """ type: typing.Literal["tool"] = "tool" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelInput] = None check_any_tool_matches: typing.Optional[bool] = None name: str parent_folder_id: 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 class TestsUpdateRequestBody_Simulation(UncheckedBaseModel): """ Agent test to update """ type: typing.Literal["simulation"] = "simulation" from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_conditions: typing.Optional[typing.List[str]] = None simulation_scenario: typing.Optional[str] = None simulation_max_turns: typing.Optional[int] = None simulation_environment: typing.Optional[str] = None tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = None tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigInput]]] = None evaluation_model: typing.Optional[Llm] = None simulated_user_model: typing.Optional[Llm] = None name: str parent_folder_id: 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 TestsUpdateRequestBody = typing_extensions.Annotated[ typing.Union[TestsUpdateRequestBody_Llm, TestsUpdateRequestBody_Tool, TestsUpdateRequestBody_Simulation], UnionMetadata(discriminant="type"), ] update_forward_refs(TestsUpdateRequestBody_Llm) update_forward_refs(TestsUpdateRequestBody_Tool) update_forward_refs(TestsUpdateRequestBody_Simulation) tests_update_response.py000066400000000000000000000111421523660243400354630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tests/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.agent_failure_response_example import AgentFailureResponseExample from ....types.agent_successful_response_example import AgentSuccessfulResponseExample from ....types.conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from ....types.conversation_initiation_source import ConversationInitiationSource from ....types.llm import Llm from ....types.simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from ....types.test_from_conversation_metadata_output import TestFromConversationMetadataOutput from ....types.tool_response_mock_config_output import ToolResponseMockConfigOutput from ....types.unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput class TestsUpdateResponse_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = None id: str name: 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 TestsUpdateResponse_Tool(UncheckedBaseModel): type: typing.Literal["tool"] = "tool" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = None check_any_tool_matches: typing.Optional[bool] = None id: str name: 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 TestsUpdateResponse_Simulation(UncheckedBaseModel): type: typing.Literal["simulation"] = "simulation" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_conditions: typing.Optional[typing.List[str]] = None simulation_scenario: typing.Optional[str] = None simulation_max_turns: typing.Optional[int] = None simulation_environment: typing.Optional[str] = None tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = None tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = None evaluation_model: typing.Optional[Llm] = None simulated_user_model: typing.Optional[Llm] = None id: str name: 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 TestsUpdateResponse = typing_extensions.Annotated[ typing.Union[TestsUpdateResponse_Llm, TestsUpdateResponse_Tool, TestsUpdateResponse_Simulation], UnionMetadata(discriminant="type"), ] update_forward_refs(TestsUpdateResponse_Llm) update_forward_refs(TestsUpdateResponse_Tool) update_forward_refs(TestsUpdateResponse_Simulation) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/000077500000000000000000000000001523660243400274015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/__init__.py000066400000000000000000000020321523660243400315070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import executions _dynamic_imports: typing.Dict[str, str] = {"executions": ".executions"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["executions"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/client.py000066400000000000000000000531321523660243400312350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel from ...types.sort_direction import SortDirection from ...types.tool_request_model import ToolRequestModel from ...types.tool_response_model import ToolResponseModel from ...types.tool_sort_by import ToolSortBy from ...types.tool_type_filter import ToolTypeFilter from ...types.tools_response_model import ToolsResponseModel from .raw_client import AsyncRawToolsClient, RawToolsClient if typing.TYPE_CHECKING: from .executions.client import AsyncExecutionsClient, ExecutionsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ToolsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawToolsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._executions: typing.Optional[ExecutionsClient] = None @property def with_raw_response(self) -> RawToolsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawToolsClient """ return self._raw_client def list( self, *, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[ToolSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ToolsResponseModel: """ Get all available tools in the workspace. Parameters ---------- search : typing.Optional[str] If specified, the endpoint returns only tools whose names start with this string. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only tools owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter tools by creator user ID. When set, only tools created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] If present, the endpoint will return only tools of the given types. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[ToolSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.list( search="search", page_size=1, show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=["webhook"], sort_direction="asc", sort_by="name", cursor="cursor", ) """ _response = self._raw_client.list( search=search, page_size=page_size, show_only_owned_documents=show_only_owned_documents, created_by_user_id=created_by_user_id, types=types, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data def create( self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> ToolResponseModel: """ Add a new tool to the available tools in the workspace. Parameters ---------- request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- from elevenlabs import ( ElevenLabs, ToolRequestModel, ToolRequestModelToolConfig_Client, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.create( request=ToolRequestModel( tool_config=ToolRequestModelToolConfig_Client( name="name", description="description", expects_response=False, ), ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def get( self, tool_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ToolResponseModel: """ Get tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.get( tool_id="tool_id", environment="environment", ) """ _response = self._raw_client.get(tool_id, environment=environment, request_options=request_options) return _response.data def delete( self, tool_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete tool from the workspace. Parameters ---------- tool_id : str ID of the requested tool. force : typing.Optional[bool] If set to true, the tool will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents and branches. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.delete( tool_id="tool_id", force=True, ) """ _response = self._raw_client.delete(tool_id, force=force, request_options=request_options) return _response.data def update( self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> ToolResponseModel: """ Update tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- from elevenlabs import ( ElevenLabs, ToolRequestModel, ToolRequestModelToolConfig_Client, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.update( tool_id="tool_id", request=ToolRequestModel( tool_config=ToolRequestModelToolConfig_Client( name="name", description="description", expects_response=False, ), ), ) """ _response = self._raw_client.update(tool_id, request=request, request_options=request_options) return _response.data def get_dependent_agents( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetToolDependentAgentsResponseModel: """ Get a list of agents depending on this tool Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetToolDependentAgentsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.get_dependent_agents( tool_id="tool_id", cursor="cursor", page_size=1, ) """ _response = self._raw_client.get_dependent_agents( tool_id, cursor=cursor, page_size=page_size, request_options=request_options ) return _response.data @property def executions(self): if self._executions is None: from .executions.client import ExecutionsClient # noqa: E402 self._executions = ExecutionsClient(client_wrapper=self._client_wrapper) return self._executions class AsyncToolsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._executions: typing.Optional[AsyncExecutionsClient] = None @property def with_raw_response(self) -> AsyncRawToolsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawToolsClient """ return self._raw_client async def list( self, *, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[ToolSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ToolsResponseModel: """ Get all available tools in the workspace. Parameters ---------- search : typing.Optional[str] If specified, the endpoint returns only tools whose names start with this string. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only tools owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter tools by creator user ID. When set, only tools created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] If present, the endpoint will return only tools of the given types. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[ToolSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.list( search="search", page_size=1, show_only_owned_documents=True, created_by_user_id="created_by_user_id", types=["webhook"], sort_direction="asc", sort_by="name", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( search=search, page_size=page_size, show_only_owned_documents=show_only_owned_documents, created_by_user_id=created_by_user_id, types=types, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data async def create( self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> ToolResponseModel: """ Add a new tool to the available tools in the workspace. Parameters ---------- request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- import asyncio from elevenlabs import ( AsyncElevenLabs, ToolRequestModel, ToolRequestModelToolConfig_Client, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.create( request=ToolRequestModel( tool_config=ToolRequestModelToolConfig_Client( name="name", description="description", expects_response=False, ), ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def get( self, tool_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ToolResponseModel: """ Get tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.get( tool_id="tool_id", environment="environment", ) asyncio.run(main()) """ _response = await self._raw_client.get(tool_id, environment=environment, request_options=request_options) return _response.data async def delete( self, tool_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Delete tool from the workspace. Parameters ---------- tool_id : str ID of the requested tool. force : typing.Optional[bool] If set to true, the tool will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents and branches. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.delete( tool_id="tool_id", force=True, ) asyncio.run(main()) """ _response = await self._raw_client.delete(tool_id, force=force, request_options=request_options) return _response.data async def update( self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> ToolResponseModel: """ Update tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ToolResponseModel Successful Response Examples -------- import asyncio from elevenlabs import ( AsyncElevenLabs, ToolRequestModel, ToolRequestModelToolConfig_Client, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.update( tool_id="tool_id", request=ToolRequestModel( tool_config=ToolRequestModelToolConfig_Client( name="name", description="description", expects_response=False, ), ), ) asyncio.run(main()) """ _response = await self._raw_client.update(tool_id, request=request, request_options=request_options) return _response.data async def get_dependent_agents( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetToolDependentAgentsResponseModel: """ Get a list of agents depending on this tool Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetToolDependentAgentsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.get_dependent_agents( tool_id="tool_id", cursor="cursor", page_size=1, ) asyncio.run(main()) """ _response = await self._raw_client.get_dependent_agents( tool_id, cursor=cursor, page_size=page_size, request_options=request_options ) return _response.data @property def executions(self): if self._executions is None: from .executions.client import AsyncExecutionsClient # noqa: E402 self._executions = AsyncExecutionsClient(client_wrapper=self._client_wrapper) return self._executions elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/executions/000077500000000000000000000000001523660243400315675ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/executions/__init__.py000066400000000000000000000001251523660243400336760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/executions/client.py000066400000000000000000000143441523660243400334250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.get_tool_executions_page_response_model import GetToolExecutionsPageResponseModel from .raw_client import AsyncRawExecutionsClient, RawExecutionsClient class ExecutionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawExecutionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawExecutionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawExecutionsClient """ return self._raw_client def get( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, is_error: typing.Optional[bool] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, start_time: typing.Optional[float] = None, end_time: typing.Optional[float] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetToolExecutionsPageResponseModel: """ Get paginated list of tool executions for a specific tool. Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. is_error : typing.Optional[bool] Filter by error status. If not provided, returns all executions. agent_id : typing.Optional[str] Filter by agent ID. branch_id : typing.Optional[str] Filter by agent branch ID. start_time : typing.Optional[float] Filter executions from this Unix timestamp (inclusive). end_time : typing.Optional[float] Filter executions until this Unix timestamp (inclusive). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetToolExecutionsPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.tools.executions.get( tool_id="tool_id", cursor="cursor", page_size=1, is_error=True, agent_id="agent_id", branch_id="branch_id", start_time=1.1, end_time=1.1, ) """ _response = self._raw_client.get( tool_id, cursor=cursor, page_size=page_size, is_error=is_error, agent_id=agent_id, branch_id=branch_id, start_time=start_time, end_time=end_time, request_options=request_options, ) return _response.data class AsyncExecutionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawExecutionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawExecutionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawExecutionsClient """ return self._raw_client async def get( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, is_error: typing.Optional[bool] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, start_time: typing.Optional[float] = None, end_time: typing.Optional[float] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetToolExecutionsPageResponseModel: """ Get paginated list of tool executions for a specific tool. Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. is_error : typing.Optional[bool] Filter by error status. If not provided, returns all executions. agent_id : typing.Optional[str] Filter by agent ID. branch_id : typing.Optional[str] Filter by agent branch ID. start_time : typing.Optional[float] Filter executions from this Unix timestamp (inclusive). end_time : typing.Optional[float] Filter executions until this Unix timestamp (inclusive). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetToolExecutionsPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.tools.executions.get( tool_id="tool_id", cursor="cursor", page_size=1, is_error=True, agent_id="agent_id", branch_id="branch_id", start_time=1.1, end_time=1.1, ) asyncio.run(main()) """ _response = await self._raw_client.get( tool_id, cursor=cursor, page_size=page_size, is_error=is_error, agent_id=agent_id, branch_id=branch_id, start_time=start_time, end_time=end_time, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/executions/raw_client.py000066400000000000000000000200041523660243400342640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.get_tool_executions_page_response_model import GetToolExecutionsPageResponseModel from pydantic import ValidationError class RawExecutionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, is_error: typing.Optional[bool] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, start_time: typing.Optional[float] = None, end_time: typing.Optional[float] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetToolExecutionsPageResponseModel]: """ Get paginated list of tool executions for a specific tool. Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. is_error : typing.Optional[bool] Filter by error status. If not provided, returns all executions. agent_id : typing.Optional[str] Filter by agent ID. branch_id : typing.Optional[str] Filter by agent branch ID. start_time : typing.Optional[float] Filter executions from this Unix timestamp (inclusive). end_time : typing.Optional[float] Filter executions until this Unix timestamp (inclusive). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetToolExecutionsPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}/executions", method="GET", params={ "cursor": cursor, "page_size": page_size, "is_error": is_error, "agent_id": agent_id, "branch_id": branch_id, "start_time": start_time, "end_time": end_time, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetToolExecutionsPageResponseModel, construct_type( type_=GetToolExecutionsPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawExecutionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, is_error: typing.Optional[bool] = None, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, start_time: typing.Optional[float] = None, end_time: typing.Optional[float] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetToolExecutionsPageResponseModel]: """ Get paginated list of tool executions for a specific tool. Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. is_error : typing.Optional[bool] Filter by error status. If not provided, returns all executions. agent_id : typing.Optional[str] Filter by agent ID. branch_id : typing.Optional[str] Filter by agent branch ID. start_time : typing.Optional[float] Filter executions from this Unix timestamp (inclusive). end_time : typing.Optional[float] Filter executions until this Unix timestamp (inclusive). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetToolExecutionsPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}/executions", method="GET", params={ "cursor": cursor, "page_size": page_size, "is_error": is_error, "agent_id": agent_id, "branch_id": branch_id, "start_time": start_time, "end_time": end_time, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetToolExecutionsPageResponseModel, construct_type( type_=GetToolExecutionsPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/tools/raw_client.py000066400000000000000000001034411523660243400321050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel from ...types.sort_direction import SortDirection from ...types.tool_request_model import ToolRequestModel from ...types.tool_response_model import ToolResponseModel from ...types.tool_sort_by import ToolSortBy from ...types.tool_type_filter import ToolTypeFilter from ...types.tools_response_model import ToolsResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawToolsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[ToolSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ToolsResponseModel]: """ Get all available tools in the workspace. Parameters ---------- search : typing.Optional[str] If specified, the endpoint returns only tools whose names start with this string. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only tools owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter tools by creator user ID. When set, only tools created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] If present, the endpoint will return only tools of the given types. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[ToolSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ToolsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/tools", method="GET", params={ "search": search, "page_size": page_size, "show_only_owned_documents": show_only_owned_documents, "created_by_user_id": created_by_user_id, "types": types, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolsResponseModel, construct_type( type_=ToolsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ToolResponseModel]: """ Add a new tool to the available tools in the workspace. Parameters ---------- request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ToolResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/tools", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=ToolRequestModel, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, tool_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ToolResponseModel]: """ Get tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ToolResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="GET", params={ "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, tool_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Delete tool from the workspace. Parameters ---------- tool_id : str ID of the requested tool. force : typing.Optional[bool] If set to true, the tool will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents and branches. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ToolResponseModel]: """ Update tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ToolResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=ToolRequestModel, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_dependent_agents( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetToolDependentAgentsResponseModel]: """ Get a list of agents depending on this tool Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetToolDependentAgentsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}/dependent-agents", method="GET", params={ "cursor": cursor, "page_size": page_size, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetToolDependentAgentsResponseModel, construct_type( type_=GetToolDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawToolsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, show_only_owned_documents: typing.Optional[bool] = None, created_by_user_id: typing.Optional[str] = None, types: typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[ToolSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ToolsResponseModel]: """ Get all available tools in the workspace. Parameters ---------- search : typing.Optional[str] If specified, the endpoint returns only tools whose names start with this string. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. show_only_owned_documents : typing.Optional[bool] If set to true, the endpoint will return only tools owned by you (and not shared from somebody else). Deprecated: use created_by_user_id instead. created_by_user_id : typing.Optional[str] Filter tools by creator user ID. When set, only tools created by this user are returned. Takes precedence over show_only_owned_documents. Use '@me' to refer to the authenticated user. types : typing.Optional[typing.Union[ToolTypeFilter, typing.Sequence[ToolTypeFilter]]] If present, the endpoint will return only tools of the given types. sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[ToolSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ToolsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/tools", method="GET", params={ "search": search, "page_size": page_size, "show_only_owned_documents": show_only_owned_documents, "created_by_user_id": created_by_user_id, "types": types, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolsResponseModel, construct_type( type_=ToolsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ToolResponseModel]: """ Add a new tool to the available tools in the workspace. Parameters ---------- request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ToolResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/tools", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=ToolRequestModel, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, tool_id: str, *, environment: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ToolResponseModel]: """ Get tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. environment : typing.Optional[str] Environment whose values are used when the MCP server URL, headers, or auth connection reference environment variables. Mirrors the environment a conversation would run in; defaults to production. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ToolResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="GET", params={ "environment": environment, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, tool_id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Delete tool from the workspace. Parameters ---------- tool_id : str ID of the requested tool. force : typing.Optional[bool] If set to true, the tool will be deleted regardless of whether it is used by any agents and it will be removed from the dependent agents and branches. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="DELETE", params={ "force": force, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ToolResponseModel]: """ Update tool that is available in the workspace. Parameters ---------- tool_id : str ID of the requested tool. request : ToolRequestModel request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ToolResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=ToolRequestModel, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ToolResponseModel, construct_type( type_=ToolResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_dependent_agents( self, tool_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetToolDependentAgentsResponseModel]: """ Get a list of agents depending on this tool Parameters ---------- tool_id : str ID of the requested tool. cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many documents to return at maximum. Can not exceed 100, defaults to 30. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetToolDependentAgentsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/tools/{jsonable_encoder(tool_id)}/dependent-agents", method="GET", params={ "cursor": cursor, "page_size": page_size, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetToolDependentAgentsResponseModel, construct_type( type_=GetToolDependentAgentsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/twilio/000077500000000000000000000000001523660243400275505ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/twilio/__init__.py000066400000000000000000000001251523660243400316570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/twilio/client.py000066400000000000000000000214211523660243400314000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.telephony_call_config import TelephonyCallConfig from ...types.telephony_direction import TelephonyDirection from ...types.twilio_outbound_call_response import TwilioOutboundCallResponse from .raw_client import AsyncRawTwilioClient, RawTwilioClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TwilioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTwilioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTwilioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTwilioClient """ return self._raw_client def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, call_recording_enabled: typing.Optional[bool] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> TwilioOutboundCallResponse: """ Handle an outbound call via Twilio Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] call_recording_enabled : typing.Optional[bool] Whether let Twilio record the call. telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TwilioOutboundCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.twilio.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) """ _response = self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, call_recording_enabled=call_recording_enabled, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data def register_call( self, *, agent_id: str, from_number: str, to_number: str, direction: typing.Optional[TelephonyDirection] = OMIT, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> str: """ Register a Twilio call and return TwiML to connect the call Parameters ---------- agent_id : str from_number : str to_number : str direction : typing.Optional[TelephonyDirection] conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- str Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.twilio.register_call( agent_id="agent_id", from_number="from_number", to_number="to_number", ) """ _response = self._raw_client.register_call( agent_id=agent_id, from_number=from_number, to_number=to_number, direction=direction, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data class AsyncTwilioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTwilioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTwilioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTwilioClient """ return self._raw_client async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, call_recording_enabled: typing.Optional[bool] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> TwilioOutboundCallResponse: """ Handle an outbound call via Twilio Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] call_recording_enabled : typing.Optional[bool] Whether let Twilio record the call. telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TwilioOutboundCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.twilio.outbound_call( agent_id="agent_id", agent_phone_number_id="agent_phone_number_id", to_number="to_number", ) asyncio.run(main()) """ _response = await self._raw_client.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, conversation_initiation_client_data=conversation_initiation_client_data, call_recording_enabled=call_recording_enabled, telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data async def register_call( self, *, agent_id: str, from_number: str, to_number: str, direction: typing.Optional[TelephonyDirection] = OMIT, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> str: """ Register a Twilio call and return TwiML to connect the call Parameters ---------- agent_id : str from_number : str to_number : str direction : typing.Optional[TelephonyDirection] conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- str Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.twilio.register_call( agent_id="agent_id", from_number="from_number", to_number="to_number", ) asyncio.run(main()) """ _response = await self._raw_client.register_call( agent_id=agent_id, from_number=from_number, to_number=to_number, direction=direction, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/twilio/raw_client.py000066400000000000000000000337301523660243400322570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.telephony_call_config import TelephonyCallConfig from ...types.telephony_direction import TelephonyDirection from ...types.twilio_outbound_call_response import TwilioOutboundCallResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTwilioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, call_recording_enabled: typing.Optional[bool] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[TwilioOutboundCallResponse]: """ Handle an outbound call via Twilio Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] call_recording_enabled : typing.Optional[bool] Whether let Twilio record the call. telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TwilioOutboundCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/twilio/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "call_recording_enabled": call_recording_enabled, "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TwilioOutboundCallResponse, construct_type( type_=TwilioOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def register_call( self, *, agent_id: str, from_number: str, to_number: str, direction: typing.Optional[TelephonyDirection] = OMIT, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[str]: """ Register a Twilio call and return TwiML to connect the call Parameters ---------- agent_id : str from_number : str to_number : str direction : typing.Optional[TelephonyDirection] conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[str] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/twilio/register-call", method="POST", json={ "agent_id": agent_id, "from_number": from_number, "to_number": to_number, "direction": direction, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=_response.text) # type: ignore if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTwilioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def outbound_call( self, *, agent_id: str, agent_phone_number_id: str, to_number: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, call_recording_enabled: typing.Optional[bool] = OMIT, telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[TwilioOutboundCallResponse]: """ Handle an outbound call via Twilio Parameters ---------- agent_id : str agent_phone_number_id : str to_number : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] call_recording_enabled : typing.Optional[bool] Whether let Twilio record the call. telephony_call_config : typing.Optional[TelephonyCallConfig] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TwilioOutboundCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/twilio/outbound-call", method="POST", json={ "agent_id": agent_id, "agent_phone_number_id": agent_phone_number_id, "to_number": to_number, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), "call_recording_enabled": call_recording_enabled, "telephony_call_config": convert_and_respect_annotation_metadata( object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TwilioOutboundCallResponse, construct_type( type_=TwilioOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def register_call( self, *, agent_id: str, from_number: str, to_number: str, direction: typing.Optional[TelephonyDirection] = OMIT, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[str]: """ Register a Twilio call and return TwiML to connect the call Parameters ---------- agent_id : str from_number : str to_number : str direction : typing.Optional[TelephonyDirection] conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[str] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/twilio/register-call", method="POST", json={ "agent_id": agent_id, "from_number": from_number, "to_number": to_number, "direction": direction, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=_response.text) # type: ignore if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/users/000077500000000000000000000000001523660243400274025ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/users/__init__.py000066400000000000000000000001251523660243400315110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/users/client.py000066400000000000000000000165361523660243400312450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_conversation_users_page_response_model import GetConversationUsersPageResponseModel from ...types.sort_direction import SortDirection from ...types.users_sort_by import UsersSortBy from .raw_client import AsyncRawUsersClient, RawUsersClient class UsersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawUsersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawUsersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawUsersClient """ return self._raw_client def list( self, *, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort_by: typing.Optional[UsersSortBy] = None, sort_direction: typing.Optional[SortDirection] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationUsersPageResponseModel: """ Get distinct users from conversations with pagination. Parameters ---------- agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. branch_id : typing.Optional[str] Filter conversations by branch ID. call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. search : typing.Optional[str] Search/filter by user ID (exact match). page_size : typing.Optional[int] How many users to return at maximum. Defaults to 30. sort_by : typing.Optional[UsersSortBy] The field to sort the results by. Defaults to last_contact_unix_secs. sort_direction : typing.Optional[SortDirection] The direction to sort the results cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationUsersPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.users.list( agent_id="agent_id", branch_id="branch_id", call_start_before_unix=1, call_start_after_unix=1, search="search", page_size=1, sort_by="last_contact_unix_secs", sort_direction="asc", cursor="cursor", ) """ _response = self._raw_client.list( agent_id=agent_id, branch_id=branch_id, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, search=search, page_size=page_size, sort_by=sort_by, sort_direction=sort_direction, cursor=cursor, request_options=request_options, ) return _response.data class AsyncUsersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawUsersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawUsersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawUsersClient """ return self._raw_client async def list( self, *, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort_by: typing.Optional[UsersSortBy] = None, sort_direction: typing.Optional[SortDirection] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetConversationUsersPageResponseModel: """ Get distinct users from conversations with pagination. Parameters ---------- agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. branch_id : typing.Optional[str] Filter conversations by branch ID. call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. search : typing.Optional[str] Search/filter by user ID (exact match). page_size : typing.Optional[int] How many users to return at maximum. Defaults to 30. sort_by : typing.Optional[UsersSortBy] The field to sort the results by. Defaults to last_contact_unix_secs. sort_direction : typing.Optional[SortDirection] The direction to sort the results cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetConversationUsersPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.users.list( agent_id="agent_id", branch_id="branch_id", call_start_before_unix=1, call_start_after_unix=1, search="search", page_size=1, sort_by="last_contact_unix_secs", sort_direction="asc", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( agent_id=agent_id, branch_id=branch_id, call_start_before_unix=call_start_before_unix, call_start_after_unix=call_start_after_unix, search=search, page_size=page_size, sort_by=sort_by, sort_direction=sort_direction, cursor=cursor, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/users/raw_client.py000066400000000000000000000217521523660243400321120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.get_conversation_users_page_response_model import GetConversationUsersPageResponseModel from ...types.sort_direction import SortDirection from ...types.users_sort_by import UsersSortBy from pydantic import ValidationError class RawUsersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort_by: typing.Optional[UsersSortBy] = None, sort_direction: typing.Optional[SortDirection] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConversationUsersPageResponseModel]: """ Get distinct users from conversations with pagination. Parameters ---------- agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. branch_id : typing.Optional[str] Filter conversations by branch ID. call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. search : typing.Optional[str] Search/filter by user ID (exact match). page_size : typing.Optional[int] How many users to return at maximum. Defaults to 30. sort_by : typing.Optional[UsersSortBy] The field to sort the results by. Defaults to last_contact_unix_secs. sort_direction : typing.Optional[SortDirection] The direction to sort the results cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetConversationUsersPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/users", method="GET", params={ "agent_id": agent_id, "branch_id": branch_id, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "search": search, "page_size": page_size, "sort_by": sort_by, "sort_direction": sort_direction, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationUsersPageResponseModel, construct_type( type_=GetConversationUsersPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawUsersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, agent_id: typing.Optional[str] = None, branch_id: typing.Optional[str] = None, call_start_before_unix: typing.Optional[int] = None, call_start_after_unix: typing.Optional[int] = None, search: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort_by: typing.Optional[UsersSortBy] = None, sort_direction: typing.Optional[SortDirection] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConversationUsersPageResponseModel]: """ Get distinct users from conversations with pagination. Parameters ---------- agent_id : typing.Optional[str] Agent id (agent_…) or speech engine external id (seng_), resolved to the same underlying resource. branch_id : typing.Optional[str] Filter conversations by branch ID. call_start_before_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations up to this start date. call_start_after_unix : typing.Optional[int] Unix timestamp (in seconds) to filter conversations after to this start date. search : typing.Optional[str] Search/filter by user ID (exact match). page_size : typing.Optional[int] How many users to return at maximum. Defaults to 30. sort_by : typing.Optional[UsersSortBy] The field to sort the results by. Defaults to last_contact_unix_secs. sort_direction : typing.Optional[SortDirection] The direction to sort the results cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetConversationUsersPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/users", method="GET", params={ "agent_id": agent_id, "branch_id": branch_id, "call_start_before_unix": call_start_before_unix, "call_start_after_unix": call_start_after_unix, "search": search, "page_size": page_size, "sort_by": sort_by, "sort_direction": sort_direction, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetConversationUsersPageResponseModel, construct_type( type_=GetConversationUsersPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/000077500000000000000000000000001523660243400300705ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/__init__.py000066400000000000000000000043541523660243400322070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header, ) _dynamic_imports: typing.Dict[str, str] = { "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem": ".types", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body": ".types", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button": ".types", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/client.py000066400000000000000000000302511523660243400317210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.whats_app_outbound_call_response import WhatsAppOutboundCallResponse from ...types.whats_app_outbound_message_response import WhatsAppOutboundMessageResponse from .raw_client import AsyncRawWhatsappClient, RawWhatsappClient from .types.body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class WhatsappClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWhatsappClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawWhatsappClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWhatsappClient """ return self._raw_client def outbound_call( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, whatsapp_call_permission_request_template_name: str, whatsapp_call_permission_request_template_language_code: str, agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WhatsAppOutboundCallResponse: """ Make an outbound call via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str whatsapp_call_permission_request_template_name : str whatsapp_call_permission_request_template_language_code : str agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WhatsAppOutboundCallResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp.outbound_call( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", whatsapp_call_permission_request_template_name="whatsapp_call_permission_request_template_name", whatsapp_call_permission_request_template_language_code="whatsapp_call_permission_request_template_language_code", agent_id="agent_id", ) """ _response = self._raw_client.outbound_call( whatsapp_phone_number_id=whatsapp_phone_number_id, whatsapp_user_id=whatsapp_user_id, whatsapp_call_permission_request_template_name=whatsapp_call_permission_request_template_name, whatsapp_call_permission_request_template_language_code=whatsapp_call_permission_request_template_language_code, agent_id=agent_id, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data def outbound_message( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, template_name: str, template_language_code: str, template_params: typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WhatsAppOutboundMessageResponse: """ Send an outbound message via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str template_name : str template_language_code : str template_params : typing.Sequence[BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem] agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WhatsAppOutboundMessageResponse Successful Response Examples -------- from elevenlabs import ElevenLabs, WhatsAppTemplateTextParam from elevenlabs.conversational_ai.whatsapp import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp.outbound_message( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", template_name="template_name", template_language_code="template_language_code", template_params=[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body( parameters=[ WhatsAppTemplateTextParam( text="text", ) ], ) ], agent_id="agent_id", ) """ _response = self._raw_client.outbound_message( whatsapp_phone_number_id=whatsapp_phone_number_id, whatsapp_user_id=whatsapp_user_id, template_name=template_name, template_language_code=template_language_code, template_params=template_params, agent_id=agent_id, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data class AsyncWhatsappClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWhatsappClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawWhatsappClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWhatsappClient """ return self._raw_client async def outbound_call( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, whatsapp_call_permission_request_template_name: str, whatsapp_call_permission_request_template_language_code: str, agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WhatsAppOutboundCallResponse: """ Make an outbound call via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str whatsapp_call_permission_request_template_name : str whatsapp_call_permission_request_template_language_code : str agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WhatsAppOutboundCallResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp.outbound_call( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", whatsapp_call_permission_request_template_name="whatsapp_call_permission_request_template_name", whatsapp_call_permission_request_template_language_code="whatsapp_call_permission_request_template_language_code", agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.outbound_call( whatsapp_phone_number_id=whatsapp_phone_number_id, whatsapp_user_id=whatsapp_user_id, whatsapp_call_permission_request_template_name=whatsapp_call_permission_request_template_name, whatsapp_call_permission_request_template_language_code=whatsapp_call_permission_request_template_language_code, agent_id=agent_id, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data async def outbound_message( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, template_name: str, template_language_code: str, template_params: typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WhatsAppOutboundMessageResponse: """ Send an outbound message via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str template_name : str template_language_code : str template_params : typing.Sequence[BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem] agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WhatsAppOutboundMessageResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, WhatsAppTemplateTextParam from elevenlabs.conversational_ai.whatsapp import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp.outbound_message( whatsapp_phone_number_id="whatsapp_phone_number_id", whatsapp_user_id="whatsapp_user_id", template_name="template_name", template_language_code="template_language_code", template_params=[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body( parameters=[ WhatsAppTemplateTextParam( text="text", ) ], ) ], agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.outbound_message( whatsapp_phone_number_id=whatsapp_phone_number_id, whatsapp_user_id=whatsapp_user_id, template_name=template_name, template_language_code=template_language_code, template_params=template_params, agent_id=agent_id, conversation_initiation_client_data=conversation_initiation_client_data, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/raw_client.py000066400000000000000000000405201523660243400325720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.whats_app_outbound_call_response import WhatsAppOutboundCallResponse from ...types.whats_app_outbound_message_response import WhatsAppOutboundMessageResponse from .types.body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawWhatsappClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def outbound_call( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, whatsapp_call_permission_request_template_name: str, whatsapp_call_permission_request_template_language_code: str, agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WhatsAppOutboundCallResponse]: """ Make an outbound call via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str whatsapp_call_permission_request_template_name : str whatsapp_call_permission_request_template_language_code : str agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WhatsAppOutboundCallResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/whatsapp/outbound-call", method="POST", json={ "whatsapp_phone_number_id": whatsapp_phone_number_id, "whatsapp_user_id": whatsapp_user_id, "whatsapp_call_permission_request_template_name": whatsapp_call_permission_request_template_name, "whatsapp_call_permission_request_template_language_code": whatsapp_call_permission_request_template_language_code, "agent_id": agent_id, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WhatsAppOutboundCallResponse, construct_type( type_=WhatsAppOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def outbound_message( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, template_name: str, template_language_code: str, template_params: typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WhatsAppOutboundMessageResponse]: """ Send an outbound message via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str template_name : str template_language_code : str template_params : typing.Sequence[BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem] agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WhatsAppOutboundMessageResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/whatsapp/outbound-message", method="POST", json={ "whatsapp_phone_number_id": whatsapp_phone_number_id, "whatsapp_user_id": whatsapp_user_id, "template_name": template_name, "template_language_code": template_language_code, "template_params": convert_and_respect_annotation_metadata( object_=template_params, annotation=typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], direction="write", ), "agent_id": agent_id, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WhatsAppOutboundMessageResponse, construct_type( type_=WhatsAppOutboundMessageResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWhatsappClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def outbound_call( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, whatsapp_call_permission_request_template_name: str, whatsapp_call_permission_request_template_language_code: str, agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WhatsAppOutboundCallResponse]: """ Make an outbound call via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str whatsapp_call_permission_request_template_name : str whatsapp_call_permission_request_template_language_code : str agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WhatsAppOutboundCallResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/whatsapp/outbound-call", method="POST", json={ "whatsapp_phone_number_id": whatsapp_phone_number_id, "whatsapp_user_id": whatsapp_user_id, "whatsapp_call_permission_request_template_name": whatsapp_call_permission_request_template_name, "whatsapp_call_permission_request_template_language_code": whatsapp_call_permission_request_template_language_code, "agent_id": agent_id, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WhatsAppOutboundCallResponse, construct_type( type_=WhatsAppOutboundCallResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def outbound_message( self, *, whatsapp_phone_number_id: str, whatsapp_user_id: str, template_name: str, template_language_code: str, template_params: typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], agent_id: str, conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WhatsAppOutboundMessageResponse]: """ Send an outbound message via WhatsApp Parameters ---------- whatsapp_phone_number_id : str whatsapp_user_id : str template_name : str template_language_code : str template_params : typing.Sequence[BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem] agent_id : str conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WhatsAppOutboundMessageResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/whatsapp/outbound-message", method="POST", json={ "whatsapp_phone_number_id": whatsapp_phone_number_id, "whatsapp_user_id": whatsapp_user_id, "template_name": template_name, "template_language_code": template_language_code, "template_params": convert_and_respect_annotation_metadata( object_=template_params, annotation=typing.Sequence[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem ], direction="write", ), "agent_id": agent_id, "conversation_initiation_client_data": convert_and_respect_annotation_metadata( object_=conversation_initiation_client_data, annotation=ConversationInitiationClientDataRequestInput, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WhatsAppOutboundMessageResponse, construct_type( type_=WhatsAppOutboundMessageResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/types/000077500000000000000000000000001523660243400312345ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/types/__init__.py000066400000000000000000000053451523660243400333540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item import ( BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header, ) _dynamic_imports: typing.Dict[str, str] = { "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem": ".body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body": ".body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button": ".body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header": ".body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button", "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header", ] 70cd97a90a189cb092a369f4c1fd7927606b005e.paxheader00006660000000000000000000000314152366024340020364xustar00rootroot00000000000000204 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp/types/body_send_an_outbound_message_via_whats_app_v_1_convai_whatsapp_outbound_message_post_template_params_item.py 70cd97a90a189cb092a369f4c1fd7927606b005e.data000066400000000000000000000051301523660243400172230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.whats_app_template_header_component_params_parameters_item import ( WhatsAppTemplateHeaderComponentParamsParametersItem, ) from ....types.whats_app_template_text_param import WhatsAppTemplateTextParam class BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body( UncheckedBaseModel ): type: typing.Literal["body"] = "body" parameters: typing.List[WhatsAppTemplateTextParam] 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 BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button( UncheckedBaseModel ): type: typing.Literal["button"] = "button" parameters: typing.List[WhatsAppTemplateTextParam] index: int sub_type: 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 BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header( UncheckedBaseModel ): type: typing.Literal["header"] = "header" parameters: typing.List[WhatsAppTemplateHeaderComponentParamsParametersItem] 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 BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem = typing_extensions.Annotated[ typing.Union[ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button, BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp_accounts/000077500000000000000000000000001523660243400317675ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp_accounts/__init__.py000066400000000000000000000001251523660243400340760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp_accounts/client.py000066400000000000000000000243001523660243400336160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_whats_app_account_response import GetWhatsAppAccountResponse from ...types.list_whats_app_accounts_response import ListWhatsAppAccountsResponse from .raw_client import AsyncRawWhatsappAccountsClient, RawWhatsappAccountsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class WhatsappAccountsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWhatsappAccountsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawWhatsappAccountsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWhatsappAccountsClient """ return self._raw_client def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetWhatsAppAccountResponse: """ Get a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetWhatsAppAccountResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp_accounts.get( phone_number_id="phone_number_id", ) """ _response = self._raw_client.get(phone_number_id, request_options=request_options) return _response.data def delete(self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp_accounts.delete( phone_number_id="phone_number_id", ) """ _response = self._raw_client.delete(phone_number_id, request_options=request_options) return _response.data def update( self, phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, enable_messaging: typing.Optional[bool] = OMIT, enable_audio_message_response: typing.Optional[bool] = OMIT, enable_typing_indicator: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Update a WhatsApp account Parameters ---------- phone_number_id : str assigned_agent_id : typing.Optional[str] enable_messaging : typing.Optional[bool] enable_audio_message_response : typing.Optional[bool] enable_typing_indicator : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp_accounts.update( phone_number_id="phone_number_id", ) """ _response = self._raw_client.update( phone_number_id, assigned_agent_id=assigned_agent_id, enable_messaging=enable_messaging, enable_audio_message_response=enable_audio_message_response, enable_typing_indicator=enable_typing_indicator, request_options=request_options, ) return _response.data def list( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> ListWhatsAppAccountsResponse: """ List all WhatsApp accounts Parameters ---------- agent_id : typing.Optional[str] Filter by assigned agent ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListWhatsAppAccountsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.whatsapp_accounts.list( agent_id="agent_id", ) """ _response = self._raw_client.list(agent_id=agent_id, request_options=request_options) return _response.data class AsyncWhatsappAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWhatsappAccountsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawWhatsappAccountsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWhatsappAccountsClient """ return self._raw_client async def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetWhatsAppAccountResponse: """ Get a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetWhatsAppAccountResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp_accounts.get( phone_number_id="phone_number_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(phone_number_id, request_options=request_options) return _response.data async def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp_accounts.delete( phone_number_id="phone_number_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(phone_number_id, request_options=request_options) return _response.data async def update( self, phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, enable_messaging: typing.Optional[bool] = OMIT, enable_audio_message_response: typing.Optional[bool] = OMIT, enable_typing_indicator: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Update a WhatsApp account Parameters ---------- phone_number_id : str assigned_agent_id : typing.Optional[str] enable_messaging : typing.Optional[bool] enable_audio_message_response : typing.Optional[bool] enable_typing_indicator : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp_accounts.update( phone_number_id="phone_number_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( phone_number_id, assigned_agent_id=assigned_agent_id, enable_messaging=enable_messaging, enable_audio_message_response=enable_audio_message_response, enable_typing_indicator=enable_typing_indicator, request_options=request_options, ) return _response.data async def list( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> ListWhatsAppAccountsResponse: """ List all WhatsApp accounts Parameters ---------- agent_id : typing.Optional[str] Filter by assigned agent ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListWhatsAppAccountsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.conversational_ai.whatsapp_accounts.list( agent_id="agent_id", ) asyncio.run(main()) """ _response = await self._raw_client.list(agent_id=agent_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000475571523660243400344330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/conversational_ai/whatsapp_accounts# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.get_whats_app_account_response import GetWhatsAppAccountResponse from ...types.list_whats_app_accounts_response import ListWhatsAppAccountsResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawWhatsappAccountsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetWhatsAppAccountResponse]: """ Get a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetWhatsAppAccountResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetWhatsAppAccountResponse, construct_type( type_=GetWhatsAppAccountResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, enable_messaging: typing.Optional[bool] = OMIT, enable_audio_message_response: typing.Optional[bool] = OMIT, enable_typing_indicator: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Update a WhatsApp account Parameters ---------- phone_number_id : str assigned_agent_id : typing.Optional[str] enable_messaging : typing.Optional[bool] enable_audio_message_response : typing.Optional[bool] enable_typing_indicator : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="PATCH", json={ "assigned_agent_id": assigned_agent_id, "enable_messaging": enable_messaging, "enable_audio_message_response": enable_audio_message_response, "enable_typing_indicator": enable_typing_indicator, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ListWhatsAppAccountsResponse]: """ List all WhatsApp accounts Parameters ---------- agent_id : typing.Optional[str] Filter by assigned agent ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListWhatsAppAccountsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/whatsapp-accounts", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListWhatsAppAccountsResponse, construct_type( type_=ListWhatsAppAccountsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWhatsappAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetWhatsAppAccountResponse]: """ Get a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetWhatsAppAccountResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetWhatsAppAccountResponse, construct_type( type_=GetWhatsAppAccountResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete a WhatsApp account Parameters ---------- phone_number_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, enable_messaging: typing.Optional[bool] = OMIT, enable_audio_message_response: typing.Optional[bool] = OMIT, enable_typing_indicator: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Update a WhatsApp account Parameters ---------- phone_number_id : str assigned_agent_id : typing.Optional[str] enable_messaging : typing.Optional[bool] enable_audio_message_response : typing.Optional[bool] enable_typing_indicator : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/whatsapp-accounts/{jsonable_encoder(phone_number_id)}", method="PATCH", json={ "assigned_agent_id": assigned_agent_id, "enable_messaging": enable_messaging, "enable_audio_message_response": enable_audio_message_response, "enable_typing_indicator": enable_typing_indicator, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list( self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ListWhatsAppAccountsResponse]: """ List all WhatsApp accounts Parameters ---------- agent_id : typing.Optional[str] Filter by assigned agent ID request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListWhatsAppAccountsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/whatsapp-accounts", method="GET", params={ "agent_id": agent_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListWhatsAppAccountsResponse, construct_type( type_=ListWhatsAppAccountsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/000077500000000000000000000000001523660243400234715ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/__init__.py000066400000000000000000000107441523660243400256100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .api_error import ApiError from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper from .datetime_utils import Rfc2822DateTime, parse_rfc2822_datetime, serialize_datetime from .file import File, convert_file_dict_to_httpx_tuples, with_content_type from .http_client import AsyncHttpClient, HttpClient from .http_response import AsyncHttpResponse, HttpResponse from .jsonable_encoder import jsonable_encoder from .logging import ConsoleLogger, ILogger, LogConfig, LogLevel, Logger, create_logger from .parse_error import ParsingError from .pydantic_utilities import ( IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, parse_obj_as, universal_field_validator, universal_root_validator, update_forward_refs, ) from .query_encoder import encode_query from .remove_none_from_dict import remove_none_from_dict from .request_options import RequestOptions from .serialization import FieldMetadata, convert_and_respect_annotation_metadata from .unchecked_base_model import UncheckedBaseModel, UnionMetadata, construct_type _dynamic_imports: typing.Dict[str, str] = { "ApiError": ".api_error", "AsyncClientWrapper": ".client_wrapper", "AsyncHttpClient": ".http_client", "AsyncHttpResponse": ".http_response", "BaseClientWrapper": ".client_wrapper", "ConsoleLogger": ".logging", "FieldMetadata": ".serialization", "File": ".file", "HttpClient": ".http_client", "HttpResponse": ".http_response", "ILogger": ".logging", "IS_PYDANTIC_V2": ".pydantic_utilities", "LogConfig": ".logging", "LogLevel": ".logging", "Logger": ".logging", "ParsingError": ".parse_error", "RequestOptions": ".request_options", "Rfc2822DateTime": ".datetime_utils", "SyncClientWrapper": ".client_wrapper", "UncheckedBaseModel": ".unchecked_base_model", "UnionMetadata": ".unchecked_base_model", "UniversalBaseModel": ".pydantic_utilities", "UniversalRootModel": ".pydantic_utilities", "construct_type": ".unchecked_base_model", "convert_and_respect_annotation_metadata": ".serialization", "convert_file_dict_to_httpx_tuples": ".file", "create_logger": ".logging", "encode_query": ".query_encoder", "jsonable_encoder": ".jsonable_encoder", "parse_obj_as": ".pydantic_utilities", "parse_rfc2822_datetime": ".datetime_utils", "remove_none_from_dict": ".remove_none_from_dict", "serialize_datetime": ".datetime_utils", "universal_field_validator": ".pydantic_utilities", "universal_root_validator": ".pydantic_utilities", "update_forward_refs": ".pydantic_utilities", "with_content_type": ".file", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "ApiError", "AsyncClientWrapper", "AsyncHttpClient", "AsyncHttpResponse", "BaseClientWrapper", "ConsoleLogger", "FieldMetadata", "File", "HttpClient", "HttpResponse", "ILogger", "IS_PYDANTIC_V2", "LogConfig", "LogLevel", "Logger", "ParsingError", "RequestOptions", "Rfc2822DateTime", "SyncClientWrapper", "UncheckedBaseModel", "UnionMetadata", "UniversalBaseModel", "UniversalRootModel", "construct_type", "convert_and_respect_annotation_metadata", "convert_file_dict_to_httpx_tuples", "create_logger", "encode_query", "jsonable_encoder", "parse_obj_as", "parse_rfc2822_datetime", "remove_none_from_dict", "serialize_datetime", "universal_field_validator", "universal_root_validator", "update_forward_refs", "with_content_type", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/api_error.py000066400000000000000000000011461523660243400260270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Any, Dict, Optional class ApiError(Exception): headers: Optional[Dict[str, str]] status_code: Optional[int] body: Any def __init__( self, *, headers: Optional[Dict[str, str]] = None, status_code: Optional[int] = None, body: Any = None, ) -> None: self.headers = headers self.status_code = status_code self.body = body def __str__(self) -> str: return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/client_wrapper.py000066400000000000000000000067141523660243400270710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import httpx from .http_client import AsyncHttpClient, HttpClient from .logging import LogConfig, Logger class BaseClientWrapper: def __init__( self, *, api_key: typing.Optional[str] = None, headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self._api_key = api_key self._headers = headers self._base_url = base_url self._timeout = timeout self._logging = logging def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { "User-Agent": "elevenlabs/2.63.0", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "elevenlabs", "X-Fern-SDK-Version": "2.63.0", **(self.get_custom_headers() or {}), } if self._api_key is not None: headers["xi-api-key"] = self._api_key return headers def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: return self._headers def get_base_url(self) -> str: return self._base_url def get_timeout(self) -> typing.Optional[float]: return self._timeout class SyncClientWrapper(BaseClientWrapper): def __init__( self, *, api_key: typing.Optional[str] = None, headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, httpx_client: httpx.Client, ): super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout, logging=logging) self.httpx_client = HttpClient( httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout, base_url=self.get_base_url, logging_config=self._logging, ) class AsyncClientWrapper(BaseClientWrapper): def __init__( self, *, api_key: typing.Optional[str] = None, headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, httpx_client: httpx.AsyncClient, ): super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout, logging=logging) self._async_token = async_token self.httpx_client = AsyncHttpClient( httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout, base_url=self.get_base_url, async_base_headers=self.async_get_headers, logging_config=self._logging, ) async def async_get_headers(self) -> typing.Dict[str, str]: headers = self.get_headers() if self._async_token is not None: token = await self._async_token() headers["Authorization"] = f"Bearer {token}" return headers elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/datetime_utils.py000066400000000000000000000047021523660243400270620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt from email.utils import parsedate_to_datetime from typing import Any import pydantic IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") def parse_rfc2822_datetime(v: Any) -> dt.datetime: """ Parse an RFC 2822 datetime string (e.g., "Wed, 02 Oct 2002 13:00:00 GMT") into a datetime object. If the value is already a datetime, return it as-is. Falls back to ISO 8601 parsing if RFC 2822 parsing fails. """ if isinstance(v, dt.datetime): return v if isinstance(v, str): try: return parsedate_to_datetime(v) except Exception: pass # Fallback to ISO 8601 parsing return dt.datetime.fromisoformat(v.replace("Z", "+00:00")) raise ValueError(f"Expected str or datetime, got {type(v)}") class Rfc2822DateTime(dt.datetime): """A datetime subclass that parses RFC 2822 date strings. On Pydantic V1, uses __get_validators__ for pre-validation. On Pydantic V2, uses __get_pydantic_core_schema__ for BeforeValidator-style parsing. """ @classmethod def __get_validators__(cls): # type: ignore[no-untyped-def] yield parse_rfc2822_datetime @classmethod def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> Any: # type: ignore[override] from pydantic_core import core_schema return core_schema.no_info_before_validator_function(parse_rfc2822_datetime, core_schema.datetime_schema()) def serialize_datetime(v: dt.datetime) -> str: """ Serialize a datetime including timezone info. Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. """ def _serialize_zoned_datetime(v: dt.datetime) -> str: if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): # UTC is a special case where we use "Z" at the end instead of "+00:00" return v.isoformat().replace("+00:00", "Z") else: # Delegate to the typical +/- offset format return v.isoformat() if v.tzinfo is not None: return _serialize_zoned_datetime(v) else: local_tz = dt.datetime.now().astimezone().tzinfo localized_dt = v.replace(tzinfo=local_tz) return _serialize_zoned_datetime(localized_dt) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/file.py000066400000000000000000000051471523660243400247710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast # File typing inspired by the flexibility of types within the httpx library # https://github.com/encode/httpx/blob/master/httpx/_types.py FileContent = Union[IO[bytes], bytes, str] File = Union[ # file (or bytes) FileContent, # (filename, file (or bytes)) Tuple[Optional[str], FileContent], # (filename, file (or bytes), content_type) Tuple[Optional[str], FileContent, Optional[str]], # (filename, file (or bytes), content_type, headers) Tuple[ Optional[str], FileContent, Optional[str], Mapping[str, str], ], ] def convert_file_dict_to_httpx_tuples( d: Dict[str, Union[File, List[File]]], ) -> List[Tuple[str, File]]: """ The format we use is a list of tuples, where the first element is the name of the file and the second is the file object. Typically HTTPX wants a dict, but to be able to send lists of files, you have to use the list approach (which also works for non-lists) https://github.com/encode/httpx/pull/1032 """ httpx_tuples = [] for key, file_like in d.items(): if isinstance(file_like, list): for file_like_item in file_like: httpx_tuples.append((key, file_like_item)) else: httpx_tuples.append((key, file_like)) return httpx_tuples def with_content_type(*, file: File, default_content_type: str) -> File: """ This function resolves to the file's content type, if provided, and defaults to the default_content_type value if not. """ if isinstance(file, tuple): if len(file) == 2: filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore return (filename, content, default_content_type) elif len(file) == 3: filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore out_content_type = file_content_type or default_content_type return (filename, content, out_content_type) elif len(file) == 4: filename, content, file_content_type, headers = cast( # type: ignore Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file ) out_content_type = file_content_type or default_content_type return (filename, content, out_content_type, headers) else: raise ValueError(f"Unexpected tuple length: {len(file)}") return (None, file, default_content_type) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/force_multipart.py000066400000000000000000000007351523660243400272470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Any, Dict class ForceMultipartDict(Dict[str, Any]): """ A dictionary subclass that always evaluates to True in boolean contexts. This is used to force multipart/form-data encoding in HTTP requests even when the dictionary is empty, which would normally evaluate to False. """ def __bool__(self) -> bool: return True FORCE_MULTIPART = ForceMultipartDict() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_client.py000066400000000000000000000710131523660243400263620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import asyncio import email.utils import re import time import typing from contextlib import asynccontextmanager, contextmanager from random import random import httpx from .file import File, convert_file_dict_to_httpx_tuples from .force_multipart import FORCE_MULTIPART from .jsonable_encoder import jsonable_encoder from .logging import LogConfig, Logger, create_logger from .query_encoder import encode_query from .remove_none_from_dict import remove_none_from_dict as remove_none_from_dict from .request_options import RequestOptions from httpx._types import RequestFiles INITIAL_RETRY_DELAY_SECONDS = 1.0 MAX_RETRY_DELAY_SECONDS = 60.0 JITTER_FACTOR = 0.2 # 20% random jitter def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: """ This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. Inspired by the urllib3 retry implementation. """ retry_after_ms = response_headers.get("retry-after-ms") if retry_after_ms is not None: try: return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 except Exception: pass retry_after = response_headers.get("retry-after") if retry_after is None: return None # Attempt to parse the header as an int. if re.match(r"^\s*[0-9]+\s*$", retry_after): seconds = float(retry_after) # Fallback to parsing it as a date. else: retry_date_tuple = email.utils.parsedate_tz(retry_after) if retry_date_tuple is None: return None if retry_date_tuple[9] is None: # Python 2 # Assume UTC if no timezone was specified # On Python2.7, parsedate_tz returns None for a timezone offset # instead of 0 if no timezone is given, where mktime_tz treats # a None timezone offset as local time. retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] retry_date = email.utils.mktime_tz(retry_date_tuple) seconds = retry_date - time.time() if seconds < 0: seconds = 0 return seconds def _add_positive_jitter(delay: float) -> float: """Add positive jitter (0-20%) to prevent thundering herd.""" jitter_multiplier = 1 + random() * JITTER_FACTOR return delay * jitter_multiplier def _add_symmetric_jitter(delay: float) -> float: """Add symmetric jitter (±10%) for exponential backoff.""" jitter_multiplier = 1 + (random() - 0.5) * JITTER_FACTOR return delay * jitter_multiplier def _parse_x_ratelimit_reset(response_headers: httpx.Headers) -> typing.Optional[float]: """ Parse the X-RateLimit-Reset header (Unix timestamp in seconds). Returns seconds to wait, or None if header is missing/invalid. """ reset_time_str = response_headers.get("x-ratelimit-reset") if reset_time_str is None: return None try: reset_time = int(reset_time_str) delay = reset_time - time.time() if delay > 0: return delay except (ValueError, TypeError): pass return None def _retry_timeout(response: httpx.Response, retries: int) -> float: """ Determine the amount of time to wait before retrying a request. This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff with a jitter to determine the number of seconds to wait. """ # 1. Check Retry-After header first retry_after = _parse_retry_after(response.headers) if retry_after is not None and retry_after > 0: return min(retry_after, MAX_RETRY_DELAY_SECONDS) # 2. Check X-RateLimit-Reset header (with positive jitter) ratelimit_reset = _parse_x_ratelimit_reset(response.headers) if ratelimit_reset is not None: return _add_positive_jitter(min(ratelimit_reset, MAX_RETRY_DELAY_SECONDS)) # 3. Fall back to exponential backoff (with symmetric jitter) backoff = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) return _add_symmetric_jitter(backoff) def _should_retry(response: httpx.Response) -> bool: retryable_400s = [429, 408, 409] return response.status_code >= 500 or response.status_code in retryable_400s _SENSITIVE_HEADERS = frozenset( { "authorization", "www-authenticate", "x-api-key", "api-key", "apikey", "x-api-token", "x-auth-token", "auth-token", "cookie", "set-cookie", "proxy-authorization", "proxy-authenticate", "x-csrf-token", "x-xsrf-token", "x-session-token", "x-access-token", } ) def _redact_headers(headers: typing.Dict[str, str]) -> typing.Dict[str, str]: return {k: ("[REDACTED]" if k.lower() in _SENSITIVE_HEADERS else v) for k, v in headers.items()} def _build_url(base_url: str, path: typing.Optional[str]) -> str: """ Build a full URL by joining a base URL with a path. This function correctly handles base URLs that contain path prefixes (e.g., tenant-based URLs) by using string concatenation instead of urllib.parse.urljoin(), which would incorrectly strip path components when the path starts with '/'. Example: >>> _build_url("https://cloud.example.com/org/tenant/api", "/users") 'https://cloud.example.com/org/tenant/api/users' Args: base_url: The base URL, which may contain path prefixes. path: The path to append. Can be None or empty string. Returns: The full URL with base_url and path properly joined. """ if not path: return base_url return f"{base_url.rstrip('/')}/{path.lstrip('/')}" def _maybe_filter_none_from_multipart_data( data: typing.Optional[typing.Any], request_files: typing.Optional[RequestFiles], force_multipart: typing.Optional[bool], ) -> typing.Optional[typing.Any]: """ Filter None values from data body for multipart/form requests. This prevents httpx from converting None to empty strings in multipart encoding. Only applies when files are present or force_multipart is True. """ if data is not None and isinstance(data, typing.Mapping) and (request_files or force_multipart): return remove_none_from_dict(data) return data def remove_omit_from_dict( original: typing.Dict[str, typing.Optional[typing.Any]], omit: typing.Optional[typing.Any], ) -> typing.Dict[str, typing.Any]: if omit is None: return original new: typing.Dict[str, typing.Any] = {} for key, value in original.items(): if value is not omit: new[key] = value return new def maybe_filter_request_body( data: typing.Optional[typing.Any], request_options: typing.Optional[RequestOptions], omit: typing.Optional[typing.Any], ) -> typing.Optional[typing.Any]: if data is None: return ( jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} if request_options is not None else None ) elif not isinstance(data, typing.Mapping): data_content = jsonable_encoder(data) else: data_content = { **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore **( jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} if request_options is not None else {} ), } return data_content # Abstracted out for testing purposes def get_request_body( *, json: typing.Optional[typing.Any], data: typing.Optional[typing.Any], request_options: typing.Optional[RequestOptions], omit: typing.Optional[typing.Any], ) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: json_body = None data_body = None if data is not None: data_body = maybe_filter_request_body(data, request_options, omit) else: # If both data and json are None, we send json data in the event extra properties are specified json_body = maybe_filter_request_body(json, request_options, omit) has_additional_body_parameters = bool( request_options is not None and request_options.get("additional_body_parameters") ) # Only collapse empty dict to None when the body was not explicitly provided # and there are no additional body parameters. This preserves explicit empty # bodies (e.g., when an endpoint has a request body type but all fields are optional). if json_body == {} and json is None and not has_additional_body_parameters: json_body = None if data_body == {} and data is None and not has_additional_body_parameters: data_body = None return json_body, data_body class HttpClient: def __init__( self, *, httpx_client: httpx.Client, base_timeout: typing.Callable[[], typing.Optional[float]], base_headers: typing.Callable[[], typing.Dict[str, str]], base_url: typing.Optional[typing.Callable[[], str]] = None, logging_config: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self.base_url = base_url self.base_timeout = base_timeout self.base_headers = base_headers self.httpx_client = httpx_client self.logger = create_logger(logging_config) def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: base_url = maybe_base_url if self.base_url is not None and base_url is None: base_url = self.base_url() if base_url is None: raise ValueError("A base_url is required to make this request, please provide one and try again.") return base_url def request( self, path: typing.Optional[str] = None, *, method: str, base_url: typing.Optional[str] = None, params: typing.Optional[typing.Dict[str, typing.Any]] = None, json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, files: typing.Optional[ typing.Union[ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], typing.List[typing.Tuple[str, File]], ] ] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 0, omit: typing.Optional[typing.Any] = None, force_multipart: typing.Optional[bool] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) timeout = ( request_options.get("timeout_in_seconds") if request_options is not None and request_options.get("timeout_in_seconds") is not None else self.base_timeout() ) json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) request_files: typing.Optional[RequestFiles] = ( convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) if (files is not None and files is not omit and isinstance(files, dict)) else None ) if (request_files is None or len(request_files) == 0) and force_multipart: request_files = FORCE_MULTIPART data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) # Compute encoded params separately to avoid passing empty list to httpx # (httpx strips existing query params from URL when params=[] is passed) _encoded_params = encode_query( jsonable_encoder( remove_none_from_dict( remove_omit_from_dict( { **(params if params is not None else {}), **( request_options.get("additional_query_parameters", {}) or {} if request_options is not None else {} ), }, omit, ) ) ) ) _request_url = _build_url(base_url, path) _request_headers = jsonable_encoder( remove_none_from_dict( { **self.base_headers(), **(headers if headers is not None else {}), **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), } ) ) if self.logger.is_debug(): self.logger.debug( "Making HTTP request", method=method, url=_request_url, headers=_redact_headers(_request_headers), has_body=json_body is not None or data_body is not None, ) response = self.httpx_client.request( method=method, url=_request_url, headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, content=content, files=request_files, timeout=timeout, ) max_retries: int = request_options.get("max_retries", 2) if request_options is not None else 2 if _should_retry(response=response): if retries < max_retries: time.sleep(_retry_timeout(response=response, retries=retries)) return self.request( path=path, method=method, base_url=base_url, params=params, json=json, content=content, files=files, headers=headers, request_options=request_options, retries=retries + 1, omit=omit, ) if self.logger.is_debug(): if 200 <= response.status_code < 400: self.logger.debug( "HTTP request succeeded", method=method, url=_request_url, status_code=response.status_code, ) if self.logger.is_error(): if response.status_code >= 400: self.logger.error( "HTTP request failed with error status", method=method, url=_request_url, status_code=response.status_code, ) return response @contextmanager def stream( self, path: typing.Optional[str] = None, *, method: str, base_url: typing.Optional[str] = None, params: typing.Optional[typing.Dict[str, typing.Any]] = None, json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, files: typing.Optional[ typing.Union[ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], typing.List[typing.Tuple[str, File]], ] ] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 0, omit: typing.Optional[typing.Any] = None, force_multipart: typing.Optional[bool] = None, ) -> typing.Iterator[httpx.Response]: base_url = self.get_base_url(base_url) timeout = ( request_options.get("timeout_in_seconds") if request_options is not None and request_options.get("timeout_in_seconds") is not None else self.base_timeout() ) request_files: typing.Optional[RequestFiles] = ( convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) if (files is not None and files is not omit and isinstance(files, dict)) else None ) if (request_files is None or len(request_files) == 0) and force_multipart: request_files = FORCE_MULTIPART json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) # Compute encoded params separately to avoid passing empty list to httpx # (httpx strips existing query params from URL when params=[] is passed) _encoded_params = encode_query( jsonable_encoder( remove_none_from_dict( remove_omit_from_dict( { **(params if params is not None else {}), **( request_options.get("additional_query_parameters", {}) if request_options is not None else {} ), }, omit, ) ) ) ) _request_url = _build_url(base_url, path) _request_headers = jsonable_encoder( remove_none_from_dict( { **self.base_headers(), **(headers if headers is not None else {}), **(request_options.get("additional_headers", {}) if request_options is not None else {}), } ) ) if self.logger.is_debug(): self.logger.debug( "Making streaming HTTP request", method=method, url=_request_url, headers=_redact_headers(_request_headers), ) with self.httpx_client.stream( method=method, url=_request_url, headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, content=content, files=request_files, timeout=timeout, ) as stream: yield stream class AsyncHttpClient: def __init__( self, *, httpx_client: httpx.AsyncClient, base_timeout: typing.Callable[[], typing.Optional[float]], base_headers: typing.Callable[[], typing.Dict[str, str]], base_url: typing.Optional[typing.Callable[[], str]] = None, async_base_headers: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Dict[str, str]]]] = None, logging_config: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self.base_url = base_url self.base_timeout = base_timeout self.base_headers = base_headers self.async_base_headers = async_base_headers self.httpx_client = httpx_client self.logger = create_logger(logging_config) async def _get_headers(self) -> typing.Dict[str, str]: if self.async_base_headers is not None: return await self.async_base_headers() return self.base_headers() def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: base_url = maybe_base_url if self.base_url is not None and base_url is None: base_url = self.base_url() if base_url is None: raise ValueError("A base_url is required to make this request, please provide one and try again.") return base_url async def request( self, path: typing.Optional[str] = None, *, method: str, base_url: typing.Optional[str] = None, params: typing.Optional[typing.Dict[str, typing.Any]] = None, json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, files: typing.Optional[ typing.Union[ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], typing.List[typing.Tuple[str, File]], ] ] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 0, omit: typing.Optional[typing.Any] = None, force_multipart: typing.Optional[bool] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) timeout = ( request_options.get("timeout_in_seconds") if request_options is not None and request_options.get("timeout_in_seconds") is not None else self.base_timeout() ) request_files: typing.Optional[RequestFiles] = ( convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) if (files is not None and files is not omit and isinstance(files, dict)) else None ) if (request_files is None or len(request_files) == 0) and force_multipart: request_files = FORCE_MULTIPART json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) # Get headers (supports async token providers) _headers = await self._get_headers() # Compute encoded params separately to avoid passing empty list to httpx # (httpx strips existing query params from URL when params=[] is passed) _encoded_params = encode_query( jsonable_encoder( remove_none_from_dict( remove_omit_from_dict( { **(params if params is not None else {}), **( request_options.get("additional_query_parameters", {}) or {} if request_options is not None else {} ), }, omit, ) ) ) ) _request_url = _build_url(base_url, path) _request_headers = jsonable_encoder( remove_none_from_dict( { **_headers, **(headers if headers is not None else {}), **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), } ) ) if self.logger.is_debug(): self.logger.debug( "Making HTTP request", method=method, url=_request_url, headers=_redact_headers(_request_headers), has_body=json_body is not None or data_body is not None, ) response = await self.httpx_client.request( method=method, url=_request_url, headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, content=content, files=request_files, timeout=timeout, ) max_retries: int = request_options.get("max_retries", 2) if request_options is not None else 2 if _should_retry(response=response): if retries < max_retries: await asyncio.sleep(_retry_timeout(response=response, retries=retries)) return await self.request( path=path, method=method, base_url=base_url, params=params, json=json, content=content, files=files, headers=headers, request_options=request_options, retries=retries + 1, omit=omit, ) if self.logger.is_debug(): if 200 <= response.status_code < 400: self.logger.debug( "HTTP request succeeded", method=method, url=_request_url, status_code=response.status_code, ) if self.logger.is_error(): if response.status_code >= 400: self.logger.error( "HTTP request failed with error status", method=method, url=_request_url, status_code=response.status_code, ) return response @asynccontextmanager async def stream( self, path: typing.Optional[str] = None, *, method: str, base_url: typing.Optional[str] = None, params: typing.Optional[typing.Dict[str, typing.Any]] = None, json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, files: typing.Optional[ typing.Union[ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], typing.List[typing.Tuple[str, File]], ] ] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 0, omit: typing.Optional[typing.Any] = None, force_multipart: typing.Optional[bool] = None, ) -> typing.AsyncIterator[httpx.Response]: base_url = self.get_base_url(base_url) timeout = ( request_options.get("timeout_in_seconds") if request_options is not None and request_options.get("timeout_in_seconds") is not None else self.base_timeout() ) request_files: typing.Optional[RequestFiles] = ( convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) if (files is not None and files is not omit and isinstance(files, dict)) else None ) if (request_files is None or len(request_files) == 0) and force_multipart: request_files = FORCE_MULTIPART json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) # Get headers (supports async token providers) _headers = await self._get_headers() # Compute encoded params separately to avoid passing empty list to httpx # (httpx strips existing query params from URL when params=[] is passed) _encoded_params = encode_query( jsonable_encoder( remove_none_from_dict( remove_omit_from_dict( { **(params if params is not None else {}), **( request_options.get("additional_query_parameters", {}) if request_options is not None else {} ), }, omit=omit, ) ) ) ) _request_url = _build_url(base_url, path) _request_headers = jsonable_encoder( remove_none_from_dict( { **_headers, **(headers if headers is not None else {}), **(request_options.get("additional_headers", {}) if request_options is not None else {}), } ) ) if self.logger.is_debug(): self.logger.debug( "Making streaming HTTP request", method=method, url=_request_url, headers=_redact_headers(_request_headers), ) async with self.httpx_client.stream( method=method, url=_request_url, headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, content=content, files=request_files, timeout=timeout, ) as stream: yield stream elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_response.py000066400000000000000000000026351523660243400267460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Dict, Generic, TypeVar import httpx # Generic to represent the underlying type of the data wrapped by the HTTP response. T = TypeVar("T") class BaseHttpResponse: """Minimalist HTTP response wrapper that exposes response headers and status code.""" _response: httpx.Response def __init__(self, response: httpx.Response): self._response = response @property def headers(self) -> Dict[str, str]: return dict(self._response.headers) @property def status_code(self) -> int: return self._response.status_code class HttpResponse(Generic[T], BaseHttpResponse): """HTTP response wrapper that exposes response headers and data.""" _data: T def __init__(self, response: httpx.Response, data: T): super().__init__(response) self._data = data @property def data(self) -> T: return self._data def close(self) -> None: self._response.close() class AsyncHttpResponse(Generic[T], BaseHttpResponse): """HTTP response wrapper that exposes response headers and data.""" _data: T def __init__(self, response: httpx.Response, data: T): super().__init__(response) self._data = data @property def data(self) -> T: return self._data async def close(self) -> None: await self._response.aclose() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/000077500000000000000000000000001523660243400253225ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/__init__.py000066400000000000000000000025061523660243400274360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from ._api import EventSource, aconnect_sse, connect_sse from ._exceptions import SSEError from ._models import ServerSentEvent _dynamic_imports: typing.Dict[str, str] = { "EventSource": "._api", "SSEError": "._exceptions", "ServerSentEvent": "._models", "aconnect_sse": "._api", "connect_sse": "._api", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/_api.py000066400000000000000000000075201523660243400266100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import re from contextlib import asynccontextmanager, contextmanager from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast import httpx from ._decoders import SSEDecoder from ._exceptions import SSEError from ._models import ServerSentEvent class EventSource: def __init__(self, response: httpx.Response) -> None: self._response = response def _check_content_type(self) -> None: content_type = self._response.headers.get("content-type", "").partition(";")[0] if "text/event-stream" not in content_type: raise SSEError( f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" ) def _get_charset(self) -> str: """Extract charset from Content-Type header, fallback to UTF-8.""" content_type = self._response.headers.get("content-type", "") # Parse charset parameter using regex charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) if charset_match: charset = charset_match.group(1).strip("\"'") # Validate that it's a known encoding try: # Test if the charset is valid by trying to encode/decode "test".encode(charset).decode(charset) return charset except (LookupError, UnicodeError): # If charset is invalid, fall back to UTF-8 pass # Default to UTF-8 if no charset specified or invalid charset return "utf-8" @property def response(self) -> httpx.Response: return self._response def iter_sse(self) -> Iterator[ServerSentEvent]: self._check_content_type() decoder = SSEDecoder() charset = self._get_charset() buffer = "" for chunk in self._response.iter_bytes(): # Decode chunk using detected charset text_chunk = chunk.decode(charset, errors="replace") buffer += text_chunk # Process complete lines while "\n" in buffer: line, buffer = buffer.split("\n", 1) line = line.rstrip("\r") sse = decoder.decode(line) # when we reach a "\n\n" => line = '' # => decoder will attempt to return an SSE Event if sse is not None: yield sse # Process any remaining data in buffer if buffer.strip(): line = buffer.rstrip("\r") sse = decoder.decode(line) if sse is not None: yield sse async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: self._check_content_type() decoder = SSEDecoder() lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) try: async for line in lines: line = line.rstrip("\n") sse = decoder.decode(line) if sse is not None: yield sse finally: await lines.aclose() @contextmanager def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: headers = kwargs.pop("headers", {}) headers["Accept"] = "text/event-stream" headers["Cache-Control"] = "no-store" with client.stream(method, url, headers=headers, **kwargs) as response: yield EventSource(response) @asynccontextmanager async def aconnect_sse( client: httpx.AsyncClient, method: str, url: str, **kwargs: Any, ) -> AsyncIterator[EventSource]: headers = kwargs.pop("headers", {}) headers["Accept"] = "text/event-stream" headers["Cache-Control"] = "no-store" async with client.stream(method, url, headers=headers, **kwargs) as response: yield EventSource(response) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/_decoders.py000066400000000000000000000033051523660243400276240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import List, Optional from ._models import ServerSentEvent class SSEDecoder: def __init__(self) -> None: self._event = "" self._data: List[str] = [] self._last_event_id = "" self._retry: Optional[int] = None def decode(self, line: str) -> Optional[ServerSentEvent]: # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 if not line: if not self._event and not self._data and not self._last_event_id and self._retry is None: return None sse = ServerSentEvent( event=self._event, data="\n".join(self._data), id=self._last_event_id, retry=self._retry, ) # NOTE: as per the SSE spec, do not reset last_event_id. self._event = "" self._data = [] self._retry = None return sse if line.startswith(":"): return None fieldname, _, value = line.partition(":") if value.startswith(" "): value = value[1:] if fieldname == "event": self._event = value elif fieldname == "data": self._data.append(value) elif fieldname == "id": if "\0" in value: pass else: self._last_event_id = value elif fieldname == "retry": try: self._retry = int(value) except (TypeError, ValueError): pass else: pass # Field is ignored. return None elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/_exceptions.py000066400000000000000000000001771523660243400302210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import httpx class SSEError(httpx.TransportError): pass elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/http_sse/_models.py000066400000000000000000000006151523660243400273200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import json from dataclasses import dataclass from typing import Any, Optional @dataclass(frozen=True) class ServerSentEvent: event: str = "message" data: str = "" id: str = "" retry: Optional[int] = None def json(self) -> Any: """Parse the data field as JSON.""" return json.loads(self.data) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/jsonable_encoder.py000066400000000000000000000075731523660243400273530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. """ jsonable_encoder converts a Python object to a JSON-friendly dict (e.g. datetimes to strings, Pydantic models to dicts). Taken from FastAPI, and made a bit simpler https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py """ import base64 import dataclasses import datetime as dt from enum import Enum from pathlib import PurePath from types import GeneratorType from typing import Any, Callable, Dict, List, Optional, Set, Union import pydantic from .datetime_utils import serialize_datetime from .pydantic_utilities import ( IS_PYDANTIC_V2, encode_by_type, to_jsonable_with_fallback, ) SetIntStr = Set[Union[int, str]] DictIntStrAny = Dict[Union[int, str], Any] def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: custom_encoder = custom_encoder or {} # Generated SDKs use Ellipsis (`...`) as the sentinel value for "OMIT". # OMIT values should be excluded from serialized payloads. if obj is Ellipsis: return None if custom_encoder: if type(obj) in custom_encoder: return custom_encoder[type(obj)](obj) else: for encoder_type, encoder_instance in custom_encoder.items(): if isinstance(obj, encoder_type): return encoder_instance(obj) if isinstance(obj, pydantic.BaseModel): if IS_PYDANTIC_V2: encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 else: encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 if custom_encoder: encoder.update(custom_encoder) obj_dict = obj.dict(by_alias=True) if "__root__" in obj_dict: obj_dict = obj_dict["__root__"] if "root" in obj_dict: obj_dict = obj_dict["root"] return jsonable_encoder(obj_dict, custom_encoder=encoder) if dataclasses.is_dataclass(obj): obj_dict = dataclasses.asdict(obj) # type: ignore return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) if isinstance(obj, bytes): return base64.b64encode(obj).decode("utf-8") if isinstance(obj, Enum): return obj.value if isinstance(obj, PurePath): return str(obj) if isinstance(obj, (str, int, float, type(None))): return obj if isinstance(obj, dt.datetime): return serialize_datetime(obj) if isinstance(obj, dt.date): return str(obj) if isinstance(obj, dict): encoded_dict = {} allowed_keys = set(obj.keys()) for key, value in obj.items(): if key in allowed_keys: if value is Ellipsis: continue encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) encoded_dict[encoded_key] = encoded_value return encoded_dict if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): encoded_list = [] for item in obj: if item is Ellipsis: continue encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) return encoded_list def fallback_serializer(o: Any) -> Any: attempt_encode = encode_by_type(o) if attempt_encode is not None: return attempt_encode try: data = dict(o) except Exception as e: errors: List[Exception] = [] errors.append(e) try: data = vars(o) except Exception as e: errors.append(e) raise ValueError(errors) from e return jsonable_encoder(data, custom_encoder=custom_encoder) return to_jsonable_with_fallback(obj, fallback_serializer) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/logging.py000066400000000000000000000062541523660243400255000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import logging import typing LogLevel = typing.Literal["debug", "info", "warn", "error"] _LOG_LEVEL_MAP: typing.Dict[LogLevel, int] = { "debug": 1, "info": 2, "warn": 3, "error": 4, } class ILogger(typing.Protocol): def debug(self, message: str, **kwargs: typing.Any) -> None: ... def info(self, message: str, **kwargs: typing.Any) -> None: ... def warn(self, message: str, **kwargs: typing.Any) -> None: ... def error(self, message: str, **kwargs: typing.Any) -> None: ... class ConsoleLogger: _logger: logging.Logger def __init__(self) -> None: self._logger = logging.getLogger("fern") if not self._logger.handlers: handler = logging.StreamHandler() handler.setFormatter(logging.Formatter("%(levelname)s - %(message)s")) self._logger.addHandler(handler) self._logger.setLevel(logging.DEBUG) def debug(self, message: str, **kwargs: typing.Any) -> None: self._logger.debug(message, extra=kwargs) def info(self, message: str, **kwargs: typing.Any) -> None: self._logger.info(message, extra=kwargs) def warn(self, message: str, **kwargs: typing.Any) -> None: self._logger.warning(message, extra=kwargs) def error(self, message: str, **kwargs: typing.Any) -> None: self._logger.error(message, extra=kwargs) class LogConfig(typing.TypedDict, total=False): level: LogLevel logger: ILogger silent: bool class Logger: _level: int _logger: ILogger _silent: bool def __init__(self, *, level: LogLevel, logger: ILogger, silent: bool) -> None: self._level = _LOG_LEVEL_MAP[level] self._logger = logger self._silent = silent def _should_log(self, level: LogLevel) -> bool: return not self._silent and self._level <= _LOG_LEVEL_MAP[level] def is_debug(self) -> bool: return self._should_log("debug") def is_info(self) -> bool: return self._should_log("info") def is_warn(self) -> bool: return self._should_log("warn") def is_error(self) -> bool: return self._should_log("error") def debug(self, message: str, **kwargs: typing.Any) -> None: if self.is_debug(): self._logger.debug(message, **kwargs) def info(self, message: str, **kwargs: typing.Any) -> None: if self.is_info(): self._logger.info(message, **kwargs) def warn(self, message: str, **kwargs: typing.Any) -> None: if self.is_warn(): self._logger.warn(message, **kwargs) def error(self, message: str, **kwargs: typing.Any) -> None: if self.is_error(): self._logger.error(message, **kwargs) _default_logger: Logger = Logger(level="info", logger=ConsoleLogger(), silent=True) def create_logger(config: typing.Optional[typing.Union[LogConfig, Logger]] = None) -> Logger: if config is None: return _default_logger if isinstance(config, Logger): return config return Logger( level=config.get("level", "info"), logger=config.get("logger", ConsoleLogger()), silent=config.get("silent", True), ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/parse_error.py000066400000000000000000000021271523660243400263700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Any, Dict, Optional class ParsingError(Exception): """ Raised when the SDK fails to parse/validate a response from the server. This typically indicates that the server returned a response whose shape does not match the expected schema. """ headers: Optional[Dict[str, str]] status_code: Optional[int] body: Any cause: Optional[Exception] def __init__( self, *, headers: Optional[Dict[str, str]] = None, status_code: Optional[int] = None, body: Any = None, cause: Optional[Exception] = None, ) -> None: self.headers = headers self.status_code = status_code self.body = body self.cause = cause super().__init__() if cause is not None: self.__cause__ = cause def __str__(self) -> str: cause_str = f", cause: {self.cause}" if self.cause is not None else "" return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}{cause_str}" elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/pydantic_utilities.py000066400000000000000000000624731523660243400277650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # nopycln: file import datetime as dt import inspect import json import logging from collections import defaultdict from dataclasses import asdict from typing import ( TYPE_CHECKING, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast, ) import pydantic import typing_extensions from pydantic.fields import FieldInfo as _FieldInfo _logger = logging.getLogger(__name__) if TYPE_CHECKING: from .http_sse._models import ServerSentEvent IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") if IS_PYDANTIC_V2: _datetime_adapter = pydantic.TypeAdapter(dt.datetime) # type: ignore[attr-defined] _date_adapter = pydantic.TypeAdapter(dt.date) # type: ignore[attr-defined] def parse_datetime(value: Any) -> dt.datetime: # type: ignore[misc] if isinstance(value, dt.datetime): return value return _datetime_adapter.validate_python(value) def parse_date(value: Any) -> dt.date: # type: ignore[misc] if isinstance(value, dt.datetime): return value.date() if isinstance(value, dt.date): return value return _date_adapter.validate_python(value) # Avoid importing from pydantic.v1 to maintain Python 3.14 compatibility. from typing import get_args as get_args # type: ignore[assignment] from typing import get_origin as get_origin # type: ignore[assignment] def is_literal_type(tp: Optional[Type[Any]]) -> bool: # type: ignore[misc] return typing_extensions.get_origin(tp) is typing_extensions.Literal def is_union(tp: Optional[Type[Any]]) -> bool: # type: ignore[misc] return tp is Union or typing_extensions.get_origin(tp) is Union # type: ignore[comparison-overlap] # Inline encoders_by_type to avoid importing from pydantic.v1.json import re as _re from collections import deque as _deque from decimal import Decimal as _Decimal from enum import Enum as _Enum from ipaddress import ( IPv4Address as _IPv4Address, ) from ipaddress import ( IPv4Interface as _IPv4Interface, ) from ipaddress import ( IPv4Network as _IPv4Network, ) from ipaddress import ( IPv6Address as _IPv6Address, ) from ipaddress import ( IPv6Interface as _IPv6Interface, ) from ipaddress import ( IPv6Network as _IPv6Network, ) from pathlib import Path as _Path from types import GeneratorType as _GeneratorType from uuid import UUID as _UUID from pydantic.fields import FieldInfo as ModelField # type: ignore[no-redef, assignment] def _decimal_encoder(dec_value: Any) -> Any: if dec_value.as_tuple().exponent >= 0: return int(dec_value) return float(dec_value) encoders_by_type: Dict[Type[Any], Callable[[Any], Any]] = { # type: ignore[no-redef] bytes: lambda o: o.decode(), dt.date: lambda o: o.isoformat(), dt.datetime: lambda o: o.isoformat(), dt.time: lambda o: o.isoformat(), dt.timedelta: lambda td: td.total_seconds(), _Decimal: _decimal_encoder, _Enum: lambda o: o.value, frozenset: list, _deque: list, _GeneratorType: list, _IPv4Address: str, _IPv4Interface: str, _IPv4Network: str, _IPv6Address: str, _IPv6Interface: str, _IPv6Network: str, _Path: str, _re.Pattern: lambda o: o.pattern, set: list, _UUID: str, } else: from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef, assignment] from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] from pydantic.typing import get_args as get_args # type: ignore[no-redef] from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef, assignment] from pydantic.typing import is_union as is_union # type: ignore[no-redef] from .datetime_utils import serialize_datetime from .serialization import convert_and_respect_annotation_metadata from typing_extensions import TypeAlias T = TypeVar("T") Model = TypeVar("Model", bound=pydantic.BaseModel) def _get_discriminator_and_variants(type_: Type[Any]) -> Tuple[Optional[str], Optional[List[Type[Any]]]]: """ Extract the discriminator field name and union variants from a discriminated union type. Supports Annotated[Union[...], Field(discriminator=...)] patterns. Returns (discriminator, variants) or (None, None) if not a discriminated union. """ origin = typing_extensions.get_origin(type_) if origin is typing_extensions.Annotated: args = typing_extensions.get_args(type_) if len(args) >= 2: inner_type = args[0] # Check annotations for discriminator discriminator = None for annotation in args[1:]: if hasattr(annotation, "discriminator"): discriminator = getattr(annotation, "discriminator", None) break if discriminator: inner_origin = typing_extensions.get_origin(inner_type) if inner_origin is Union: variants = list(typing_extensions.get_args(inner_type)) return discriminator, variants return None, None def _get_field_annotation(model: Type[Any], field_name: str) -> Optional[Type[Any]]: """Get the type annotation of a field from a Pydantic model.""" if IS_PYDANTIC_V2: fields = getattr(model, "model_fields", {}) field_info = fields.get(field_name) if field_info: return cast(Optional[Type[Any]], field_info.annotation) else: fields = getattr(model, "__fields__", {}) field_info = fields.get(field_name) if field_info: return cast(Optional[Type[Any]], field_info.outer_type_) return None def _find_variant_by_discriminator( variants: List[Type[Any]], discriminator: str, discriminator_value: Any, ) -> Optional[Type[Any]]: """Find the union variant that matches the discriminator value.""" for variant in variants: if not (inspect.isclass(variant) and issubclass(variant, pydantic.BaseModel)): continue disc_annotation = _get_field_annotation(variant, discriminator) if disc_annotation and is_literal_type(disc_annotation): literal_args = get_args(disc_annotation) if literal_args and literal_args[0] == discriminator_value: return variant return None def _is_string_type(type_: Type[Any]) -> bool: """Check if a type is str or Optional[str].""" if type_ is str: return True origin = typing_extensions.get_origin(type_) if origin is Union: args = typing_extensions.get_args(type_) # Optional[str] = Union[str, None] non_none_args = [a for a in args if a is not type(None)] if len(non_none_args) == 1 and non_none_args[0] is str: return True return False def parse_sse_obj(sse: "ServerSentEvent", type_: Type[T]) -> T: """ Parse a ServerSentEvent into the appropriate type. Handles two scenarios based on where the discriminator field is located: 1. Data-level discrimination: The discriminator (e.g., 'type') is inside the 'data' payload. The union describes the data content, not the SSE envelope. -> Returns: json.loads(data) parsed into the type Example: ChatStreamResponse with discriminator='type' Input: ServerSentEvent(event="message", data='{"type": "content-delta", ...}', id="") Output: ContentDeltaEvent (parsed from data, SSE envelope stripped) 2. Event-level discrimination: The discriminator (e.g., 'event') is at the SSE event level. The union describes the full SSE event structure. -> Returns: SSE envelope with 'data' field JSON-parsed only if the variant expects non-string Example: JobStreamResponse with discriminator='event' Input: ServerSentEvent(event="ERROR", data='{"code": "FAILED", ...}', id="123") Output: JobStreamResponse_Error with data as ErrorData object But for variants where data is str (like STATUS_UPDATE): Input: ServerSentEvent(event="STATUS_UPDATE", data='{"status": "processing"}', id="1") Output: JobStreamResponse_StatusUpdate with data as string (not parsed) Args: sse: The ServerSentEvent object to parse type_: The target discriminated union type Returns: The parsed object of type T Note: This function is only available in SDK contexts where http_sse module exists. """ sse_event = asdict(sse) discriminator, variants = _get_discriminator_and_variants(type_) if discriminator is None or variants is None: # Not a discriminated union - parse the data field as JSON data_value = sse_event.get("data") if isinstance(data_value, str) and data_value: try: parsed_data = json.loads(data_value) return parse_obj_as(type_, parsed_data) except json.JSONDecodeError as e: _logger.warning( "Failed to parse SSE data field as JSON: %s, data: %s", e, data_value[:100] if len(data_value) > 100 else data_value, ) return parse_obj_as(type_, sse_event) data_value = sse_event.get("data") # Check if discriminator is at the top level (event-level discrimination) if discriminator in sse_event: # Case 2: Event-level discrimination # Find the matching variant to check if 'data' field needs JSON parsing disc_value = sse_event.get(discriminator) matching_variant = _find_variant_by_discriminator(variants, discriminator, disc_value) if matching_variant is not None: # Check what type the variant expects for 'data' data_type = _get_field_annotation(matching_variant, "data") if data_type is not None and not _is_string_type(data_type): # Variant expects non-string data - parse JSON if isinstance(data_value, str) and data_value: try: parsed_data = json.loads(data_value) new_object = dict(sse_event) new_object["data"] = parsed_data return parse_obj_as(type_, new_object) except json.JSONDecodeError as e: _logger.warning( "Failed to parse SSE data field as JSON for event-level discrimination: %s, data: %s", e, data_value[:100] if len(data_value) > 100 else data_value, ) # Either no matching variant, data is string type, or JSON parse failed return parse_obj_as(type_, sse_event) else: # Case 1: Data-level discrimination # The discriminator is inside the data payload - extract and parse data only if isinstance(data_value, str) and data_value: try: parsed_data = json.loads(data_value) return parse_obj_as(type_, parsed_data) except json.JSONDecodeError as e: _logger.warning( "Failed to parse SSE data field as JSON for data-level discrimination: %s, data: %s", e, data_value[:100] if len(data_value) > 100 else data_value, ) return parse_obj_as(type_, sse_event) def parse_obj_as(type_: Type[T], object_: Any) -> T: # convert_and_respect_annotation_metadata is required for TypedDict aliasing. # # For Pydantic models, whether we should pre-dealias depends on how the model encodes aliasing: # - If the model uses real Pydantic aliases (pydantic.Field(alias=...)), then we must pass wire keys through # unchanged so Pydantic can validate them. # - If the model encodes aliasing only via FieldMetadata annotations, then we MUST pre-dealias because Pydantic # will not recognize those aliases during validation. if inspect.isclass(type_) and issubclass(type_, pydantic.BaseModel): has_pydantic_aliases = False if IS_PYDANTIC_V2: for field_name, field_info in getattr(type_, "model_fields", {}).items(): # type: ignore[attr-defined] alias = getattr(field_info, "alias", None) if alias is not None and alias != field_name: has_pydantic_aliases = True break else: for field in getattr(type_, "__fields__", {}).values(): alias = getattr(field, "alias", None) name = getattr(field, "name", None) if alias is not None and name is not None and alias != name: has_pydantic_aliases = True break dealiased_object = ( object_ if has_pydantic_aliases else convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") ) else: dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") if IS_PYDANTIC_V2: adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] return adapter.validate_python(dealiased_object) return pydantic.parse_obj_as(type_, dealiased_object) def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: if IS_PYDANTIC_V2: from pydantic_core import to_jsonable_python return to_jsonable_python(obj, fallback=fallback_serializer) return fallback_serializer(obj) class UniversalBaseModel(pydantic.BaseModel): if IS_PYDANTIC_V2: model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] # Allow fields beginning with `model_` to be used in the model protected_namespaces=(), ) @pydantic.model_validator(mode="before") # type: ignore[attr-defined] @classmethod def _coerce_field_names_to_aliases(cls, data: Any) -> Any: """ Accept Python field names in input by rewriting them to their Pydantic aliases, while avoiding silent collisions when a key could refer to multiple fields. """ if not isinstance(data, Mapping): return data fields = getattr(cls, "model_fields", {}) # type: ignore[attr-defined] name_to_alias: Dict[str, str] = {} alias_to_name: Dict[str, str] = {} for name, field_info in fields.items(): alias = getattr(field_info, "alias", None) or name name_to_alias[name] = alias if alias != name: alias_to_name[alias] = name # Detect ambiguous keys: a key that is an alias for one field and a name for another. ambiguous_keys = set(alias_to_name.keys()).intersection(set(name_to_alias.keys())) for key in ambiguous_keys: if key in data and name_to_alias[key] not in data: raise ValueError( f"Ambiguous input key '{key}': it is both a field name and an alias. " "Provide the explicit alias key to disambiguate." ) original_keys = set(data.keys()) rewritten: Dict[str, Any] = dict(data) for name, alias in name_to_alias.items(): if alias != name and name in original_keys and alias not in rewritten: rewritten[alias] = rewritten.pop(name) return rewritten @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] def serialize_model(self) -> Any: # type: ignore[name-defined] serialized = self.dict() # type: ignore[attr-defined] data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} return data else: class Config: smart_union = True json_encoders = {dt.datetime: serialize_datetime} @pydantic.root_validator(pre=True) def _coerce_field_names_to_aliases(cls, values: Any) -> Any: """ Pydantic v1 equivalent of _coerce_field_names_to_aliases. """ if not isinstance(values, Mapping): return values fields = getattr(cls, "__fields__", {}) name_to_alias: Dict[str, str] = {} alias_to_name: Dict[str, str] = {} for name, field in fields.items(): alias = getattr(field, "alias", None) or name name_to_alias[name] = alias if alias != name: alias_to_name[alias] = name ambiguous_keys = set(alias_to_name.keys()).intersection(set(name_to_alias.keys())) for key in ambiguous_keys: if key in values and name_to_alias[key] not in values: raise ValueError( f"Ambiguous input key '{key}': it is both a field name and an alias. " "Provide the explicit alias key to disambiguate." ) original_keys = set(values.keys()) rewritten: Dict[str, Any] = dict(values) for name, alias in name_to_alias.items(): if alias != name and name in original_keys and alias not in rewritten: rewritten[alias] = rewritten.pop(name) return rewritten @classmethod def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") return cls.construct(_fields_set, **dealiased_object) @classmethod def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") if IS_PYDANTIC_V2: return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] return super().construct(_fields_set, **dealiased_object) def json(self, **kwargs: Any) -> str: kwargs_with_defaults = { "by_alias": True, "exclude_unset": True, **kwargs, } if IS_PYDANTIC_V2: return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] return super().json(**kwargs_with_defaults) def dict(self, **kwargs: Any) -> Dict[str, Any]: """ Override the default dict method to `exclude_unset` by default. This function patches `exclude_unset` to work include fields within non-None default values. """ # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2 # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. # # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models # that we have less control over, and this is less intrusive than custom serializers for now. if IS_PYDANTIC_V2: kwargs_with_defaults_exclude_unset = { **kwargs, "by_alias": True, "exclude_unset": True, "exclude_none": False, } kwargs_with_defaults_exclude_none = { **kwargs, "by_alias": True, "exclude_none": True, "exclude_unset": False, } dict_dump = deep_union_pydantic_dicts( super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] ) else: _fields_set = self.__fields_set__.copy() fields = _get_model_fields(self.__class__) for name, field in fields.items(): if name not in _fields_set: default = _get_field_default(field) # If the default values are non-null act like they've been set # This effectively allows exclude_unset to work like exclude_none where # the latter passes through intentionally set none values. if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): _fields_set.add(name) if default is not None: self.__fields_set__.add(name) kwargs_with_defaults_exclude_unset_include_fields = { "by_alias": True, "exclude_unset": True, "include": _fields_set, **kwargs, } dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) return cast( Dict[str, Any], convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), ) def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: converted_list: List[Any] = [] for i, item in enumerate(source): destination_value = destination[i] if isinstance(item, dict): converted_list.append(deep_union_pydantic_dicts(item, destination_value)) elif isinstance(item, list): converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) else: converted_list.append(item) return converted_list def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: for key, value in source.items(): node = destination.setdefault(key, {}) if isinstance(value, dict): deep_union_pydantic_dicts(value, node) # Note: we do not do this same processing for sets given we do not have sets of models # and given the sets are unordered, the processing of the set and matching objects would # be non-trivial. elif isinstance(value, list): destination[key] = _union_list_of_pydantic_dicts(value, node) else: destination[key] = value return destination if IS_PYDANTIC_V2: class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] pass UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] else: UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] def encode_by_type(o: Any) -> Any: encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) for type_, encoder in encoders_by_type.items(): encoders_by_class_tuples[encoder] += (type_,) if type(o) in encoders_by_type: return encoders_by_type[type(o)](o) for encoder, classes_tuple in encoders_by_class_tuples.items(): if isinstance(o, classes_tuple): return encoder(o) def update_forward_refs(model: Type["Model"], **localns: Any) -> None: if IS_PYDANTIC_V2: model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] else: model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing AnyCallable = Callable[..., Any] def universal_root_validator( pre: bool = False, ) -> Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: if IS_PYDANTIC_V2: # In Pydantic v2, for RootModel we always use "before" mode # The custom validators transform the input value before the model is created return cast(AnyCallable, pydantic.model_validator(mode="before")(func)) # type: ignore[attr-defined] return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] return decorator def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: if IS_PYDANTIC_V2: return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) return decorator PydanticField = Union[ModelField, _FieldInfo] def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: if IS_PYDANTIC_V2: return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] return cast(Mapping[str, PydanticField], model.__fields__) def _get_field_default(field: PydanticField) -> Any: try: value = field.get_default() # type: ignore[union-attr] except: value = field.default if IS_PYDANTIC_V2: from pydantic_core import PydanticUndefined if value == PydanticUndefined: return None return value return value elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/query_encoder.py000066400000000000000000000041401523660243400267060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Any, Dict, List, Optional, Tuple import pydantic # Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: result = [] for k, v in dict_flat.items(): key = f"{key_prefix}[{k}]" if key_prefix is not None else k if isinstance(v, dict): result.extend(traverse_query_dict(v, key)) elif isinstance(v, list): for arr_v in v: if isinstance(arr_v, dict): result.extend(traverse_query_dict(arr_v, key)) else: result.append((key, arr_v)) else: result.append((key, v)) return result def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): if isinstance(query_value, pydantic.BaseModel): obj_dict = query_value.dict(by_alias=True) else: obj_dict = query_value return traverse_query_dict(obj_dict, query_key) elif isinstance(query_value, list): encoded_values: List[Tuple[str, Any]] = [] for value in query_value: if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): if isinstance(value, pydantic.BaseModel): obj_dict = value.dict(by_alias=True) elif isinstance(value, dict): obj_dict = value encoded_values.extend(single_query_encoder(query_key, obj_dict)) else: encoded_values.append((query_key, value)) return encoded_values return [(query_key, query_value)] def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: if query is None: return None encoded_query = [] for k, v in query.items(): encoded_query.extend(single_query_encoder(k, v)) return encoded_query elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/remove_none_from_dict.py000066400000000000000000000005261523660243400304100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from typing import Any, Dict, Mapping, Optional def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: new: Dict[str, Any] = {} for key, value in original.items(): if value is not None: new[key] = value return new elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/request_options.py000066400000000000000000000032211523660243400273040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing try: from typing import NotRequired # type: ignore except ImportError: from typing_extensions import NotRequired class RequestOptions(typing.TypedDict, total=False): """ Additional options for request-specific configuration when calling APIs via the SDK. This is used primarily as an optional final parameter for service functions. Attributes: - timeout_in_seconds: int. The number of seconds to await an API call before timing out. - max_retries: int. The max number of retries to attempt if the API call fails. - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. """ timeout_in_seconds: NotRequired[int] max_retries: NotRequired[int] additional_headers: NotRequired[typing.Dict[str, typing.Any]] additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] chunk_size: NotRequired[int] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/serialization.py000066400000000000000000000231321523660243400267210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import collections import inspect import typing import pydantic import typing_extensions class FieldMetadata: """ Metadata class used to annotate fields to provide additional information. Example: class MyDict(TypedDict): field: typing.Annotated[str, FieldMetadata(alias="field_name")] Will serialize: `{"field": "value"}` To: `{"field_name": "value"}` """ alias: str def __init__(self, *, alias: str) -> None: self.alias = alias def convert_and_respect_annotation_metadata( *, object_: typing.Any, annotation: typing.Any, inner_type: typing.Optional[typing.Any] = None, direction: typing.Literal["read", "write"], ) -> typing.Any: """ Respect the metadata annotations on a field, such as aliasing. This function effectively manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for TypedDicts, which cannot support aliasing out of the box, and can be extended for additional utilities, such as defaults. Parameters ---------- object_ : typing.Any annotation : type The type we're looking to apply typing annotations from inner_type : typing.Optional[type] Returns ------- typing.Any """ if object_ is None: return None if inner_type is None: inner_type = annotation clean_type = _remove_annotations(inner_type) # Pydantic models if ( inspect.isclass(clean_type) and issubclass(clean_type, pydantic.BaseModel) and isinstance(object_, typing.Mapping) ): return _convert_mapping(object_, clean_type, direction) # TypedDicts if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): return _convert_mapping(object_, clean_type, direction) if ( typing_extensions.get_origin(clean_type) == typing.Dict or typing_extensions.get_origin(clean_type) == dict or clean_type == typing.Dict ) and isinstance(object_, typing.Dict): key_type = typing_extensions.get_args(clean_type)[0] value_type = typing_extensions.get_args(clean_type)[1] return { key: convert_and_respect_annotation_metadata( object_=value, annotation=annotation, inner_type=value_type, direction=direction, ) for key, value in object_.items() } # If you're iterating on a string, do not bother to coerce it to a sequence. if not isinstance(object_, str): if ( typing_extensions.get_origin(clean_type) == typing.Set or typing_extensions.get_origin(clean_type) == set or clean_type == typing.Set ) and isinstance(object_, typing.Set): inner_type = typing_extensions.get_args(clean_type)[0] return { convert_and_respect_annotation_metadata( object_=item, annotation=annotation, inner_type=inner_type, direction=direction, ) for item in object_ } elif ( ( typing_extensions.get_origin(clean_type) == typing.List or typing_extensions.get_origin(clean_type) == list or clean_type == typing.List ) and isinstance(object_, typing.List) ) or ( ( typing_extensions.get_origin(clean_type) == typing.Sequence or typing_extensions.get_origin(clean_type) == collections.abc.Sequence or clean_type == typing.Sequence ) and isinstance(object_, typing.Sequence) ): inner_type = typing_extensions.get_args(clean_type)[0] return [ convert_and_respect_annotation_metadata( object_=item, annotation=annotation, inner_type=inner_type, direction=direction, ) for item in object_ ] if typing_extensions.get_origin(clean_type) == typing.Union: # We should be able to ~relatively~ safely try to convert keys against all # member types in the union, the edge case here is if one member aliases a field # of the same name to a different name from another member # Or if another member aliases a field of the same name that another member does not. for member in typing_extensions.get_args(clean_type): object_ = convert_and_respect_annotation_metadata( object_=object_, annotation=annotation, inner_type=member, direction=direction, ) return object_ annotated_type = _get_annotation(annotation) if annotated_type is None: return object_ # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) # Then we can safely call it on the recursive conversion. return object_ def _convert_mapping( object_: typing.Mapping[str, object], expected_type: typing.Any, direction: typing.Literal["read", "write"], ) -> typing.Mapping[str, object]: converted_object: typing.Dict[str, object] = {} try: annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) except NameError: # The TypedDict contains a circular reference, so # we use the __annotations__ attribute directly. annotations = getattr(expected_type, "__annotations__", {}) aliases_to_field_names = _get_alias_to_field_name(annotations) for key, value in object_.items(): if direction == "read" and key in aliases_to_field_names: dealiased_key = aliases_to_field_names.get(key) if dealiased_key is not None: type_ = annotations.get(dealiased_key) else: type_ = annotations.get(key) # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map # # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias # then we can just pass the value through as is if type_ is None: converted_object[key] = value elif direction == "read" and key not in aliases_to_field_names: converted_object[key] = convert_and_respect_annotation_metadata( object_=value, annotation=type_, direction=direction ) else: converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) ) return converted_object def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: maybe_annotated_type = typing_extensions.get_origin(type_) if maybe_annotated_type is None: return None if maybe_annotated_type == typing_extensions.NotRequired: type_ = typing_extensions.get_args(type_)[0] maybe_annotated_type = typing_extensions.get_origin(type_) if maybe_annotated_type == typing_extensions.Annotated: return type_ return None def _remove_annotations(type_: typing.Any) -> typing.Any: maybe_annotated_type = typing_extensions.get_origin(type_) if maybe_annotated_type is None: return type_ if maybe_annotated_type == typing_extensions.NotRequired: return _remove_annotations(typing_extensions.get_args(type_)[0]) if maybe_annotated_type == typing_extensions.Annotated: return _remove_annotations(typing_extensions.get_args(type_)[0]) return type_ def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: annotations = typing_extensions.get_type_hints(type_, include_extras=True) return _get_alias_to_field_name(annotations) def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: annotations = typing_extensions.get_type_hints(type_, include_extras=True) return _get_field_to_alias_name(annotations) def _get_alias_to_field_name( field_to_hint: typing.Dict[str, typing.Any], ) -> typing.Dict[str, str]: aliases = {} for field, hint in field_to_hint.items(): maybe_alias = _get_alias_from_type(hint) if maybe_alias is not None: aliases[maybe_alias] = field return aliases def _get_field_to_alias_name( field_to_hint: typing.Dict[str, typing.Any], ) -> typing.Dict[str, str]: aliases = {} for field, hint in field_to_hint.items(): maybe_alias = _get_alias_from_type(hint) if maybe_alias is not None: aliases[field] = maybe_alias return aliases def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: maybe_annotated_type = _get_annotation(type_) if maybe_annotated_type is not None: # The actual annotations are 1 onward, the first is the annotated type annotations = typing_extensions.get_args(maybe_annotated_type)[1:] for annotation in annotations: if isinstance(annotation, FieldMetadata) and annotation.alias is not None: return annotation.alias return None def _alias_key( key: str, type_: typing.Any, direction: typing.Literal["read", "write"], aliases_to_field_names: typing.Dict[str, str], ) -> str: if direction == "read": return aliases_to_field_names.get(key, key) return _get_alias_from_type(type_=type_) or key elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/core/unchecked_base_model.py000066400000000000000000000340261523660243400301530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import inspect import typing import uuid import pydantic import typing_extensions from .pydantic_utilities import ( # type: ignore[attr-defined] IS_PYDANTIC_V2, ModelField, UniversalBaseModel, get_args, get_origin, is_literal_type, is_union, parse_date, parse_datetime, parse_obj_as, ) from .serialization import get_field_to_alias_mapping from pydantic_core import PydanticUndefined class UnionMetadata: discriminant: str def __init__(self, *, discriminant: str) -> None: self.discriminant = discriminant Model = typing.TypeVar("Model", bound=pydantic.BaseModel) class UncheckedBaseModel(UniversalBaseModel): if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 else: class Config: extra = pydantic.Extra.allow @classmethod def model_construct( cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, ) -> "Model": # Fallback construct function to the specified override below. return cls.construct(_fields_set=_fields_set, **values) # Allow construct to not validate model # Implementation taken from: https://github.com/pydantic/pydantic/issues/1168#issuecomment-817742836 @classmethod def construct( cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, ) -> "Model": m = cls.__new__(cls) fields_values = {} if _fields_set is None: _fields_set = set(values.keys()) fields = _get_model_fields(cls) populate_by_name = _get_is_populate_by_name(cls) field_aliases = get_field_to_alias_mapping(cls) for name, field in fields.items(): # Key here is only used to pull data from the values dict # you should always use the NAME of the field to for field_values, etc. # because that's how the object is constructed from a pydantic perspective key = field.alias if (key is None or field.alias == name) and name in field_aliases: key = field_aliases[name] if key is None or (key not in values and populate_by_name): # Added this to allow population by field name key = name if key in values: if IS_PYDANTIC_V2: type_ = field.annotation # type: ignore # Pydantic v2 else: type_ = typing.cast(typing.Type, field.outer_type_) # type: ignore # Pydantic < v1.10.15 fields_values[name] = ( construct_type(object_=values[key], type_=type_) if type_ is not None else values[key] ) _fields_set.add(name) else: default = _get_field_default(field) fields_values[name] = default # If the default values are non-null act like they've been set # This effectively allows exclude_unset to work like exclude_none where # the latter passes through intentionally set none values. if default != None and default != PydanticUndefined: _fields_set.add(name) # Add extras back in extras = {} pydantic_alias_fields = [field.alias for field in fields.values()] internal_alias_fields = list(field_aliases.values()) for key, value in values.items(): # If the key is not a field by name, nor an alias to a field, then it's extra if (key not in pydantic_alias_fields and key not in internal_alias_fields) and key not in fields: if IS_PYDANTIC_V2: extras[key] = value else: _fields_set.add(key) fields_values[key] = value object.__setattr__(m, "__dict__", fields_values) if IS_PYDANTIC_V2: object.__setattr__(m, "__pydantic_private__", None) object.__setattr__(m, "__pydantic_extra__", extras) object.__setattr__(m, "__pydantic_fields_set__", _fields_set) else: object.__setattr__(m, "__fields_set__", _fields_set) m._init_private_attributes() # type: ignore # Pydantic v1 return m def _validate_collection_items_compatible(collection: typing.Any, target_type: typing.Type[typing.Any]) -> bool: """ Validate that all items in a collection are compatible with the target type. Args: collection: The collection to validate (list, set, or dict values) target_type: The target type to validate against Returns: True if all items are compatible, False otherwise """ if inspect.isclass(target_type) and issubclass(target_type, pydantic.BaseModel): for item in collection: try: # Try to validate the item against the target type if isinstance(item, dict): parse_obj_as(target_type, item) else: # If it's not a dict, it might already be the right type if not isinstance(item, target_type): return False except Exception: return False return True def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: inner_types = get_args(union_type) if typing.Any in inner_types: return object_ for inner_type in inner_types: # Handle lists of objects that need parsing if get_origin(inner_type) is list and isinstance(object_, list): list_inner_type = get_args(inner_type)[0] try: if inspect.isclass(list_inner_type) and issubclass(list_inner_type, pydantic.BaseModel): # Validate that all items in the list are compatible with the target type if _validate_collection_items_compatible(object_, list_inner_type): parsed_list = [parse_obj_as(object_=item, type_=list_inner_type) for item in object_] return parsed_list except Exception: pass try: if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): # Attempt a validated parse until one works return parse_obj_as(inner_type, object_) except Exception: continue # If none of the types work, try matching literal fields first, then fall back # First pass: try types where all literal fields match the object's values for inner_type in inner_types: if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): fields = _get_model_fields(inner_type) literal_fields_match = True for field_name, field in fields.items(): # Check if this field has a Literal type if IS_PYDANTIC_V2: field_type = field.annotation # type: ignore # Pydantic v2 else: field_type = field.outer_type_ # type: ignore # Pydantic v1 if is_literal_type(field_type): # type: ignore[arg-type] field_default = _get_field_default(field) name_or_alias = get_field_to_alias_mapping(inner_type).get(field_name, field_name) # Get the value from the object if isinstance(object_, dict): object_value = object_.get(name_or_alias) else: object_value = getattr(object_, name_or_alias, None) # If the literal field value doesn't match, this type is not a match if object_value is not None and field_default != object_value: literal_fields_match = False break # If all literal fields match, try to construct this type if literal_fields_match: try: return construct_type(object_=object_, type_=inner_type) except Exception: continue # Second pass: if no literal matches, just return the first successful cast for inner_type in inner_types: try: return construct_type(object_=object_, type_=inner_type) except Exception: continue def _convert_union_type(type_: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: base_type = get_origin(type_) or type_ union_type = type_ if base_type == typing_extensions.Annotated: # type: ignore[comparison-overlap] union_type = get_args(type_)[0] annotated_metadata = get_args(type_)[1:] for metadata in annotated_metadata: if isinstance(metadata, UnionMetadata): try: # Cast to the correct type, based on the discriminant for inner_type in get_args(union_type): try: objects_discriminant = getattr(object_, metadata.discriminant) except: objects_discriminant = object_[metadata.discriminant] if inner_type.__fields__[metadata.discriminant].default == objects_discriminant: return construct_type(object_=object_, type_=inner_type) except Exception: # Allow to fall through to our regular union handling pass return _convert_undiscriminated_union_type(union_type, object_) def construct_type(*, type_: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: """ Here we are essentially creating the same `construct` method in spirit as the above, but for all types, not just Pydantic models. The idea is to essentially attempt to coerce object_ to type_ (recursively) """ # Short circuit when dealing with optionals, don't try to coerces None to a type if object_ is None: return None base_type = get_origin(type_) or type_ is_annotated = base_type == typing_extensions.Annotated # type: ignore[comparison-overlap] maybe_annotation_members = get_args(type_) is_annotated_union = is_annotated and is_union(get_origin(maybe_annotation_members[0])) if base_type == typing.Any: # type: ignore[comparison-overlap] return object_ if base_type == dict: if not isinstance(object_, typing.Mapping): return object_ key_type, items_type = get_args(type_) d = { construct_type(object_=key, type_=key_type): construct_type(object_=item, type_=items_type) for key, item in object_.items() } return d if base_type == list: if not isinstance(object_, list): return object_ inner_type = get_args(type_)[0] return [construct_type(object_=entry, type_=inner_type) for entry in object_] if base_type == set: if not isinstance(object_, set) and not isinstance(object_, list): return object_ inner_type = get_args(type_)[0] return {construct_type(object_=entry, type_=inner_type) for entry in object_} if is_union(base_type) or is_annotated_union: return _convert_union_type(type_, object_) # Cannot do an `issubclass` with a literal type, let's also just confirm we have a class before this call if ( object_ is not None and not is_literal_type(type_) and ( (inspect.isclass(base_type) and issubclass(base_type, pydantic.BaseModel)) or ( is_annotated and inspect.isclass(maybe_annotation_members[0]) and issubclass(maybe_annotation_members[0], pydantic.BaseModel) ) ) ): if IS_PYDANTIC_V2: return type_.model_construct(**object_) else: return type_.construct(**object_) if base_type == dt.datetime: try: return parse_datetime(object_) except Exception: return object_ if base_type == dt.date: try: return parse_date(object_) except Exception: return object_ if base_type == uuid.UUID: try: return uuid.UUID(object_) except Exception: return object_ if base_type == int: try: return int(object_) except Exception: return object_ if base_type == bool: try: if isinstance(object_, str): stringified_object = object_.lower() return stringified_object == "true" or stringified_object == "1" return bool(object_) except Exception: return object_ return object_ def _get_is_populate_by_name(model: typing.Type["Model"]) -> bool: if IS_PYDANTIC_V2: return model.model_config.get("populate_by_name", False) # type: ignore # Pydantic v2 return model.__config__.allow_population_by_field_name # type: ignore # Pydantic v1 from pydantic.fields import FieldInfo as _FieldInfo PydanticField = typing.Union[ModelField, _FieldInfo] # Pydantic V1 swapped the typing of __fields__'s values from ModelField to FieldInfo # And so we try to handle both V1 cases, as well as V2 (FieldInfo from model.model_fields) def _get_model_fields( model: typing.Type["Model"], ) -> typing.Mapping[str, PydanticField]: if IS_PYDANTIC_V2: return model.model_fields # type: ignore # Pydantic v2 else: return model.__fields__ # type: ignore # Pydantic v1 def _get_field_default(field: PydanticField) -> typing.Any: try: value = field.get_default() # type: ignore # Pydantic < v1.10.15 except: value = field.default if IS_PYDANTIC_V2: from pydantic_core import PydanticUndefined if value == PydanticUndefined: return None return value return value elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/000077500000000000000000000000001523660243400241535ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/__init__.py000066400000000000000000000060161523660243400262670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( DubRequestMode, DubbingListRequestCreationSourcesItem, DubbingListRequestDubbingModelsItem, DubbingListRequestDubbingStatus, DubbingListRequestDubbingStatusesItem, DubbingListRequestFilterByCreator, DubbingListRequestOrderBy, DubbingListRequestOrderDirection, ) from . import audio, project, resource, transcript, transcripts from .project import ProjectCreateRequestModelId, ProjectListRequestSortDirection from .transcript import TranscriptGetTranscriptForDubRequestFormatType, TranscriptGetTranscriptForDubResponse from .transcripts import TranscriptsGetRequestFormatType _dynamic_imports: typing.Dict[str, str] = { "DubRequestMode": ".types", "DubbingListRequestCreationSourcesItem": ".types", "DubbingListRequestDubbingModelsItem": ".types", "DubbingListRequestDubbingStatus": ".types", "DubbingListRequestDubbingStatusesItem": ".types", "DubbingListRequestFilterByCreator": ".types", "DubbingListRequestOrderBy": ".types", "DubbingListRequestOrderDirection": ".types", "ProjectCreateRequestModelId": ".project", "ProjectListRequestSortDirection": ".project", "TranscriptGetTranscriptForDubRequestFormatType": ".transcript", "TranscriptGetTranscriptForDubResponse": ".transcript", "TranscriptsGetRequestFormatType": ".transcripts", "audio": ".audio", "project": ".project", "resource": ".resource", "transcript": ".transcript", "transcripts": ".transcripts", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DubRequestMode", "DubbingListRequestCreationSourcesItem", "DubbingListRequestDubbingModelsItem", "DubbingListRequestDubbingStatus", "DubbingListRequestDubbingStatusesItem", "DubbingListRequestFilterByCreator", "DubbingListRequestOrderBy", "DubbingListRequestOrderDirection", "ProjectCreateRequestModelId", "ProjectListRequestSortDirection", "TranscriptGetTranscriptForDubRequestFormatType", "TranscriptGetTranscriptForDubResponse", "TranscriptsGetRequestFormatType", "audio", "project", "resource", "transcript", "transcripts", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/audio/000077500000000000000000000000001523660243400252545ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/audio/__init__.py000066400000000000000000000001251523660243400273630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/audio/client.py000066400000000000000000000074041523660243400271110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawAudioClient, RawAudioClient class AudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioClient """ return self._raw_client def get( self, dubbing_id: str, language_code: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ID of the language. 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. Returns ------- typing.Iterator[bytes] The dubbed audio or video file Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.audio.get( dubbing_id="dubbing_id", language_code="language_code", ) """ with self._raw_client.get(dubbing_id, language_code, request_options=request_options) as r: yield from r.data class AsyncAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioClient """ return self._raw_client async def get( self, dubbing_id: str, language_code: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ID of the language. 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. Returns ------- typing.AsyncIterator[bytes] The dubbed audio or video file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.audio.get( dubbing_id="dubbing_id", language_code="language_code", ) asyncio.run(main()) """ async with self._raw_client.get(dubbing_id, language_code, request_options=request_options) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/audio/raw_client.py000066400000000000000000000237361523660243400277700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.too_early_error import TooEarlyError from ...errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError class RawAudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def get( self, dubbing_id: str, language_code: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ID of the language. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The dubbed audio or video file """ with self._client_wrapper.httpx_client.stream( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/audio/{jsonable_encoder(language_code)}", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 425: raise TooEarlyError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def get( self, dubbing_id: str, language_code: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ID of the language. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The dubbed audio or video file """ async with self._client_wrapper.httpx_client.stream( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/audio/{jsonable_encoder(language_code)}", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 425: raise TooEarlyError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/client.py000066400000000000000000000724371523660243400260200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.delete_dubbing_response_model import DeleteDubbingResponseModel from ..types.do_dubbing_response import DoDubbingResponse from ..types.dubbing_metadata_page_response_model import DubbingMetadataPageResponseModel from ..types.dubbing_metadata_response import DubbingMetadataResponse from .raw_client import AsyncRawDubbingClient, RawDubbingClient from .types.dub_request_mode import DubRequestMode from .types.dubbing_list_request_creation_sources_item import DubbingListRequestCreationSourcesItem from .types.dubbing_list_request_dubbing_models_item import DubbingListRequestDubbingModelsItem from .types.dubbing_list_request_dubbing_status import DubbingListRequestDubbingStatus from .types.dubbing_list_request_dubbing_statuses_item import DubbingListRequestDubbingStatusesItem from .types.dubbing_list_request_filter_by_creator import DubbingListRequestFilterByCreator from .types.dubbing_list_request_order_by import DubbingListRequestOrderBy from .types.dubbing_list_request_order_direction import DubbingListRequestOrderDirection if typing.TYPE_CHECKING: from .audio.client import AsyncAudioClient, AudioClient from .project.client import AsyncProjectClient, ProjectClient from .resource.client import AsyncResourceClient, ResourceClient from .transcript.client import AsyncTranscriptClient, TranscriptClient from .transcripts.client import AsyncTranscriptsClient, TranscriptsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class DubbingClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDubbingClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._project: typing.Optional[ProjectClient] = None self._resource: typing.Optional[ResourceClient] = None self._audio: typing.Optional[AudioClient] = None self._transcript: typing.Optional[TranscriptClient] = None self._transcripts: typing.Optional[TranscriptsClient] = None @property def with_raw_response(self) -> RawDubbingClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDubbingClient """ return self._raw_client def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None, dubbing_statuses: typing.Optional[ typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]] ] = None, dubbing_models: typing.Optional[ typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]] ] = None, target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, creation_sources: typing.Optional[ typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]] ] = None, filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None, order_by: typing.Optional[DubbingListRequestOrderBy] = None, order_direction: typing.Optional[DubbingListRequestOrderDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingMetadataPageResponseModel: """ List the dubs you have access to. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many dubs to return at maximum. Can not exceed 200, defaults to 100. dubbing_status : typing.Optional[DubbingListRequestDubbingStatus] What state the dub is currently in. dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]] Filter by dubbing status. dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]] Filter by dubbing model generation. target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by target language code. creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]] Filter by dubbing creation source. filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator] Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them. order_by : typing.Optional[DubbingListRequestOrderBy] The field to use for ordering results from this query. order_direction : typing.Optional[DubbingListRequestOrderDirection] The order direction to use for results from this query. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingMetadataPageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.list( cursor="cursor", page_size=1, dubbing_status="dubbing", dubbing_statuses=["queued"], dubbing_models=["dubbing_v1"], target_language_codes=["target_language_codes"], creation_sources=["flow_node"], filter_by_creator="personal", order_by="created_at", order_direction="DESCENDING", ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, dubbing_status=dubbing_status, dubbing_statuses=dubbing_statuses, dubbing_models=dubbing_models, target_language_codes=target_language_codes, creation_sources=creation_sources, filter_by_creator=filter_by_creator, order_by=order_by, order_direction=order_direction, request_options=request_options, ) return _response.data def create( self, *, file: typing.Optional[core.File] = OMIT, csv_file: typing.Optional[core.File] = OMIT, foreground_audio_file: typing.Optional[core.File] = OMIT, background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, target_lang: typing.Optional[str] = OMIT, target_accent: typing.Optional[str] = OMIT, num_speakers: typing.Optional[int] = OMIT, watermark: typing.Optional[bool] = OMIT, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, highest_resolution: typing.Optional[bool] = OMIT, drop_background_audio: typing.Optional[bool] = OMIT, use_profanity_filter: typing.Optional[bool] = OMIT, dubbing_studio: typing.Optional[bool] = OMIT, disable_voice_cloning: typing.Optional[bool] = OMIT, mode: typing.Optional[DubRequestMode] = OMIT, csv_fps: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DoDubbingResponse: """ Dubs a provided audio or video file into given language. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation csv_file : typing.Optional[core.File] See core.File for more documentation foreground_audio_file : typing.Optional[core.File] See core.File for more documentation background_audio_file : typing.Optional[core.File] See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. source_url : typing.Optional[str] URL of the source video/audio file. source_lang : typing.Optional[str] Source language. Expects a valid iso639-1 or iso639-3 language code. target_lang : typing.Optional[str] The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code. target_accent : typing.Optional[str] [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer. num_speakers : typing.Optional[int] Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers watermark : typing.Optional[bool] Whether to apply watermark to the output video. start_time : typing.Optional[int] Start time of the source video/audio file. end_time : typing.Optional[int] End time of the source video/audio file. highest_resolution : typing.Optional[bool] Whether to use the highest resolution available. drop_background_audio : typing.Optional[bool] An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. use_profanity_filter : typing.Optional[bool] [BETA] Whether transcripts should have profanities censored with the words '[censored]' dubbing_studio : typing.Optional[bool] Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. disable_voice_cloning : typing.Optional[bool] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubRequestMode] The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DoDubbingResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.create() """ _response = self._raw_client.create( file=file, csv_file=csv_file, foreground_audio_file=foreground_audio_file, background_audio_file=background_audio_file, name=name, source_url=source_url, source_lang=source_lang, target_lang=target_lang, target_accent=target_accent, num_speakers=num_speakers, watermark=watermark, start_time=start_time, end_time=end_time, highest_resolution=highest_resolution, drop_background_audio=drop_background_audio, use_profanity_filter=use_profanity_filter, dubbing_studio=dubbing_studio, disable_voice_cloning=disable_voice_cloning, mode=mode, csv_fps=csv_fps, request_options=request_options, ) return _response.data def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingMetadataResponse: """ Returns metadata about a dubbing project, including whether it's still in progress or not Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingMetadataResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.get( dubbing_id="dubbing_id", ) """ _response = self._raw_client.get(dubbing_id, request_options=request_options) return _response.data def delete( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteDubbingResponseModel: """ Deletes a dubbing project. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteDubbingResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.delete( dubbing_id="dubbing_id", ) """ _response = self._raw_client.delete(dubbing_id, request_options=request_options) return _response.data @property def project(self): if self._project is None: from .project.client import ProjectClient # noqa: E402 self._project = ProjectClient(client_wrapper=self._client_wrapper) return self._project @property def resource(self): if self._resource is None: from .resource.client import ResourceClient # noqa: E402 self._resource = ResourceClient(client_wrapper=self._client_wrapper) return self._resource @property def audio(self): if self._audio is None: from .audio.client import AudioClient # noqa: E402 self._audio = AudioClient(client_wrapper=self._client_wrapper) return self._audio @property def transcript(self): if self._transcript is None: from .transcript.client import TranscriptClient # noqa: E402 self._transcript = TranscriptClient(client_wrapper=self._client_wrapper) return self._transcript @property def transcripts(self): if self._transcripts is None: from .transcripts.client import TranscriptsClient # noqa: E402 self._transcripts = TranscriptsClient(client_wrapper=self._client_wrapper) return self._transcripts class AsyncDubbingClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDubbingClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._project: typing.Optional[AsyncProjectClient] = None self._resource: typing.Optional[AsyncResourceClient] = None self._audio: typing.Optional[AsyncAudioClient] = None self._transcript: typing.Optional[AsyncTranscriptClient] = None self._transcripts: typing.Optional[AsyncTranscriptsClient] = None @property def with_raw_response(self) -> AsyncRawDubbingClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDubbingClient """ return self._raw_client async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None, dubbing_statuses: typing.Optional[ typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]] ] = None, dubbing_models: typing.Optional[ typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]] ] = None, target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, creation_sources: typing.Optional[ typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]] ] = None, filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None, order_by: typing.Optional[DubbingListRequestOrderBy] = None, order_direction: typing.Optional[DubbingListRequestOrderDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingMetadataPageResponseModel: """ List the dubs you have access to. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many dubs to return at maximum. Can not exceed 200, defaults to 100. dubbing_status : typing.Optional[DubbingListRequestDubbingStatus] What state the dub is currently in. dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]] Filter by dubbing status. dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]] Filter by dubbing model generation. target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by target language code. creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]] Filter by dubbing creation source. filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator] Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them. order_by : typing.Optional[DubbingListRequestOrderBy] The field to use for ordering results from this query. order_direction : typing.Optional[DubbingListRequestOrderDirection] The order direction to use for results from this query. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingMetadataPageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.list( cursor="cursor", page_size=1, dubbing_status="dubbing", dubbing_statuses=["queued"], dubbing_models=["dubbing_v1"], target_language_codes=["target_language_codes"], creation_sources=["flow_node"], filter_by_creator="personal", order_by="created_at", order_direction="DESCENDING", ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, dubbing_status=dubbing_status, dubbing_statuses=dubbing_statuses, dubbing_models=dubbing_models, target_language_codes=target_language_codes, creation_sources=creation_sources, filter_by_creator=filter_by_creator, order_by=order_by, order_direction=order_direction, request_options=request_options, ) return _response.data async def create( self, *, file: typing.Optional[core.File] = OMIT, csv_file: typing.Optional[core.File] = OMIT, foreground_audio_file: typing.Optional[core.File] = OMIT, background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, target_lang: typing.Optional[str] = OMIT, target_accent: typing.Optional[str] = OMIT, num_speakers: typing.Optional[int] = OMIT, watermark: typing.Optional[bool] = OMIT, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, highest_resolution: typing.Optional[bool] = OMIT, drop_background_audio: typing.Optional[bool] = OMIT, use_profanity_filter: typing.Optional[bool] = OMIT, dubbing_studio: typing.Optional[bool] = OMIT, disable_voice_cloning: typing.Optional[bool] = OMIT, mode: typing.Optional[DubRequestMode] = OMIT, csv_fps: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DoDubbingResponse: """ Dubs a provided audio or video file into given language. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation csv_file : typing.Optional[core.File] See core.File for more documentation foreground_audio_file : typing.Optional[core.File] See core.File for more documentation background_audio_file : typing.Optional[core.File] See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. source_url : typing.Optional[str] URL of the source video/audio file. source_lang : typing.Optional[str] Source language. Expects a valid iso639-1 or iso639-3 language code. target_lang : typing.Optional[str] The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code. target_accent : typing.Optional[str] [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer. num_speakers : typing.Optional[int] Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers watermark : typing.Optional[bool] Whether to apply watermark to the output video. start_time : typing.Optional[int] Start time of the source video/audio file. end_time : typing.Optional[int] End time of the source video/audio file. highest_resolution : typing.Optional[bool] Whether to use the highest resolution available. drop_background_audio : typing.Optional[bool] An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. use_profanity_filter : typing.Optional[bool] [BETA] Whether transcripts should have profanities censored with the words '[censored]' dubbing_studio : typing.Optional[bool] Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. disable_voice_cloning : typing.Optional[bool] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubRequestMode] The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DoDubbingResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.create() asyncio.run(main()) """ _response = await self._raw_client.create( file=file, csv_file=csv_file, foreground_audio_file=foreground_audio_file, background_audio_file=background_audio_file, name=name, source_url=source_url, source_lang=source_lang, target_lang=target_lang, target_accent=target_accent, num_speakers=num_speakers, watermark=watermark, start_time=start_time, end_time=end_time, highest_resolution=highest_resolution, drop_background_audio=drop_background_audio, use_profanity_filter=use_profanity_filter, dubbing_studio=dubbing_studio, disable_voice_cloning=disable_voice_cloning, mode=mode, csv_fps=csv_fps, request_options=request_options, ) return _response.data async def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingMetadataResponse: """ Returns metadata about a dubbing project, including whether it's still in progress or not Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingMetadataResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.get( dubbing_id="dubbing_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(dubbing_id, request_options=request_options) return _response.data async def delete( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteDubbingResponseModel: """ Deletes a dubbing project. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteDubbingResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.delete( dubbing_id="dubbing_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(dubbing_id, request_options=request_options) return _response.data @property def project(self): if self._project is None: from .project.client import AsyncProjectClient # noqa: E402 self._project = AsyncProjectClient(client_wrapper=self._client_wrapper) return self._project @property def resource(self): if self._resource is None: from .resource.client import AsyncResourceClient # noqa: E402 self._resource = AsyncResourceClient(client_wrapper=self._client_wrapper) return self._resource @property def audio(self): if self._audio is None: from .audio.client import AsyncAudioClient # noqa: E402 self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper) return self._audio @property def transcript(self): if self._transcript is None: from .transcript.client import AsyncTranscriptClient # noqa: E402 self._transcript = AsyncTranscriptClient(client_wrapper=self._client_wrapper) return self._transcript @property def transcripts(self): if self._transcripts is None: from .transcripts.client import AsyncTranscriptsClient # noqa: E402 self._transcripts = AsyncTranscriptsClient(client_wrapper=self._client_wrapper) return self._transcripts elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/000077500000000000000000000000001523660243400256215ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/__init__.py000066400000000000000000000025101523660243400277300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ProjectCreateRequestModelId, ProjectListRequestSortDirection from . import language, transcript _dynamic_imports: typing.Dict[str, str] = { "ProjectCreateRequestModelId": ".types", "ProjectListRequestSortDirection": ".types", "language": ".language", "transcript": ".transcript", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ProjectCreateRequestModelId", "ProjectListRequestSortDirection", "language", "transcript"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/client.py000066400000000000000000000420771523660243400274630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ... import core from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.dubbing_project_list_response import DubbingProjectListResponse from ...types.dubbing_project_response import DubbingProjectResponse from .raw_client import AsyncRawProjectClient, RawProjectClient from .types.project_create_request_model_id import ProjectCreateRequestModelId from .types.project_list_request_sort_direction import ProjectListRequestSortDirection if typing.TYPE_CHECKING: from .language.client import AsyncLanguageClient, LanguageClient from .transcript.client import AsyncTranscriptClient, TranscriptClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ProjectClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawProjectClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._language: typing.Optional[LanguageClient] = None self._transcript: typing.Optional[TranscriptClient] = None @property def with_raw_response(self) -> RawProjectClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawProjectClient """ return self._raw_client def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingProjectListResponse: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectListResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.list( page_size=20, ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, status=status, sort_direction=sort_direction, request_options=request_options, ) return _response.data def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[ProjectCreateRequestModelId] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, webhook_ids: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingProjectResponse: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[ProjectCreateRequestModelId] Default dubbing model id ('dubbing_v1' or 'dubbing_v2') for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. webhook_ids : typing.Optional[typing.List[str]] Ids of workspace webhooks to notify when this project becomes ready or fails, and when any of its languages completes or fails. At most 3; each must be a webhook configured in your workspace. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.create( source_url="https://example.com/promo.mp4", source_language="en", reference="Q3 marketing video", ) """ _response = self._raw_client.create( file=file, source_url=source_url, reference=reference, source_language=source_language, model_id=model_id, keyterms=keyterms, webhook_ids=webhook_ids, target_language=target_language, transcript=transcript, request_options=request_options, ) return _response.data def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingProjectResponse: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) """ _response = self._raw_client.get(project_id, request_options=request_options) return _response.data def delete(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) """ _response = self._raw_client.delete(project_id, request_options=request_options) return _response.data @property def language(self): if self._language is None: from .language.client import LanguageClient # noqa: E402 self._language = LanguageClient(client_wrapper=self._client_wrapper) return self._language @property def transcript(self): if self._transcript is None: from .transcript.client import TranscriptClient # noqa: E402 self._transcript = TranscriptClient(client_wrapper=self._client_wrapper) return self._transcript class AsyncProjectClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawProjectClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._language: typing.Optional[AsyncLanguageClient] = None self._transcript: typing.Optional[AsyncTranscriptClient] = None @property def with_raw_response(self) -> AsyncRawProjectClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawProjectClient """ return self._raw_client async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingProjectListResponse: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectListResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.list( page_size=20, ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, status=status, sort_direction=sort_direction, request_options=request_options, ) return _response.data async def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[ProjectCreateRequestModelId] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, webhook_ids: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingProjectResponse: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[ProjectCreateRequestModelId] Default dubbing model id ('dubbing_v1' or 'dubbing_v2') for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. webhook_ids : typing.Optional[typing.List[str]] Ids of workspace webhooks to notify when this project becomes ready or fails, and when any of its languages completes or fails. At most 3; each must be a webhook configured in your workspace. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.create( source_url="https://example.com/promo.mp4", source_language="en", reference="Q3 marketing video", ) asyncio.run(main()) """ _response = await self._raw_client.create( file=file, source_url=source_url, reference=reference, source_language=source_language, model_id=model_id, keyterms=keyterms, webhook_ids=webhook_ids, target_language=target_language, transcript=transcript, request_options=request_options, ) return _response.data async def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingProjectResponse: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingProjectResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, request_options=request_options) return _response.data async def delete(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. 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.dubbing.project.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) asyncio.run(main()) """ _response = await self._raw_client.delete(project_id, request_options=request_options) return _response.data @property def language(self): if self._language is None: from .language.client import AsyncLanguageClient # noqa: E402 self._language = AsyncLanguageClient(client_wrapper=self._client_wrapper) return self._language @property def transcript(self): if self._transcript is None: from .transcript.client import AsyncTranscriptClient # noqa: E402 self._transcript = AsyncTranscriptClient(client_wrapper=self._client_wrapper) return self._transcript elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/000077500000000000000000000000001523660243400274045ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/__init__.py000066400000000000000000000020321523660243400315120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import transcript _dynamic_imports: typing.Dict[str, str] = {"transcript": ".transcript"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["transcript"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/client.py000066400000000000000000000340131523660243400312350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.dubbing_language_list_response import DubbingLanguageListResponse from ....types.dubbing_language_response import DubbingLanguageResponse from ....types.voice_settings import VoiceSettings from .raw_client import AsyncRawLanguageClient, RawLanguageClient if typing.TYPE_CHECKING: from .transcript.client import AsyncTranscriptClient, TranscriptClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class LanguageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLanguageClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._transcript: typing.Optional[TranscriptClient] = None @property def with_raw_response(self) -> RawLanguageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLanguageClient """ return self._raw_client def list( self, project_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingLanguageListResponse: """ List a project's language targets (cursor-paginated). Parameters ---------- project_id : str Identifier of the parent dubbing project. cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of language targets per page (max 100). status : typing.Optional[str] Filter to targets in this status (queued, processing, completed, stale, failed). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageListResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.list( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", page_size=20, ) """ _response = self._raw_client.list( project_id, cursor=cursor, page_size=page_size, status=status, request_options=request_options ) return _response.data def create( self, project_id: str, *, target_language: str, voice_settings: typing.Optional[VoiceSettings] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingLanguageResponse: """ Queue a language target for a project (starts once the project is ready). Parameters ---------- project_id : str Identifier of the parent dubbing project. target_language : str BCP-47 language tag to dub the project into (e.g. 'fr', 'es-MX'); must be a language the dubbing model supports. A region-qualified tag must be one of the supported dialects. voice_settings : typing.Optional[VoiceSettings] Voice settings applied to the whole language (e.g. cloning strength). translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] Enterprise only. Optional translations to use instead of machine translation. A map from each source segment's external_id (or its id, if you supplied none) to the translated text; every source segment must be covered exactly once. At most 20000 entries, totalling at most 4 MiB of text. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.create( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", target_language="es", ) """ _response = self._raw_client.create( project_id, target_language=target_language, voice_settings=voice_settings, translations=translations, request_options=request_options, ) return _response.data def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingLanguageResponse: """ Full language-target detail. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) """ _response = self._raw_client.get(project_id, language_id, request_options=request_options) return _response.data def delete( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Delete a language target. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) """ _response = self._raw_client.delete(project_id, language_id, request_options=request_options) return _response.data @property def transcript(self): if self._transcript is None: from .transcript.client import TranscriptClient # noqa: E402 self._transcript = TranscriptClient(client_wrapper=self._client_wrapper) return self._transcript class AsyncLanguageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLanguageClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._transcript: typing.Optional[AsyncTranscriptClient] = None @property def with_raw_response(self) -> AsyncRawLanguageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLanguageClient """ return self._raw_client async def list( self, project_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingLanguageListResponse: """ List a project's language targets (cursor-paginated). Parameters ---------- project_id : str Identifier of the parent dubbing project. cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of language targets per page (max 100). status : typing.Optional[str] Filter to targets in this status (queued, processing, completed, stale, failed). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageListResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.list( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", page_size=20, ) asyncio.run(main()) """ _response = await self._raw_client.list( project_id, cursor=cursor, page_size=page_size, status=status, request_options=request_options ) return _response.data async def create( self, project_id: str, *, target_language: str, voice_settings: typing.Optional[VoiceSettings] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingLanguageResponse: """ Queue a language target for a project (starts once the project is ready). Parameters ---------- project_id : str Identifier of the parent dubbing project. target_language : str BCP-47 language tag to dub the project into (e.g. 'fr', 'es-MX'); must be a language the dubbing model supports. A region-qualified tag must be one of the supported dialects. voice_settings : typing.Optional[VoiceSettings] Voice settings applied to the whole language (e.g. cloning strength). translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] Enterprise only. Optional translations to use instead of machine translation. A map from each source segment's external_id (or its id, if you supplied none) to the translated text; every source segment must be covered exactly once. At most 20000 entries, totalling at most 4 MiB of text. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.create( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", target_language="es", ) asyncio.run(main()) """ _response = await self._raw_client.create( project_id, target_language=target_language, voice_settings=voice_settings, translations=translations, request_options=request_options, ) return _response.data async def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingLanguageResponse: """ Full language-target detail. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingLanguageResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, language_id, request_options=request_options) return _response.data async def delete( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ Delete a language target. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to delete. 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.dubbing.project.language.delete( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) asyncio.run(main()) """ _response = await self._raw_client.delete(project_id, language_id, request_options=request_options) return _response.data @property def transcript(self): if self._transcript is None: from .transcript.client import AsyncTranscriptClient # noqa: E402 self._transcript = AsyncTranscriptClient(client_wrapper=self._client_wrapper) return self._transcript elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/raw_client.py000066400000000000000000000536341523660243400321200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.dubbing_language_list_response import DubbingLanguageListResponse from ....types.dubbing_language_response import DubbingLanguageResponse from ....types.voice_settings import VoiceSettings from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawLanguageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, project_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingLanguageListResponse]: """ List a project's language targets (cursor-paginated). Parameters ---------- project_id : str Identifier of the parent dubbing project. cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of language targets per page (max 100). status : typing.Optional[str] Filter to targets in this status (queued, processing, completed, stale, failed). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingLanguageListResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageListResponse, construct_type( type_=DubbingLanguageListResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, project_id: str, *, target_language: str, voice_settings: typing.Optional[VoiceSettings] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingLanguageResponse]: """ Queue a language target for a project (starts once the project is ready). Parameters ---------- project_id : str Identifier of the parent dubbing project. target_language : str BCP-47 language tag to dub the project into (e.g. 'fr', 'es-MX'); must be a language the dubbing model supports. A region-qualified tag must be one of the supported dialects. voice_settings : typing.Optional[VoiceSettings] Voice settings applied to the whole language (e.g. cloning strength). translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] Enterprise only. Optional translations to use instead of machine translation. A map from each source segment's external_id (or its id, if you supplied none) to the translated text; every source segment must be covered exactly once. At most 20000 entries, totalling at most 4 MiB of text. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingLanguageResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language", method="POST", json={ "target_language": target_language, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "translations": translations, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageResponse, construct_type( type_=DubbingLanguageResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingLanguageResponse]: """ Full language-target detail. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingLanguageResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageResponse, construct_type( type_=DubbingLanguageResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Delete a language target. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLanguageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, project_id: str, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingLanguageListResponse]: """ List a project's language targets (cursor-paginated). Parameters ---------- project_id : str Identifier of the parent dubbing project. cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of language targets per page (max 100). status : typing.Optional[str] Filter to targets in this status (queued, processing, completed, stale, failed). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingLanguageListResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageListResponse, construct_type( type_=DubbingLanguageListResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, project_id: str, *, target_language: str, voice_settings: typing.Optional[VoiceSettings] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingLanguageResponse]: """ Queue a language target for a project (starts once the project is ready). Parameters ---------- project_id : str Identifier of the parent dubbing project. target_language : str BCP-47 language tag to dub the project into (e.g. 'fr', 'es-MX'); must be a language the dubbing model supports. A region-qualified tag must be one of the supported dialects. voice_settings : typing.Optional[VoiceSettings] Voice settings applied to the whole language (e.g. cloning strength). translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] Enterprise only. Optional translations to use instead of machine translation. A map from each source segment's external_id (or its id, if you supplied none) to the translated text; every source segment must be covered exactly once. At most 20000 entries, totalling at most 4 MiB of text. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingLanguageResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language", method="POST", json={ "target_language": target_language, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "translations": translations, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageResponse, construct_type( type_=DubbingLanguageResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingLanguageResponse]: """ Full language-target detail. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingLanguageResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingLanguageResponse, construct_type( type_=DubbingLanguageResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a language target. Parameters ---------- project_id : str Identifier of the parent dubbing project. language_id : str Identifier of the language target to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/transcript/000077500000000000000000000000001523660243400315755ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/transcript/__init__.py000066400000000000000000000001251523660243400337040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/transcript/client.py000066400000000000000000000341611523660243400334320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.dubbing_bulk_target_segment_update_response import DubbingBulkTargetSegmentUpdateResponse from .....types.dubbing_regenerate_response import DubbingRegenerateResponse from .....types.dubbing_target_segment_update_request import DubbingTargetSegmentUpdateRequest from .....types.dubbing_target_segment_update_response import DubbingTargetSegmentUpdateResponse from .....types.dubbing_target_transcript_response import DubbingTargetTranscriptResponse from .raw_client import AsyncRawTranscriptClient, RawTranscriptClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTranscriptClient """ return self._raw_client def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingTargetTranscriptResponse: """ A language target's transcript: source segments with their translations. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTargetTranscriptResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) """ _response = self._raw_client.get(project_id, language_id, request_options=request_options) return _response.data def update_segment( self, project_id: str, language_id: str, segment_id: str, *, request: DubbingTargetSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingTargetSegmentUpdateResponse: """ Enterprise only. Edit a segment's translation for a language target. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segment_id : str Identifier of the segment to edit. request : DubbingTargetSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTargetSegmentUpdateResponse Successful Response Examples -------- from elevenlabs import DubbingTargetSegmentUpdateRequest, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), ) """ _response = self._raw_client.update_segment( project_id, language_id, segment_id, request=request, request_options=request_options ) return _response.data def update_segments( self, project_id: str, language_id: str, *, segments: typing.Dict[str, DubbingTargetSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> DubbingBulkTargetSegmentUpdateResponse: """ Enterprise only. Edit several segments' translations for a language target in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segments : typing.Dict[str, DubbingTargetSegmentUpdateRequest] Map of segment id to the translation edit to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingBulkTargetSegmentUpdateResponse Successful Response Examples -------- from elevenlabs import DubbingTargetSegmentUpdateRequest, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingTargetSegmentUpdateRequest( translation="Empecemos.", ), }, ) """ _response = self._raw_client.update_segments( project_id, language_id, segments=segments, request_options=request_options ) return _response.data def regenerate( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingRegenerateResponse: """ Enterprise only. Re-dub a target from its edited transcript, re-synthesizing only the edited regions (charged like a generation). Conflicts when the target has no edits to apply -- nothing is dispatched and nothing is charged. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingRegenerateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.language.transcript.regenerate( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) """ _response = self._raw_client.regenerate(project_id, language_id, request_options=request_options) return _response.data class AsyncTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTranscriptClient """ return self._raw_client async def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingTargetTranscriptResponse: """ A language target's transcript: source segments with their translations. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTargetTranscriptResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, language_id, request_options=request_options) return _response.data async def update_segment( self, project_id: str, language_id: str, segment_id: str, *, request: DubbingTargetSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingTargetSegmentUpdateResponse: """ Enterprise only. Edit a segment's translation for a language target. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segment_id : str Identifier of the segment to edit. request : DubbingTargetSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTargetSegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DubbingTargetSegmentUpdateRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), ) asyncio.run(main()) """ _response = await self._raw_client.update_segment( project_id, language_id, segment_id, request=request, request_options=request_options ) return _response.data async def update_segments( self, project_id: str, language_id: str, *, segments: typing.Dict[str, DubbingTargetSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> DubbingBulkTargetSegmentUpdateResponse: """ Enterprise only. Edit several segments' translations for a language target in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segments : typing.Dict[str, DubbingTargetSegmentUpdateRequest] Map of segment id to the translation edit to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingBulkTargetSegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DubbingTargetSegmentUpdateRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingTargetSegmentUpdateRequest( translation="Bienvenido a nuestra última demostración de producto.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingTargetSegmentUpdateRequest( translation="Empecemos.", ), }, ) asyncio.run(main()) """ _response = await self._raw_client.update_segments( project_id, language_id, segments=segments, request_options=request_options ) return _response.data async def regenerate( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingRegenerateResponse: """ Enterprise only. Re-dub a target from its edited transcript, re-synthesizing only the edited regions (charged like a generation). Conflicts when the target has no edits to apply -- nothing is dispatched and nothing is charged. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingRegenerateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.language.transcript.regenerate( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", language_id="lang_1001kwkyxp0je6ktn4knsfrasx5s", ) asyncio.run(main()) """ _response = await self._raw_client.regenerate(project_id, language_id, request_options=request_options) return _response.data raw_client.py000066400000000000000000000551041523660243400342240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/language/transcript# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.serialization import convert_and_respect_annotation_metadata from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.dubbing_bulk_target_segment_update_response import DubbingBulkTargetSegmentUpdateResponse from .....types.dubbing_regenerate_response import DubbingRegenerateResponse from .....types.dubbing_target_segment_update_request import DubbingTargetSegmentUpdateRequest from .....types.dubbing_target_segment_update_response import DubbingTargetSegmentUpdateResponse from .....types.dubbing_target_transcript_response import DubbingTargetTranscriptResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingTargetTranscriptResponse]: """ A language target's transcript: source segments with their translations. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingTargetTranscriptResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTargetTranscriptResponse, construct_type( type_=DubbingTargetTranscriptResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_segment( self, project_id: str, language_id: str, segment_id: str, *, request: DubbingTargetSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingTargetSegmentUpdateResponse]: """ Enterprise only. Edit a segment's translation for a language target. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segment_id : str Identifier of the segment to edit. request : DubbingTargetSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingTargetSegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=DubbingTargetSegmentUpdateRequest, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTargetSegmentUpdateResponse, construct_type( type_=DubbingTargetSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_segments( self, project_id: str, language_id: str, *, segments: typing.Dict[str, DubbingTargetSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingBulkTargetSegmentUpdateResponse]: """ Enterprise only. Edit several segments' translations for a language target in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segments : typing.Dict[str, DubbingTargetSegmentUpdateRequest] Map of segment id to the translation edit to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingBulkTargetSegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/segments", method="PATCH", json={ "segments": convert_and_respect_annotation_metadata( object_=segments, annotation=typing.Dict[str, DubbingTargetSegmentUpdateRequest], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingBulkTargetSegmentUpdateResponse, construct_type( type_=DubbingBulkTargetSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def regenerate( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingRegenerateResponse]: """ Enterprise only. Re-dub a target from its edited transcript, re-synthesizing only the edited regions (charged like a generation). Conflicts when the target has no edits to apply -- nothing is dispatched and nothing is charged. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingRegenerateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/regenerate", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingRegenerateResponse, construct_type( type_=DubbingRegenerateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingTargetTranscriptResponse]: """ A language target's transcript: source segments with their translations. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingTargetTranscriptResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTargetTranscriptResponse, construct_type( type_=DubbingTargetTranscriptResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_segment( self, project_id: str, language_id: str, segment_id: str, *, request: DubbingTargetSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingTargetSegmentUpdateResponse]: """ Enterprise only. Edit a segment's translation for a language target. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segment_id : str Identifier of the segment to edit. request : DubbingTargetSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingTargetSegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=DubbingTargetSegmentUpdateRequest, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTargetSegmentUpdateResponse, construct_type( type_=DubbingTargetSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_segments( self, project_id: str, language_id: str, *, segments: typing.Dict[str, DubbingTargetSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingBulkTargetSegmentUpdateResponse]: """ Enterprise only. Edit several segments' translations for a language target in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. segments : typing.Dict[str, DubbingTargetSegmentUpdateRequest] Map of segment id to the translation edit to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingBulkTargetSegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/segments", method="PATCH", json={ "segments": convert_and_respect_annotation_metadata( object_=segments, annotation=typing.Dict[str, DubbingTargetSegmentUpdateRequest], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingBulkTargetSegmentUpdateResponse, construct_type( type_=DubbingBulkTargetSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def regenerate( self, project_id: str, language_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingRegenerateResponse]: """ Enterprise only. Re-dub a target from its edited transcript, re-synthesizing only the edited regions (charged like a generation). Conflicts when the target has no edits to apply -- nothing is dispatched and nothing is charged. Parameters ---------- project_id : str Identifier of the dubbing project. language_id : str Identifier of the language target. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingRegenerateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/language/{jsonable_encoder(language_id)}/transcript/regenerate", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingRegenerateResponse, construct_type( type_=DubbingRegenerateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/raw_client.py000066400000000000000000000603231523660243400303260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.dubbing_project_list_response import DubbingProjectListResponse from ...types.dubbing_project_response import DubbingProjectResponse from .types.project_create_request_model_id import ProjectCreateRequestModelId from .types.project_list_request_sort_direction import ProjectListRequestSortDirection from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawProjectClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingProjectListResponse]: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectListResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectListResponse, construct_type( type_=DubbingProjectListResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[ProjectCreateRequestModelId] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, webhook_ids: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingProjectResponse]: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[ProjectCreateRequestModelId] Default dubbing model id ('dubbing_v1' or 'dubbing_v2') for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. webhook_ids : typing.Optional[typing.List[str]] Ids of workspace webhooks to notify when this project becomes ready or fails, and when any of its languages completes or fails. At most 3; each must be a webhook configured in your workspace. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="POST", data={ "source_url": source_url, "reference": reference, "source_language": source_language, "model_id": model_id, "keyterms": keyterms, "webhook_ids": webhook_ids, "target_language": target_language, }, files={ **({"file": file} if file is not None else {}), **({"transcript": transcript} if transcript is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingProjectResponse]: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingProjectResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawProjectClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, status: typing.Optional[str] = None, sort_direction: typing.Optional[ProjectListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingProjectListResponse]: """ List the workspace's dubbing projects (cursor-paginated). Parameters ---------- cursor : typing.Optional[str] Pagination cursor from a previous response's next_cursor. page_size : typing.Optional[int] Number of projects per page (max 100). status : typing.Optional[str] Filter to projects in this status (preparing, ready, failed). sort_direction : typing.Optional[ProjectListRequestSortDirection] Sort by creation time (default 'DESCENDING'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectListResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="GET", params={ "cursor": cursor, "page_size": page_size, "status": status, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectListResponse, construct_type( type_=DubbingProjectListResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, file: typing.Optional[core.File] = OMIT, source_url: typing.Optional[str] = OMIT, reference: typing.Optional[str] = OMIT, source_language: typing.Optional[str] = OMIT, model_id: typing.Optional[ProjectCreateRequestModelId] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, webhook_ids: typing.Optional[typing.List[str]] = OMIT, target_language: typing.Optional[str] = OMIT, transcript: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingProjectResponse]: """ Create a dubbing project from an uploaded file or a source URL. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation source_url : typing.Optional[str] Public URL to fetch the source media from. Provide this or file. reference : typing.Optional[str] Optional free-form string (max 500 characters) to identify the project on your end. source_language : typing.Optional[str] BCP-47 language tag of the source media; must be a language the transcription model supports. Any region or script subtag is ignored, since transcription is per-language. Omit to auto-detect. model_id : typing.Optional[ProjectCreateRequestModelId] Default dubbing model id ('dubbing_v1' or 'dubbing_v2') for the project's language targets; a target may override it. Omit to use the system default. keyterms : typing.Optional[typing.List[str]] Key terms to bias transcription/translation toward (e.g. product or brand names). At most 1000 terms; each term at most 50 characters and 5 words; the characters `<>{}[]\\` are not allowed. webhook_ids : typing.Optional[typing.List[str]] Ids of workspace webhooks to notify when this project becomes ready or fails, and when any of its languages completes or fails. At most 3; each must be a webhook configured in your workspace. target_language : typing.Optional[str] Optional shortcut: also create a language target in this BCP-47 language, queued to start once the project is ready. Must be a language the dubbing model supports, and a region-qualified tag must be one of the supported dialects. transcript : typing.Optional[core.File] See core.File for more documentation request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing/project", method="POST", data={ "source_url": source_url, "reference": reference, "source_language": source_language, "model_id": model_id, "keyterms": keyterms, "webhook_ids": webhook_ids, "target_language": target_language, }, files={ **({"file": file} if file is not None else {}), **({"transcript": transcript} if transcript is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingProjectResponse]: """ Full project detail, including its language target ids. Parameters ---------- project_id : str Identifier of the dubbing project to fetch. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingProjectResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingProjectResponse, construct_type( type_=DubbingProjectResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a project and its language targets. Parameters ---------- project_id : str Identifier of the dubbing project to delete. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/transcript/000077500000000000000000000000001523660243400300125ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/transcript/__init__.py000066400000000000000000000001251523660243400321210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/transcript/client.py000066400000000000000000000373641523660243400316570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.dubbing_bulk_source_segment_update_response import DubbingBulkSourceSegmentUpdateResponse from ....types.dubbing_segment_update_request import DubbingSegmentUpdateRequest from ....types.dubbing_source_segment_update_response import DubbingSourceSegmentUpdateResponse from ....types.dubbing_source_transcript_response import DubbingSourceTranscriptResponse from ....types.dubbing_transcript_revision_response import DubbingTranscriptRevisionResponse from .raw_client import AsyncRawTranscriptClient, RawTranscriptClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTranscriptClient """ return self._raw_client def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingSourceTranscriptResponse: """ The project's source transcript, as editable segments. Parameters ---------- project_id : str Identifier of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceTranscriptResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) """ _response = self._raw_client.get(project_id, request_options=request_options) return _response.data def delete_segment( self, project_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingTranscriptRevisionResponse: """ Enterprise only. Remove a source segment from the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to remove. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTranscriptRevisionResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.transcript.delete_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", ) """ _response = self._raw_client.delete_segment(project_id, segment_id, request_options=request_options) return _response.data def update_segment( self, project_id: str, segment_id: str, *, request: DubbingSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingSourceSegmentUpdateResponse: """ Enterprise only. Edit a source segment's text, speaker, or timing. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to edit. request : DubbingSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceSegmentUpdateResponse Successful Response Examples -------- from elevenlabs import DubbingSegmentUpdateRequest, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), ) """ _response = self._raw_client.update_segment( project_id, segment_id, request=request, request_options=request_options ) return _response.data def update_segments( self, project_id: str, *, segments: typing.Dict[str, DubbingSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> DubbingBulkSourceSegmentUpdateResponse: """ Enterprise only. Edit several source segments' text, speaker, or timing in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. segments : typing.Dict[str, DubbingSegmentUpdateRequest] Map of segment id to the partial update to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingBulkSourceSegmentUpdateResponse Successful Response Examples -------- from elevenlabs import DubbingSegmentUpdateRequest, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingSegmentUpdateRequest( speaker_id="narrator", ), }, ) """ _response = self._raw_client.update_segments(project_id, segments=segments, request_options=request_options) return _response.data def create_segment( self, project_id: str, *, text: str, speaker_id: str, start_s: float, end_s: float, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingSourceSegmentUpdateResponse: """ Enterprise only. Add a new source segment to the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. text : str The text of the new segment. speaker_id : str Identifier of the segment's speaker. start_s : float Start time of the segment, in seconds. end_s : float End time of the segment, in seconds. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceSegmentUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.project.transcript.create_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", text="Thanks for watching.", speaker_id="default_speaker", start_s=42.0, end_s=44.0, ) """ _response = self._raw_client.create_segment( project_id, text=text, speaker_id=speaker_id, start_s=start_s, end_s=end_s, request_options=request_options ) return _response.data class AsyncTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTranscriptClient """ return self._raw_client async def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingSourceTranscriptResponse: """ The project's source transcript, as editable segments. Parameters ---------- project_id : str Identifier of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceTranscriptResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.transcript.get( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, request_options=request_options) return _response.data async def delete_segment( self, project_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DubbingTranscriptRevisionResponse: """ Enterprise only. Remove a source segment from the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to remove. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTranscriptRevisionResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.transcript.delete_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", ) asyncio.run(main()) """ _response = await self._raw_client.delete_segment(project_id, segment_id, request_options=request_options) return _response.data async def update_segment( self, project_id: str, segment_id: str, *, request: DubbingSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingSourceSegmentUpdateResponse: """ Enterprise only. Edit a source segment's text, speaker, or timing. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to edit. request : DubbingSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceSegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DubbingSegmentUpdateRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.transcript.update_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segment_id="0199a3f0-1c2d-7abc-8def-0123456789ab", request=DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), ) asyncio.run(main()) """ _response = await self._raw_client.update_segment( project_id, segment_id, request=request, request_options=request_options ) return _response.data async def update_segments( self, project_id: str, *, segments: typing.Dict[str, DubbingSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> DubbingBulkSourceSegmentUpdateResponse: """ Enterprise only. Edit several source segments' text, speaker, or timing in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. segments : typing.Dict[str, DubbingSegmentUpdateRequest] Map of segment id to the partial update to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingBulkSourceSegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DubbingSegmentUpdateRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.transcript.update_segments( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", segments={ "0199a3f0-1c2d-7abc-8def-0123456789ab": DubbingSegmentUpdateRequest( text="Welcome to our latest product demo.", ), "0199a3f0-3e4f-7abc-8def-0123456789cd": DubbingSegmentUpdateRequest( speaker_id="narrator", ), }, ) asyncio.run(main()) """ _response = await self._raw_client.update_segments( project_id, segments=segments, request_options=request_options ) return _response.data async def create_segment( self, project_id: str, *, text: str, speaker_id: str, start_s: float, end_s: float, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingSourceSegmentUpdateResponse: """ Enterprise only. Add a new source segment to the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. text : str The text of the new segment. speaker_id : str Identifier of the segment's speaker. start_s : float Start time of the segment, in seconds. end_s : float End time of the segment, in seconds. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingSourceSegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.project.transcript.create_segment( project_id="proj_1601kwkyxp0hfzvtmyxwqxx6mcy3", text="Thanks for watching.", speaker_id="default_speaker", start_s=42.0, end_s=44.0, ) asyncio.run(main()) """ _response = await self._raw_client.create_segment( project_id, text=text, speaker_id=speaker_id, start_s=start_s, end_s=end_s, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/transcript/raw_client.py000066400000000000000000000660551523660243400325270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.dubbing_bulk_source_segment_update_response import DubbingBulkSourceSegmentUpdateResponse from ....types.dubbing_segment_update_request import DubbingSegmentUpdateRequest from ....types.dubbing_source_segment_update_response import DubbingSourceSegmentUpdateResponse from ....types.dubbing_source_transcript_response import DubbingSourceTranscriptResponse from ....types.dubbing_transcript_revision_response import DubbingTranscriptRevisionResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingSourceTranscriptResponse]: """ The project's source transcript, as editable segments. Parameters ---------- project_id : str Identifier of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingSourceTranscriptResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceTranscriptResponse, construct_type( type_=DubbingSourceTranscriptResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete_segment( self, project_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingTranscriptRevisionResponse]: """ Enterprise only. Remove a source segment from the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to remove. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingTranscriptRevisionResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTranscriptRevisionResponse, construct_type( type_=DubbingTranscriptRevisionResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_segment( self, project_id: str, segment_id: str, *, request: DubbingSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingSourceSegmentUpdateResponse]: """ Enterprise only. Edit a source segment's text, speaker, or timing. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to edit. request : DubbingSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingSourceSegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=DubbingSegmentUpdateRequest, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceSegmentUpdateResponse, construct_type( type_=DubbingSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update_segments( self, project_id: str, *, segments: typing.Dict[str, DubbingSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingBulkSourceSegmentUpdateResponse]: """ Enterprise only. Edit several source segments' text, speaker, or timing in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. segments : typing.Dict[str, DubbingSegmentUpdateRequest] Map of segment id to the partial update to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingBulkSourceSegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segments", method="PATCH", json={ "segments": convert_and_respect_annotation_metadata( object_=segments, annotation=typing.Dict[str, DubbingSegmentUpdateRequest], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingBulkSourceSegmentUpdateResponse, construct_type( type_=DubbingBulkSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_segment( self, project_id: str, *, text: str, speaker_id: str, start_s: float, end_s: float, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingSourceSegmentUpdateResponse]: """ Enterprise only. Add a new source segment to the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. text : str The text of the new segment. speaker_id : str Identifier of the segment's speaker. start_s : float Start time of the segment, in seconds. end_s : float End time of the segment, in seconds. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingSourceSegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment", method="POST", json={ "text": text, "speaker_id": speaker_id, "start_s": start_s, "end_s": end_s, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceSegmentUpdateResponse, construct_type( type_=DubbingSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingSourceTranscriptResponse]: """ The project's source transcript, as editable segments. Parameters ---------- project_id : str Identifier of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingSourceTranscriptResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceTranscriptResponse, construct_type( type_=DubbingSourceTranscriptResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete_segment( self, project_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingTranscriptRevisionResponse]: """ Enterprise only. Remove a source segment from the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to remove. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingTranscriptRevisionResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTranscriptRevisionResponse, construct_type( type_=DubbingTranscriptRevisionResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_segment( self, project_id: str, segment_id: str, *, request: DubbingSegmentUpdateRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingSourceSegmentUpdateResponse]: """ Enterprise only. Edit a source segment's text, speaker, or timing. Parameters ---------- project_id : str Identifier of the dubbing project. segment_id : str Identifier of the segment to edit. request : DubbingSegmentUpdateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingSourceSegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment/{jsonable_encoder(segment_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=DubbingSegmentUpdateRequest, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceSegmentUpdateResponse, construct_type( type_=DubbingSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_segments( self, project_id: str, *, segments: typing.Dict[str, DubbingSegmentUpdateRequest], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingBulkSourceSegmentUpdateResponse]: """ Enterprise only. Edit several source segments' text, speaker, or timing in one atomic request. Parameters ---------- project_id : str Identifier of the dubbing project. segments : typing.Dict[str, DubbingSegmentUpdateRequest] Map of segment id to the partial update to apply to that segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingBulkSourceSegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segments", method="PATCH", json={ "segments": convert_and_respect_annotation_metadata( object_=segments, annotation=typing.Dict[str, DubbingSegmentUpdateRequest], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingBulkSourceSegmentUpdateResponse, construct_type( type_=DubbingBulkSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_segment( self, project_id: str, *, text: str, speaker_id: str, start_s: float, end_s: float, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingSourceSegmentUpdateResponse]: """ Enterprise only. Add a new source segment to the transcript. Parameters ---------- project_id : str Identifier of the dubbing project. text : str The text of the new segment. speaker_id : str Identifier of the segment's speaker. start_s : float Start time of the segment, in seconds. end_s : float End time of the segment, in seconds. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingSourceSegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/project/{jsonable_encoder(project_id)}/transcript/segment", method="POST", json={ "text": text, "speaker_id": speaker_id, "start_s": start_s, "end_s": end_s, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingSourceSegmentUpdateResponse, construct_type( type_=DubbingSourceSegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/types/000077500000000000000000000000001523660243400267655ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/types/__init__.py000066400000000000000000000025171523660243400311030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .project_create_request_model_id import ProjectCreateRequestModelId from .project_list_request_sort_direction import ProjectListRequestSortDirection _dynamic_imports: typing.Dict[str, str] = { "ProjectCreateRequestModelId": ".project_create_request_model_id", "ProjectListRequestSortDirection": ".project_list_request_sort_direction", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ProjectCreateRequestModelId", "ProjectListRequestSortDirection"] project_create_request_model_id.py000066400000000000000000000002741523660243400356600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/types# This file was auto-generated by Fern from our API Definition. import typing ProjectCreateRequestModelId = typing.Union[typing.Literal["dubbing_v1"], typing.Literal["dubbing_v2"], str] project_list_request_sort_direction.py000066400000000000000000000002661523660243400366440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/project/types# This file was auto-generated by Fern from our API Definition. import typing ProjectListRequestSortDirection = typing.Union[typing.Literal["ASCENDING", "DESCENDING"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/raw_client.py000066400000000000000000001056641523660243400266700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.delete_dubbing_response_model import DeleteDubbingResponseModel from ..types.do_dubbing_response import DoDubbingResponse from ..types.dubbing_metadata_page_response_model import DubbingMetadataPageResponseModel from ..types.dubbing_metadata_response import DubbingMetadataResponse from .types.dub_request_mode import DubRequestMode from .types.dubbing_list_request_creation_sources_item import DubbingListRequestCreationSourcesItem from .types.dubbing_list_request_dubbing_models_item import DubbingListRequestDubbingModelsItem from .types.dubbing_list_request_dubbing_status import DubbingListRequestDubbingStatus from .types.dubbing_list_request_dubbing_statuses_item import DubbingListRequestDubbingStatusesItem from .types.dubbing_list_request_filter_by_creator import DubbingListRequestFilterByCreator from .types.dubbing_list_request_order_by import DubbingListRequestOrderBy from .types.dubbing_list_request_order_direction import DubbingListRequestOrderDirection from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawDubbingClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None, dubbing_statuses: typing.Optional[ typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]] ] = None, dubbing_models: typing.Optional[ typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]] ] = None, target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, creation_sources: typing.Optional[ typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]] ] = None, filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None, order_by: typing.Optional[DubbingListRequestOrderBy] = None, order_direction: typing.Optional[DubbingListRequestOrderDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingMetadataPageResponseModel]: """ List the dubs you have access to. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many dubs to return at maximum. Can not exceed 200, defaults to 100. dubbing_status : typing.Optional[DubbingListRequestDubbingStatus] What state the dub is currently in. dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]] Filter by dubbing status. dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]] Filter by dubbing model generation. target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by target language code. creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]] Filter by dubbing creation source. filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator] Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them. order_by : typing.Optional[DubbingListRequestOrderBy] The field to use for ordering results from this query. order_direction : typing.Optional[DubbingListRequestOrderDirection] The order direction to use for results from this query. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingMetadataPageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing", method="GET", params={ "cursor": cursor, "page_size": page_size, "dubbing_status": dubbing_status, "dubbing_statuses": dubbing_statuses, "dubbing_models": dubbing_models, "target_language_codes": target_language_codes, "creation_sources": creation_sources, "filter_by_creator": filter_by_creator, "order_by": order_by, "order_direction": order_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingMetadataPageResponseModel, construct_type( type_=DubbingMetadataPageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, file: typing.Optional[core.File] = OMIT, csv_file: typing.Optional[core.File] = OMIT, foreground_audio_file: typing.Optional[core.File] = OMIT, background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, target_lang: typing.Optional[str] = OMIT, target_accent: typing.Optional[str] = OMIT, num_speakers: typing.Optional[int] = OMIT, watermark: typing.Optional[bool] = OMIT, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, highest_resolution: typing.Optional[bool] = OMIT, drop_background_audio: typing.Optional[bool] = OMIT, use_profanity_filter: typing.Optional[bool] = OMIT, dubbing_studio: typing.Optional[bool] = OMIT, disable_voice_cloning: typing.Optional[bool] = OMIT, mode: typing.Optional[DubRequestMode] = OMIT, csv_fps: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DoDubbingResponse]: """ Dubs a provided audio or video file into given language. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation csv_file : typing.Optional[core.File] See core.File for more documentation foreground_audio_file : typing.Optional[core.File] See core.File for more documentation background_audio_file : typing.Optional[core.File] See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. source_url : typing.Optional[str] URL of the source video/audio file. source_lang : typing.Optional[str] Source language. Expects a valid iso639-1 or iso639-3 language code. target_lang : typing.Optional[str] The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code. target_accent : typing.Optional[str] [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer. num_speakers : typing.Optional[int] Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers watermark : typing.Optional[bool] Whether to apply watermark to the output video. start_time : typing.Optional[int] Start time of the source video/audio file. end_time : typing.Optional[int] End time of the source video/audio file. highest_resolution : typing.Optional[bool] Whether to use the highest resolution available. drop_background_audio : typing.Optional[bool] An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. use_profanity_filter : typing.Optional[bool] [BETA] Whether transcripts should have profanities censored with the words '[censored]' dubbing_studio : typing.Optional[bool] Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. disable_voice_cloning : typing.Optional[bool] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubRequestMode] The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DoDubbingResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/dubbing", method="POST", data={ "name": name, "source_url": source_url, "source_lang": source_lang, "target_lang": target_lang, "target_accent": target_accent, "num_speakers": num_speakers, "watermark": watermark, "start_time": start_time, "end_time": end_time, "highest_resolution": highest_resolution, "drop_background_audio": drop_background_audio, "use_profanity_filter": use_profanity_filter, "dubbing_studio": dubbing_studio, "disable_voice_cloning": disable_voice_cloning, "mode": mode, "csv_fps": csv_fps, }, files={ **({"file": file} if file is not None else {}), **({"csv_file": csv_file} if csv_file is not None else {}), **({"foreground_audio_file": foreground_audio_file} if foreground_audio_file is not None else {}), **({"background_audio_file": background_audio_file} if background_audio_file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DoDubbingResponse, construct_type( type_=DoDubbingResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingMetadataResponse]: """ Returns metadata about a dubbing project, including whether it's still in progress or not Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingMetadataResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingMetadataResponse, construct_type( type_=DubbingMetadataResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteDubbingResponseModel]: """ Deletes a dubbing project. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteDubbingResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteDubbingResponseModel, construct_type( type_=DeleteDubbingResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDubbingClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None, dubbing_statuses: typing.Optional[ typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]] ] = None, dubbing_models: typing.Optional[ typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]] ] = None, target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, creation_sources: typing.Optional[ typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]] ] = None, filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None, order_by: typing.Optional[DubbingListRequestOrderBy] = None, order_direction: typing.Optional[DubbingListRequestOrderDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingMetadataPageResponseModel]: """ List the dubs you have access to. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many dubs to return at maximum. Can not exceed 200, defaults to 100. dubbing_status : typing.Optional[DubbingListRequestDubbingStatus] What state the dub is currently in. dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]] Filter by dubbing status. dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]] Filter by dubbing model generation. target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by target language code. creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]] Filter by dubbing creation source. filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator] Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them. order_by : typing.Optional[DubbingListRequestOrderBy] The field to use for ordering results from this query. order_direction : typing.Optional[DubbingListRequestOrderDirection] The order direction to use for results from this query. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingMetadataPageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing", method="GET", params={ "cursor": cursor, "page_size": page_size, "dubbing_status": dubbing_status, "dubbing_statuses": dubbing_statuses, "dubbing_models": dubbing_models, "target_language_codes": target_language_codes, "creation_sources": creation_sources, "filter_by_creator": filter_by_creator, "order_by": order_by, "order_direction": order_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingMetadataPageResponseModel, construct_type( type_=DubbingMetadataPageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, file: typing.Optional[core.File] = OMIT, csv_file: typing.Optional[core.File] = OMIT, foreground_audio_file: typing.Optional[core.File] = OMIT, background_audio_file: typing.Optional[core.File] = OMIT, name: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, source_lang: typing.Optional[str] = OMIT, target_lang: typing.Optional[str] = OMIT, target_accent: typing.Optional[str] = OMIT, num_speakers: typing.Optional[int] = OMIT, watermark: typing.Optional[bool] = OMIT, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, highest_resolution: typing.Optional[bool] = OMIT, drop_background_audio: typing.Optional[bool] = OMIT, use_profanity_filter: typing.Optional[bool] = OMIT, dubbing_studio: typing.Optional[bool] = OMIT, disable_voice_cloning: typing.Optional[bool] = OMIT, mode: typing.Optional[DubRequestMode] = OMIT, csv_fps: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DoDubbingResponse]: """ Dubs a provided audio or video file into given language. Parameters ---------- file : typing.Optional[core.File] See core.File for more documentation csv_file : typing.Optional[core.File] See core.File for more documentation foreground_audio_file : typing.Optional[core.File] See core.File for more documentation background_audio_file : typing.Optional[core.File] See core.File for more documentation name : typing.Optional[str] Name of the dubbing project. source_url : typing.Optional[str] URL of the source video/audio file. source_lang : typing.Optional[str] Source language. Expects a valid iso639-1 or iso639-3 language code. target_lang : typing.Optional[str] The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code. target_accent : typing.Optional[str] [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer. num_speakers : typing.Optional[int] Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers watermark : typing.Optional[bool] Whether to apply watermark to the output video. start_time : typing.Optional[int] Start time of the source video/audio file. end_time : typing.Optional[int] End time of the source video/audio file. highest_resolution : typing.Optional[bool] Whether to use the highest resolution available. drop_background_audio : typing.Optional[bool] An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. use_profanity_filter : typing.Optional[bool] [BETA] Whether transcripts should have profanities censored with the words '[censored]' dubbing_studio : typing.Optional[bool] Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. disable_voice_cloning : typing.Optional[bool] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubRequestMode] The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DoDubbingResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/dubbing", method="POST", data={ "name": name, "source_url": source_url, "source_lang": source_lang, "target_lang": target_lang, "target_accent": target_accent, "num_speakers": num_speakers, "watermark": watermark, "start_time": start_time, "end_time": end_time, "highest_resolution": highest_resolution, "drop_background_audio": drop_background_audio, "use_profanity_filter": use_profanity_filter, "dubbing_studio": dubbing_studio, "disable_voice_cloning": disable_voice_cloning, "mode": mode, "csv_fps": csv_fps, }, files={ **({"file": file} if file is not None else {}), **({"csv_file": csv_file} if csv_file is not None else {}), **({"foreground_audio_file": foreground_audio_file} if foreground_audio_file is not None else {}), **({"background_audio_file": background_audio_file} if background_audio_file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DoDubbingResponse, construct_type( type_=DoDubbingResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingMetadataResponse]: """ Returns metadata about a dubbing project, including whether it's still in progress or not Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingMetadataResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingMetadataResponse, construct_type( type_=DubbingMetadataResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteDubbingResponseModel]: """ Deletes a dubbing project. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteDubbingResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteDubbingResponseModel, construct_type( type_=DeleteDubbingResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/000077500000000000000000000000001523660243400260025ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/__init__.py000066400000000000000000000021501523660243400301110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import language, segment, speaker _dynamic_imports: typing.Dict[str, str] = {"language": ".language", "segment": ".segment", "speaker": ".speaker"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["language", "segment", "speaker"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/client.py000066400000000000000000000510111523660243400276300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.dubbing_render_response_model import DubbingRenderResponseModel from ...types.dubbing_resource import DubbingResource from ...types.render_type import RenderType from ...types.segment_dub_response import SegmentDubResponse from ...types.segment_migration_response import SegmentMigrationResponse from ...types.segment_transcription_response import SegmentTranscriptionResponse from ...types.segment_translation_response import SegmentTranslationResponse from .raw_client import AsyncRawResourceClient, RawResourceClient if typing.TYPE_CHECKING: from .language.client import AsyncLanguageClient, LanguageClient from .segment.client import AsyncSegmentClient, SegmentClient from .speaker.client import AsyncSpeakerClient, SpeakerClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ResourceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawResourceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._language: typing.Optional[LanguageClient] = None self._segment: typing.Optional[SegmentClient] = None self._speaker: typing.Optional[SpeakerClient] = None @property def with_raw_response(self) -> RawResourceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawResourceClient """ return self._raw_client def get(self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DubbingResource: """ Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingResource Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.get( dubbing_id="dubbing_id", ) """ _response = self._raw_client.get(dubbing_id, request_options=request_options) return _response.data def migrate_segments( self, dubbing_id: str, *, segment_ids: typing.Sequence[str], speaker_id: str, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentMigrationResponse: """ Change the attribution of one or more segments to a different speaker. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_ids : typing.Sequence[str] speaker_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentMigrationResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.migrate_segments( dubbing_id="dubbing_id", segment_ids=["segment_ids"], speaker_id="speaker_id", ) """ _response = self._raw_client.migrate_segments( dubbing_id, segment_ids=segment_ids, speaker_id=speaker_id, request_options=request_options ) return _response.data def transcribe( self, dubbing_id: str, *, segments: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> SegmentTranscriptionResponse: """ Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Transcribe this specific list of segments. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentTranscriptionResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.transcribe( dubbing_id="dubbing_id", segments=["segments"], ) """ _response = self._raw_client.transcribe(dubbing_id, segments=segments, request_options=request_options) return _response.data def translate( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentTranslationResponse: """ Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Translate only this list of segments. languages : typing.Optional[typing.Sequence[str]] Translate only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentTranslationResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.translate( dubbing_id="dubbing_id", segments=["segments"], ) """ _response = self._raw_client.translate( dubbing_id, segments=segments, languages=languages, request_options=request_options ) return _response.data def dub( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentDubResponse: """ 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. segments : typing.Sequence[str] Dub only this list of segments. languages : typing.Optional[typing.Sequence[str]] Dub only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentDubResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.dub( dubbing_id="dubbing_id", segments=["segments"], ) """ _response = self._raw_client.dub( dubbing_id, segments=segments, languages=languages, request_options=request_options ) return _response.data def render( self, dubbing_id: str, language: str, *, render_type: RenderType, normalize_volume: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingRenderResponseModel: """ Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint. Parameters ---------- dubbing_id : str ID of the dubbing project. language : str The target language code to render, eg. 'es'. To render the source track use 'original'. render_type : RenderType The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] normalize_volume : typing.Optional[bool] Whether to normalize the volume of the rendered audio. 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.resource.render( dubbing_id="dubbing_id", language="language", render_type="mp4", ) """ _response = self._raw_client.render( dubbing_id, language, render_type=render_type, normalize_volume=normalize_volume, request_options=request_options, ) return _response.data @property def language(self): if self._language is None: from .language.client import LanguageClient # noqa: E402 self._language = LanguageClient(client_wrapper=self._client_wrapper) return self._language @property def segment(self): if self._segment is None: from .segment.client import SegmentClient # noqa: E402 self._segment = SegmentClient(client_wrapper=self._client_wrapper) return self._segment @property def speaker(self): if self._speaker is None: from .speaker.client import SpeakerClient # noqa: E402 self._speaker = SpeakerClient(client_wrapper=self._client_wrapper) return self._speaker class AsyncResourceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawResourceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._language: typing.Optional[AsyncLanguageClient] = None self._segment: typing.Optional[AsyncSegmentClient] = None self._speaker: typing.Optional[AsyncSpeakerClient] = None @property def with_raw_response(self) -> AsyncRawResourceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawResourceClient """ return self._raw_client async def get(self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DubbingResource: """ Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingResource Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.get( dubbing_id="dubbing_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(dubbing_id, request_options=request_options) return _response.data async def migrate_segments( self, dubbing_id: str, *, segment_ids: typing.Sequence[str], speaker_id: str, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentMigrationResponse: """ Change the attribution of one or more segments to a different speaker. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_ids : typing.Sequence[str] speaker_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentMigrationResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.migrate_segments( dubbing_id="dubbing_id", segment_ids=["segment_ids"], speaker_id="speaker_id", ) asyncio.run(main()) """ _response = await self._raw_client.migrate_segments( dubbing_id, segment_ids=segment_ids, speaker_id=speaker_id, request_options=request_options ) return _response.data async def transcribe( self, dubbing_id: str, *, segments: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> SegmentTranscriptionResponse: """ Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Transcribe this specific list of segments. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentTranscriptionResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.transcribe( dubbing_id="dubbing_id", segments=["segments"], ) asyncio.run(main()) """ _response = await self._raw_client.transcribe(dubbing_id, segments=segments, request_options=request_options) return _response.data async def translate( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentTranslationResponse: """ Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Translate only this list of segments. languages : typing.Optional[typing.Sequence[str]] Translate only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentTranslationResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.translate( dubbing_id="dubbing_id", segments=["segments"], ) asyncio.run(main()) """ _response = await self._raw_client.translate( dubbing_id, segments=segments, languages=languages, request_options=request_options ) return _response.data async def dub( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentDubResponse: """ 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. segments : typing.Sequence[str] Dub only this list of segments. languages : typing.Optional[typing.Sequence[str]] Dub only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentDubResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.dub( dubbing_id="dubbing_id", segments=["segments"], ) asyncio.run(main()) """ _response = await self._raw_client.dub( dubbing_id, segments=segments, languages=languages, request_options=request_options ) return _response.data async def render( self, dubbing_id: str, language: str, *, render_type: RenderType, normalize_volume: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingRenderResponseModel: """ Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint. Parameters ---------- dubbing_id : str ID of the dubbing project. language : str The target language code to render, eg. 'es'. To render the source track use 'original'. render_type : RenderType The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] normalize_volume : typing.Optional[bool] Whether to normalize the volume of the rendered audio. 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.resource.render( dubbing_id="dubbing_id", language="language", render_type="mp4", ) asyncio.run(main()) """ _response = await self._raw_client.render( dubbing_id, language, render_type=render_type, normalize_volume=normalize_volume, request_options=request_options, ) return _response.data @property def language(self): if self._language is None: from .language.client import AsyncLanguageClient # noqa: E402 self._language = AsyncLanguageClient(client_wrapper=self._client_wrapper) return self._language @property def segment(self): if self._segment is None: from .segment.client import AsyncSegmentClient # noqa: E402 self._segment = AsyncSegmentClient(client_wrapper=self._client_wrapper) return self._segment @property def speaker(self): if self._speaker is None: from .speaker.client import AsyncSpeakerClient # noqa: E402 self._speaker = AsyncSpeakerClient(client_wrapper=self._client_wrapper) return self._speaker elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/language/000077500000000000000000000000001523660243400275655ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/language/__init__.py000066400000000000000000000001251523660243400316740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/language/client.py000066400000000000000000000071701523660243400314220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.language_added_response import LanguageAddedResponse from .raw_client import AsyncRawLanguageClient, RawLanguageClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class LanguageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLanguageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLanguageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLanguageClient """ return self._raw_client def add( self, dubbing_id: str, *, language: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> LanguageAddedResponse: """ Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. language : typing.Optional[str] The Target language. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LanguageAddedResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.language.add( dubbing_id="dubbing_id", ) """ _response = self._raw_client.add(dubbing_id, language=language, request_options=request_options) return _response.data class AsyncLanguageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLanguageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLanguageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLanguageClient """ return self._raw_client async def add( self, dubbing_id: str, *, language: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> LanguageAddedResponse: """ Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. language : typing.Optional[str] The Target language. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LanguageAddedResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.language.add( dubbing_id="dubbing_id", ) asyncio.run(main()) """ _response = await self._raw_client.add(dubbing_id, language=language, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/language/raw_client.py000066400000000000000000000140301523660243400322640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.language_added_response import LanguageAddedResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawLanguageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def add( self, dubbing_id: str, *, language: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[LanguageAddedResponse]: """ Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. language : typing.Optional[str] The Target language. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[LanguageAddedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/language", method="POST", json={ "language": language, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LanguageAddedResponse, construct_type( type_=LanguageAddedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLanguageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def add( self, dubbing_id: str, *, language: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[LanguageAddedResponse]: """ Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. language : typing.Optional[str] The Target language. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[LanguageAddedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/language", method="POST", json={ "language": language, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LanguageAddedResponse, construct_type( type_=LanguageAddedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/raw_client.py000066400000000000000000001021071523660243400305040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.dubbing_render_response_model import DubbingRenderResponseModel from ...types.dubbing_resource import DubbingResource from ...types.render_type import RenderType from ...types.segment_dub_response import SegmentDubResponse from ...types.segment_migration_response import SegmentMigrationResponse from ...types.segment_transcription_response import SegmentTranscriptionResponse from ...types.segment_translation_response import SegmentTranslationResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawResourceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DubbingResource]: """ Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingResource] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingResource, construct_type( type_=DubbingResource, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def migrate_segments( self, dubbing_id: str, *, segment_ids: typing.Sequence[str], speaker_id: str, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentMigrationResponse]: """ Change the attribution of one or more segments to a different speaker. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_ids : typing.Sequence[str] speaker_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentMigrationResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/migrate-segments", method="POST", json={ "segment_ids": segment_ids, "speaker_id": speaker_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentMigrationResponse, construct_type( type_=SegmentMigrationResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def transcribe( self, dubbing_id: str, *, segments: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentTranscriptionResponse]: """ Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Transcribe this specific list of segments. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentTranscriptionResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/transcribe", method="POST", json={ "segments": segments, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentTranscriptionResponse, construct_type( type_=SegmentTranscriptionResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def translate( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentTranslationResponse]: """ Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Translate only this list of segments. languages : typing.Optional[typing.Sequence[str]] Translate only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentTranslationResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/translate", method="POST", json={ "segments": segments, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentTranslationResponse, construct_type( type_=SegmentTranslationResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def dub( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentDubResponse]: """ 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. segments : typing.Sequence[str] Dub only this list of segments. languages : typing.Optional[typing.Sequence[str]] Dub only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentDubResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/dub", method="POST", json={ "segments": segments, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentDubResponse, construct_type( type_=SegmentDubResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def render( self, dubbing_id: str, language: str, *, render_type: RenderType, normalize_volume: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingRenderResponseModel]: """ Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint. Parameters ---------- dubbing_id : str ID of the dubbing project. language : str The target language code to render, eg. 'es'. To render the source track use 'original'. render_type : RenderType The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] normalize_volume : typing.Optional[bool] Whether to normalize the volume of the rendered audio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingRenderResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/render/{jsonable_encoder(language)}", method="POST", json={ "render_type": render_type, "normalize_volume": normalize_volume, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingRenderResponseModel, construct_type( type_=DubbingRenderResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawResourceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DubbingResource]: """ Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. Parameters ---------- dubbing_id : str ID of the dubbing project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingResource] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingResource, construct_type( type_=DubbingResource, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def migrate_segments( self, dubbing_id: str, *, segment_ids: typing.Sequence[str], speaker_id: str, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentMigrationResponse]: """ Change the attribution of one or more segments to a different speaker. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_ids : typing.Sequence[str] speaker_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentMigrationResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/migrate-segments", method="POST", json={ "segment_ids": segment_ids, "speaker_id": speaker_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentMigrationResponse, construct_type( type_=SegmentMigrationResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def transcribe( self, dubbing_id: str, *, segments: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentTranscriptionResponse]: """ Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Transcribe this specific list of segments. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentTranscriptionResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/transcribe", method="POST", json={ "segments": segments, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentTranscriptionResponse, construct_type( type_=SegmentTranscriptionResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def translate( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentTranslationResponse]: """ Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. Parameters ---------- dubbing_id : str ID of the dubbing project. segments : typing.Sequence[str] Translate only this list of segments. languages : typing.Optional[typing.Sequence[str]] Translate only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentTranslationResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/translate", method="POST", json={ "segments": segments, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentTranslationResponse, construct_type( type_=SegmentTranslationResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def dub( self, dubbing_id: str, *, segments: typing.Sequence[str], languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentDubResponse]: """ 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. segments : typing.Sequence[str] Dub only this list of segments. languages : typing.Optional[typing.Sequence[str]] Dub only these languages for each segment. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentDubResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/dub", method="POST", json={ "segments": segments, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentDubResponse, construct_type( type_=SegmentDubResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def render( self, dubbing_id: str, language: str, *, render_type: RenderType, normalize_volume: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingRenderResponseModel]: """ Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint. Parameters ---------- dubbing_id : str ID of the dubbing project. language : str The target language code to render, eg. 'es'. To render the source track use 'original'. render_type : RenderType The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] normalize_volume : typing.Optional[bool] Whether to normalize the volume of the rendered audio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingRenderResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/render/{jsonable_encoder(language)}", method="POST", json={ "render_type": render_type, "normalize_volume": normalize_volume, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingRenderResponseModel, construct_type( type_=DubbingRenderResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/segment/000077500000000000000000000000001523660243400274445ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/segment/__init__.py000066400000000000000000000001251523660243400315530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/segment/client.py000066400000000000000000000156261523660243400313060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.segment_delete_response import SegmentDeleteResponse from ....types.segment_update_response import SegmentUpdateResponse from .raw_client import AsyncRawSegmentClient, RawSegmentClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SegmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSegmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSegmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSegmentClient """ return self._raw_client def update( self, dubbing_id: str, segment_id: str, language: str, *, start_time: typing.Optional[float] = OMIT, end_time: typing.Optional[float] = OMIT, text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentUpdateResponse: """ Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment language : str ID of the language. start_time : typing.Optional[float] end_time : typing.Optional[float] text : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.segment.update( dubbing_id="dubbing_id", segment_id="segment_id", language="language", ) """ _response = self._raw_client.update( dubbing_id, segment_id, language, start_time=start_time, end_time=end_time, text=text, request_options=request_options, ) return _response.data def delete( self, dubbing_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SegmentDeleteResponse: """ Deletes a single segment from the dubbing. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentDeleteResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.segment.delete( dubbing_id="dubbing_id", segment_id="segment_id", ) """ _response = self._raw_client.delete(dubbing_id, segment_id, request_options=request_options) return _response.data class AsyncSegmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSegmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSegmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSegmentClient """ return self._raw_client async def update( self, dubbing_id: str, segment_id: str, language: str, *, start_time: typing.Optional[float] = OMIT, end_time: typing.Optional[float] = OMIT, text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentUpdateResponse: """ Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment language : str ID of the language. start_time : typing.Optional[float] end_time : typing.Optional[float] text : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.segment.update( dubbing_id="dubbing_id", segment_id="segment_id", language="language", ) asyncio.run(main()) """ _response = await self._raw_client.update( dubbing_id, segment_id, language, start_time=start_time, end_time=end_time, text=text, request_options=request_options, ) return _response.data async def delete( self, dubbing_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SegmentDeleteResponse: """ Deletes a single segment from the dubbing. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentDeleteResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.segment.delete( dubbing_id="dubbing_id", segment_id="segment_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(dubbing_id, segment_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/segment/raw_client.py000066400000000000000000000266311523660243400321550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.segment_delete_response import SegmentDeleteResponse from ....types.segment_update_response import SegmentUpdateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSegmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def update( self, dubbing_id: str, segment_id: str, language: str, *, start_time: typing.Optional[float] = OMIT, end_time: typing.Optional[float] = OMIT, text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentUpdateResponse]: """ Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment language : str ID of the language. start_time : typing.Optional[float] end_time : typing.Optional[float] text : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/segment/{jsonable_encoder(segment_id)}/{jsonable_encoder(language)}", method="PATCH", json={ "start_time": start_time, "end_time": end_time, "text": text, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentUpdateResponse, construct_type( type_=SegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, dubbing_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SegmentDeleteResponse]: """ Deletes a single segment from the dubbing. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentDeleteResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/segment/{jsonable_encoder(segment_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentDeleteResponse, construct_type( type_=SegmentDeleteResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSegmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def update( self, dubbing_id: str, segment_id: str, language: str, *, start_time: typing.Optional[float] = OMIT, end_time: typing.Optional[float] = OMIT, text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentUpdateResponse]: """ Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment language : str ID of the language. start_time : typing.Optional[float] end_time : typing.Optional[float] text : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/segment/{jsonable_encoder(segment_id)}/{jsonable_encoder(language)}", method="PATCH", json={ "start_time": start_time, "end_time": end_time, "text": text, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentUpdateResponse, construct_type( type_=SegmentUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, dubbing_id: str, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SegmentDeleteResponse]: """ Deletes a single segment from the dubbing. Parameters ---------- dubbing_id : str ID of the dubbing project. segment_id : str ID of the segment request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentDeleteResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/segment/{jsonable_encoder(segment_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentDeleteResponse, construct_type( type_=SegmentDeleteResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/000077500000000000000000000000001523660243400274345ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/__init__.py000066400000000000000000000020161523660243400315440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import segment _dynamic_imports: typing.Dict[str, str] = {"segment": ".segment"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["segment"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/client.py000066400000000000000000000354061523660243400312740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse from ....types.speaker_created_response import SpeakerCreatedResponse from ....types.speaker_updated_response import SpeakerUpdatedResponse from .raw_client import AsyncRawSpeakerClient, RawSpeakerClient if typing.TYPE_CHECKING: from .segment.client import AsyncSegmentClient, SegmentClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SpeakerClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSpeakerClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._segment: typing.Optional[SegmentClient] = None @property def with_raw_response(self) -> RawSpeakerClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSpeakerClient """ return self._raw_client def update( self, dubbing_id: str, speaker_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeakerUpdatedResponse: """ Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. languages : typing.Optional[typing.Sequence[str]] Languages to apply these changes to. If empty, will apply to all languages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeakerUpdatedResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.speaker.update( dubbing_id="dubbing_id", speaker_id="speaker_id", ) """ _response = self._raw_client.update( dubbing_id, speaker_id, speaker_name=speaker_name, voice_id=voice_id, voice_stability=voice_stability, voice_similarity=voice_similarity, voice_style=voice_style, languages=languages, request_options=request_options, ) return _response.data def create( self, dubbing_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeakerCreatedResponse: """ Creates a new speaker in a dubbing resource. The speaker is added to every available language and can optionally be associated with an ElevenLabs voice and voice settings. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeakerCreatedResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.speaker.create( dubbing_id="dubbing_id", ) """ _response = self._raw_client.create( dubbing_id, speaker_name=speaker_name, voice_id=voice_id, voice_stability=voice_stability, voice_similarity=voice_similarity, voice_style=voice_style, request_options=request_options, ) return _response.data def find_similar_voices( self, dubbing_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SimilarVoicesForSpeakerResponse: """ Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SimilarVoicesForSpeakerResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.speaker.find_similar_voices( dubbing_id="dubbing_id", speaker_id="speaker_id", ) """ _response = self._raw_client.find_similar_voices(dubbing_id, speaker_id, request_options=request_options) return _response.data @property def segment(self): if self._segment is None: from .segment.client import SegmentClient # noqa: E402 self._segment = SegmentClient(client_wrapper=self._client_wrapper) return self._segment class AsyncSpeakerClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSpeakerClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._segment: typing.Optional[AsyncSegmentClient] = None @property def with_raw_response(self) -> AsyncRawSpeakerClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSpeakerClient """ return self._raw_client async def update( self, dubbing_id: str, speaker_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeakerUpdatedResponse: """ Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. languages : typing.Optional[typing.Sequence[str]] Languages to apply these changes to. If empty, will apply to all languages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeakerUpdatedResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.speaker.update( dubbing_id="dubbing_id", speaker_id="speaker_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( dubbing_id, speaker_id, speaker_name=speaker_name, voice_id=voice_id, voice_stability=voice_stability, voice_similarity=voice_similarity, voice_style=voice_style, languages=languages, request_options=request_options, ) return _response.data async def create( self, dubbing_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeakerCreatedResponse: """ Creates a new speaker in a dubbing resource. The speaker is added to every available language and can optionally be associated with an ElevenLabs voice and voice settings. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeakerCreatedResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.speaker.create( dubbing_id="dubbing_id", ) asyncio.run(main()) """ _response = await self._raw_client.create( dubbing_id, speaker_name=speaker_name, voice_id=voice_id, voice_stability=voice_stability, voice_similarity=voice_similarity, voice_style=voice_style, request_options=request_options, ) return _response.data async def find_similar_voices( self, dubbing_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SimilarVoicesForSpeakerResponse: """ Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SimilarVoicesForSpeakerResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.speaker.find_similar_voices( dubbing_id="dubbing_id", speaker_id="speaker_id", ) asyncio.run(main()) """ _response = await self._raw_client.find_similar_voices(dubbing_id, speaker_id, request_options=request_options) return _response.data @property def segment(self): if self._segment is None: from .segment.client import AsyncSegmentClient # noqa: E402 self._segment = AsyncSegmentClient(client_wrapper=self._client_wrapper) return self._segment elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/raw_client.py000066400000000000000000000522201523660243400321360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse from ....types.speaker_created_response import SpeakerCreatedResponse from ....types.speaker_updated_response import SpeakerUpdatedResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSpeakerClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def update( self, dubbing_id: str, speaker_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeakerUpdatedResponse]: """ Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. languages : typing.Optional[typing.Sequence[str]] Languages to apply these changes to. If empty, will apply to all languages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeakerUpdatedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}", method="PATCH", json={ "speaker_name": speaker_name, "voice_id": voice_id, "voice_stability": voice_stability, "voice_similarity": voice_similarity, "voice_style": voice_style, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerUpdatedResponse, construct_type( type_=SpeakerUpdatedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, dubbing_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeakerCreatedResponse]: """ Creates a new speaker in a dubbing resource. The speaker is added to every available language and can optionally be associated with an ElevenLabs voice and voice settings. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeakerCreatedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker", method="POST", json={ "speaker_name": speaker_name, "voice_id": voice_id, "voice_stability": voice_stability, "voice_similarity": voice_similarity, "voice_style": voice_style, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerCreatedResponse, construct_type( type_=SpeakerCreatedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def find_similar_voices( self, dubbing_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SimilarVoicesForSpeakerResponse]: """ Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SimilarVoicesForSpeakerResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/similar-voices", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SimilarVoicesForSpeakerResponse, construct_type( type_=SimilarVoicesForSpeakerResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSpeakerClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def update( self, dubbing_id: str, speaker_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, languages: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeakerUpdatedResponse]: """ Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. languages : typing.Optional[typing.Sequence[str]] Languages to apply these changes to. If empty, will apply to all languages. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeakerUpdatedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}", method="PATCH", json={ "speaker_name": speaker_name, "voice_id": voice_id, "voice_stability": voice_stability, "voice_similarity": voice_similarity, "voice_style": voice_style, "languages": languages, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerUpdatedResponse, construct_type( type_=SpeakerUpdatedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, dubbing_id: str, *, speaker_name: typing.Optional[str] = OMIT, voice_id: typing.Optional[str] = OMIT, voice_stability: typing.Optional[float] = OMIT, voice_similarity: typing.Optional[float] = OMIT, voice_style: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeakerCreatedResponse]: """ Creates a new speaker in a dubbing resource. The speaker is added to every available language and can optionally be associated with an ElevenLabs voice and voice settings. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_name : typing.Optional[str] Name to attribute to this speaker. voice_id : typing.Optional[str] Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. voice_stability : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 0.65, with a valid range of [0.0, 1.0]. voice_similarity : typing.Optional[float] For models that support it, the voice similarity value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. voice_style : typing.Optional[float] For models that support it, the voice style value to use. This will default to 1.0, with a valid range of [0.0, 1.0]. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeakerCreatedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker", method="POST", json={ "speaker_name": speaker_name, "voice_id": voice_id, "voice_stability": voice_stability, "voice_similarity": voice_similarity, "voice_style": voice_style, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerCreatedResponse, construct_type( type_=SpeakerCreatedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def find_similar_voices( self, dubbing_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SimilarVoicesForSpeakerResponse]: """ Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SimilarVoicesForSpeakerResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/similar-voices", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SimilarVoicesForSpeakerResponse, construct_type( type_=SimilarVoicesForSpeakerResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/segment/000077500000000000000000000000001523660243400310765ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/segment/__init__.py000066400000000000000000000001251523660243400332050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/segment/client.py000066400000000000000000000115531523660243400327330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.segment_create_response import SegmentCreateResponse from .raw_client import AsyncRawSegmentClient, RawSegmentClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SegmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSegmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSegmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSegmentClient """ return self._raw_client def create( self, dubbing_id: str, speaker_id: str, *, start_time: float, end_time: float, text: typing.Optional[str] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentCreateResponse: """ Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. start_time : float end_time : float text : typing.Optional[str] translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentCreateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.resource.speaker.segment.create( dubbing_id="dubbing_id", speaker_id="speaker_id", start_time=1.1, end_time=1.1, ) """ _response = self._raw_client.create( dubbing_id, speaker_id, start_time=start_time, end_time=end_time, text=text, translations=translations, request_options=request_options, ) return _response.data class AsyncSegmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSegmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSegmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSegmentClient """ return self._raw_client async def create( self, dubbing_id: str, speaker_id: str, *, start_time: float, end_time: float, text: typing.Optional[str] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SegmentCreateResponse: """ Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. start_time : float end_time : float text : typing.Optional[str] translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SegmentCreateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.resource.speaker.segment.create( dubbing_id="dubbing_id", speaker_id="speaker_id", start_time=1.1, end_time=1.1, ) asyncio.run(main()) """ _response = await self._raw_client.create( dubbing_id, speaker_id, start_time=start_time, end_time=end_time, text=text, translations=translations, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/resource/speaker/segment/raw_client.py000066400000000000000000000160451523660243400336050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.segment_create_response import SegmentCreateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSegmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, dubbing_id: str, speaker_id: str, *, start_time: float, end_time: float, text: typing.Optional[str] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SegmentCreateResponse]: """ Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. start_time : float end_time : float text : typing.Optional[str] translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SegmentCreateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", method="POST", json={ "start_time": start_time, "end_time": end_time, "text": text, "translations": translations, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentCreateResponse, construct_type( type_=SegmentCreateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSegmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, dubbing_id: str, speaker_id: str, *, start_time: float, end_time: float, text: typing.Optional[str] = OMIT, translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SegmentCreateResponse]: """ Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. Parameters ---------- dubbing_id : str ID of the dubbing project. speaker_id : str ID of the speaker. start_time : float end_time : float text : typing.Optional[str] translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SegmentCreateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", method="POST", json={ "start_time": start_time, "end_time": end_time, "text": text, "translations": translations, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SegmentCreateResponse, construct_type( type_=SegmentCreateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/000077500000000000000000000000001523660243400263445ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/__init__.py000066400000000000000000000024241523660243400304570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import TranscriptGetTranscriptForDubRequestFormatType, TranscriptGetTranscriptForDubResponse _dynamic_imports: typing.Dict[str, str] = { "TranscriptGetTranscriptForDubRequestFormatType": ".types", "TranscriptGetTranscriptForDubResponse": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptGetTranscriptForDubRequestFormatType", "TranscriptGetTranscriptForDubResponse"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/client.py000066400000000000000000000114051523660243400301750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawTranscriptClient, RawTranscriptClient from .types.transcript_get_transcript_for_dub_request_format_type import TranscriptGetTranscriptForDubRequestFormatType from .types.transcript_get_transcript_for_dub_response import TranscriptGetTranscriptForDubResponse class TranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTranscriptClient """ return self._raw_client def get_transcript_for_dub( self, dubbing_id: str, language_code: str, *, format_type: typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> TranscriptGetTranscriptForDubResponse: """ Returns transcript for the dub as an SRT or WEBVTT file. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TranscriptGetTranscriptForDubResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.transcript.get_transcript_for_dub( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) """ _response = self._raw_client.get_transcript_for_dub( dubbing_id, language_code, format_type=format_type, request_options=request_options ) return _response.data class AsyncTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTranscriptClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTranscriptClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTranscriptClient """ return self._raw_client async def get_transcript_for_dub( self, dubbing_id: str, language_code: str, *, format_type: typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> TranscriptGetTranscriptForDubResponse: """ Returns transcript for the dub as an SRT or WEBVTT file. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TranscriptGetTranscriptForDubResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.transcript.get_transcript_for_dub( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) asyncio.run(main()) """ _response = await self._raw_client.get_transcript_for_dub( dubbing_id, language_code, format_type=format_type, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/raw_client.py000066400000000000000000000227261523660243400310560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.too_early_error import TooEarlyError from ...errors.unprocessable_entity_error import UnprocessableEntityError from .types.transcript_get_transcript_for_dub_request_format_type import TranscriptGetTranscriptForDubRequestFormatType from .types.transcript_get_transcript_for_dub_response import TranscriptGetTranscriptForDubResponse from pydantic import ValidationError class RawTranscriptClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_transcript_for_dub( self, dubbing_id: str, language_code: str, *, format_type: typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[TranscriptGetTranscriptForDubResponse]: """ Returns transcript for the dub as an SRT or WEBVTT file. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TranscriptGetTranscriptForDubResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/transcript/{jsonable_encoder(language_code)}", method="GET", params={ "format_type": format_type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TranscriptGetTranscriptForDubResponse, construct_type( type_=TranscriptGetTranscriptForDubResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 425: raise TooEarlyError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTranscriptClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_transcript_for_dub( self, dubbing_id: str, language_code: str, *, format_type: typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[TranscriptGetTranscriptForDubResponse]: """ Returns transcript for the dub as an SRT or WEBVTT file. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : typing.Optional[TranscriptGetTranscriptForDubRequestFormatType] Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TranscriptGetTranscriptForDubResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/transcript/{jsonable_encoder(language_code)}", method="GET", params={ "format_type": format_type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TranscriptGetTranscriptForDubResponse, construct_type( type_=TranscriptGetTranscriptForDubResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 425: raise TooEarlyError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/types/000077500000000000000000000000001523660243400275105ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/types/__init__.py000066400000000000000000000027241523660243400316260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .transcript_get_transcript_for_dub_request_format_type import TranscriptGetTranscriptForDubRequestFormatType from .transcript_get_transcript_for_dub_response import TranscriptGetTranscriptForDubResponse _dynamic_imports: typing.Dict[str, str] = { "TranscriptGetTranscriptForDubRequestFormatType": ".transcript_get_transcript_for_dub_request_format_type", "TranscriptGetTranscriptForDubResponse": ".transcript_get_transcript_for_dub_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptGetTranscriptForDubRequestFormatType", "TranscriptGetTranscriptForDubResponse"] transcript_get_transcript_for_dub_request_format_type.py000066400000000000000000000003031523660243400431610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/types# This file was auto-generated by Fern from our API Definition. import typing TranscriptGetTranscriptForDubRequestFormatType = typing.Union[typing.Literal["srt", "webvtt", "json"], typing.Any] transcript_get_transcript_for_dub_response.py000066400000000000000000000004021523660243400407160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcript/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.dubbing_transcript_response_model import DubbingTranscriptResponseModel TranscriptGetTranscriptForDubResponse = typing.Union[DubbingTranscriptResponseModel, str] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/000077500000000000000000000000001523660243400265275ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/__init__.py000066400000000000000000000021311523660243400306350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import TranscriptsGetRequestFormatType _dynamic_imports: typing.Dict[str, str] = {"TranscriptsGetRequestFormatType": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptsGetRequestFormatType"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/client.py000066400000000000000000000106061523660243400303620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.dubbing_transcripts_response_model import DubbingTranscriptsResponseModel from .raw_client import AsyncRawTranscriptsClient, RawTranscriptsClient from .types.transcripts_get_request_format_type import TranscriptsGetRequestFormatType class TranscriptsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTranscriptsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTranscriptsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTranscriptsClient """ return self._raw_client def get( self, dubbing_id: str, language_code: str, format_type: TranscriptsGetRequestFormatType, *, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingTranscriptsResponseModel: """ Fetch the transcript for one of the languages in a dub. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : TranscriptsGetRequestFormatType Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTranscriptsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.dubbing.transcripts.get( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) """ _response = self._raw_client.get(dubbing_id, language_code, format_type, request_options=request_options) return _response.data class AsyncTranscriptsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTranscriptsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTranscriptsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTranscriptsClient """ return self._raw_client async def get( self, dubbing_id: str, language_code: str, format_type: TranscriptsGetRequestFormatType, *, request_options: typing.Optional[RequestOptions] = None, ) -> DubbingTranscriptsResponseModel: """ Fetch the transcript for one of the languages in a dub. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : TranscriptsGetRequestFormatType Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DubbingTranscriptsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.dubbing.transcripts.get( dubbing_id="dubbing_id", language_code="source", format_type="srt", ) asyncio.run(main()) """ _response = await self._raw_client.get(dubbing_id, language_code, format_type, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/raw_client.py000066400000000000000000000146601523660243400312370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.dubbing_transcripts_response_model import DubbingTranscriptsResponseModel from .types.transcripts_get_request_format_type import TranscriptsGetRequestFormatType from pydantic import ValidationError class RawTranscriptsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, dubbing_id: str, language_code: str, format_type: TranscriptsGetRequestFormatType, *, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DubbingTranscriptsResponseModel]: """ Fetch the transcript for one of the languages in a dub. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : TranscriptsGetRequestFormatType Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DubbingTranscriptsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/transcripts/{jsonable_encoder(language_code)}/format/{jsonable_encoder(format_type)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTranscriptsResponseModel, construct_type( type_=DubbingTranscriptsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTranscriptsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, dubbing_id: str, language_code: str, format_type: TranscriptsGetRequestFormatType, *, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DubbingTranscriptsResponseModel]: """ Fetch the transcript for one of the languages in a dub. Parameters ---------- dubbing_id : str ID of the dubbing project. language_code : str ISO-693 language code to retrieve the transcript for. Use 'source' to fetch the transcript of the original media. format_type : TranscriptsGetRequestFormatType Format to return transcript in. For subtitles use either 'srt' or 'webvtt', and for a full transcript use 'json'. The 'json' format is not yet supported for Dubbing Studio. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DubbingTranscriptsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/dubbing/{jsonable_encoder(dubbing_id)}/transcripts/{jsonable_encoder(language_code)}/format/{jsonable_encoder(format_type)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DubbingTranscriptsResponseModel, construct_type( type_=DubbingTranscriptsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/types/000077500000000000000000000000001523660243400276735ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/types/__init__.py000066400000000000000000000022251523660243400320050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .transcripts_get_request_format_type import TranscriptsGetRequestFormatType _dynamic_imports: typing.Dict[str, str] = {"TranscriptsGetRequestFormatType": ".transcripts_get_request_format_type"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptsGetRequestFormatType"] transcripts_get_request_format_type.py000066400000000000000000000002641523660243400375640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/transcripts/types# This file was auto-generated by Fern from our API Definition. import typing TranscriptsGetRequestFormatType = typing.Union[typing.Literal["srt", "webvtt", "json"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types/000077500000000000000000000000001523660243400253175ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types/__init__.py000066400000000000000000000050401523660243400274270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .dub_request_mode import DubRequestMode from .dubbing_list_request_creation_sources_item import DubbingListRequestCreationSourcesItem from .dubbing_list_request_dubbing_models_item import DubbingListRequestDubbingModelsItem from .dubbing_list_request_dubbing_status import DubbingListRequestDubbingStatus from .dubbing_list_request_dubbing_statuses_item import DubbingListRequestDubbingStatusesItem from .dubbing_list_request_filter_by_creator import DubbingListRequestFilterByCreator from .dubbing_list_request_order_by import DubbingListRequestOrderBy from .dubbing_list_request_order_direction import DubbingListRequestOrderDirection _dynamic_imports: typing.Dict[str, str] = { "DubRequestMode": ".dub_request_mode", "DubbingListRequestCreationSourcesItem": ".dubbing_list_request_creation_sources_item", "DubbingListRequestDubbingModelsItem": ".dubbing_list_request_dubbing_models_item", "DubbingListRequestDubbingStatus": ".dubbing_list_request_dubbing_status", "DubbingListRequestDubbingStatusesItem": ".dubbing_list_request_dubbing_statuses_item", "DubbingListRequestFilterByCreator": ".dubbing_list_request_filter_by_creator", "DubbingListRequestOrderBy": ".dubbing_list_request_order_by", "DubbingListRequestOrderDirection": ".dubbing_list_request_order_direction", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "DubRequestMode", "DubbingListRequestCreationSourcesItem", "DubbingListRequestDubbingModelsItem", "DubbingListRequestDubbingStatus", "DubbingListRequestDubbingStatusesItem", "DubbingListRequestFilterByCreator", "DubbingListRequestOrderBy", "DubbingListRequestOrderDirection", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types/dub_request_mode.py000066400000000000000000000002411523660243400312140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DubRequestMode = typing.Union[typing.Literal["automatic", "manual"], typing.Any] dubbing_list_request_creation_sources_item.py000066400000000000000000000003211523660243400364700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestCreationSourcesItem = typing.Union[ typing.Literal["flow_node", "dubbing_ui", "dubbing_api"], typing.Any ] dubbing_list_request_dubbing_models_item.py000066400000000000000000000002731523660243400361040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestDubbingModelsItem = typing.Union[typing.Literal["dubbing_v1", "dubbing_v2"], typing.Any] dubbing_list_request_dubbing_status.py000066400000000000000000000002721523660243400351250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestDubbingStatus = typing.Union[typing.Literal["dubbing", "dubbed", "failed"], typing.Any] dubbing_list_request_dubbing_statuses_item.py000066400000000000000000000003351523660243400364730ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestDubbingStatusesItem = typing.Union[ typing.Literal["queued", "preparing", "dubbing", "dubbed", "failed"], typing.Any ] dubbing_list_request_filter_by_creator.py000066400000000000000000000002721523660243400356060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestFilterByCreator = typing.Union[typing.Literal["personal", "others", "all"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types/dubbing_list_request_order_by.py000066400000000000000000000002531523660243400337730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestOrderBy = typing.Union[typing.Literal["created_at", "name"], typing.Any] dubbing_list_request_order_direction.py000066400000000000000000000002671523660243400352670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/dubbing/types# This file was auto-generated by Fern from our API Definition. import typing DubbingListRequestOrderDirection = typing.Union[typing.Literal["DESCENDING", "ASCENDING"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment.py000066400000000000000000000006301523660243400254560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import enum class ElevenLabsEnvironment(enum.Enum): PRODUCTION = "https://api.elevenlabs.io" PRODUCTION_US = "https://api.us.elevenlabs.io" PRODUCTION_EU = "https://api.eu.residency.elevenlabs.io" PRODUCTION_INDIA = "https://api.in.residency.elevenlabs.io" PRODUCTION_SINGAPORE = "https://api.sg.residency.elevenlabs.io" elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/000077500000000000000000000000001523660243400271355ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/__init__.py000066400000000000000000000037141523660243400312530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( EnvironmentVariablesCreateRequestBody, EnvironmentVariablesCreateRequestBody_AuthConnection, EnvironmentVariablesCreateRequestBody_Secret, EnvironmentVariablesCreateRequestBody_String, EnvironmentVariablesListRequestType, UpdateEnvironmentVariableRequestValuesValue, ) _dynamic_imports: typing.Dict[str, str] = { "EnvironmentVariablesCreateRequestBody": ".types", "EnvironmentVariablesCreateRequestBody_AuthConnection": ".types", "EnvironmentVariablesCreateRequestBody_Secret": ".types", "EnvironmentVariablesCreateRequestBody_String": ".types", "EnvironmentVariablesListRequestType": ".types", "UpdateEnvironmentVariableRequestValuesValue": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "EnvironmentVariablesCreateRequestBody", "EnvironmentVariablesCreateRequestBody_AuthConnection", "EnvironmentVariablesCreateRequestBody_Secret", "EnvironmentVariablesCreateRequestBody_String", "EnvironmentVariablesListRequestType", "UpdateEnvironmentVariableRequestValuesValue", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/client.py000066400000000000000000000310151523660243400307650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.environment_variable_response import EnvironmentVariableResponse from ..types.environment_variables_list_response import EnvironmentVariablesListResponse from .raw_client import AsyncRawEnvironmentVariablesClient, RawEnvironmentVariablesClient from .types.environment_variables_create_request_body import EnvironmentVariablesCreateRequestBody from .types.environment_variables_list_request_type import EnvironmentVariablesListRequestType from .types.update_environment_variable_request_values_value import UpdateEnvironmentVariableRequestValuesValue # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class EnvironmentVariablesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawEnvironmentVariablesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawEnvironmentVariablesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawEnvironmentVariablesClient """ return self._raw_client def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, label: typing.Optional[str] = None, environment: typing.Optional[str] = None, type: typing.Optional[EnvironmentVariablesListRequestType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> EnvironmentVariablesListResponse: """ List all environment variables for the workspace with optional filtering Parameters ---------- cursor : typing.Optional[str] Pagination cursor from previous response page_size : typing.Optional[int] Number of items to return (1-100) label : typing.Optional[str] Filter by exact label match environment : typing.Optional[str] Filter to only return variables that have this environment. When specified, the values dict in the response will only contain this environment. type : typing.Optional[EnvironmentVariablesListRequestType] Filter by variable type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariablesListResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.environment_variables.list( cursor="cursor", page_size=1, label="label", environment="environment", type="string", ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, label=label, environment=environment, type=type, request_options=request_options, ) return _response.data def create( self, *, request: EnvironmentVariablesCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> EnvironmentVariableResponse: """ Create a new environment variable for the workspace Parameters ---------- request : EnvironmentVariablesCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.environment_variables import ( EnvironmentVariablesCreateRequestBody_String, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.environment_variables.create( request=EnvironmentVariablesCreateRequestBody_String( label="label", values={"key": "value"}, ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def get( self, env_var_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> EnvironmentVariableResponse: """ Get a specific environment variable by ID Parameters ---------- env_var_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.environment_variables.get( env_var_id="env_var_id", ) """ _response = self._raw_client.get(env_var_id, request_options=request_options) return _response.data def update( self, env_var_id: str, *, values: typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], request_options: typing.Optional[RequestOptions] = None, ) -> EnvironmentVariableResponse: """ Replace an environment variable's values. Use null to remove an environment (except production). Parameters ---------- env_var_id : str values : typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]] Values to replace. Set to null to remove an environment (except 'production'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.environment_variables.update( env_var_id="env_var_id", values={}, ) """ _response = self._raw_client.update(env_var_id, values=values, request_options=request_options) return _response.data class AsyncEnvironmentVariablesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawEnvironmentVariablesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawEnvironmentVariablesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawEnvironmentVariablesClient """ return self._raw_client async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, label: typing.Optional[str] = None, environment: typing.Optional[str] = None, type: typing.Optional[EnvironmentVariablesListRequestType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> EnvironmentVariablesListResponse: """ List all environment variables for the workspace with optional filtering Parameters ---------- cursor : typing.Optional[str] Pagination cursor from previous response page_size : typing.Optional[int] Number of items to return (1-100) label : typing.Optional[str] Filter by exact label match environment : typing.Optional[str] Filter to only return variables that have this environment. When specified, the values dict in the response will only contain this environment. type : typing.Optional[EnvironmentVariablesListRequestType] Filter by variable type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariablesListResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.environment_variables.list( cursor="cursor", page_size=1, label="label", environment="environment", type="string", ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, label=label, environment=environment, type=type, request_options=request_options, ) return _response.data async def create( self, *, request: EnvironmentVariablesCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> EnvironmentVariableResponse: """ Create a new environment variable for the workspace Parameters ---------- request : EnvironmentVariablesCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.environment_variables import ( EnvironmentVariablesCreateRequestBody_String, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.environment_variables.create( request=EnvironmentVariablesCreateRequestBody_String( label="label", values={"key": "value"}, ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def get( self, env_var_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> EnvironmentVariableResponse: """ Get a specific environment variable by ID Parameters ---------- env_var_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.environment_variables.get( env_var_id="env_var_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(env_var_id, request_options=request_options) return _response.data async def update( self, env_var_id: str, *, values: typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], request_options: typing.Optional[RequestOptions] = None, ) -> EnvironmentVariableResponse: """ Replace an environment variable's values. Use null to remove an environment (except production). Parameters ---------- env_var_id : str values : typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]] Values to replace. Set to null to remove an environment (except 'production'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EnvironmentVariableResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.environment_variables.update( env_var_id="env_var_id", values={}, ) asyncio.run(main()) """ _response = await self._raw_client.update(env_var_id, values=values, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/raw_client.py000066400000000000000000000667671523660243400316640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.bad_request_error import BadRequestError from ..errors.conflict_error import ConflictError from ..errors.not_found_error import NotFoundError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.environment_variable_response import EnvironmentVariableResponse from ..types.environment_variables_list_response import EnvironmentVariablesListResponse from .types.environment_variables_create_request_body import EnvironmentVariablesCreateRequestBody from .types.environment_variables_list_request_type import EnvironmentVariablesListRequestType from .types.update_environment_variable_request_values_value import UpdateEnvironmentVariableRequestValuesValue from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawEnvironmentVariablesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, label: typing.Optional[str] = None, environment: typing.Optional[str] = None, type: typing.Optional[EnvironmentVariablesListRequestType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EnvironmentVariablesListResponse]: """ List all environment variables for the workspace with optional filtering Parameters ---------- cursor : typing.Optional[str] Pagination cursor from previous response page_size : typing.Optional[int] Number of items to return (1-100) label : typing.Optional[str] Filter by exact label match environment : typing.Optional[str] Filter to only return variables that have this environment. When specified, the values dict in the response will only contain this environment. type : typing.Optional[EnvironmentVariablesListRequestType] Filter by variable type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EnvironmentVariablesListResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/environment-variables", method="GET", params={ "cursor": cursor, "page_size": page_size, "label": label, "environment": environment, "type": type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariablesListResponse, construct_type( type_=EnvironmentVariablesListResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, request: EnvironmentVariablesCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[EnvironmentVariableResponse]: """ Create a new environment variable for the workspace Parameters ---------- request : EnvironmentVariablesCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EnvironmentVariableResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/convai/environment-variables", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=EnvironmentVariablesCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 409: raise ConflictError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, env_var_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[EnvironmentVariableResponse]: """ Get a specific environment variable by ID Parameters ---------- env_var_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EnvironmentVariableResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/environment-variables/{jsonable_encoder(env_var_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, env_var_id: str, *, values: typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EnvironmentVariableResponse]: """ Replace an environment variable's values. Use null to remove an environment (except production). Parameters ---------- env_var_id : str values : typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]] Values to replace. Set to null to remove an environment (except 'production'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EnvironmentVariableResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/environment-variables/{jsonable_encoder(env_var_id)}", method="PATCH", json={ "values": convert_and_respect_annotation_metadata( object_=values, annotation=typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawEnvironmentVariablesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, label: typing.Optional[str] = None, environment: typing.Optional[str] = None, type: typing.Optional[EnvironmentVariablesListRequestType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EnvironmentVariablesListResponse]: """ List all environment variables for the workspace with optional filtering Parameters ---------- cursor : typing.Optional[str] Pagination cursor from previous response page_size : typing.Optional[int] Number of items to return (1-100) label : typing.Optional[str] Filter by exact label match environment : typing.Optional[str] Filter to only return variables that have this environment. When specified, the values dict in the response will only contain this environment. type : typing.Optional[EnvironmentVariablesListRequestType] Filter by variable type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EnvironmentVariablesListResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/environment-variables", method="GET", params={ "cursor": cursor, "page_size": page_size, "label": label, "environment": environment, "type": type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariablesListResponse, construct_type( type_=EnvironmentVariablesListResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, request: EnvironmentVariablesCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[EnvironmentVariableResponse]: """ Create a new environment variable for the workspace Parameters ---------- request : EnvironmentVariablesCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EnvironmentVariableResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/convai/environment-variables", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=EnvironmentVariablesCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 409: raise ConflictError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, env_var_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[EnvironmentVariableResponse]: """ Get a specific environment variable by ID Parameters ---------- env_var_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EnvironmentVariableResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/environment-variables/{jsonable_encoder(env_var_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, env_var_id: str, *, values: typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EnvironmentVariableResponse]: """ Replace an environment variable's values. Use null to remove an environment (except production). Parameters ---------- env_var_id : str values : typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]] Values to replace. Set to null to remove an environment (except 'production'). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EnvironmentVariableResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/convai/environment-variables/{jsonable_encoder(env_var_id)}", method="PATCH", json={ "values": convert_and_respect_annotation_metadata( object_=values, annotation=typing.Dict[str, typing.Optional[UpdateEnvironmentVariableRequestValuesValue]], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EnvironmentVariableResponse, construct_type( type_=EnvironmentVariableResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/types/000077500000000000000000000000001523660243400303015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/types/__init__.py000066400000000000000000000044661523660243400324240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .environment_variables_create_request_body import ( EnvironmentVariablesCreateRequestBody, EnvironmentVariablesCreateRequestBody_AuthConnection, EnvironmentVariablesCreateRequestBody_Secret, EnvironmentVariablesCreateRequestBody_String, ) from .environment_variables_list_request_type import EnvironmentVariablesListRequestType from .update_environment_variable_request_values_value import UpdateEnvironmentVariableRequestValuesValue _dynamic_imports: typing.Dict[str, str] = { "EnvironmentVariablesCreateRequestBody": ".environment_variables_create_request_body", "EnvironmentVariablesCreateRequestBody_AuthConnection": ".environment_variables_create_request_body", "EnvironmentVariablesCreateRequestBody_Secret": ".environment_variables_create_request_body", "EnvironmentVariablesCreateRequestBody_String": ".environment_variables_create_request_body", "EnvironmentVariablesListRequestType": ".environment_variables_list_request_type", "UpdateEnvironmentVariableRequestValuesValue": ".update_environment_variable_request_values_value", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "EnvironmentVariablesCreateRequestBody", "EnvironmentVariablesCreateRequestBody_AuthConnection", "EnvironmentVariablesCreateRequestBody_Secret", "EnvironmentVariablesCreateRequestBody_String", "EnvironmentVariablesListRequestType", "UpdateEnvironmentVariableRequestValuesValue", ] environment_variables_create_request_body.py000066400000000000000000000044001523660243400412760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ...types.environment_variable_auth_connection_value_request import EnvironmentVariableAuthConnectionValueRequest from ...types.environment_variable_secret_value_request import EnvironmentVariableSecretValueRequest class EnvironmentVariablesCreateRequestBody_String(UncheckedBaseModel): type: typing.Literal["string"] = "string" label: str values: typing.Dict[str, 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 EnvironmentVariablesCreateRequestBody_Secret(UncheckedBaseModel): type: typing.Literal["secret"] = "secret" label: str values: typing.Dict[str, EnvironmentVariableSecretValueRequest] 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 EnvironmentVariablesCreateRequestBody_AuthConnection(UncheckedBaseModel): type: typing.Literal["auth_connection"] = "auth_connection" label: str values: typing.Dict[str, EnvironmentVariableAuthConnectionValueRequest] 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 EnvironmentVariablesCreateRequestBody = typing_extensions.Annotated[ typing.Union[ EnvironmentVariablesCreateRequestBody_String, EnvironmentVariablesCreateRequestBody_Secret, EnvironmentVariablesCreateRequestBody_AuthConnection, ], UnionMetadata(discriminant="type"), ] environment_variables_list_request_type.py000066400000000000000000000003061523660243400410330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/types# This file was auto-generated by Fern from our API Definition. import typing EnvironmentVariablesListRequestType = typing.Union[typing.Literal["string", "secret", "auth_connection"], typing.Any] update_environment_variable_request_values_value.py000066400000000000000000000007101523660243400426700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/environment_variables/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.environment_variable_auth_connection_value_request import EnvironmentVariableAuthConnectionValueRequest from ...types.environment_variable_secret_value_request import EnvironmentVariableSecretValueRequest UpdateEnvironmentVariableRequestValuesValue = typing.Union[ str, EnvironmentVariableSecretValueRequest, EnvironmentVariableAuthConnectionValueRequest ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/000077500000000000000000000000001523660243400240555ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/__init__.py000066400000000000000000000034471523660243400261760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .bad_request_error import BadRequestError from .conflict_error import ConflictError from .forbidden_error import ForbiddenError from .not_found_error import NotFoundError from .too_early_error import TooEarlyError from .unauthorized_error import UnauthorizedError from .unprocessable_entity_error import UnprocessableEntityError _dynamic_imports: typing.Dict[str, str] = { "BadRequestError": ".bad_request_error", "ConflictError": ".conflict_error", "ForbiddenError": ".forbidden_error", "NotFoundError": ".not_found_error", "TooEarlyError": ".too_early_error", "UnauthorizedError": ".unauthorized_error", "UnprocessableEntityError": ".unprocessable_entity_error", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BadRequestError", "ConflictError", "ForbiddenError", "NotFoundError", "TooEarlyError", "UnauthorizedError", "UnprocessableEntityError", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/bad_request_error.py000066400000000000000000000005011523660243400301320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class BadRequestError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=400, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/conflict_error.py000066400000000000000000000004771523660243400274510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class ConflictError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=409, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/forbidden_error.py000066400000000000000000000005001523660243400275670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class ForbiddenError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=403, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/not_found_error.py000066400000000000000000000004771523660243400276430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class NotFoundError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=404, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/too_early_error.py000066400000000000000000000004771523660243400276450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class TooEarlyError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=425, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/unauthorized_error.py000066400000000000000000000005031523660243400303570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class UnauthorizedError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=401, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/errors/unprocessable_entity_error.py000066400000000000000000000005121523660243400320770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.api_error import ApiError class UnprocessableEntityError(ApiError): def __init__(self, body: typing.Any, headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=422, headers=headers, body=body) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/forced_alignment/000077500000000000000000000000001523660243400260415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/forced_alignment/__init__.py000066400000000000000000000001251523660243400301500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/forced_alignment/client.py000066400000000000000000000075051523660243400277000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.forced_alignment_response_model import ForcedAlignmentResponseModel from .raw_client import AsyncRawForcedAlignmentClient, RawForcedAlignmentClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ForcedAlignmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawForcedAlignmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawForcedAlignmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawForcedAlignmentClient """ return self._raw_client def create( self, *, file: core.File, text: str, request_options: typing.Optional[RequestOptions] = None ) -> ForcedAlignmentResponseModel: """ Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. Parameters ---------- file : core.File See core.File for more documentation 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. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ForcedAlignmentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.forced_alignment.create( text="text", ) """ _response = self._raw_client.create(file=file, text=text, request_options=request_options) return _response.data class AsyncForcedAlignmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawForcedAlignmentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawForcedAlignmentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawForcedAlignmentClient """ return self._raw_client async def create( self, *, file: core.File, text: str, request_options: typing.Optional[RequestOptions] = None ) -> ForcedAlignmentResponseModel: """ Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. Parameters ---------- file : core.File See core.File for more documentation 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. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ForcedAlignmentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.forced_alignment.create( text="text", ) asyncio.run(main()) """ _response = await self._raw_client.create(file=file, text=text, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/forced_alignment/raw_client.py000066400000000000000000000141521523660243400305450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.forced_alignment_response_model import ForcedAlignmentResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawForcedAlignmentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, file: core.File, text: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ForcedAlignmentResponseModel]: """ Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. Parameters ---------- file : core.File See core.File for more documentation 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. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ForcedAlignmentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/forced-alignment", method="POST", data={ "text": text, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ForcedAlignmentResponseModel, construct_type( type_=ForcedAlignmentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawForcedAlignmentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, file: core.File, text: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ForcedAlignmentResponseModel]: """ Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. Parameters ---------- file : core.File See core.File for more documentation 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. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ForcedAlignmentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/forced-alignment", method="POST", data={ "text": text, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ForcedAlignmentResponseModel, construct_type( type_=ForcedAlignmentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/000077500000000000000000000000001523660243400242425ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/__init__.py000066400000000000000000000023001523660243400263460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import HistoryListRequestSortDirection, HistoryListRequestSource _dynamic_imports: typing.Dict[str, str] = { "HistoryListRequestSortDirection": ".types", "HistoryListRequestSource": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["HistoryListRequestSortDirection", "HistoryListRequestSource"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/client.py000066400000000000000000000452041523660243400260770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.delete_history_item_response import DeleteHistoryItemResponse from ..types.get_speech_history_response import GetSpeechHistoryResponse from ..types.speech_history_item_response import SpeechHistoryItemResponse from .raw_client import AsyncRawHistoryClient, RawHistoryClient from .types.history_list_request_sort_direction import HistoryListRequestSortDirection from .types.history_list_request_source import HistoryListRequestSource # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class HistoryClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawHistoryClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawHistoryClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawHistoryClient """ return self._raw_client def list( self, *, page_size: typing.Optional[int] = None, start_after_history_item_id: typing.Optional[str] = None, voice_id: typing.Optional[str] = None, model_id: typing.Optional[str] = None, date_before_unix: typing.Optional[int] = None, date_after_unix: typing.Optional[int] = None, sort_direction: typing.Optional[HistoryListRequestSortDirection] = None, search: typing.Optional[str] = None, source: typing.Optional[HistoryListRequestSource] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSpeechHistoryResponse: """ Returns a list of your generated audio (e.g. text to speech, speech to speech, Studio, dubbing). Music and SFX generations are not included and cannot currently be retrieved via the API. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Can not exceed 1000, defaults to 100. start_after_history_item_id : typing.Optional[str] After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date. voice_id : typing.Optional[str] ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. model_id : typing.Optional[str] Search term used for filtering history items. If provided, source becomes required. date_before_unix : typing.Optional[int] Unix timestamp to filter history items before this date (exclusive). date_after_unix : typing.Optional[int] Unix timestamp to filter history items after this date (inclusive). sort_direction : typing.Optional[HistoryListRequestSortDirection] Sort direction for the results. search : typing.Optional[str] search term used for filtering source : typing.Optional[HistoryListRequestSource] Source of the generated history item request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSpeechHistoryResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.history.list( page_size=1, start_after_history_item_id="start_after_history_item_id", voice_id="voice_id", model_id="model_id", date_before_unix=1, date_after_unix=1, sort_direction="asc", search="search", source="TTS", ) """ _response = self._raw_client.list( page_size=page_size, start_after_history_item_id=start_after_history_item_id, voice_id=voice_id, model_id=model_id, date_before_unix=date_before_unix, date_after_unix=date_after_unix, sort_direction=sort_direction, search=search, source=source, request_options=request_options, ) return _response.data def get( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SpeechHistoryItemResponse: """ Retrieves a history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechHistoryItemResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.history.get( history_item_id="VW7YKqPnjY4h39yTbx2L", ) """ _response = self._raw_client.get(history_item_id, request_options=request_options) return _response.data def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteHistoryItemResponse: """ Delete a history item by its ID Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteHistoryItemResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.history.delete( history_item_id="VW7YKqPnjY4h39yTbx2L", ) """ _response = self._raw_client.delete(history_item_id, request_options=request_options) return _response.data def get_audio( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Returns the audio of an history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. 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. Returns ------- typing.Iterator[bytes] The audio file of the history item. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.history.get_audio( history_item_id="history_item_id", ) """ with self._raw_client.get_audio(history_item_id, request_options=request_options) as r: yield from r.data def download( self, *, history_item_ids: typing.Sequence[str], output_format: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file. Parameters ---------- history_item_ids : typing.Sequence[str] A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint. output_format : typing.Optional[str] Output format to transcode the audio file, can be wav or default. 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. Returns ------- typing.Iterator[bytes] The requested audio file, or a zip file containing multiple audio files when multiple history items are requested. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.history.download( history_item_ids=["history_item_ids", "history_item_ids"], ) """ with self._raw_client.download( history_item_ids=history_item_ids, output_format=output_format, request_options=request_options ) as r: yield from r.data class AsyncHistoryClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawHistoryClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawHistoryClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawHistoryClient """ return self._raw_client async def list( self, *, page_size: typing.Optional[int] = None, start_after_history_item_id: typing.Optional[str] = None, voice_id: typing.Optional[str] = None, model_id: typing.Optional[str] = None, date_before_unix: typing.Optional[int] = None, date_after_unix: typing.Optional[int] = None, sort_direction: typing.Optional[HistoryListRequestSortDirection] = None, search: typing.Optional[str] = None, source: typing.Optional[HistoryListRequestSource] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetSpeechHistoryResponse: """ Returns a list of your generated audio (e.g. text to speech, speech to speech, Studio, dubbing). Music and SFX generations are not included and cannot currently be retrieved via the API. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Can not exceed 1000, defaults to 100. start_after_history_item_id : typing.Optional[str] After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date. voice_id : typing.Optional[str] ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. model_id : typing.Optional[str] Search term used for filtering history items. If provided, source becomes required. date_before_unix : typing.Optional[int] Unix timestamp to filter history items before this date (exclusive). date_after_unix : typing.Optional[int] Unix timestamp to filter history items after this date (inclusive). sort_direction : typing.Optional[HistoryListRequestSortDirection] Sort direction for the results. search : typing.Optional[str] search term used for filtering source : typing.Optional[HistoryListRequestSource] Source of the generated history item request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetSpeechHistoryResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.history.list( page_size=1, start_after_history_item_id="start_after_history_item_id", voice_id="voice_id", model_id="model_id", date_before_unix=1, date_after_unix=1, sort_direction="asc", search="search", source="TTS", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, start_after_history_item_id=start_after_history_item_id, voice_id=voice_id, model_id=model_id, date_before_unix=date_before_unix, date_after_unix=date_after_unix, sort_direction=sort_direction, search=search, source=source, request_options=request_options, ) return _response.data async def get( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SpeechHistoryItemResponse: """ Retrieves a history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechHistoryItemResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.history.get( history_item_id="VW7YKqPnjY4h39yTbx2L", ) asyncio.run(main()) """ _response = await self._raw_client.get(history_item_id, request_options=request_options) return _response.data async def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteHistoryItemResponse: """ Delete a history item by its ID Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteHistoryItemResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.history.delete( history_item_id="VW7YKqPnjY4h39yTbx2L", ) asyncio.run(main()) """ _response = await self._raw_client.delete(history_item_id, request_options=request_options) return _response.data async def get_audio( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Returns the audio of an history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. 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. Returns ------- typing.AsyncIterator[bytes] The audio file of the history item. Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.history.get_audio( history_item_id="history_item_id", ) asyncio.run(main()) """ async with self._raw_client.get_audio(history_item_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk async def download( self, *, history_item_ids: typing.Sequence[str], output_format: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file. Parameters ---------- history_item_ids : typing.Sequence[str] A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint. output_format : typing.Optional[str] Output format to transcode the audio file, can be wav or default. 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. Returns ------- typing.AsyncIterator[bytes] The requested audio file, or a zip file containing multiple audio files when multiple history items are requested. Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.history.download( history_item_ids=["history_item_ids", "history_item_ids"], ) asyncio.run(main()) """ async with self._raw_client.download( history_item_ids=history_item_ids, output_format=output_format, request_options=request_options ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/raw_client.py000066400000000000000000001012551523660243400267470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.bad_request_error import BadRequestError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.delete_history_item_response import DeleteHistoryItemResponse from ..types.get_speech_history_response import GetSpeechHistoryResponse from ..types.speech_history_item_response import SpeechHistoryItemResponse from .types.history_list_request_sort_direction import HistoryListRequestSortDirection from .types.history_list_request_source import HistoryListRequestSource from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawHistoryClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, page_size: typing.Optional[int] = None, start_after_history_item_id: typing.Optional[str] = None, voice_id: typing.Optional[str] = None, model_id: typing.Optional[str] = None, date_before_unix: typing.Optional[int] = None, date_after_unix: typing.Optional[int] = None, sort_direction: typing.Optional[HistoryListRequestSortDirection] = None, search: typing.Optional[str] = None, source: typing.Optional[HistoryListRequestSource] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetSpeechHistoryResponse]: """ Returns a list of your generated audio (e.g. text to speech, speech to speech, Studio, dubbing). Music and SFX generations are not included and cannot currently be retrieved via the API. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Can not exceed 1000, defaults to 100. start_after_history_item_id : typing.Optional[str] After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date. voice_id : typing.Optional[str] ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. model_id : typing.Optional[str] Search term used for filtering history items. If provided, source becomes required. date_before_unix : typing.Optional[int] Unix timestamp to filter history items before this date (exclusive). date_after_unix : typing.Optional[int] Unix timestamp to filter history items after this date (inclusive). sort_direction : typing.Optional[HistoryListRequestSortDirection] Sort direction for the results. search : typing.Optional[str] search term used for filtering source : typing.Optional[HistoryListRequestSource] Source of the generated history item request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetSpeechHistoryResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/history", method="GET", params={ "page_size": page_size, "start_after_history_item_id": start_after_history_item_id, "voice_id": voice_id, "model_id": model_id, "date_before_unix": date_before_unix, "date_after_unix": date_after_unix, "sort_direction": sort_direction, "search": search, "source": source, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSpeechHistoryResponse, construct_type( type_=GetSpeechHistoryResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SpeechHistoryItemResponse]: """ Retrieves a history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechHistoryItemResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/history/{jsonable_encoder(history_item_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechHistoryItemResponse, construct_type( type_=SpeechHistoryItemResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteHistoryItemResponse]: """ Delete a history item by its ID Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteHistoryItemResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/history/{jsonable_encoder(history_item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteHistoryItemResponse, construct_type( type_=DeleteHistoryItemResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def get_audio( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Returns the audio of an history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The audio file of the history item. """ with self._client_wrapper.httpx_client.stream( f"v1/history/{jsonable_encoder(history_item_id)}/audio", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def download( self, *, history_item_ids: typing.Sequence[str], output_format: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file. Parameters ---------- history_item_ids : typing.Sequence[str] A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint. output_format : typing.Optional[str] Output format to transcode the audio file, can be wav or default. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The requested audio file, or a zip file containing multiple audio files when multiple history items are requested. """ with self._client_wrapper.httpx_client.stream( "v1/history/download", method="POST", json={ "history_item_ids": history_item_ids, "output_format": output_format, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawHistoryClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, page_size: typing.Optional[int] = None, start_after_history_item_id: typing.Optional[str] = None, voice_id: typing.Optional[str] = None, model_id: typing.Optional[str] = None, date_before_unix: typing.Optional[int] = None, date_after_unix: typing.Optional[int] = None, sort_direction: typing.Optional[HistoryListRequestSortDirection] = None, search: typing.Optional[str] = None, source: typing.Optional[HistoryListRequestSource] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetSpeechHistoryResponse]: """ Returns a list of your generated audio (e.g. text to speech, speech to speech, Studio, dubbing). Music and SFX generations are not included and cannot currently be retrieved via the API. Parameters ---------- page_size : typing.Optional[int] How many history items to return at maximum. Can not exceed 1000, defaults to 100. start_after_history_item_id : typing.Optional[str] After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date. voice_id : typing.Optional[str] ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. model_id : typing.Optional[str] Search term used for filtering history items. If provided, source becomes required. date_before_unix : typing.Optional[int] Unix timestamp to filter history items before this date (exclusive). date_after_unix : typing.Optional[int] Unix timestamp to filter history items after this date (inclusive). sort_direction : typing.Optional[HistoryListRequestSortDirection] Sort direction for the results. search : typing.Optional[str] search term used for filtering source : typing.Optional[HistoryListRequestSource] Source of the generated history item request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetSpeechHistoryResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/history", method="GET", params={ "page_size": page_size, "start_after_history_item_id": start_after_history_item_id, "voice_id": voice_id, "model_id": model_id, "date_before_unix": date_before_unix, "date_after_unix": date_after_unix, "sort_direction": sort_direction, "search": search, "source": source, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetSpeechHistoryResponse, construct_type( type_=GetSpeechHistoryResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SpeechHistoryItemResponse]: """ Retrieves a history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechHistoryItemResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/history/{jsonable_encoder(history_item_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechHistoryItemResponse, construct_type( type_=SpeechHistoryItemResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteHistoryItemResponse]: """ Delete a history item by its ID Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteHistoryItemResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/history/{jsonable_encoder(history_item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteHistoryItemResponse, construct_type( type_=DeleteHistoryItemResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def get_audio( self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Returns the audio of an history item. Parameters ---------- history_item_id : str ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/list) endpoint to retrieve a list of history items. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The audio file of the history item. """ async with self._client_wrapper.httpx_client.stream( f"v1/history/{jsonable_encoder(history_item_id)}/audio", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def download( self, *, history_item_ids: typing.Sequence[str], output_format: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Download one or more history items. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file. Parameters ---------- history_item_ids : typing.Sequence[str] A list of history items to download, you can get IDs of history items and other metadata using the GET https://api.elevenlabs.io/v1/history endpoint. output_format : typing.Optional[str] Output format to transcode the audio file, can be wav or default. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The requested audio file, or a zip file containing multiple audio files when multiple history items are requested. """ async with self._client_wrapper.httpx_client.stream( "v1/history/download", method="POST", json={ "history_item_ids": history_item_ids, "output_format": output_format, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/types/000077500000000000000000000000001523660243400254065ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/types/__init__.py000066400000000000000000000024761523660243400275300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .history_list_request_sort_direction import HistoryListRequestSortDirection from .history_list_request_source import HistoryListRequestSource _dynamic_imports: typing.Dict[str, str] = { "HistoryListRequestSortDirection": ".history_list_request_sort_direction", "HistoryListRequestSource": ".history_list_request_source", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["HistoryListRequestSortDirection", "HistoryListRequestSource"] history_list_request_sort_direction.py000066400000000000000000000002521523660243400353130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/types# This file was auto-generated by Fern from our API Definition. import typing HistoryListRequestSortDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/history/types/history_list_request_source.py000066400000000000000000000002531523660243400336440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing HistoryListRequestSource = typing.Union[typing.Literal["TTS", "STS", "Flows"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/models/000077500000000000000000000000001523660243400240245ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/models/__init__.py000066400000000000000000000001251523660243400261330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/models/client.py000066400000000000000000000051371523660243400256620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.model import Model from .raw_client import AsyncRawModelsClient, RawModelsClient class ModelsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawModelsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawModelsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawModelsClient """ return self._raw_client def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Model]: """ Gets a list of available models. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[Model] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.models.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data class AsyncModelsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawModelsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawModelsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawModelsClient """ return self._raw_client async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Model]: """ Gets a list of available models. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[Model] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.models.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/models/raw_client.py000066400000000000000000000112741523660243400265320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.model import Model from pydantic import ValidationError class RawModelsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[typing.List[Model]]: """ Gets a list of available models. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.List[Model]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/models", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[Model], construct_type( type_=typing.List[Model], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawModelsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.List[Model]]: """ Gets a list of available models. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.List[Model]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/models", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[Model], construct_type( type_=typing.List[Model], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/000077500000000000000000000000001523660243400236615ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/__init__.py000066400000000000000000000117101523660243400257720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyComposeMusicV1MusicPostCompositionPlan, BodyComposeMusicV1MusicPostModelId, BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, BodyStreamComposedMusicV1MusicStreamPostModelId, BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, MusicComposeDetailedRequestOutputFormat, MusicComposeDetailedStreamRequestOutputFormat, MusicComposeRequestOutputFormat, MusicSeparateStemsRequestStemVariationId, MusicStreamRequestOutputFormat, MusicVideoToMusicRequestModelId, ) from . import composition_plan, finetunes from .composition_plan import ( BodyGenerateCompositionPlanV1MusicPlanPostModelId, BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, CompositionPlanCreateResponse, ) from .finetunes import ( FinetunesCreateRequestModelId, FinetunesCreateRequestVisibility, FinetunesListRequestSort, FinetunesListRequestSortDirection, UpdateMusicFinetuneRequestModelVisibility, ) _dynamic_imports: typing.Dict[str, str] = { "BodyComposeMusicV1MusicPostCompositionPlan": ".types", "BodyComposeMusicV1MusicPostModelId": ".types", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan": ".types", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId": ".types", "BodyGenerateCompositionPlanV1MusicPlanPostModelId": ".composition_plan", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan": ".composition_plan", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan": ".types", "BodyStreamComposedMusicV1MusicStreamPostModelId": ".types", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan": ".types", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId": ".types", "CompositionPlanCreateResponse": ".composition_plan", "FinetunesCreateRequestModelId": ".finetunes", "FinetunesCreateRequestVisibility": ".finetunes", "FinetunesListRequestSort": ".finetunes", "FinetunesListRequestSortDirection": ".finetunes", "MusicComposeDetailedRequestOutputFormat": ".types", "MusicComposeDetailedStreamRequestOutputFormat": ".types", "MusicComposeRequestOutputFormat": ".types", "MusicSeparateStemsRequestStemVariationId": ".types", "MusicStreamRequestOutputFormat": ".types", "MusicVideoToMusicRequestModelId": ".types", "UpdateMusicFinetuneRequestModelVisibility": ".finetunes", "composition_plan": ".composition_plan", "finetunes": ".finetunes", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyComposeMusicV1MusicPostCompositionPlan", "BodyComposeMusicV1MusicPostModelId", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId", "BodyGenerateCompositionPlanV1MusicPlanPostModelId", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan", "BodyStreamComposedMusicV1MusicStreamPostModelId", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId", "CompositionPlanCreateResponse", "FinetunesCreateRequestModelId", "FinetunesCreateRequestVisibility", "FinetunesListRequestSort", "FinetunesListRequestSortDirection", "MusicComposeDetailedRequestOutputFormat", "MusicComposeDetailedStreamRequestOutputFormat", "MusicComposeRequestOutputFormat", "MusicSeparateStemsRequestStemVariationId", "MusicStreamRequestOutputFormat", "MusicVideoToMusicRequestModelId", "UpdateMusicFinetuneRequestModelVisibility", "composition_plan", "finetunes", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/client.py000066400000000000000000001517051523660243400255220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.allowed_output_formats import AllowedOutputFormats from ..types.music_upload_response import MusicUploadResponse from .raw_client import AsyncRawMusicClient, RawMusicClient from .types.body_compose_music_v_1_music_post_composition_plan import BodyComposeMusicV1MusicPostCompositionPlan from .types.body_compose_music_v_1_music_post_model_id import BodyComposeMusicV1MusicPostModelId from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, ) from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, ) from .types.body_stream_composed_music_v_1_music_stream_post_composition_plan import ( BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, ) from .types.body_stream_composed_music_v_1_music_stream_post_model_id import ( BodyStreamComposedMusicV1MusicStreamPostModelId, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, ) from .types.music_compose_detailed_request_output_format import MusicComposeDetailedRequestOutputFormat from .types.music_compose_detailed_stream_request_output_format import MusicComposeDetailedStreamRequestOutputFormat from .types.music_compose_request_output_format import MusicComposeRequestOutputFormat from .types.music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId from .types.music_stream_request_output_format import MusicStreamRequestOutputFormat from .types.music_video_to_music_request_model_id import MusicVideoToMusicRequestModelId if typing.TYPE_CHECKING: from .composition_plan.client import AsyncCompositionPlanClient, CompositionPlanClient from .finetunes.client import AsyncFinetunesClient, FinetunesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class MusicClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMusicClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._composition_plan: typing.Optional[CompositionPlanClient] = None self._finetunes: typing.Optional[FinetunesClient] = None @property def with_raw_response(self) -> RawMusicClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMusicClient """ return self._raw_client def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[bytes] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ with self._raw_client.video_to_music( videos=videos, output_format=output_format, description=description, tags=tags, model_id=model_id, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: yield from r.data def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[bytes] The generated audio file in the format specified Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.compose() """ with self._raw_client.compose( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, respect_sections_durations=respect_sections_durations, store_for_inpainting=store_for_inpainting, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: yield from r.data def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[bytes] Multipart/mixed response with JSON metadata and binary audio file Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.compose_detailed() """ with self._raw_client.compose_detailed( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, respect_sections_durations=respect_sections_durations, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: yield from r.data def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[str]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[str] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) response = client.music.compose_detailed_stream( output_format="auto", ) for chunk in response: yield chunk """ with self._raw_client.compose_detailed_stream( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, request_options=request_options, ) as r: yield from r.data def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.Iterator[bytes] Streaming audio data in the format specified Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.stream() """ with self._raw_client.stream( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, store_for_inpainting=store_for_inpainting, request_options=request_options, ) as r: yield from r.data def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicUploadResponse: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicUploadResponse Successfully uploaded music file with optional composition plan Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.upload() """ _response = self._raw_client.upload( file=file, extract_composition_plan=extract_composition_plan, with_timestamps=with_timestamps, request_options=request_options, ) return _response.data def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[bytes] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ with self._raw_client.separate_stems( file=file, output_format=output_format, stem_variation_id=stem_variation_id, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: yield from r.data @property def composition_plan(self): if self._composition_plan is None: from .composition_plan.client import CompositionPlanClient # noqa: E402 self._composition_plan = CompositionPlanClient(client_wrapper=self._client_wrapper) return self._composition_plan @property def finetunes(self): if self._finetunes is None: from .finetunes.client import FinetunesClient # noqa: E402 self._finetunes = FinetunesClient(client_wrapper=self._client_wrapper) return self._finetunes class AsyncMusicClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMusicClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._composition_plan: typing.Optional[AsyncCompositionPlanClient] = None self._finetunes: typing.Optional[AsyncFinetunesClient] = None @property def with_raw_response(self) -> AsyncRawMusicClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMusicClient """ return self._raw_client async def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[bytes] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ async with self._raw_client.video_to_music( videos=videos, output_format=output_format, description=description, tags=tags, model_id=model_id, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[bytes] The generated audio file in the format specified Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.compose() asyncio.run(main()) """ async with self._raw_client.compose( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, respect_sections_durations=respect_sections_durations, store_for_inpainting=store_for_inpainting, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[bytes] Multipart/mixed response with JSON metadata and binary audio file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.compose_detailed() asyncio.run(main()) """ async with self._raw_client.compose_detailed( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, respect_sections_durations=respect_sections_durations, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[str]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[str] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: response = await client.music.compose_detailed_stream( output_format="auto", ) async for chunk in response: yield chunk asyncio.run(main()) """ async with self._raw_client.compose_detailed_stream( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.AsyncIterator[bytes] Streaming audio data in the format specified Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.stream() asyncio.run(main()) """ async with self._raw_client.stream( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, seed=seed, force_instrumental=force_instrumental, finetune_id=finetune_id, store_for_inpainting=store_for_inpainting, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicUploadResponse: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicUploadResponse Successfully uploaded music file with optional composition plan Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.upload() asyncio.run(main()) """ _response = await self._raw_client.upload( file=file, extract_composition_plan=extract_composition_plan, with_timestamps=with_timestamps, request_options=request_options, ) return _response.data async def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[bytes] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ async with self._raw_client.separate_stems( file=file, output_format=output_format, stem_variation_id=stem_variation_id, sign_with_c_2_pa=sign_with_c_2_pa, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk @property def composition_plan(self): if self._composition_plan is None: from .composition_plan.client import AsyncCompositionPlanClient # noqa: E402 self._composition_plan = AsyncCompositionPlanClient(client_wrapper=self._client_wrapper) return self._composition_plan @property def finetunes(self): if self._finetunes is None: from .finetunes.client import AsyncFinetunesClient # noqa: E402 self._finetunes = AsyncFinetunesClient(client_wrapper=self._client_wrapper) return self._finetunes elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/000077500000000000000000000000001523660243400272365ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/__init__.py000066400000000000000000000030121523660243400313430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyGenerateCompositionPlanV1MusicPlanPostModelId, BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, CompositionPlanCreateResponse, ) _dynamic_imports: typing.Dict[str, str] = { "BodyGenerateCompositionPlanV1MusicPlanPostModelId": ".types", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan": ".types", "CompositionPlanCreateResponse": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyGenerateCompositionPlanV1MusicPlanPostModelId", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan", "CompositionPlanCreateResponse", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/client.py000066400000000000000000000135531523660243400310750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawCompositionPlanClient, RawCompositionPlanClient from .types.body_generate_composition_plan_v_1_music_plan_post_model_id import ( BodyGenerateCompositionPlanV1MusicPlanPostModelId, ) from .types.body_generate_composition_plan_v_1_music_plan_post_source_composition_plan import ( BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, ) from .types.composition_plan_create_response import CompositionPlanCreateResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class CompositionPlanClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCompositionPlanClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCompositionPlanClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawCompositionPlanClient """ return self._raw_client def create( self, *, prompt: str, music_length_ms: typing.Optional[int] = OMIT, source_composition_plan: typing.Optional[ BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan ] = OMIT, model_id: typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CompositionPlanCreateResponse: """ Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier. Parameters ---------- prompt : str A simple text prompt to compose a plan from. music_length_ms : typing.Optional[int] The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. source_composition_plan : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan] An optional composition plan to use as a source for the new composition plan. model_id : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] The model to use for the generation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CompositionPlanCreateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.composition_plan.create( prompt="prompt", ) """ _response = self._raw_client.create( prompt=prompt, music_length_ms=music_length_ms, source_composition_plan=source_composition_plan, model_id=model_id, request_options=request_options, ) return _response.data class AsyncCompositionPlanClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCompositionPlanClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCompositionPlanClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawCompositionPlanClient """ return self._raw_client async def create( self, *, prompt: str, music_length_ms: typing.Optional[int] = OMIT, source_composition_plan: typing.Optional[ BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan ] = OMIT, model_id: typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CompositionPlanCreateResponse: """ Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier. Parameters ---------- prompt : str A simple text prompt to compose a plan from. music_length_ms : typing.Optional[int] The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. source_composition_plan : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan] An optional composition plan to use as a source for the new composition plan. model_id : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] The model to use for the generation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CompositionPlanCreateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.composition_plan.create( prompt="prompt", ) asyncio.run(main()) """ _response = await self._raw_client.create( prompt=prompt, music_length_ms=music_length_ms, source_composition_plan=source_composition_plan, model_id=model_id, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/raw_client.py000066400000000000000000000211471523660243400317440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from .types.body_generate_composition_plan_v_1_music_plan_post_model_id import ( BodyGenerateCompositionPlanV1MusicPlanPostModelId, ) from .types.body_generate_composition_plan_v_1_music_plan_post_source_composition_plan import ( BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, ) from .types.composition_plan_create_response import CompositionPlanCreateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawCompositionPlanClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, prompt: str, music_length_ms: typing.Optional[int] = OMIT, source_composition_plan: typing.Optional[ BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan ] = OMIT, model_id: typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CompositionPlanCreateResponse]: """ Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier. Parameters ---------- prompt : str A simple text prompt to compose a plan from. music_length_ms : typing.Optional[int] The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. source_composition_plan : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan] An optional composition plan to use as a source for the new composition plan. model_id : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] The model to use for the generation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CompositionPlanCreateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/music/plan", method="POST", json={ "prompt": prompt, "music_length_ms": music_length_ms, "source_composition_plan": convert_and_respect_annotation_metadata( object_=source_composition_plan, annotation=BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, direction="write", ), "model_id": model_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CompositionPlanCreateResponse, construct_type( type_=CompositionPlanCreateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawCompositionPlanClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, prompt: str, music_length_ms: typing.Optional[int] = OMIT, source_composition_plan: typing.Optional[ BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan ] = OMIT, model_id: typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CompositionPlanCreateResponse]: """ Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier. Parameters ---------- prompt : str A simple text prompt to compose a plan from. music_length_ms : typing.Optional[int] The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. source_composition_plan : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan] An optional composition plan to use as a source for the new composition plan. model_id : typing.Optional[BodyGenerateCompositionPlanV1MusicPlanPostModelId] The model to use for the generation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CompositionPlanCreateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/music/plan", method="POST", json={ "prompt": prompt, "music_length_ms": music_length_ms, "source_composition_plan": convert_and_respect_annotation_metadata( object_=source_composition_plan, annotation=BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, direction="write", ), "model_id": model_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CompositionPlanCreateResponse, construct_type( type_=CompositionPlanCreateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/types/000077500000000000000000000000001523660243400304025ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/types/__init__.py000066400000000000000000000035431523660243400325200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_generate_composition_plan_v_1_music_plan_post_model_id import ( BodyGenerateCompositionPlanV1MusicPlanPostModelId, ) from .body_generate_composition_plan_v_1_music_plan_post_source_composition_plan import ( BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan, ) from .composition_plan_create_response import CompositionPlanCreateResponse _dynamic_imports: typing.Dict[str, str] = { "BodyGenerateCompositionPlanV1MusicPlanPostModelId": ".body_generate_composition_plan_v_1_music_plan_post_model_id", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan": ".body_generate_composition_plan_v_1_music_plan_post_source_composition_plan", "CompositionPlanCreateResponse": ".composition_plan_create_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyGenerateCompositionPlanV1MusicPlanPostModelId", "BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan", "CompositionPlanCreateResponse", ] body_generate_composition_plan_v_1_music_plan_post_model_id.py000066400000000000000000000003051523660243400450170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/types# This file was auto-generated by Fern from our API Definition. import typing BodyGenerateCompositionPlanV1MusicPlanPostModelId = typing.Union[typing.Literal["music_v1", "music_v2"], typing.Any] body_generate_composition_plan_v_1_music_plan_post_source_composition_plan.py000066400000000000000000000004441523660243400502040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.composition_plan import CompositionPlan from ....types.music_prompt import MusicPrompt BodyGenerateCompositionPlanV1MusicPlanPostSourceCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] composition_plan_create_response.py000066400000000000000000000004021523660243400375070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/composition_plan/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.composition_plan import CompositionPlan from ....types.music_prompt import MusicPrompt CompositionPlanCreateResponse = typing.Union[MusicPrompt, CompositionPlan] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/000077500000000000000000000000001523660243400256615ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/__init__.py000066400000000000000000000032101523660243400277660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( FinetunesCreateRequestModelId, FinetunesCreateRequestVisibility, FinetunesListRequestSort, FinetunesListRequestSortDirection, UpdateMusicFinetuneRequestModelVisibility, ) _dynamic_imports: typing.Dict[str, str] = { "FinetunesCreateRequestModelId": ".types", "FinetunesCreateRequestVisibility": ".types", "FinetunesListRequestSort": ".types", "FinetunesListRequestSortDirection": ".types", "UpdateMusicFinetuneRequestModelVisibility": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "FinetunesCreateRequestModelId", "FinetunesCreateRequestVisibility", "FinetunesListRequestSort", "FinetunesListRequestSortDirection", "UpdateMusicFinetuneRequestModelVisibility", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/client.py000066400000000000000000000442551523660243400275230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ... import core from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.finetune_created_by import FinetuneCreatedBy from ...types.finetune_visibility import FinetuneVisibility from ...types.music_finetune_page_response_model import MusicFinetunePageResponseModel from ...types.music_finetune_response_model import MusicFinetuneResponseModel from .raw_client import AsyncRawFinetunesClient, RawFinetunesClient from .types.finetunes_create_request_model_id import FinetunesCreateRequestModelId from .types.finetunes_create_request_visibility import FinetunesCreateRequestVisibility from .types.finetunes_list_request_sort import FinetunesListRequestSort from .types.finetunes_list_request_sort_direction import FinetunesListRequestSortDirection from .types.update_music_finetune_request_model_visibility import UpdateMusicFinetuneRequestModelVisibility # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class FinetunesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawFinetunesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawFinetunesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawFinetunesClient """ return self._raw_client def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetunePageResponseModel: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetunePageResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.finetunes.list( cursor="cursor", page_size=1, visibility="private", created_by="self", sort="created_at", sort_direction="asc", ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, visibility=visibility, created_by=created_by, sort=sort, sort_direction=sort_direction, request_options=request_options, ) return _response.data def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetuneResponseModel: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.finetunes.create( name="name", primary_genre="primary_genre", ) """ _response = self._raw_client.create( name=name, primary_genre=primary_genre, files=files, tags=tags, visibility=visibility, model_id=model_id, request_options=request_options, ) return _response.data def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MusicFinetuneResponseModel: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.finetunes.get( finetune_id="finetune_id", ) """ _response = self._raw_client.get(finetune_id, request_options=request_options) return _response.data def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MusicFinetuneResponseModel: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.finetunes.delete( finetune_id="finetune_id", ) """ _response = self._raw_client.delete(finetune_id, request_options=request_options) return _response.data def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetuneResponseModel: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.music.finetunes.update( finetune_id="finetune_id", ) """ _response = self._raw_client.update( finetune_id, name=name, tags=tags, primary_genre=primary_genre, visibility=visibility, request_options=request_options, ) return _response.data class AsyncFinetunesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawFinetunesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawFinetunesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawFinetunesClient """ return self._raw_client async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetunePageResponseModel: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetunePageResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.finetunes.list( cursor="cursor", page_size=1, visibility="private", created_by="self", sort="created_at", sort_direction="asc", ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, visibility=visibility, created_by=created_by, sort=sort, sort_direction=sort_direction, request_options=request_options, ) return _response.data async def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetuneResponseModel: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.finetunes.create( name="name", primary_genre="primary_genre", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, primary_genre=primary_genre, files=files, tags=tags, visibility=visibility, model_id=model_id, request_options=request_options, ) return _response.data async def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MusicFinetuneResponseModel: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.finetunes.get( finetune_id="finetune_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(finetune_id, request_options=request_options) return _response.data async def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> MusicFinetuneResponseModel: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.finetunes.delete( finetune_id="finetune_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(finetune_id, request_options=request_options) return _response.data async def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> MusicFinetuneResponseModel: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- MusicFinetuneResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.music.finetunes.update( finetune_id="finetune_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( finetune_id, name=name, tags=tags, primary_genre=primary_genre, visibility=visibility, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/raw_client.py000066400000000000000000001114241523660243400303650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.forbidden_error import ForbiddenError from ...errors.not_found_error import NotFoundError from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.finetune_created_by import FinetuneCreatedBy from ...types.finetune_visibility import FinetuneVisibility from ...types.music_finetune_page_response_model import MusicFinetunePageResponseModel from ...types.music_finetune_response_model import MusicFinetuneResponseModel from .types.finetunes_create_request_model_id import FinetunesCreateRequestModelId from .types.finetunes_create_request_visibility import FinetunesCreateRequestVisibility from .types.finetunes_list_request_sort import FinetunesListRequestSort from .types.finetunes_list_request_sort_direction import FinetunesListRequestSortDirection from .types.update_music_finetune_request_model_visibility import UpdateMusicFinetuneRequestModelVisibility from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawFinetunesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetunePageResponseModel]: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetunePageResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="GET", params={ "cursor": cursor, "page_size": page_size, "visibility": visibility, "created_by": created_by, "sort": sort, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetunePageResponseModel, construct_type( type_=MusicFinetunePageResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetuneResponseModel]: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="POST", data={ "name": name, "primary_genre": primary_genre, "tags": tags, "visibility": visibility, "model_id": model_id, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[MusicFinetuneResponseModel]: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[MusicFinetuneResponseModel]: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicFinetuneResponseModel]: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="PATCH", json={ "name": name, "tags": tags, "primary_genre": primary_genre, "visibility": visibility, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawFinetunesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, visibility: typing.Optional[FinetuneVisibility] = None, created_by: typing.Optional[FinetuneCreatedBy] = None, sort: typing.Optional[FinetunesListRequestSort] = None, sort_direction: typing.Optional[FinetunesListRequestSortDirection] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetunePageResponseModel]: """ List music finetunes accessible to you (your own, workspace-shared, and ElevenLabs-curated), with optional filtering, sorting, and cursor pagination. Parameters ---------- cursor : typing.Optional[str] Used for fetching the next page. Cursor is returned in the response. page_size : typing.Optional[int] How many finetunes to return. Max 100, default 50. visibility : typing.Optional[FinetuneVisibility] Filter by visibility. 'private' returns private finetunes; 'workspace' returns workspace-shared finetunes; 'public' returns public finetunes, which are currently ElevenLabs curated finetunes. Omit to return all accessible finetunes. created_by : typing.Optional[FinetuneCreatedBy] Filter by creator. 'self' returns finetunes you created; 'workspace' returns finetunes created by workspace teammates; 'elevenlabs' returns ElevenLabs curated finetunes. Omit to return finetunes from all creators. sort : typing.Optional[FinetunesListRequestSort] Sort by field (created_at or name) sort_direction : typing.Optional[FinetunesListRequestSortDirection] Sort direction (asc or desc) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetunePageResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="GET", params={ "cursor": cursor, "page_size": page_size, "visibility": visibility, "created_by": created_by, "sort": sort, "sort_direction": sort_direction, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetunePageResponseModel, construct_type( type_=MusicFinetunePageResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, primary_genre: str, files: typing.Optional[typing.List[core.File]] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, visibility: typing.Optional[FinetunesCreateRequestVisibility] = OMIT, model_id: typing.Optional[FinetunesCreateRequestModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Create a new music finetune Parameters ---------- name : str Name for the finetune (5-200 characters). primary_genre : str Primary musical genre of the finetune. files : typing.Optional[typing.List[core.File]] See core.File for more documentation tags : typing.Optional[typing.List[str]] Tags to associate with the finetune. visibility : typing.Optional[FinetunesCreateRequestVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. model_id : typing.Optional[FinetunesCreateRequestModelId] The model to create a finetune for. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/music/finetunes", method="POST", data={ "name": name, "primary_genre": primary_genre, "tags": tags, "visibility": visibility, "model_id": model_id, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Get a music finetune. Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, finetune_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Delete a music finetune Parameters ---------- finetune_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, finetune_id: str, *, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, primary_genre: typing.Optional[str] = OMIT, visibility: typing.Optional[UpdateMusicFinetuneRequestModelVisibility] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicFinetuneResponseModel]: """ Update a music finetune. Parameters ---------- finetune_id : str name : typing.Optional[str] Updated name for the finetune. tags : typing.Optional[typing.Sequence[str]] Replacement set of tags. primary_genre : typing.Optional[str] Updated primary musical genre. visibility : typing.Optional[UpdateMusicFinetuneRequestModelVisibility] Finetune visibility. Only 'private' and 'workspace' can be set. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicFinetuneResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/music/finetunes/{jsonable_encoder(finetune_id)}", method="PATCH", json={ "name": name, "tags": tags, "primary_genre": primary_genre, "visibility": visibility, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicFinetuneResponseModel, construct_type( type_=MusicFinetuneResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types/000077500000000000000000000000001523660243400270255ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types/__init__.py000066400000000000000000000037411523660243400311430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .finetunes_create_request_model_id import FinetunesCreateRequestModelId from .finetunes_create_request_visibility import FinetunesCreateRequestVisibility from .finetunes_list_request_sort import FinetunesListRequestSort from .finetunes_list_request_sort_direction import FinetunesListRequestSortDirection from .update_music_finetune_request_model_visibility import UpdateMusicFinetuneRequestModelVisibility _dynamic_imports: typing.Dict[str, str] = { "FinetunesCreateRequestModelId": ".finetunes_create_request_model_id", "FinetunesCreateRequestVisibility": ".finetunes_create_request_visibility", "FinetunesListRequestSort": ".finetunes_list_request_sort", "FinetunesListRequestSortDirection": ".finetunes_list_request_sort_direction", "UpdateMusicFinetuneRequestModelVisibility": ".update_music_finetune_request_model_visibility", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "FinetunesCreateRequestModelId", "FinetunesCreateRequestVisibility", "FinetunesListRequestSort", "FinetunesListRequestSortDirection", "UpdateMusicFinetuneRequestModelVisibility", ] finetunes_create_request_model_id.py000066400000000000000000000002611523660243400362460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types# This file was auto-generated by Fern from our API Definition. import typing FinetunesCreateRequestModelId = typing.Union[typing.Literal["music_v1", "music_v2"], typing.Any] finetunes_create_request_visibility.py000066400000000000000000000002641523660243400366640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types# This file was auto-generated by Fern from our API Definition. import typing FinetunesCreateRequestVisibility = typing.Union[typing.Literal["private", "workspace"], typing.Any] finetunes_list_request_sort.py000066400000000000000000000002521523660243400351710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types# This file was auto-generated by Fern from our API Definition. import typing FinetunesListRequestSort = typing.Union[typing.Literal["created_at", "name"], typing.Any] finetunes_list_request_sort_direction.py000066400000000000000000000002541523660243400372330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types# This file was auto-generated by Fern from our API Definition. import typing FinetunesListRequestSortDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] update_music_finetune_request_model_visibility.py000066400000000000000000000002751523660243400411020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/finetunes/types# This file was auto-generated by Fern from our API Definition. import typing UpdateMusicFinetuneRequestModelVisibility = typing.Union[typing.Literal["private", "workspace"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/raw_client.py000066400000000000000000002406261523660243400263740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import json import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.forbidden_error import ForbiddenError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.allowed_output_formats import AllowedOutputFormats from ..types.music_upload_response import MusicUploadResponse from .types.body_compose_music_v_1_music_post_composition_plan import BodyComposeMusicV1MusicPostCompositionPlan from .types.body_compose_music_v_1_music_post_model_id import BodyComposeMusicV1MusicPostModelId from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, ) from .types.body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, ) from .types.body_stream_composed_music_v_1_music_stream_post_composition_plan import ( BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, ) from .types.body_stream_composed_music_v_1_music_stream_post_model_id import ( BodyStreamComposedMusicV1MusicStreamPostModelId, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, ) from .types.body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, ) from .types.music_compose_detailed_request_output_format import MusicComposeDetailedRequestOutputFormat from .types.music_compose_detailed_stream_request_output_format import MusicComposeDetailedStreamRequestOutputFormat from .types.music_compose_request_output_format import MusicComposeRequestOutputFormat from .types.music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId from .types.music_stream_request_output_format import MusicStreamRequestOutputFormat from .types.music_video_to_music_request_model_id import MusicVideoToMusicRequestModelId from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMusicClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ with self._client_wrapper.httpx_client.stream( "v1/music/video-to-music", method="POST", params={ "output_format": output_format, }, data={ "description": description, "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "videos": videos, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated audio file in the format specified """ with self._client_wrapper.httpx_client.stream( "v1/music", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicV1MusicPostCompositionPlan, direction="write" ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Multipart/mixed response with JSON metadata and binary audio file """ with self._client_wrapper.httpx_client.stream( "v1/music/detailed", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[str]]]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[HttpResponse[typing.Iterator[str]]] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. """ with self._client_wrapper.httpx_client.stream( "v1/music/detailed/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[str]]: try: if 200 <= _response.status_code < 300: def _iter(): for _text in _response.iter_lines(): try: if len(_text) == 0: continue yield typing.cast( str, construct_type( type_=str, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return HttpResponse(response=_response, data=_iter()) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data in the format specified """ with self._client_wrapper.httpx_client.stream( "v1/music/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[MusicUploadResponse]: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[MusicUploadResponse] Successfully uploaded music file with optional composition plan """ _response = self._client_wrapper.httpx_client.request( "v1/music/upload", method="POST", data={ "extract_composition_plan": extract_composition_plan, "with_timestamps": with_timestamps, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicUploadResponse, construct_type( type_=MusicUploadResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ with self._client_wrapper.httpx_client.stream( "v1/music/stem-separation", method="POST", params={ "output_format": output_format, }, data={ "stem_variation_id": stem_variation_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawMusicClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def video_to_music( self, *, videos: typing.List[core.File], output_format: typing.Optional[AllowedOutputFormats] = None, description: typing.Optional[str] = OMIT, tags: typing.Optional[typing.List[str]] = OMIT, model_id: typing.Optional[MusicVideoToMusicRequestModelId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Generate background music from one or more video files. Videos are combined in order. Optional description and style tags influence the generated music. Parameters ---------- videos : typing.List[core.File] See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. description : typing.Optional[str] Optional text description of the music you want. A maximum of 1000 characters is allowed. tags : typing.Optional[typing.List[str]] Optional list of style tags (e.g. ['upbeat', 'cinematic']). A maximum of 10 tags is allowed. model_id : typing.Optional[MusicVideoToMusicRequestModelId] The model to use for the generation. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Generated audio file matching the video. Content-Type and file extension depend on the output_format parameter (default mp3). """ async with self._client_wrapper.httpx_client.stream( "v1/music/video-to-music", method="POST", params={ "output_format": output_format, }, data={ "description": description, "tags": tags, "model_id": model_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "videos": videos, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose( self, *, output_format: typing.Optional[MusicComposeRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicV1MusicPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicV1MusicPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicV1MusicPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated audio file in the format specified """ async with self._client_wrapper.httpx_client.stream( "v1/music", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicV1MusicPostCompositionPlan, direction="write" ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose_detailed( self, *, output_format: typing.Optional[MusicComposeDetailedRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, respect_sections_durations: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Compose a song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicComposeDetailedRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation respect_sections_durations : typing.Optional[bool] Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual section durations for better quality and latency, while preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Multipart/mixed response with JSON metadata and binary audio file """ async with self._client_wrapper.httpx_client.stream( "v1/music/detailed", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "respect_sections_durations": respect_sections_durations, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, "sign_with_c2pa": sign_with_c_2_pa, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def compose_detailed_stream( self, *, output_format: typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[ BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan ] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]]: """ Stream a song and its detailed metadata using Server-Sent Events (SSE). Parameters ---------- output_format : typing.Optional[MusicComposeDetailedStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[str]]] Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion. """ async with self._client_wrapper.httpx_client.stream( "v1/music/detailed/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, "with_timestamps": with_timestamps, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[str]]: try: if 200 <= _response.status_code < 300: async def _iter(): async for _text in _response.aiter_lines(): try: if len(_text) == 0: continue yield typing.cast( str, construct_type( type_=str, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return AsyncHttpResponse(response=_response, data=_iter()) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream( self, *, output_format: typing.Optional[MusicStreamRequestOutputFormat] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] = OMIT, seed: typing.Optional[int] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, finetune_id: typing.Optional[str] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream a composed song from a prompt or a composition plan. Parameters ---------- output_format : typing.Optional[MusicStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. prompt : typing.Optional[str] A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. composition_plan : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostCompositionPlan] A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. music_length_ms : typing.Optional[int] The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt. model_id : typing.Optional[BodyStreamComposedMusicV1MusicStreamPostModelId] The model to use for the generation. seed : typing.Optional[int] Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt. force_instrumental : typing.Optional[bool] If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. finetune_id : typing.Optional[str] The ID of the finetune to use for the generation store_for_inpainting : typing.Optional[bool] Whether to store the generated song for inpainting. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data in the format specified """ async with self._client_wrapper.httpx_client.stream( "v1/music/stream", method="POST", params={ "output_format": output_format, }, json={ "prompt": prompt, "composition_plan": convert_and_respect_annotation_metadata( object_=composition_plan, annotation=BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, direction="write", ), "music_length_ms": music_length_ms, "model_id": model_id, "seed": seed, "force_instrumental": force_instrumental, "finetune_id": finetune_id, "store_for_inpainting": store_for_inpainting, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def upload( self, *, file: core.File, extract_composition_plan: typing.Optional[str] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[MusicUploadResponse]: """ Upload a music file to be later used for inpainting. Price for uploading is the same as the one for song generation. All uploaded content gets inspected for copyright infringement. If copyrighted content is detected, half of the request cost is still charged. Parameters ---------- file : core.File See core.File for more documentation extract_composition_plan : typing.Optional[str] Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1` or `music_v2`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. with_timestamps : typing.Optional[bool] Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[MusicUploadResponse] Successfully uploaded music file with optional composition plan """ _response = await self._client_wrapper.httpx_client.request( "v1/music/upload", method="POST", data={ "extract_composition_plan": extract_composition_plan, "with_timestamps": with_timestamps, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( MusicUploadResponse, construct_type( type_=MusicUploadResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def separate_stems( self, *, file: core.File, output_format: typing.Optional[AllowedOutputFormats] = None, stem_variation_id: typing.Optional[MusicSeparateStemsRequestStemVariationId] = OMIT, sign_with_c_2_pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Separate an audio file into individual stems. This endpoint might have high latency, depending on the length of the audio file. Parameters ---------- file : core.File See core.File for more documentation output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. stem_variation_id : typing.Optional[MusicSeparateStemsRequestStemVariationId] The id of the stem variation to use. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] ZIP archive containing separated audio stems. Each stem is provided as a separate audio file in the requested output format. """ async with self._client_wrapper.httpx_client.stream( "v1/music/stem-separation", method="POST", params={ "output_format": output_format, }, data={ "stem_variation_id": stem_variation_id, "sign_with_c2pa": sign_with_c_2_pa, }, files={ "file": file, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types/000077500000000000000000000000001523660243400250255ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types/__init__.py000066400000000000000000000123241523660243400271400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_compose_music_v_1_music_post_composition_plan import BodyComposeMusicV1MusicPostCompositionPlan from .body_compose_music_v_1_music_post_model_id import BodyComposeMusicV1MusicPostModelId from .body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan, ) from .body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id import ( BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId, ) from .body_stream_composed_music_v_1_music_stream_post_composition_plan import ( BodyStreamComposedMusicV1MusicStreamPostCompositionPlan, ) from .body_stream_composed_music_v_1_music_stream_post_model_id import ( BodyStreamComposedMusicV1MusicStreamPostModelId, ) from .body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan, ) from .body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id import ( BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId, ) from .music_compose_detailed_request_output_format import MusicComposeDetailedRequestOutputFormat from .music_compose_detailed_stream_request_output_format import MusicComposeDetailedStreamRequestOutputFormat from .music_compose_request_output_format import MusicComposeRequestOutputFormat from .music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId from .music_stream_request_output_format import MusicStreamRequestOutputFormat from .music_video_to_music_request_model_id import MusicVideoToMusicRequestModelId _dynamic_imports: typing.Dict[str, str] = { "BodyComposeMusicV1MusicPostCompositionPlan": ".body_compose_music_v_1_music_post_composition_plan", "BodyComposeMusicV1MusicPostModelId": ".body_compose_music_v_1_music_post_model_id", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan": ".body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId": ".body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan": ".body_stream_composed_music_v_1_music_stream_post_composition_plan", "BodyStreamComposedMusicV1MusicStreamPostModelId": ".body_stream_composed_music_v_1_music_stream_post_model_id", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan": ".body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId": ".body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id", "MusicComposeDetailedRequestOutputFormat": ".music_compose_detailed_request_output_format", "MusicComposeDetailedStreamRequestOutputFormat": ".music_compose_detailed_stream_request_output_format", "MusicComposeRequestOutputFormat": ".music_compose_request_output_format", "MusicSeparateStemsRequestStemVariationId": ".music_separate_stems_request_stem_variation_id", "MusicStreamRequestOutputFormat": ".music_stream_request_output_format", "MusicVideoToMusicRequestModelId": ".music_video_to_music_request_model_id", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyComposeMusicV1MusicPostCompositionPlan", "BodyComposeMusicV1MusicPostModelId", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan", "BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId", "BodyStreamComposedMusicV1MusicStreamPostCompositionPlan", "BodyStreamComposedMusicV1MusicStreamPostModelId", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan", "BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId", "MusicComposeDetailedRequestOutputFormat", "MusicComposeDetailedStreamRequestOutputFormat", "MusicComposeRequestOutputFormat", "MusicSeparateStemsRequestStemVariationId", "MusicStreamRequestOutputFormat", "MusicVideoToMusicRequestModelId", ] body_compose_music_v_1_music_post_composition_plan.py000066400000000000000000000004151523660243400376510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.composition_plan import CompositionPlan from ...types.music_prompt import MusicPrompt BodyComposeMusicV1MusicPostCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] body_compose_music_v_1_music_post_model_id.py000066400000000000000000000002661523660243400360540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing BodyComposeMusicV1MusicPostModelId = typing.Union[typing.Literal["music_v1", "music_v2"], typing.Any] body_compose_music_with_a_detailed_response_v_1_music_detailed_post_composition_plan.py000066400000000000000000000004521523660243400466110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.composition_plan import CompositionPlan from ...types.music_prompt import MusicPrompt BodyComposeMusicWithADetailedResponseV1MusicDetailedPostCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] body_compose_music_with_a_detailed_response_v_1_music_detailed_post_model_id.py000066400000000000000000000003311523660243400450040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing BodyComposeMusicWithADetailedResponseV1MusicDetailedPostModelId = typing.Union[ typing.Literal["music_v1", "music_v2"], typing.Any ] body_stream_composed_music_v_1_music_stream_post_composition_plan.py000066400000000000000000000004321523660243400427420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.composition_plan import CompositionPlan from ...types.music_prompt import MusicPrompt BodyStreamComposedMusicV1MusicStreamPostCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] body_stream_composed_music_v_1_music_stream_post_model_id.py000066400000000000000000000003031523660243400411360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing BodyStreamComposedMusicV1MusicStreamPostModelId = typing.Union[typing.Literal["music_v1", "music_v2"], typing.Any] c778944237bd99ad756dca556bcd851ebedd4eb5.paxheader00006660000000000000000000000260152366024340020765xustar00rootroot00000000000000176 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types/body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_composition_plan.py c778944237bd99ad756dca556bcd851ebedd4eb5.data000066400000000000000000000004751523660243400176330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...types.composition_plan import CompositionPlan from ...types.music_prompt import MusicPrompt BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostCompositionPlan = typing.Union[ MusicPrompt, CompositionPlan ] body_stream_composed_music_with_a_detailed_response_v_1_music_detailed_stream_post_model_id.py000066400000000000000000000003461523660243400501040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPostModelId = typing.Union[ typing.Literal["music_v1", "music_v2"], typing.Any ] music_compose_detailed_request_output_format.py000066400000000000000000000014161523660243400365620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicComposeDetailedRequestOutputFormat = typing.Union[ typing.Literal[ "auto", "mp3_48000_128", "mp3_48000_192", "mp3_48000_240", "mp3_48000_320", "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] music_compose_detailed_stream_request_output_format.py000066400000000000000000000014241523660243400401340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicComposeDetailedStreamRequestOutputFormat = typing.Union[ typing.Literal[ "auto", "mp3_48000_128", "mp3_48000_192", "mp3_48000_240", "mp3_48000_320", "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] music_compose_request_output_format.py000066400000000000000000000014061523660243400347260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicComposeRequestOutputFormat = typing.Union[ typing.Literal[ "auto", "mp3_48000_128", "mp3_48000_192", "mp3_48000_240", "mp3_48000_320", "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] music_separate_stems_request_stem_variation_id.py000066400000000000000000000003041523660243400370640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicSeparateStemsRequestStemVariationId = typing.Union[typing.Literal["two_stems_v1", "six_stems_v1"], typing.Any] music_stream_request_output_format.py000066400000000000000000000014051523660243400345530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicStreamRequestOutputFormat = typing.Union[ typing.Literal[ "auto", "mp3_48000_128", "mp3_48000_192", "mp3_48000_240", "mp3_48000_320", "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] music_video_to_music_request_model_id.py000066400000000000000000000002631523660243400351350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music/types# This file was auto-generated by Fern from our API Definition. import typing MusicVideoToMusicRequestModelId = typing.Union[typing.Literal["music_v1", "music_v2"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/music_custom.py000066400000000000000000000261621523660243400256340ustar00rootroot00000000000000import json import logging import re import typing from dataclasses import dataclass from elevenlabs.core.request_options import RequestOptions from elevenlabs.music.client import AsyncMusicClient as AutogeneratedAsyncMusicClient from elevenlabs.music.client import MusicClient as AutogeneratedMusicClient from elevenlabs.types.allowed_output_formats import AllowedOutputFormats from elevenlabs.types.music_prompt import MusicPrompt # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) logger = logging.getLogger(__name__) def _find_audio_start(data: bytes, start: int) -> int: """Find the blank line separating headers from body, returning the index of the body start.""" crlf_pos = data.find(b"\r\n\r\n", start) if crlf_pos != -1: return crlf_pos + 4 lf_pos = data.find(b"\n\n", start) if lf_pos != -1: return lf_pos + 2 raise ValueError("Could not find header/body separator in audio part") @dataclass class SongMetadata: title: str description: str genres: typing.List[str] languages: typing.List[str] is_explicit: bool @dataclass class MultipartResponse: json: typing.Dict[str, typing.Any] # Contains compositionPlan and songMetadata audio: bytes filename: str song_id: typing.Optional[str] = None class MusicClient(AutogeneratedMusicClient): """ A client to handle ElevenLabs music-related functionality Extends the autogenerated client to include custom music methods """ def compose_detailed( # type: ignore[override] self, *, output_format: typing.Optional[AllowedOutputFormats] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[MusicPrompt] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[typing.Literal["music_v1"]] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c2pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, **kwargs: typing.Any, ) -> MultipartResponse: """ Compose a song from a prompt or a composition plan with detailed response parsing. This method calls the original compose_detailed and then parses the stream response. Returns a MultipartResponse containing parsed JSON metadata, audio bytes, filename, and song_id (if store_for_inpainting was True). """ # Use the raw client directly to access response headers (for song_id) with self._raw_client.compose_detailed( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, force_instrumental=force_instrumental, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, sign_with_c_2_pa=sign_with_c2pa, request_options=request_options, ) as r: result = self._parse_multipart(r.data) result.song_id = r.headers.get("song-id") return result def _parse_multipart(self, stream: typing.Iterator[bytes]) -> MultipartResponse: """ Reads a byte stream containing multipart data and parses it into JSON and audio parts. Args: stream: Iterator of bytes from ElevenLabs music API response Returns: MultipartResponse containing parsed JSON metadata, audio bytes, and filename """ # Collect all chunks into a single bytes object chunks = [] for chunk in stream: chunks.append(chunk) # Combine all chunks into a single buffer response_bytes = b''.join(chunks) # Parse the multipart content response_text = response_bytes.decode('utf-8', errors='ignore') lines = response_text.split('\n') if not lines: raise ValueError("Empty response from music API") boundary = lines[0].strip() # Find the JSON part (should be early in the response) json_data = None filename = 'generated_music.mp3' # Parse JSON from the text representation for i in range(min(10, len(lines))): if 'Content-Type: application/json' in lines[i] and i + 2 < len(lines): json_line = lines[i + 2] if json_line.strip() and json_line.startswith('{'): try: json_data = json.loads(json_line) except json.JSONDecodeError as e: logger.error(f'Failed to parse composition plan JSON: {e}') break # Extract filename from headers for i in range(min(20, len(lines))): if 'filename=' in lines[i]: match = re.search(r'filename="([^"]+)"', lines[i]) if match: filename = match.group(1) break # Find where the audio data starts (after the second boundary and headers) boundary_bytes = boundary.encode('utf-8') first_boundary = -1 second_boundary = -1 for i in range(len(response_bytes) - len(boundary_bytes) + 1): if response_bytes[i:i + len(boundary_bytes)] == boundary_bytes: if first_boundary == -1: first_boundary = i elif second_boundary == -1: second_boundary = i break if second_boundary == -1: raise ValueError('Could not find audio part boundary') # Find the start of audio data (after headers and empty line) audio_start = _find_audio_start(response_bytes, second_boundary + len(boundary_bytes)) # Audio goes until the end (or until we find another boundary) audio_buffer = response_bytes[audio_start:] if not json_data: raise ValueError('Could not parse JSON data') return MultipartResponse( json=json_data, audio=audio_buffer, filename=filename ) class AsyncMusicClient(AutogeneratedAsyncMusicClient): """ An async client to handle ElevenLabs music-related functionality Extends the autogenerated async client to include custom music methods """ async def compose_detailed( # type: ignore[override] self, *, output_format: typing.Optional[AllowedOutputFormats] = None, prompt: typing.Optional[str] = OMIT, composition_plan: typing.Optional[MusicPrompt] = OMIT, music_length_ms: typing.Optional[int] = OMIT, model_id: typing.Optional[typing.Literal["music_v1"]] = OMIT, force_instrumental: typing.Optional[bool] = OMIT, store_for_inpainting: typing.Optional[bool] = OMIT, with_timestamps: typing.Optional[bool] = OMIT, sign_with_c2pa: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, **kwargs: typing.Any, ) -> MultipartResponse: """ Compose a song from a prompt or a composition plan with detailed response parsing. This method calls the original compose_detailed and then parses the stream response. Returns a MultipartResponse containing parsed JSON metadata, audio bytes, filename, and song_id (if store_for_inpainting was True). """ # Use the raw client directly to access response headers (for song_id) async with self._raw_client.compose_detailed( output_format=output_format, prompt=prompt, composition_plan=composition_plan, music_length_ms=music_length_ms, model_id=model_id, force_instrumental=force_instrumental, store_for_inpainting=store_for_inpainting, with_timestamps=with_timestamps, sign_with_c_2_pa=sign_with_c2pa, request_options=request_options, ) as r: result = await self._parse_multipart_async(r.data) result.song_id = r.headers.get("song-id") return result async def _parse_multipart_async(self, stream: typing.AsyncIterator[bytes]) -> MultipartResponse: """ Reads an async byte stream containing multipart data and parses it into JSON and audio parts. Args: stream: AsyncIterator of bytes from ElevenLabs music API response Returns: MultipartResponse containing parsed JSON metadata, audio bytes, and filename """ # Collect all chunks into a single bytes object chunks = [] async for chunk in stream: chunks.append(chunk) # Combine all chunks into a single buffer response_bytes = b''.join(chunks) # Parse the multipart content response_text = response_bytes.decode('utf-8', errors='ignore') lines = response_text.split('\n') if not lines: raise ValueError("Empty response from music API") boundary = lines[0].strip() # Find the JSON part (should be early in the response) json_data = None filename = 'generated_music.mp3' # Parse JSON from the text representation for i in range(min(10, len(lines))): if 'Content-Type: application/json' in lines[i] and i + 2 < len(lines): json_line = lines[i + 2] if json_line.strip() and json_line.startswith('{'): try: json_data = json.loads(json_line) except json.JSONDecodeError as e: logger.error(f'Failed to parse JSON: {e}') break # Extract filename from headers for i in range(min(20, len(lines))): if 'filename=' in lines[i]: match = re.search(r'filename="([^"]+)"', lines[i]) if match: filename = match.group(1) break # Find where the audio data starts (after the second boundary and headers) boundary_bytes = boundary.encode('utf-8') first_boundary = -1 second_boundary = -1 for i in range(len(response_bytes) - len(boundary_bytes) + 1): if response_bytes[i:i + len(boundary_bytes)] == boundary_bytes: if first_boundary == -1: first_boundary = i elif second_boundary == -1: second_boundary = i break if second_boundary == -1: raise ValueError('Could not find audio part boundary') # Find the start of audio data (after headers and empty line) audio_start = _find_audio_start(response_bytes, second_boundary + len(boundary_bytes)) # Audio goes until the end (or until we find another boundary) audio_buffer = response_bytes[audio_start:] if not json_data: raise ValueError('Could not parse JSON data') return MultipartResponse( json=json_data, audio=audio_buffer, filename=filename )elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/play.py000066400000000000000000000055431523660243400240670ustar00rootroot00000000000000import shutil import subprocess from typing import Iterator, Union def is_installed(lib_name: str) -> bool: lib = shutil.which(lib_name) if lib is None: return False return True def play( audio: Union[bytes, Iterator[bytes]], notebook: bool = False, use_ffmpeg: bool = True ) -> None: if isinstance(audio, Iterator): audio = b"".join(audio) if notebook: try: from IPython.display import Audio, display # type: ignore except ModuleNotFoundError: message = ( "`pip install ipython` required when `notebook=True` " ) raise ValueError(message) display(Audio(audio, rate=44100, autoplay=True)) elif use_ffmpeg: if not is_installed("ffplay"): message = ( "ffplay from ffmpeg not found, necessary to play audio. " "On mac you can install it with 'brew install ffmpeg'. " "On linux and windows you can install it from https://ffmpeg.org/" ) raise ValueError(message) args = ["ffplay", "-autoexit", "-", "-nodisp"] proc = subprocess.Popen( args=args, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, ) out, err = proc.communicate(input=audio) proc.poll() else: try: import io import sounddevice as sd # type: ignore import soundfile as sf # type: ignore except ModuleNotFoundError: message = ( "`pip install sounddevice soundfile` required when `use_ffmpeg=False` " ) raise ValueError(message) sd.play(*sf.read(io.BytesIO(audio))) sd.wait() def save(audio: Union[bytes, Iterator[bytes]], filename: str) -> None: if isinstance(audio, Iterator): audio = b"".join(audio) with open(filename, "wb") as f: f.write(audio) def stream(audio_stream: Iterator[bytes]) -> bytes: if not is_installed("mpv"): message = ( "mpv not found, necessary to stream audio. " "On mac you can install it with 'brew install mpv'. " "On linux and windows you can install it from https://mpv.io/" ) raise ValueError(message) mpv_command = ["mpv", "--no-cache", "--no-terminal", "--", "fd://0"] mpv_process = subprocess.Popen( mpv_command, stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) audio = b"" for chunk in audio_stream: if chunk is not None: mpv_process.stdin.write(chunk) # type: ignore mpv_process.stdin.flush() # type: ignore audio += chunk if mpv_process.stdin: mpv_process.stdin.close() mpv_process.wait() return audio elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/000077500000000000000000000000001523660243400251125ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/__init__.py000066400000000000000000000020121523660243400272160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import orders _dynamic_imports: typing.Dict[str, str] = {"orders": ".orders"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["orders"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/client.py000066400000000000000000000036471523660243400267540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawProductionsClient, RawProductionsClient if typing.TYPE_CHECKING: from .orders.client import AsyncOrdersClient, OrdersClient class ProductionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawProductionsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._orders: typing.Optional[OrdersClient] = None @property def with_raw_response(self) -> RawProductionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawProductionsClient """ return self._raw_client @property def orders(self): if self._orders is None: from .orders.client import OrdersClient # noqa: E402 self._orders = OrdersClient(client_wrapper=self._client_wrapper) return self._orders class AsyncProductionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawProductionsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._orders: typing.Optional[AsyncOrdersClient] = None @property def with_raw_response(self) -> AsyncRawProductionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawProductionsClient """ return self._raw_client @property def orders(self): if self._orders is None: from .orders.client import AsyncOrdersClient # noqa: E402 self._orders = AsyncOrdersClient(client_wrapper=self._client_wrapper) return self._orders elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/000077500000000000000000000000001523660243400264105ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/__init__.py000066400000000000000000000022561523660243400305260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import deliverables, items, languages, media _dynamic_imports: typing.Dict[str, str] = { "deliverables": ".deliverables", "items": ".items", "languages": ".languages", "media": ".media", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["deliverables", "items", "languages", "media"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/client.py000066400000000000000000000442751523660243400302540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import datetime as dt import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.create_order_request import CreateOrderRequest from ...types.create_order_response import CreateOrderResponse from ...types.list_orders_response import ListOrdersResponse from ...types.order_id import OrderId from ...types.order_response import OrderResponse from ...types.order_state import OrderState from ...types.submit_order_response import SubmitOrderResponse from ...types.update_order_request import UpdateOrderRequest from ...types.update_order_response import UpdateOrderResponse from .raw_client import AsyncRawOrdersClient, RawOrdersClient if typing.TYPE_CHECKING: from .deliverables.client import AsyncDeliverablesClient, DeliverablesClient from .items.client import AsyncItemsClient, ItemsClient from .languages.client import AsyncLanguagesClient, LanguagesClient from .media.client import AsyncMediaClient, MediaClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class OrdersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawOrdersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._media: typing.Optional[MediaClient] = None self._items: typing.Optional[ItemsClient] = None self._deliverables: typing.Optional[DeliverablesClient] = None self._languages: typing.Optional[LanguagesClient] = None @property def with_raw_response(self) -> RawOrdersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawOrdersClient """ return self._raw_client def list( self, *, page_size: typing.Optional[int] = None, offset: typing.Optional[int] = None, status: typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] = None, start_date: typing.Optional[dt.datetime] = None, end_date: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListOrdersResponse: """ Lists Productions orders in the workspace. Supports filtering by status and date range, with pagination. Parameters ---------- page_size : typing.Optional[int] Maximum number of orders to return per page. offset : typing.Optional[int] Number of orders to skip for pagination. status : typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] Filter orders by one or more statuses. start_date : typing.Optional[dt.datetime] Filter orders created on or after this date. end_date : typing.Optional[dt.datetime] Filter orders created on or before this date. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListOrdersResponse Successful Response Examples -------- import datetime from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.list( page_size=1, offset=1, status=["open"], start_date=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), end_date=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), ) """ _response = self._raw_client.list( page_size=page_size, offset=offset, status=status, start_date=start_date, end_date=end_date, request_options=request_options, ) return _response.data def create( self, *, request: typing.Optional[CreateOrderRequest] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateOrderResponse: """ Creates a new Productions order in the workspace. The order starts in the open state and can be configured with items before submission. Parameters ---------- request : typing.Optional[CreateOrderRequest] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateOrderResponse Successful Response Examples -------- from elevenlabs import CreateOrderRequest, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.create( request=CreateOrderRequest( sandbox=False, ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def get(self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None) -> OrderResponse: """ Retrieves full details for a Productions order. Quote and pricing information may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until it is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.get( order_id="order_id", ) """ _response = self._raw_client.get(order_id, request_options=request_options) return _response.data def update( self, order_id: OrderId, *, request: UpdateOrderRequest, request_options: typing.Optional[RequestOptions] = None ) -> UpdateOrderResponse: """ Updates an open order. Parameters ---------- order_id : OrderId The ID of the order. request : UpdateOrderRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpdateOrderResponse Successful Response Examples -------- from elevenlabs import ElevenLabs, UpdateOrderRequest client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.update( order_id="order_id", request=UpdateOrderRequest( name="Spanish Dubs", ), ) """ _response = self._raw_client.update(order_id, request=request, request_options=request_options) return _response.data def submit( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> SubmitOrderResponse: """ Submits an open order for processing. The order must have at least one item. Once submitted, items can no longer be modified. Upon submission, the workspace will be charged for the order. The quote is based on information extracted from the uploaded media, such as its duration. The quote may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until the quote is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SubmitOrderResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.submit( order_id="order_id", ) """ _response = self._raw_client.submit(order_id, request_options=request_options) return _response.data @property def media(self): if self._media is None: from .media.client import MediaClient # noqa: E402 self._media = MediaClient(client_wrapper=self._client_wrapper) return self._media @property def items(self): if self._items is None: from .items.client import ItemsClient # noqa: E402 self._items = ItemsClient(client_wrapper=self._client_wrapper) return self._items @property def deliverables(self): if self._deliverables is None: from .deliverables.client import DeliverablesClient # noqa: E402 self._deliverables = DeliverablesClient(client_wrapper=self._client_wrapper) return self._deliverables @property def languages(self): if self._languages is None: from .languages.client import LanguagesClient # noqa: E402 self._languages = LanguagesClient(client_wrapper=self._client_wrapper) return self._languages class AsyncOrdersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawOrdersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._media: typing.Optional[AsyncMediaClient] = None self._items: typing.Optional[AsyncItemsClient] = None self._deliverables: typing.Optional[AsyncDeliverablesClient] = None self._languages: typing.Optional[AsyncLanguagesClient] = None @property def with_raw_response(self) -> AsyncRawOrdersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawOrdersClient """ return self._raw_client async def list( self, *, page_size: typing.Optional[int] = None, offset: typing.Optional[int] = None, status: typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] = None, start_date: typing.Optional[dt.datetime] = None, end_date: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListOrdersResponse: """ Lists Productions orders in the workspace. Supports filtering by status and date range, with pagination. Parameters ---------- page_size : typing.Optional[int] Maximum number of orders to return per page. offset : typing.Optional[int] Number of orders to skip for pagination. status : typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] Filter orders by one or more statuses. start_date : typing.Optional[dt.datetime] Filter orders created on or after this date. end_date : typing.Optional[dt.datetime] Filter orders created on or before this date. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListOrdersResponse Successful Response Examples -------- import asyncio import datetime from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.list( page_size=1, offset=1, status=["open"], start_date=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), end_date=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, offset=offset, status=status, start_date=start_date, end_date=end_date, request_options=request_options, ) return _response.data async def create( self, *, request: typing.Optional[CreateOrderRequest] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateOrderResponse: """ Creates a new Productions order in the workspace. The order starts in the open state and can be configured with items before submission. Parameters ---------- request : typing.Optional[CreateOrderRequest] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreateOrderResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, CreateOrderRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.create( request=CreateOrderRequest( sandbox=False, ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def get(self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None) -> OrderResponse: """ Retrieves full details for a Productions order. Quote and pricing information may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until it is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.get( order_id="order_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(order_id, request_options=request_options) return _response.data async def update( self, order_id: OrderId, *, request: UpdateOrderRequest, request_options: typing.Optional[RequestOptions] = None ) -> UpdateOrderResponse: """ Updates an open order. Parameters ---------- order_id : OrderId The ID of the order. request : UpdateOrderRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpdateOrderResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, UpdateOrderRequest client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.update( order_id="order_id", request=UpdateOrderRequest( name="Spanish Dubs", ), ) asyncio.run(main()) """ _response = await self._raw_client.update(order_id, request=request, request_options=request_options) return _response.data async def submit( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> SubmitOrderResponse: """ Submits an open order for processing. The order must have at least one item. Once submitted, items can no longer be modified. Upon submission, the workspace will be charged for the order. The quote is based on information extracted from the uploaded media, such as its duration. The quote may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until the quote is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SubmitOrderResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.submit( order_id="order_id", ) asyncio.run(main()) """ _response = await self._raw_client.submit(order_id, request_options=request_options) return _response.data @property def media(self): if self._media is None: from .media.client import AsyncMediaClient # noqa: E402 self._media = AsyncMediaClient(client_wrapper=self._client_wrapper) return self._media @property def items(self): if self._items is None: from .items.client import AsyncItemsClient # noqa: E402 self._items = AsyncItemsClient(client_wrapper=self._client_wrapper) return self._items @property def deliverables(self): if self._deliverables is None: from .deliverables.client import AsyncDeliverablesClient # noqa: E402 self._deliverables = AsyncDeliverablesClient(client_wrapper=self._client_wrapper) return self._deliverables @property def languages(self): if self._languages is None: from .languages.client import AsyncLanguagesClient # noqa: E402 self._languages = AsyncLanguagesClient(client_wrapper=self._client_wrapper) return self._languages elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/deliverables/000077500000000000000000000000001523660243400310515ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/deliverables/__init__.py000066400000000000000000000001251523660243400331600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/deliverables/client.py000066400000000000000000000064061523660243400327070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.order_deliverables_response import OrderDeliverablesResponse from ....types.order_id import OrderId from .raw_client import AsyncRawDeliverablesClient, RawDeliverablesClient class DeliverablesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDeliverablesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDeliverablesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawDeliverablesClient """ return self._raw_client def list( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> OrderDeliverablesResponse: """ Retrieves the delivered files for a completed order. Returns an empty list if the order is not yet completed. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderDeliverablesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.deliverables.list( order_id="order_id", ) """ _response = self._raw_client.list(order_id, request_options=request_options) return _response.data class AsyncDeliverablesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDeliverablesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDeliverablesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawDeliverablesClient """ return self._raw_client async def list( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> OrderDeliverablesResponse: """ Retrieves the delivered files for a completed order. Returns an empty list if the order is not yet completed. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderDeliverablesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.deliverables.list( order_id="order_id", ) asyncio.run(main()) """ _response = await self._raw_client.list(order_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/deliverables/raw_client.py000066400000000000000000000125161523660243400335570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.order_deliverables_response import OrderDeliverablesResponse from ....types.order_id import OrderId from pydantic import ValidationError class RawDeliverablesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[OrderDeliverablesResponse]: """ Retrieves the delivered files for a completed order. Returns an empty list if the order is not yet completed. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[OrderDeliverablesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/deliverables", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderDeliverablesResponse, construct_type( type_=OrderDeliverablesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawDeliverablesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[OrderDeliverablesResponse]: """ Retrieves the delivered files for a completed order. Returns an empty list if the order is not yet completed. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[OrderDeliverablesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/deliverables", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderDeliverablesResponse, construct_type( type_=OrderDeliverablesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/items/000077500000000000000000000000001523660243400275315ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/items/__init__.py000066400000000000000000000001251523660243400316400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/items/client.py000066400000000000000000000160511523660243400313640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.item_id import ItemId from ....types.order_id import OrderId from ....types.remove_order_item_response import RemoveOrderItemResponse from ....types.upsert_order_item_request import UpsertOrderItemRequest from ....types.upsert_order_item_response import UpsertOrderItemResponse from .raw_client import AsyncRawItemsClient, RawItemsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ItemsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawItemsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawItemsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawItemsClient """ return self._raw_client def upsert( self, order_id: OrderId, *, request: UpsertOrderItemRequest, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertOrderItemResponse: """ Adds or updates an order item on an open order. Returns the item ID and the quoted price. Parameters ---------- order_id : OrderId The ID of the order. request : UpsertOrderItemRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpsertOrderItemResponse Successful Response Examples -------- from elevenlabs import ( ElevenLabs, OrderItemRequestInput_Dub, UpsertOrderItemRequest, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.items.upsert( order_id="order_id", request=UpsertOrderItemRequest( item=OrderItemRequestInput_Dub( media_id="prodmedia_01jgatk6h0fwxrtbjade61yqhx", source_language="en", destination_languages=["hi", "fr-FR", "de"], include_captions=True, include_source_captions=False, instructions="Voices don't need to match the originals, prioritize native-sounding voices", captions_sdh=False, ), ), ) """ _response = self._raw_client.upsert(order_id, request=request, request_options=request_options) return _response.data def remove( self, order_id: OrderId, item_id: ItemId, *, request_options: typing.Optional[RequestOptions] = None ) -> RemoveOrderItemResponse: """ Removes an order item from an open order. Parameters ---------- order_id : OrderId The ID of the order. item_id : ItemId The ID of the order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RemoveOrderItemResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.items.remove( order_id="order_id", item_id="item_id", ) """ _response = self._raw_client.remove(order_id, item_id, request_options=request_options) return _response.data class AsyncItemsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawItemsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawItemsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawItemsClient """ return self._raw_client async def upsert( self, order_id: OrderId, *, request: UpsertOrderItemRequest, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertOrderItemResponse: """ Adds or updates an order item on an open order. Returns the item ID and the quoted price. Parameters ---------- order_id : OrderId The ID of the order. request : UpsertOrderItemRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpsertOrderItemResponse Successful Response Examples -------- import asyncio from elevenlabs import ( AsyncElevenLabs, OrderItemRequestInput_Dub, UpsertOrderItemRequest, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.items.upsert( order_id="order_id", request=UpsertOrderItemRequest( item=OrderItemRequestInput_Dub( media_id="prodmedia_01jgatk6h0fwxrtbjade61yqhx", source_language="en", destination_languages=["hi", "fr-FR", "de"], include_captions=True, include_source_captions=False, instructions="Voices don't need to match the originals, prioritize native-sounding voices", captions_sdh=False, ), ), ) asyncio.run(main()) """ _response = await self._raw_client.upsert(order_id, request=request, request_options=request_options) return _response.data async def remove( self, order_id: OrderId, item_id: ItemId, *, request_options: typing.Optional[RequestOptions] = None ) -> RemoveOrderItemResponse: """ Removes an order item from an open order. Parameters ---------- order_id : OrderId The ID of the order. item_id : ItemId The ID of the order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RemoveOrderItemResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.items.remove( order_id="order_id", item_id="item_id", ) asyncio.run(main()) """ _response = await self._raw_client.remove(order_id, item_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/items/raw_client.py000066400000000000000000000255111523660243400322360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.item_id import ItemId from ....types.order_id import OrderId from ....types.remove_order_item_response import RemoveOrderItemResponse from ....types.upsert_order_item_request import UpsertOrderItemRequest from ....types.upsert_order_item_response import UpsertOrderItemResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawItemsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def upsert( self, order_id: OrderId, *, request: UpsertOrderItemRequest, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpsertOrderItemResponse]: """ Adds or updates an order item on an open order. Returns the item ID and the quoted price. Parameters ---------- order_id : OrderId The ID of the order. request : UpsertOrderItemRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[UpsertOrderItemResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/items", method="POST", json={ "request": convert_and_respect_annotation_metadata( object_=request, annotation=UpsertOrderItemRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpsertOrderItemResponse, construct_type( type_=UpsertOrderItemResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def remove( self, order_id: OrderId, item_id: ItemId, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RemoveOrderItemResponse]: """ Removes an order item from an open order. Parameters ---------- order_id : OrderId The ID of the order. item_id : ItemId The ID of the order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RemoveOrderItemResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/items/{jsonable_encoder(item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RemoveOrderItemResponse, construct_type( type_=RemoveOrderItemResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawItemsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def upsert( self, order_id: OrderId, *, request: UpsertOrderItemRequest, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpsertOrderItemResponse]: """ Adds or updates an order item on an open order. Returns the item ID and the quoted price. Parameters ---------- order_id : OrderId The ID of the order. request : UpsertOrderItemRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[UpsertOrderItemResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/items", method="POST", json={ "request": convert_and_respect_annotation_metadata( object_=request, annotation=UpsertOrderItemRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpsertOrderItemResponse, construct_type( type_=UpsertOrderItemResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def remove( self, order_id: OrderId, item_id: ItemId, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RemoveOrderItemResponse]: """ Removes an order item from an open order. Parameters ---------- order_id : OrderId The ID of the order. item_id : ItemId The ID of the order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RemoveOrderItemResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/items/{jsonable_encoder(item_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RemoveOrderItemResponse, construct_type( type_=RemoveOrderItemResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/languages/000077500000000000000000000000001523660243400303565ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/languages/__init__.py000066400000000000000000000001251523660243400324650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/languages/client.py000066400000000000000000000062501523660243400322110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.languages_response import LanguagesResponse from ....types.order_item_kind import OrderItemKind from .raw_client import AsyncRawLanguagesClient, RawLanguagesClient class LanguagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLanguagesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLanguagesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawLanguagesClient """ return self._raw_client def list( self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None ) -> LanguagesResponse: """ Returns the available languages for a given order item kind. Parameters ---------- order_item_kind : OrderItemKind The kind of order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LanguagesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.languages.list( order_item_kind="dub", ) """ _response = self._raw_client.list(order_item_kind, request_options=request_options) return _response.data class AsyncLanguagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLanguagesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLanguagesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawLanguagesClient """ return self._raw_client async def list( self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None ) -> LanguagesResponse: """ Returns the available languages for a given order item kind. Parameters ---------- order_item_kind : OrderItemKind The kind of order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- LanguagesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.languages.list( order_item_kind="dub", ) asyncio.run(main()) """ _response = await self._raw_client.list(order_item_kind, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/languages/raw_client.py000066400000000000000000000123441523660243400330630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.languages_response import LanguagesResponse from ....types.order_item_kind import OrderItemKind from pydantic import ValidationError class RawLanguagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[LanguagesResponse]: """ Returns the available languages for a given order item kind. Parameters ---------- order_item_kind : OrderItemKind The kind of order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[LanguagesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/languages/{jsonable_encoder(order_item_kind)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LanguagesResponse, construct_type( type_=LanguagesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawLanguagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[LanguagesResponse]: """ Returns the available languages for a given order item kind. Parameters ---------- order_item_kind : OrderItemKind The kind of order item. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[LanguagesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/languages/{jsonable_encoder(order_item_kind)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( LanguagesResponse, construct_type( type_=LanguagesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/media/000077500000000000000000000000001523660243400274675ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/media/__init__.py000066400000000000000000000001251523660243400315760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/media/client.py000066400000000000000000000205141523660243400313210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.media_id import MediaId from ....types.order_id import OrderId from ....types.order_media_response import OrderMediaResponse from ....types.register_media_response import RegisterMediaResponse from .raw_client import AsyncRawMediaClient, RawMediaClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class MediaClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMediaClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawMediaClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMediaClient """ return self._raw_client def register( self, order_id: OrderId, *, declared_language: str, media: typing.Optional[core.File] = OMIT, media_url: typing.Optional[str] = OMIT, media_url_filename: typing.Optional[str] = OMIT, media_url_content_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> RegisterMediaResponse: """ Registers a media file with an order, either by uploading it directly or by providing a URL to fetch it from. Exactly one of `media` or `media_url` must be provided. The registered media can then be referenced when adding order items. Parameters ---------- order_id : OrderId The ID of the order to which this media will be attached. declared_language : str The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind. media : typing.Optional[core.File] See core.File for more documentation media_url : typing.Optional[str] A URL to fetch the media file from. Mutually exclusive with media. media_url_filename : typing.Optional[str] The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url. media_url_content_type : typing.Optional[str] The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RegisterMediaResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.media.register( order_id="order_id", declared_language="declared_language", ) """ _response = self._raw_client.register( order_id, declared_language=declared_language, media=media, media_url=media_url, media_url_filename=media_url_filename, media_url_content_type=media_url_content_type, request_options=request_options, ) return _response.data def get( self, order_id: OrderId, media_id: MediaId, *, request_options: typing.Optional[RequestOptions] = None ) -> OrderMediaResponse: """ Retrieves metadata and a time-limited download URL for a previously uploaded media file. Parameters ---------- order_id : OrderId The ID of the order. media_id : MediaId The ID of the media file. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderMediaResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.productions.orders.media.get( order_id="order_id", media_id="media_id", ) """ _response = self._raw_client.get(order_id, media_id, request_options=request_options) return _response.data class AsyncMediaClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMediaClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawMediaClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMediaClient """ return self._raw_client async def register( self, order_id: OrderId, *, declared_language: str, media: typing.Optional[core.File] = OMIT, media_url: typing.Optional[str] = OMIT, media_url_filename: typing.Optional[str] = OMIT, media_url_content_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> RegisterMediaResponse: """ Registers a media file with an order, either by uploading it directly or by providing a URL to fetch it from. Exactly one of `media` or `media_url` must be provided. The registered media can then be referenced when adding order items. Parameters ---------- order_id : OrderId The ID of the order to which this media will be attached. declared_language : str The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind. media : typing.Optional[core.File] See core.File for more documentation media_url : typing.Optional[str] A URL to fetch the media file from. Mutually exclusive with media. media_url_filename : typing.Optional[str] The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url. media_url_content_type : typing.Optional[str] The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RegisterMediaResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.media.register( order_id="order_id", declared_language="declared_language", ) asyncio.run(main()) """ _response = await self._raw_client.register( order_id, declared_language=declared_language, media=media, media_url=media_url, media_url_filename=media_url_filename, media_url_content_type=media_url_content_type, request_options=request_options, ) return _response.data async def get( self, order_id: OrderId, media_id: MediaId, *, request_options: typing.Optional[RequestOptions] = None ) -> OrderMediaResponse: """ Retrieves metadata and a time-limited download URL for a previously uploaded media file. Parameters ---------- order_id : OrderId The ID of the order. media_id : MediaId The ID of the media file. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- OrderMediaResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.productions.orders.media.get( order_id="order_id", media_id="media_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(order_id, media_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/media/raw_client.py000066400000000000000000000316571523660243400322040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.media_id import MediaId from ....types.order_id import OrderId from ....types.order_media_response import OrderMediaResponse from ....types.register_media_response import RegisterMediaResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMediaClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def register( self, order_id: OrderId, *, declared_language: str, media: typing.Optional[core.File] = OMIT, media_url: typing.Optional[str] = OMIT, media_url_filename: typing.Optional[str] = OMIT, media_url_content_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[RegisterMediaResponse]: """ Registers a media file with an order, either by uploading it directly or by providing a URL to fetch it from. Exactly one of `media` or `media_url` must be provided. The registered media can then be referenced when adding order items. Parameters ---------- order_id : OrderId The ID of the order to which this media will be attached. declared_language : str The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind. media : typing.Optional[core.File] See core.File for more documentation media_url : typing.Optional[str] A URL to fetch the media file from. Mutually exclusive with media. media_url_filename : typing.Optional[str] The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url. media_url_content_type : typing.Optional[str] The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RegisterMediaResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/media", method="POST", data={ "declared_language": declared_language, "media_url": media_url, "media_url_filename": media_url_filename, "media_url_content_type": media_url_content_type, }, files={ **({"media": media} if media is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RegisterMediaResponse, construct_type( type_=RegisterMediaResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, order_id: OrderId, media_id: MediaId, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[OrderMediaResponse]: """ Retrieves metadata and a time-limited download URL for a previously uploaded media file. Parameters ---------- order_id : OrderId The ID of the order. media_id : MediaId The ID of the media file. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[OrderMediaResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/media/{jsonable_encoder(media_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderMediaResponse, construct_type( type_=OrderMediaResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawMediaClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def register( self, order_id: OrderId, *, declared_language: str, media: typing.Optional[core.File] = OMIT, media_url: typing.Optional[str] = OMIT, media_url_filename: typing.Optional[str] = OMIT, media_url_content_type: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[RegisterMediaResponse]: """ Registers a media file with an order, either by uploading it directly or by providing a URL to fetch it from. Exactly one of `media` or `media_url` must be provided. The registered media can then be referenced when adding order items. Parameters ---------- order_id : OrderId The ID of the order to which this media will be attached. declared_language : str The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind. media : typing.Optional[core.File] See core.File for more documentation media_url : typing.Optional[str] A URL to fetch the media file from. Mutually exclusive with media. media_url_filename : typing.Optional[str] The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url. media_url_content_type : typing.Optional[str] The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RegisterMediaResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/media", method="POST", data={ "declared_language": declared_language, "media_url": media_url, "media_url_filename": media_url_filename, "media_url_content_type": media_url_content_type, }, files={ **({"media": media} if media is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RegisterMediaResponse, construct_type( type_=RegisterMediaResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, order_id: OrderId, media_id: MediaId, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[OrderMediaResponse]: """ Retrieves metadata and a time-limited download URL for a previously uploaded media file. Parameters ---------- order_id : OrderId The ID of the order. media_id : MediaId The ID of the media file. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[OrderMediaResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/media/{jsonable_encoder(media_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderMediaResponse, construct_type( type_=OrderMediaResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/orders/raw_client.py000066400000000000000000000656021523660243400311220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.datetime_utils import serialize_datetime from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.create_order_request import CreateOrderRequest from ...types.create_order_response import CreateOrderResponse from ...types.list_orders_response import ListOrdersResponse from ...types.order_id import OrderId from ...types.order_response import OrderResponse from ...types.order_state import OrderState from ...types.submit_order_response import SubmitOrderResponse from ...types.update_order_request import UpdateOrderRequest from ...types.update_order_response import UpdateOrderResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawOrdersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, page_size: typing.Optional[int] = None, offset: typing.Optional[int] = None, status: typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] = None, start_date: typing.Optional[dt.datetime] = None, end_date: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListOrdersResponse]: """ Lists Productions orders in the workspace. Supports filtering by status and date range, with pagination. Parameters ---------- page_size : typing.Optional[int] Maximum number of orders to return per page. offset : typing.Optional[int] Number of orders to skip for pagination. status : typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] Filter orders by one or more statuses. start_date : typing.Optional[dt.datetime] Filter orders created on or after this date. end_date : typing.Optional[dt.datetime] Filter orders created on or before this date. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListOrdersResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/productions/orders", method="GET", params={ "page_size": page_size, "offset": offset, "status": status, "start_date": serialize_datetime(start_date) if start_date is not None else None, "end_date": serialize_datetime(end_date) if end_date is not None else None, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListOrdersResponse, construct_type( type_=ListOrdersResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, request: typing.Optional[CreateOrderRequest] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateOrderResponse]: """ Creates a new Productions order in the workspace. The order starts in the open state and can be configured with items before submission. Parameters ---------- request : typing.Optional[CreateOrderRequest] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreateOrderResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/productions/orders", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateOrderRequest, direction="write" ), request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateOrderResponse, construct_type( type_=CreateOrderResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[OrderResponse]: """ Retrieves full details for a Productions order. Quote and pricing information may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until it is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[OrderResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderResponse, construct_type( type_=OrderResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, order_id: OrderId, *, request: UpdateOrderRequest, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[UpdateOrderResponse]: """ Updates an open order. Parameters ---------- order_id : OrderId The ID of the order. request : UpdateOrderRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[UpdateOrderResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}", method="PATCH", json={ "request": convert_and_respect_annotation_metadata( object_=request, annotation=UpdateOrderRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpdateOrderResponse, construct_type( type_=UpdateOrderResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def submit( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SubmitOrderResponse]: """ Submits an open order for processing. The order must have at least one item. Once submitted, items can no longer be modified. Upon submission, the workspace will be charged for the order. The quote is based on information extracted from the uploaded media, such as its duration. The quote may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until the quote is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SubmitOrderResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/submit", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SubmitOrderResponse, construct_type( type_=SubmitOrderResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawOrdersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, page_size: typing.Optional[int] = None, offset: typing.Optional[int] = None, status: typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] = None, start_date: typing.Optional[dt.datetime] = None, end_date: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListOrdersResponse]: """ Lists Productions orders in the workspace. Supports filtering by status and date range, with pagination. Parameters ---------- page_size : typing.Optional[int] Maximum number of orders to return per page. offset : typing.Optional[int] Number of orders to skip for pagination. status : typing.Optional[typing.Union[OrderState, typing.Sequence[OrderState]]] Filter orders by one or more statuses. start_date : typing.Optional[dt.datetime] Filter orders created on or after this date. end_date : typing.Optional[dt.datetime] Filter orders created on or before this date. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListOrdersResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/productions/orders", method="GET", params={ "page_size": page_size, "offset": offset, "status": status, "start_date": serialize_datetime(start_date) if start_date is not None else None, "end_date": serialize_datetime(end_date) if end_date is not None else None, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListOrdersResponse, construct_type( type_=ListOrdersResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, request: typing.Optional[CreateOrderRequest] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateOrderResponse]: """ Creates a new Productions order in the workspace. The order starts in the open state and can be configured with items before submission. Parameters ---------- request : typing.Optional[CreateOrderRequest] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreateOrderResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/productions/orders", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateOrderRequest, direction="write" ), request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreateOrderResponse, construct_type( type_=CreateOrderResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[OrderResponse]: """ Retrieves full details for a Productions order. Quote and pricing information may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until it is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[OrderResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( OrderResponse, construct_type( type_=OrderResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, order_id: OrderId, *, request: UpdateOrderRequest, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[UpdateOrderResponse]: """ Updates an open order. Parameters ---------- order_id : OrderId The ID of the order. request : UpdateOrderRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[UpdateOrderResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}", method="PATCH", json={ "request": convert_and_respect_annotation_metadata( object_=request, annotation=UpdateOrderRequest, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpdateOrderResponse, construct_type( type_=UpdateOrderResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def submit( self, order_id: OrderId, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SubmitOrderResponse]: """ Submits an open order for processing. The order must have at least one item. Once submitted, items can no longer be modified. Upon submission, the workspace will be charged for the order. The quote is based on information extracted from the uploaded media, such as its duration. The quote may not be available immediately; if you wish to see the quote before submission, you may need to poll the order details until the quote is ready. Parameters ---------- order_id : OrderId The ID of the order. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SubmitOrderResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/productions/orders/{jsonable_encoder(order_id)}/submit", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SubmitOrderResponse, construct_type( type_=SubmitOrderResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/productions/raw_client.py000066400000000000000000000006431523660243400276160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawProductionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawProductionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/000077500000000000000000000000001523660243400301665ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/__init__.py000066400000000000000000000101521523660243400322760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( AddPronunciationDictionaryRequestWorkspaceAccess, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess, PronunciationDictionariesListRequestSort, ) from . import rules from .rules import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme, PronunciationDictionaryRule, PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme, ) _dynamic_imports: typing.Dict[str, str] = { "AddPronunciationDictionaryRequestWorkspaceAccess": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess": ".types", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem": ".rules", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias": ".rules", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme": ".rules", "PronunciationDictionariesListRequestSort": ".types", "PronunciationDictionaryRule": ".rules", "PronunciationDictionaryRule_Alias": ".rules", "PronunciationDictionaryRule_Phoneme": ".rules", "rules": ".rules", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AddPronunciationDictionaryRequestWorkspaceAccess", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", "PronunciationDictionariesListRequestSort", "PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme", "rules", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/client.py000066400000000000000000000607561523660243400320340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.add_pronunciation_dictionary_response_model import AddPronunciationDictionaryResponseModel from ..types.get_pronunciation_dictionaries_metadata_response_model import ( GetPronunciationDictionariesMetadataResponseModel, ) from ..types.get_pronunciation_dictionary_metadata_response import GetPronunciationDictionaryMetadataResponse from ..types.get_pronunciation_dictionary_with_rules_response_model import ( GetPronunciationDictionaryWithRulesResponseModel, ) from .raw_client import AsyncRawPronunciationDictionariesClient, RawPronunciationDictionariesClient from .types.add_pronunciation_dictionary_request_workspace_access import ( AddPronunciationDictionaryRequestWorkspaceAccess, ) from .types.body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem, ) from .types.body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_workspace_access import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess, ) from .types.pronunciation_dictionaries_list_request_sort import PronunciationDictionariesListRequestSort if typing.TYPE_CHECKING: from .rules.client import AsyncRulesClient, RulesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class PronunciationDictionariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPronunciationDictionariesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._rules: typing.Optional[RulesClient] = None @property def with_raw_response(self) -> RawPronunciationDictionariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPronunciationDictionariesClient """ return self._raw_client def create_from_file( self, *, name: str, file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddPronunciationDictionaryResponseModel: """ Creates a new pronunciation dictionary from a lexicon .PLS file Parameters ---------- name : str The name of the pronunciation dictionary, used for identification only. file : typing.Optional[core.File] See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddPronunciationDictionaryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.create_from_file( name="name", ) """ _response = self._raw_client.create_from_file( name=name, file=file, description=description, workspace_access=workspace_access, request_options=request_options, ) return _response.data def create_from_rules( self, *, rules: typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem], name: str, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddPronunciationDictionaryResponseModel: """ Creates a new pronunciation dictionary from provided rules. Parameters ---------- rules : typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } name : str The name of the pronunciation dictionary, used for identification only. description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddPronunciationDictionaryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.pronunciation_dictionaries import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.create_from_rules( rules=[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], name="My Dictionary", ) """ _response = self._raw_client.create_from_rules( rules=rules, name=name, description=description, workspace_access=workspace_access, request_options=request_options, ) return _response.data def get( self, pronunciation_dictionary_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetPronunciationDictionaryWithRulesResponseModel: """ Get metadata for a pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionaryWithRulesResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.get( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get(pronunciation_dictionary_id, request_options=request_options) return _response.data def update( self, pronunciation_dictionary_id: str, *, archived: typing.Optional[bool] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetPronunciationDictionaryMetadataResponse: """ Partially update the pronunciation dictionary without changing the version Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary archived : typing.Optional[bool] Whether to archive the pronunciation dictionary. name : typing.Optional[str] The name of the pronunciation dictionary, used for identification only. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionaryMetadataResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.update( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( pronunciation_dictionary_id, archived=archived, name=name, request_options=request_options ) return _response.data def download( self, dictionary_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Get a PLS file with a pronunciation dictionary version rules Parameters ---------- dictionary_id : str The id of the pronunciation dictionary version_id : str The id of the pronunciation dictionary version 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. Returns ------- typing.Iterator[bytes] The PLS file containing pronunciation dictionary rules Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.download( dictionary_id="dictionary_id", version_id="version_id", ) """ with self._raw_client.download(dictionary_id, version_id, request_options=request_options) as r: yield from r.data def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort: typing.Optional[PronunciationDictionariesListRequestSort] = None, sort_direction: typing.Optional[str] = None, include_archived: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetPronunciationDictionariesMetadataResponseModel: """ Get a list of the pronunciation dictionaries you have access to and their metadata Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. sort : typing.Optional[PronunciationDictionariesListRequestSort] Which field to sort by, one of 'created_at_unix' or 'name'. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'ascending' or 'descending'. include_archived : typing.Optional[bool] Whether to include archived pronunciation dictionaries in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionariesMetadataResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.list( cursor="cursor", page_size=1, sort="creation_time_unix", sort_direction="sort_direction", include_archived=False, ) """ _response = self._raw_client.list( cursor=cursor, page_size=page_size, sort=sort, sort_direction=sort_direction, include_archived=include_archived, request_options=request_options, ) return _response.data @property def rules(self): if self._rules is None: from .rules.client import RulesClient # noqa: E402 self._rules = RulesClient(client_wrapper=self._client_wrapper) return self._rules class AsyncPronunciationDictionariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPronunciationDictionariesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._rules: typing.Optional[AsyncRulesClient] = None @property def with_raw_response(self) -> AsyncRawPronunciationDictionariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPronunciationDictionariesClient """ return self._raw_client async def create_from_file( self, *, name: str, file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddPronunciationDictionaryResponseModel: """ Creates a new pronunciation dictionary from a lexicon .PLS file Parameters ---------- name : str The name of the pronunciation dictionary, used for identification only. file : typing.Optional[core.File] See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddPronunciationDictionaryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.create_from_file( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create_from_file( name=name, file=file, description=description, workspace_access=workspace_access, request_options=request_options, ) return _response.data async def create_from_rules( self, *, rules: typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem], name: str, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddPronunciationDictionaryResponseModel: """ Creates a new pronunciation dictionary from provided rules. Parameters ---------- rules : typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } name : str The name of the pronunciation dictionary, used for identification only. description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddPronunciationDictionaryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.pronunciation_dictionaries import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.create_from_rules( rules=[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], name="My Dictionary", ) asyncio.run(main()) """ _response = await self._raw_client.create_from_rules( rules=rules, name=name, description=description, workspace_access=workspace_access, request_options=request_options, ) return _response.data async def get( self, pronunciation_dictionary_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetPronunciationDictionaryWithRulesResponseModel: """ Get metadata for a pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionaryWithRulesResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.get( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get(pronunciation_dictionary_id, request_options=request_options) return _response.data async def update( self, pronunciation_dictionary_id: str, *, archived: typing.Optional[bool] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetPronunciationDictionaryMetadataResponse: """ Partially update the pronunciation dictionary without changing the version Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary archived : typing.Optional[bool] Whether to archive the pronunciation dictionary. name : typing.Optional[str] The name of the pronunciation dictionary, used for identification only. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionaryMetadataResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.update( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( pronunciation_dictionary_id, archived=archived, name=name, request_options=request_options ) return _response.data async def download( self, dictionary_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Get a PLS file with a pronunciation dictionary version rules Parameters ---------- dictionary_id : str The id of the pronunciation dictionary version_id : str The id of the pronunciation dictionary version 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. Returns ------- typing.AsyncIterator[bytes] The PLS file containing pronunciation dictionary rules Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.download( dictionary_id="dictionary_id", version_id="version_id", ) asyncio.run(main()) """ async with self._raw_client.download(dictionary_id, version_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort: typing.Optional[PronunciationDictionariesListRequestSort] = None, sort_direction: typing.Optional[str] = None, include_archived: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetPronunciationDictionariesMetadataResponseModel: """ Get a list of the pronunciation dictionaries you have access to and their metadata Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. sort : typing.Optional[PronunciationDictionariesListRequestSort] Which field to sort by, one of 'created_at_unix' or 'name'. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'ascending' or 'descending'. include_archived : typing.Optional[bool] Whether to include archived pronunciation dictionaries in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetPronunciationDictionariesMetadataResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.list( cursor="cursor", page_size=1, sort="creation_time_unix", sort_direction="sort_direction", include_archived=False, ) asyncio.run(main()) """ _response = await self._raw_client.list( cursor=cursor, page_size=page_size, sort=sort, sort_direction=sort_direction, include_archived=include_archived, request_options=request_options, ) return _response.data @property def rules(self): if self._rules is None: from .rules.client import AsyncRulesClient # noqa: E402 self._rules = AsyncRulesClient(client_wrapper=self._client_wrapper) return self._rules elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/raw_client.py000066400000000000000000001153671523660243400327040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.add_pronunciation_dictionary_response_model import AddPronunciationDictionaryResponseModel from ..types.get_pronunciation_dictionaries_metadata_response_model import ( GetPronunciationDictionariesMetadataResponseModel, ) from ..types.get_pronunciation_dictionary_metadata_response import GetPronunciationDictionaryMetadataResponse from ..types.get_pronunciation_dictionary_with_rules_response_model import ( GetPronunciationDictionaryWithRulesResponseModel, ) from .types.add_pronunciation_dictionary_request_workspace_access import ( AddPronunciationDictionaryRequestWorkspaceAccess, ) from .types.body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem, ) from .types.body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_workspace_access import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess, ) from .types.pronunciation_dictionaries_list_request_sort import PronunciationDictionariesListRequestSort from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawPronunciationDictionariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create_from_file( self, *, name: str, file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddPronunciationDictionaryResponseModel]: """ Creates a new pronunciation dictionary from a lexicon .PLS file Parameters ---------- name : str The name of the pronunciation dictionary, used for identification only. file : typing.Optional[core.File] See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddPronunciationDictionaryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries/add-from-file", method="POST", data={ "name": name, "description": description, "workspace_access": workspace_access, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddPronunciationDictionaryResponseModel, construct_type( type_=AddPronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_from_rules( self, *, rules: typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem], name: str, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddPronunciationDictionaryResponseModel]: """ Creates a new pronunciation dictionary from provided rules. Parameters ---------- rules : typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } name : str The name of the pronunciation dictionary, used for identification only. description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddPronunciationDictionaryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries/add-from-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem ], direction="write", ), "name": name, "description": description, "workspace_access": workspace_access, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddPronunciationDictionaryResponseModel, construct_type( type_=AddPronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, pronunciation_dictionary_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetPronunciationDictionaryWithRulesResponseModel]: """ Get metadata for a pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetPronunciationDictionaryWithRulesResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionaryWithRulesResponseModel, construct_type( type_=GetPronunciationDictionaryWithRulesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, pronunciation_dictionary_id: str, *, archived: typing.Optional[bool] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetPronunciationDictionaryMetadataResponse]: """ Partially update the pronunciation dictionary without changing the version Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary archived : typing.Optional[bool] Whether to archive the pronunciation dictionary. name : typing.Optional[str] The name of the pronunciation dictionary, used for identification only. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetPronunciationDictionaryMetadataResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}", method="PATCH", json={ "archived": archived, "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionaryMetadataResponse, construct_type( type_=GetPronunciationDictionaryMetadataResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def download( self, dictionary_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Get a PLS file with a pronunciation dictionary version rules Parameters ---------- dictionary_id : str The id of the pronunciation dictionary version_id : str The id of the pronunciation dictionary version 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The PLS file containing pronunciation dictionary rules """ with self._client_wrapper.httpx_client.stream( f"v1/pronunciation-dictionaries/{jsonable_encoder(dictionary_id)}/{jsonable_encoder(version_id)}/download", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort: typing.Optional[PronunciationDictionariesListRequestSort] = None, sort_direction: typing.Optional[str] = None, include_archived: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetPronunciationDictionariesMetadataResponseModel]: """ Get a list of the pronunciation dictionaries you have access to and their metadata Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. sort : typing.Optional[PronunciationDictionariesListRequestSort] Which field to sort by, one of 'created_at_unix' or 'name'. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'ascending' or 'descending'. include_archived : typing.Optional[bool] Whether to include archived pronunciation dictionaries in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetPronunciationDictionariesMetadataResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries", method="GET", params={ "cursor": cursor, "page_size": page_size, "sort": sort, "sort_direction": sort_direction, "include_archived": include_archived, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionariesMetadataResponseModel, construct_type( type_=GetPronunciationDictionariesMetadataResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawPronunciationDictionariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create_from_file( self, *, name: str, file: typing.Optional[core.File] = OMIT, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddPronunciationDictionaryResponseModel]: """ Creates a new pronunciation dictionary from a lexicon .PLS file Parameters ---------- name : str The name of the pronunciation dictionary, used for identification only. file : typing.Optional[core.File] See core.File for more documentation description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[AddPronunciationDictionaryRequestWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddPronunciationDictionaryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries/add-from-file", method="POST", data={ "name": name, "description": description, "workspace_access": workspace_access, }, files={ **({"file": file} if file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddPronunciationDictionaryResponseModel, construct_type( type_=AddPronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_from_rules( self, *, rules: typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem], name: str, description: typing.Optional[str] = OMIT, workspace_access: typing.Optional[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddPronunciationDictionaryResponseModel]: """ Creates a new pronunciation dictionary from provided rules. Parameters ---------- rules : typing.Sequence[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } name : str The name of the pronunciation dictionary, used for identification only. description : typing.Optional[str] A description of the pronunciation dictionary, used for identification only. workspace_access : typing.Optional[BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess] Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddPronunciationDictionaryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries/add-from-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem ], direction="write", ), "name": name, "description": description, "workspace_access": workspace_access, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddPronunciationDictionaryResponseModel, construct_type( type_=AddPronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, pronunciation_dictionary_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetPronunciationDictionaryWithRulesResponseModel]: """ Get metadata for a pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetPronunciationDictionaryWithRulesResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionaryWithRulesResponseModel, construct_type( type_=GetPronunciationDictionaryWithRulesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, pronunciation_dictionary_id: str, *, archived: typing.Optional[bool] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetPronunciationDictionaryMetadataResponse]: """ Partially update the pronunciation dictionary without changing the version Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary archived : typing.Optional[bool] Whether to archive the pronunciation dictionary. name : typing.Optional[str] The name of the pronunciation dictionary, used for identification only. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetPronunciationDictionaryMetadataResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}", method="PATCH", json={ "archived": archived, "name": name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionaryMetadataResponse, construct_type( type_=GetPronunciationDictionaryMetadataResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def download( self, dictionary_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Get a PLS file with a pronunciation dictionary version rules Parameters ---------- dictionary_id : str The id of the pronunciation dictionary version_id : str The id of the pronunciation dictionary version 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The PLS file containing pronunciation dictionary rules """ async with self._client_wrapper.httpx_client.stream( f"v1/pronunciation-dictionaries/{jsonable_encoder(dictionary_id)}/{jsonable_encoder(version_id)}/download", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, sort: typing.Optional[PronunciationDictionariesListRequestSort] = None, sort_direction: typing.Optional[str] = None, include_archived: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetPronunciationDictionariesMetadataResponseModel]: """ Get a list of the pronunciation dictionaries you have access to and their metadata Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. sort : typing.Optional[PronunciationDictionariesListRequestSort] Which field to sort by, one of 'created_at_unix' or 'name'. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'ascending' or 'descending'. include_archived : typing.Optional[bool] Whether to include archived pronunciation dictionaries in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetPronunciationDictionariesMetadataResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/pronunciation-dictionaries", method="GET", params={ "cursor": cursor, "page_size": page_size, "sort": sort, "sort_direction": sort_direction, "include_archived": include_archived, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetPronunciationDictionariesMetadataResponseModel, construct_type( type_=GetPronunciationDictionariesMetadataResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/000077500000000000000000000000001523660243400313205ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/__init__.py000066400000000000000000000050171523660243400334340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme, PronunciationDictionaryRule, PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme, ) _dynamic_imports: typing.Dict[str, str] = { "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem": ".types", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias": ".types", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme": ".types", "PronunciationDictionaryRule": ".types", "PronunciationDictionaryRule_Alias": ".types", "PronunciationDictionaryRule_Phoneme": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", "PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/client.py000066400000000000000000000315741523660243400331620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.pronunciation_dictionary_rules_response_model import PronunciationDictionaryRulesResponseModel from .raw_client import AsyncRawRulesClient, RawRulesClient from .types.body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, ) from .types.pronunciation_dictionary_rule import PronunciationDictionaryRule # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RulesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawRulesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawRulesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawRulesClient """ return self._raw_client def set( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Replaces all existing rules on the pronunciation dictionary with the provided ones. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successfully set rules on the pronunciation dictionary Examples -------- from elevenlabs import ElevenLabs from elevenlabs.pronunciation_dictionaries.rules import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.rules.set( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], ) """ _response = self._raw_client.set(pronunciation_dictionary_id, rules=rules, request_options=request_options) return _response.data def add( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[PronunciationDictionaryRule] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.pronunciation_dictionaries.rules import ( PronunciationDictionaryRule_Alias, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.rules.add( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ PronunciationDictionaryRule_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], ) """ _response = self._raw_client.add(pronunciation_dictionary_id, rules=rules, request_options=request_options) return _response.data def remove( self, pronunciation_dictionary_id: str, *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Remove rules from the pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rule_strings : typing.Sequence[str] List of strings to remove from the pronunciation dictionary. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.pronunciation_dictionaries.rules.remove( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rule_strings=["rule_strings"], ) """ _response = self._raw_client.remove( pronunciation_dictionary_id, rule_strings=rule_strings, request_options=request_options ) return _response.data class AsyncRulesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawRulesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawRulesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawRulesClient """ return self._raw_client async def set( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Replaces all existing rules on the pronunciation dictionary with the provided ones. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successfully set rules on the pronunciation dictionary Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.pronunciation_dictionaries.rules import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.rules.set( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], ) asyncio.run(main()) """ _response = await self._raw_client.set( pronunciation_dictionary_id, rules=rules, request_options=request_options ) return _response.data async def add( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[PronunciationDictionaryRule] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.pronunciation_dictionaries.rules import ( PronunciationDictionaryRule_Alias, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.rules.add( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rules=[ PronunciationDictionaryRule_Alias( string_to_replace="Thailand", case_sensitive=True, word_boundaries=True, alias="tie-land", ) ], ) asyncio.run(main()) """ _response = await self._raw_client.add( pronunciation_dictionary_id, rules=rules, request_options=request_options ) return _response.data async def remove( self, pronunciation_dictionary_id: str, *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> PronunciationDictionaryRulesResponseModel: """ Remove rules from the pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rule_strings : typing.Sequence[str] List of strings to remove from the pronunciation dictionary. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PronunciationDictionaryRulesResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.pronunciation_dictionaries.rules.remove( pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", rule_strings=["rule_strings"], ) asyncio.run(main()) """ _response = await self._raw_client.remove( pronunciation_dictionary_id, rule_strings=rule_strings, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/raw_client.py000066400000000000000000000471561523660243400340360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.pronunciation_dictionary_rules_response_model import PronunciationDictionaryRulesResponseModel from .types.body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, ) from .types.pronunciation_dictionary_rule import PronunciationDictionaryRule from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawRulesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def set( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PronunciationDictionaryRulesResponseModel]: """ Replaces all existing rules on the pronunciation dictionary with the provided ones. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PronunciationDictionaryRulesResponseModel] Successfully set rules on the pronunciation dictionary """ _response = self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/set-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def add( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PronunciationDictionaryRulesResponseModel]: """ Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[PronunciationDictionaryRule] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PronunciationDictionaryRulesResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/add-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[PronunciationDictionaryRule], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def remove( self, pronunciation_dictionary_id: str, *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PronunciationDictionaryRulesResponseModel]: """ Remove rules from the pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rule_strings : typing.Sequence[str] List of strings to remove from the pronunciation dictionary. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PronunciationDictionaryRulesResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/remove-rules", method="POST", json={ "rule_strings": rule_strings, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawRulesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def set( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PronunciationDictionaryRulesResponseModel]: """ Replaces all existing rules on the pronunciation dictionary with the provided ones. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PronunciationDictionaryRulesResponseModel] Successfully set rules on the pronunciation dictionary """ _response = await self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/set-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem ], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def add( self, pronunciation_dictionary_id: str, *, rules: typing.Sequence[PronunciationDictionaryRule], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PronunciationDictionaryRulesResponseModel]: """ Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced. Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rules : typing.Sequence[PronunciationDictionaryRule] List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PronunciationDictionaryRulesResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/add-rules", method="POST", json={ "rules": convert_and_respect_annotation_metadata( object_=rules, annotation=typing.Sequence[PronunciationDictionaryRule], direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def remove( self, pronunciation_dictionary_id: str, *, rule_strings: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PronunciationDictionaryRulesResponseModel]: """ Remove rules from the pronunciation dictionary Parameters ---------- pronunciation_dictionary_id : str The id of the pronunciation dictionary rule_strings : typing.Sequence[str] List of strings to remove from the pronunciation dictionary. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PronunciationDictionaryRulesResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/pronunciation-dictionaries/{jsonable_encoder(pronunciation_dictionary_id)}/remove-rules", method="POST", json={ "rule_strings": rule_strings, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PronunciationDictionaryRulesResponseModel, construct_type( type_=PronunciationDictionaryRulesResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/types/000077500000000000000000000000001523660243400324645ustar00rootroot00000000000000__init__.py000066400000000000000000000062061523660243400345220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item import ( BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme, ) from .pronunciation_dictionary_rule import ( PronunciationDictionaryRule, PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme, ) _dynamic_imports: typing.Dict[str, str] = { "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem": ".body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias": ".body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme": ".body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item", "PronunciationDictionaryRule": ".pronunciation_dictionary_rule", "PronunciationDictionaryRule_Alias": ".pronunciation_dictionary_rule", "PronunciationDictionaryRule_Phoneme": ".pronunciation_dictionary_rule", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", "PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme", ] 97a701c90ad3521f9ee4ffe561dcc93ceabfebd1.paxheader00006660000000000000000000000353152366024340021162xustar00rootroot00000000000000235 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/types/body_set_rules_on_the_pronunciation_dictionary_v_1_pronunciation_dictionaries_pronunciation_dictionary_id_set_rules_post_rules_item.py 97a701c90ad3521f9ee4ffe561dcc93ceabfebd1.data000066400000000000000000000040101523660243400200120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias( UncheckedBaseModel ): type: typing.Literal["alias"] = "alias" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None alias: 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 BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme( UncheckedBaseModel ): type: typing.Literal["phoneme"] = "phoneme" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None phoneme: str alphabet: 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 BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem = typing_extensions.Annotated[ typing.Union[ BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme, ], UnionMetadata(discriminant="type"), ] pronunciation_dictionary_rule.py000066400000000000000000000030671523660243400411310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/rules/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class PronunciationDictionaryRule_Alias(UncheckedBaseModel): type: typing.Literal["alias"] = "alias" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None alias: 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 PronunciationDictionaryRule_Phoneme(UncheckedBaseModel): type: typing.Literal["phoneme"] = "phoneme" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None phoneme: str alphabet: 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 PronunciationDictionaryRule = typing_extensions.Annotated[ typing.Union[PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types/000077500000000000000000000000001523660243400313325ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types/__init__.py000066400000000000000000000064241523660243400334510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .add_pronunciation_dictionary_request_workspace_access import AddPronunciationDictionaryRequestWorkspaceAccess from .body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme, ) from .body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_workspace_access import ( BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess, ) from .pronunciation_dictionaries_list_request_sort import PronunciationDictionariesListRequestSort _dynamic_imports: typing.Dict[str, str] = { "AddPronunciationDictionaryRequestWorkspaceAccess": ".add_pronunciation_dictionary_request_workspace_access", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem": ".body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias": ".body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme": ".body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess": ".body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_workspace_access", "PronunciationDictionariesListRequestSort": ".pronunciation_dictionaries_list_request_sort", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AddPronunciationDictionaryRequestWorkspaceAccess", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess", "PronunciationDictionariesListRequestSort", ] add_pronunciation_dictionary_request_workspace_access.py000066400000000000000000000003341523660243400447210ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types# This file was auto-generated by Fern from our API Definition. import typing AddPronunciationDictionaryRequestWorkspaceAccess = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_rules_item.py000066400000000000000000000035441523660243400557110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias(UncheckedBaseModel): type: typing.Literal["alias"] = "alias" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None alias: 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 BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme(UncheckedBaseModel): type: typing.Literal["phoneme"] = "phoneme" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None phoneme: str alphabet: 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 BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem = typing_extensions.Annotated[ typing.Union[ BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme, ], UnionMetadata(discriminant="type"), ] 27c34f7b3069eae6fc5b6dfff5b1dcc01cbe6d74.paxheader00006660000000000000000000000311152366024340021155xustar00rootroot00000000000000201 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types/body_add_a_pronunciation_dictionary_v_1_pronunciation_dictionaries_add_from_rules_post_workspace_access.py 27c34f7b3069eae6fc5b6dfff5b1dcc01cbe6d74.data000066400000000000000000000004051523660243400200170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] pronunciation_dictionaries_list_request_sort.py000066400000000000000000000003021523660243400431170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/pronunciation_dictionaries/types# This file was auto-generated by Fern from our API Definition. import typing PronunciationDictionariesListRequestSort = typing.Union[typing.Literal["creation_time_unix", "name"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/py.typed000066400000000000000000000000001523660243400242260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/realtime/000077500000000000000000000000001523660243400243435ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/realtime/__init__.py000066400000000000000000000011751523660243400264600ustar00rootroot00000000000000""" Real-time speech-to-text WebSocket helpers for ElevenLabs API. This module provides classes for streaming audio to the ElevenLabs speech-to-text API and receiving real-time transcription results. """ from .connection import RealtimeConnection, RealtimeEvents from .scribe import ( AudioFormat, CommitStrategy, RealtimeAudioOptions, RealtimeEntityDetection, RealtimeUrlOptions, ScribeRealtime, ) __all__ = [ "RealtimeConnection", "RealtimeEvents", "ScribeRealtime", "AudioFormat", "CommitStrategy", "RealtimeEntityDetection", "RealtimeAudioOptions", "RealtimeUrlOptions", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/realtime/connection.py000066400000000000000000000234241523660243400270610ustar00rootroot00000000000000import asyncio import json import subprocess import typing from enum import Enum if typing.TYPE_CHECKING: from websockets.asyncio.client import ClientConnection class RealtimeEvents(str, Enum): """Events emitted by the RealtimeConnection""" OPEN = "open" CLOSE = "close" SESSION_STARTED = "session_started" PARTIAL_TRANSCRIPT = "partial_transcript" FINAL_TRANSCRIPT = "final_transcript" FINAL_TRANSCRIPT_WITH_TIMESTAMPS = "final_transcript_with_timestamps" COMMITTED_TRANSCRIPT = "committed_transcript" COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS = "committed_transcript_with_timestamps" COMMITTED_TRANSCRIPT_ENTITIES = "committed_transcript_entities" ERROR = "error" AUTH_ERROR = "auth_error" QUOTA_EXCEEDED = "quota_exceeded" COMMIT_THROTTLED = "commit_throttled" TRANSCRIBER_ERROR = "transcriber_error" UNACCEPTED_TERMS = "unaccepted_terms" # Deprecated: the server sends "unaccepted_terms". Kept so existing # subscribers keep firing; prefer UNACCEPTED_TERMS. UNACCEPTED_TERMS_ERROR = "unaccepted_terms_error" RATE_LIMITED = "rate_limited" INPUT_ERROR = "input_error" INVALID_REQUEST = "invalid_request" QUEUE_OVERFLOW = "queue_overflow" RESOURCE_EXHAUSTED = "resource_exhausted" SESSION_TIME_LIMIT_EXCEEDED = "session_time_limit_exceeded" CHUNK_SIZE_EXCEEDED = "chunk_size_exceeded" INSUFFICIENT_AUDIO_ACTIVITY = "insufficient_audio_activity" class RealtimeConnection: """ A WebSocket connection for real-time speech-to-text transcription. This class handles bidirectional WebSocket communication with the ElevenLabs speech-to-text API, managing audio streaming and receiving transcription results. Example: ```python connection = await client.speech_to_text.realtime.connect({ "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000 }) connection.on(RealtimeEvents.PARTIAL_TRANSCRIPT, lambda data: print(data)) connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, lambda data: print(data)) # Send audio connection.send({"audioBase64": audio_chunk}) # When done connection.commit() await connection.close() ``` """ def __init__(self, websocket: "ClientConnection", current_sample_rate: int, ffmpeg_process: typing.Optional[subprocess.Popen] = None): self.websocket = websocket self.current_sample_rate = current_sample_rate self.ffmpeg_process = ffmpeg_process self._event_handlers: typing.Dict[str, typing.List[typing.Callable]] = {} self._message_task: typing.Optional[asyncio.Task] = None def on(self, event: str, callback: typing.Callable) -> None: """ Register an event handler for a specific event type. Args: event: The event type to listen for (from RealtimeEvents enum) callback: The function to call when the event occurs Example: ```python def handle_transcript(data): print(f"Transcript: {data['transcript']}") connection.on(RealtimeEvents.PARTIAL_TRANSCRIPT, handle_transcript) ``` """ if event not in self._event_handlers: self._event_handlers[event] = [] self._event_handlers[event].append(callback) def _emit(self, event: str, *args) -> None: """Emit an event to all registered handlers""" if event in self._event_handlers: for handler in self._event_handlers[event]: try: handler(*args) except Exception as e: print(f"Error in event handler for {event}: {e}") async def _start_message_handler(self) -> None: """Start handling incoming WebSocket messages""" try: async for message in self.websocket: try: data = json.loads(message) message_type = data.get("message_type") # Try to match message_type to a known event try: event = RealtimeEvents(message_type) self._emit(event, data) # The server sends "unaccepted_terms"; also emit under the # older event name so existing subscribers keep firing. if event is RealtimeEvents.UNACCEPTED_TERMS: self._emit(RealtimeEvents.UNACCEPTED_TERMS_ERROR, data) # Also emit generic ERROR event for specific error types error_events = { RealtimeEvents.AUTH_ERROR, RealtimeEvents.QUOTA_EXCEEDED, RealtimeEvents.COMMIT_THROTTLED, RealtimeEvents.TRANSCRIBER_ERROR, RealtimeEvents.UNACCEPTED_TERMS, RealtimeEvents.UNACCEPTED_TERMS_ERROR, RealtimeEvents.RATE_LIMITED, RealtimeEvents.INPUT_ERROR, RealtimeEvents.INVALID_REQUEST, RealtimeEvents.QUEUE_OVERFLOW, RealtimeEvents.RESOURCE_EXHAUSTED, RealtimeEvents.SESSION_TIME_LIMIT_EXCEEDED, RealtimeEvents.CHUNK_SIZE_EXCEEDED, RealtimeEvents.INSUFFICIENT_AUDIO_ACTIVITY, } if event in error_events: self._emit(RealtimeEvents.ERROR, data) except ValueError: # Unknown message type, ignore pass except json.JSONDecodeError as e: self._emit(RealtimeEvents.ERROR, {"error": f"Failed to parse message: {e}"}) except Exception as e: self._emit(RealtimeEvents.ERROR, {"error": str(e)}) finally: self._emit(RealtimeEvents.CLOSE) async def send(self, data: typing.Dict[str, typing.Any]) -> None: """ Send an audio chunk to the server for transcription. Args: data: Dictionary containing the following keys: - audio_base_64 (str): Base64-encoded audio data to transcribe - previous_text (str, optional): Previous transcript text to provide context for more accurate transcription Raises: RuntimeError: If the WebSocket connection is not open Example: ```python # Send audio chunk connection.send({ "audio_base_64": base64_encoded_audio }) # Send audio chunk with context - can only be sent with the first chunk of audio connection.send({ "audio_base_64": base64_encoded_audio, "previous_text": "Previously transcribed text for context" }) ``` """ if not self.websocket: raise RuntimeError("WebSocket is not connected") message = { "message_type": "input_audio_chunk", "audio_base_64": data.get("audio_base_64", ""), "commit": False, "sample_rate": self.current_sample_rate, "previous_text": data.get("previous_text"), } await self.websocket.send(json.dumps(message)) async def commit(self) -> None: """ Commits the segment, triggering a COMMITTED_TRANSCRIPT event and clearing the buffer. It's recommend to commit often when using CommitStrategy.MANUAL to keep latency low. Raises: RuntimeError: If the WebSocket connection is not open Remarks: Only needed when using CommitStrategy.MANUAL. When using CommitStrategy.VAD, commits are handled automatically by the server. Example: ```python # Send all audio chunks for chunk in audio_chunks: connection.send({"audioBase64": chunk}) # Commit the audio segment await connection.commit() ``` """ if not self.websocket: raise RuntimeError("WebSocket is not connected") message = { "message_type": "input_audio_chunk", "audio_base_64": "", "commit": True, "sample_rate": self.current_sample_rate, } await self.websocket.send(json.dumps(message)) async def close(self) -> None: """ Closes the WebSocket connection and cleans up resources. This will terminate any ongoing transcription and stop ffmpeg processes if running. Remarks: After calling close(), this connection cannot be reused. Create a new connection if you need to start transcribing again. Example: ```python connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, async lambda data: ( print("Committed:", data["transcript"]), await connection.close() )) ``` """ await self._cleanup() if self.websocket: await self.websocket.close(1000, "User ended conversation") if self._message_task and not self._message_task.done(): self._message_task.cancel() try: await self._message_task except asyncio.CancelledError: pass async def _cleanup(self) -> None: """Clean up resources like ffmpeg processes""" if self.ffmpeg_process: self.ffmpeg_process.kill() try: self.ffmpeg_process.wait(timeout=1) except subprocess.TimeoutExpired: self.ffmpeg_process.kill() self.ffmpeg_process = None elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/realtime/scribe.py000066400000000000000000000426041523660243400261720ustar00rootroot00000000000000import asyncio import base64 import subprocess import typing from enum import Enum from typing import overload from typing_extensions import Required try: from websockets.asyncio.client import connect as websocket_connect except ImportError: raise ImportError( "The websockets package is required for realtime speech-to-text. " "Install it with: pip install websockets" ) from ..url_utils import build_ws_url from .connection import RealtimeConnection class AudioFormat(str, Enum): """Audio format options for realtime transcription""" PCM_8000 = "pcm_8000" PCM_16000 = "pcm_16000" PCM_22050 = "pcm_22050" PCM_24000 = "pcm_24000" PCM_44100 = "pcm_44100" PCM_48000 = "pcm_48000" ULAW_8000 = "ulaw_8000" class CommitStrategy(str, Enum): """ Strategy for committing transcription results. VAD: Voice Activity Detection - automatically commits when speech ends MANUAL: Manual commit - requires calling commit() to commit the segment """ VAD = "vad" MANUAL = "manual" RealtimeEntityDetection = typing.Union[str, typing.List[str]] """ Entities to detect on committed transcripts. Accepts ``"all"``, a single category (``"pii"``, ``"phi"``, ``"pci"``, ``"other"``, ``"offensive_language"``), a specific entity type such as ``"email_address"``, or a list of categories/types. """ class _RealtimeSharedOptions(typing.TypedDict, total=False): """ Options accepted by both realtime connection modes. Attributes: model_id: The model ID to use for transcription (required) commit_strategy: Strategy for committing transcriptions (optional, defaults to MANUAL) vad_silence_threshold_secs: Silence threshold in seconds for VAD (must be between 0.3 and 3.0) vad_threshold: Threshold for voice activity detection (must be between 0.1 and 0.9) min_speech_duration_ms: Minimum speech duration in milliseconds (must be between 50 and 2000) min_silence_duration_ms: Minimum silence duration in milliseconds (must be between 50 and 2000) language_code: 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. secondary_languages: Additional ISO-639-1 or ISO-639-3 language codes that may be present in the audio. Providing them makes language identification more reliable by only focusing on a certain set of languages. include_timestamps: Whether to receive the committed_transcript_with_timestamps event after committing the segment (optional, defaults to False) include_language_detection: Whether to receive a delayed final transcript carrying the detected language_code after each commit (optional, defaults to False) keyterms: Keyterms to bias the model towards (maximum 50, each at most 20 characters) no_verbatim: If True, removes filler words, false starts and disfluencies from the transcript entity_detection: Entities to detect on committed transcripts, delivered in a separate committed_transcript_entities event filter_background_audio: Reduce false activations from nearby conversations and ambient noise. Cannot be combined with include_timestamps. enable_logging: When False, zero retention mode is used for the request. Only available to enterprise customers. token: A single-use token used to authenticate the session instead of an API key. Useful when connecting from a client where an API key should not be exposed. Takes precedence over any configured api_key, which is not sent when a token is supplied. """ model_id: Required[str] commit_strategy: CommitStrategy vad_silence_threshold_secs: float vad_threshold: float min_speech_duration_ms: int min_silence_duration_ms: int language_code: str secondary_languages: typing.List[str] include_timestamps: bool include_language_detection: bool keyterms: typing.List[str] no_verbatim: bool entity_detection: RealtimeEntityDetection filter_background_audio: bool enable_logging: bool token: str class RealtimeAudioOptions(_RealtimeSharedOptions, total=False): """ Options for providing audio chunks manually. Accepts every key in :class:`_RealtimeSharedOptions`, plus: Attributes: audio_format: The audio format (required) sample_rate: The sample rate in Hz (required) """ audio_format: Required[AudioFormat] sample_rate: Required[int] class RealtimeUrlOptions(_RealtimeSharedOptions, total=False): """ Options for streaming audio from a URL. Accepts every key in :class:`_RealtimeSharedOptions`, plus: Attributes: url: The URL of the audio stream (required) """ url: Required[str] class ScribeRealtime: """ Helper class for creating realtime speech-to-text connections. Supports two modes: 1. URL-based: Stream audio from a URL (uses ffmpeg for conversion) 2. Manual: Send audio chunks yourself Example (URL-based): ```python connection = await elevenlabs.speech_to_text.realtime.connect({ "model_id": "scribe_v2_realtime", "url": "https://stream.example.com/audio.mp3" }) ``` Example (Manual chunks): ```python connection = await elevenlabs.speech_to_text.realtime.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000 }) # Send audio chunks await connection.send({"audio_base_64": chunk}) ``` """ def __init__(self, api_key: str, base_url: str = "wss://api.elevenlabs.io"): self.api_key = api_key self.base_url = base_url @overload async def connect( self, options: RealtimeAudioOptions ) -> RealtimeConnection: ... @overload async def connect( self, options: RealtimeUrlOptions ) -> RealtimeConnection: ... async def connect( self, options: typing.Union[RealtimeAudioOptions, RealtimeUrlOptions] ) -> RealtimeConnection: """ Create a realtime transcription connection. Args: options: Either RealtimeAudioOptions for manual chunk sending or RealtimeUrlOptions for URL streaming Returns: RealtimeConnection instance ready to send/receive data Raises: ValueError: If invalid options are provided RuntimeError: If ffmpeg is not available (for URL-based streaming) Example: ```python # URL-based streaming connection = await elevenlabs.speech_to_text.realtime.connect({ "model_id": "scribe_v2_realtime", "url": "https://stream.example.com/audio.mp3", }) # Manual chunks connection = await elevenlabs.speech_to_text.realtime.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, "commit_strategy": CommitStrategy.MANUAL }) ``` """ # Determine if this is URL-based or manual mode is_url_mode = "url" in options if "model_id" not in options: raise ValueError("model_id is required for realtime transcription") if is_url_mode: return await self._connect_url(typing.cast(RealtimeUrlOptions, options)) else: return await self._connect_audio(typing.cast(RealtimeAudioOptions, options)) @staticmethod def _shared_url_kwargs( options: typing.Union[RealtimeAudioOptions, RealtimeUrlOptions] ) -> typing.Dict[str, typing.Any]: """Collect the query parameters both connection modes share.""" return { "vad_silence_threshold_secs": options.get("vad_silence_threshold_secs"), "vad_threshold": options.get("vad_threshold"), "min_speech_duration_ms": options.get("min_speech_duration_ms"), "min_silence_duration_ms": options.get("min_silence_duration_ms"), "language_code": options.get("language_code"), "secondary_languages": options.get("secondary_languages"), "include_timestamps": options.get("include_timestamps", False), "include_language_detection": options.get("include_language_detection"), "keyterms": options.get("keyterms"), "no_verbatim": options.get("no_verbatim"), "entity_detection": options.get("entity_detection"), "filter_background_audio": options.get("filter_background_audio"), "enable_logging": options.get("enable_logging"), "token": options.get("token"), } def _connection_headers( self, options: typing.Union[RealtimeAudioOptions, RealtimeUrlOptions] ) -> typing.Dict[str, str]: """ Build the handshake headers. A single-use token authenticates the session on its own and takes precedence server-side, so the api key is not sent alongside one. """ if options.get("token"): return {} if not self.api_key: raise ValueError( "An api_key or a single-use token is required for realtime transcription" ) return {"xi-api-key": self.api_key} async def _connect_audio(self, options: RealtimeAudioOptions) -> RealtimeConnection: """Connect with manual audio chunk sending""" model_id = options["model_id"] audio_format = options.get("audio_format") sample_rate = options.get("sample_rate") commit_strategy = options.get("commit_strategy", CommitStrategy.MANUAL) if not audio_format or not sample_rate: raise ValueError("audio_format and sample_rate are required for manual audio mode") headers = self._connection_headers(options) # Build WebSocket URL with query parameters ws_url = self._build_websocket_url( model_id=model_id, audio_format=audio_format.value, commit_strategy=commit_strategy.value, **self._shared_url_kwargs(options), ) # Connect to WebSocket websocket = await websocket_connect(ws_url, additional_headers=headers) # Create connection object connection = RealtimeConnection( websocket=websocket, current_sample_rate=sample_rate, ffmpeg_process=None ) # Start message handler connection._message_task = asyncio.create_task(connection._start_message_handler()) connection._emit("open") return connection async def _connect_url(self, options: RealtimeUrlOptions) -> RealtimeConnection: """Connect with URL-based audio streaming using ffmpeg""" model_id = options["model_id"] url = options.get("url") commit_strategy = options.get("commit_strategy", CommitStrategy.MANUAL) if not url: raise ValueError("url is required for URL mode") # Default to 16kHz for URL streaming sample_rate = 16000 audio_format = AudioFormat.PCM_16000 headers = self._connection_headers(options) # Build WebSocket URL ws_url = self._build_websocket_url( model_id=model_id, audio_format=audio_format.value, commit_strategy=commit_strategy.value, **self._shared_url_kwargs(options), ) # Connect to WebSocket websocket = await websocket_connect(ws_url, additional_headers=headers) # Start ffmpeg process to convert stream to PCM try: ffmpeg_process = subprocess.Popen( [ "ffmpeg", "-i", url, "-f", "s16le", "-ar", str(sample_rate), "-ac", "1", "-" ], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, bufsize=0 ) except FileNotFoundError: await websocket.close(1011, "ffmpeg not found") raise RuntimeError( "ffmpeg is required for URL-based audio streaming. " "Please install ffmpeg: https://ffmpeg.org/download.html" ) # Create connection object connection = RealtimeConnection( websocket=websocket, current_sample_rate=sample_rate, ffmpeg_process=ffmpeg_process ) # Start message handler connection._message_task = asyncio.create_task(connection._start_message_handler()) connection._emit("open") # Start streaming audio from ffmpeg to websocket asyncio.create_task(self._stream_ffmpeg_to_websocket(connection)) return connection async def _stream_ffmpeg_to_websocket(self, connection: RealtimeConnection) -> None: """Stream audio from ffmpeg process to WebSocket""" if not connection.ffmpeg_process or not connection.ffmpeg_process.stdout: return try: # Read chunks from ffmpeg and send to websocket chunk_size = 8192 # 8KB chunks loop = asyncio.get_event_loop() while True: # Read from ffmpeg stdout in a non-blocking way chunk = await loop.run_in_executor( None, connection.ffmpeg_process.stdout.read, chunk_size ) if not chunk: # Stream ended break # Convert to base64 and send chunk_base64 = base64.b64encode(chunk).decode('utf-8') try: await connection.send({"audio_base_64": chunk_base64}) except Exception as e: connection._emit("error", {"error": f"Failed to send audio: {e}"}) break # Small delay to prevent overwhelming the connection await asyncio.sleep(0.01) except Exception as e: connection._emit("error", {"error": f"FFmpeg streaming error: {e}"}) finally: # Clean up ffmpeg process if connection.ffmpeg_process: connection.ffmpeg_process.kill() try: connection.ffmpeg_process.wait(timeout=1) except subprocess.TimeoutExpired: connection.ffmpeg_process.kill() def _build_websocket_url( self, model_id: str, audio_format: str, commit_strategy: str, vad_silence_threshold_secs: typing.Optional[float] = None, vad_threshold: typing.Optional[float] = None, min_speech_duration_ms: typing.Optional[int] = None, min_silence_duration_ms: typing.Optional[int] = None, language_code: typing.Optional[str] = None, secondary_languages: typing.Optional[typing.List[str]] = None, include_timestamps: typing.Optional[bool] = None, include_language_detection: typing.Optional[bool] = None, keyterms: typing.Optional[typing.List[str]] = None, no_verbatim: typing.Optional[bool] = None, entity_detection: typing.Optional[RealtimeEntityDetection] = None, filter_background_audio: typing.Optional[bool] = None, enable_logging: typing.Optional[bool] = None, token: typing.Optional[str] = None, ) -> str: """Build the WebSocket URL with query parameters""" params = [ ("model_id", model_id), ("audio_format", audio_format), ("commit_strategy", commit_strategy), ] for key, value in [ ("vad_silence_threshold_secs", vad_silence_threshold_secs), ("vad_threshold", vad_threshold), ("min_speech_duration_ms", min_speech_duration_ms), ("min_silence_duration_ms", min_silence_duration_ms), ("language_code", language_code), ]: if value is not None: params.append((key, str(value))) if secondary_languages is not None: for language in secondary_languages: params.append(("secondary_languages", language)) if include_timestamps is not None: params.append(("include_timestamps", str(include_timestamps).lower())) if include_language_detection is not None: params.append( ("include_language_detection", str(include_language_detection).lower()) ) if keyterms is not None: for term in keyterms: params.append(("keyterms", term)) if no_verbatim is not None: params.append(("no_verbatim", str(no_verbatim).lower())) if entity_detection is not None: entities = ( [entity_detection] if isinstance(entity_detection, str) else entity_detection ) for entity in entities: params.append(("entity_detection", entity)) if filter_background_audio is not None: params.append( ("filter_background_audio", str(filter_background_audio).lower()) ) if enable_logging is not None: params.append(("enable_logging", str(enable_logging).lower())) if token is not None: params.append(("token", token)) return build_ws_url(self.base_url, ["v1", "speech-to-text", "realtime"], params) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/realtime_tts.py000066400000000000000000000134141523660243400256120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import urllib.parse import json import base64 import websockets from websockets.sync.client import connect from .core.api_error import ApiError from .core.client_wrapper import SyncClientWrapper from .core.jsonable_encoder import jsonable_encoder from .core.remove_none_from_dict import remove_none_from_dict from .core.request_options import RequestOptions from .types.voice_settings import VoiceSettings from .text_to_speech.client import TextToSpeechClient from .types import OutputFormat from .url_utils import build_ws_url # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) def text_chunker(chunks: typing.Iterator[str]) -> typing.Iterator[str]: """Used during input streaming to chunk text blocks and set last char to space""" splitters = (".", ",", "?", "!", ";", ":", "—", "-", "(", ")", "[", "]", "}", " ") buffer = "" for text in chunks: if buffer.endswith(splitters): yield buffer if buffer.endswith(" ") else buffer + " " buffer = text elif text.startswith(splitters): output = buffer + text[0] yield output if output.endswith(" ") else output + " " buffer = text[1:] else: buffer += text if buffer != "": yield buffer + " " class RealtimeTextToSpeechClient(TextToSpeechClient): def __init__(self, *, client_wrapper: SyncClientWrapper): super().__init__(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._ws_base_url = urllib.parse.urlparse(self._client_wrapper.get_base_url())._replace(scheme="wss").geturl() def convert_realtime( self, voice_id: str, *, text: typing.Iterator[str], model_id: typing.Optional[str] = OMIT, output_format: typing.Optional[OutputFormat] = "mp3_44100_128", voice_settings: typing.Optional[VoiceSettings] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Converts text into speech using a voice of your choice and returns audio. Parameters: - voice_id: str. Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - text: typing.Iterator[str]. The text that will get converted into speech. - model_id: typing.Optional[str]. Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - voice_settings: typing.Optional[VoiceSettings]. Voice settings overriding stored setttings for the given voice. They are applied only on the given request. - request_options: typing.Optional[RequestOptions]. Request-specific configuration. --- from elevenlabs import PronunciationDictionaryVersionLocator, VoiceSettings from elevenlabs.client import ElevenLabs def get_text() -> typing.Iterator[str]: yield "Hello, how are you?" yield "I am fine, thank you." client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_speech.convert_realtime( voice_id="string", text=get_text(), model_id="string", voice_settings=VoiceSettings( stability=1.1, similarity_boost=1.1, style=1.1, use_speaker_boost=True, ), ) """ with connect( build_ws_url( self._ws_base_url, ["v1", "text-to-speech", voice_id, "stream-input"], {"model_id": model_id, "output_format": output_format}, ), additional_headers=jsonable_encoder( remove_none_from_dict( { **self._client_wrapper.get_headers(), **(request_options.get("additional_headers", {}) if request_options is not None else {}), } ) ) ) as socket: try: socket.send(json.dumps( dict( text=" ", try_trigger_generation=True, voice_settings=voice_settings.dict() if voice_settings else None, generation_config=dict( chunk_length_schedule=[50], ), ) )) except websockets.exceptions.ConnectionClosedError as ce: raise ApiError(body=ce.reason, status_code=ce.code) try: for text_chunk in text_chunker(text): data = dict(text=text_chunk, try_trigger_generation=True) socket.send(json.dumps(data)) try: data = json.loads(socket.recv(1e-2)) if "audio" in data and data["audio"]: yield base64.b64decode(data["audio"]) # type: ignore except TimeoutError: pass socket.send(json.dumps(dict(text=""))) while True: data = json.loads(socket.recv()) if "audio" in data and data["audio"]: yield base64.b64decode(data["audio"]) # type: ignore except websockets.exceptions.ConnectionClosed as ce: if "message" in data: raise ApiError(body=data, status_code=ce.code) elif ce.code != 1000: raise ApiError(body=ce.reason, status_code=ce.code) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/samples/000077500000000000000000000000001523660243400242055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/samples/__init__.py000066400000000000000000000001251523660243400263140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/samples/client.py000066400000000000000000000072451523660243400260450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.delete_sample_response import DeleteSampleResponse from .raw_client import AsyncRawSamplesClient, RawSamplesClient class SamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSamplesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSamplesClient """ return self._raw_client def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteSampleResponse: """ Removes a sample by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteSampleResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.samples.delete( voice_id="21m00Tcm4TlvDq8ikWAM", sample_id="VW7YKqPnjY4h39yTbx2L", ) """ _response = self._raw_client.delete(voice_id, sample_id, request_options=request_options) return _response.data class AsyncSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSamplesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSamplesClient """ return self._raw_client async def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteSampleResponse: """ Removes a sample by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteSampleResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.samples.delete( voice_id="21m00Tcm4TlvDq8ikWAM", sample_id="VW7YKqPnjY4h39yTbx2L", ) asyncio.run(main()) """ _response = await self._raw_client.delete(voice_id, sample_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/samples/raw_client.py000066400000000000000000000132571523660243400267160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.delete_sample_response import DeleteSampleResponse from pydantic import ValidationError class RawSamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteSampleResponse]: """ Removes a sample by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteSampleResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteSampleResponse, construct_type( type_=DeleteSampleResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteSampleResponse]: """ Removes a sample by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteSampleResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteSampleResponse, construct_type( type_=DeleteSampleResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/000077500000000000000000000000001523660243400261005ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/__init__.py000066400000000000000000000057761523660243400302300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import api_keys from .api_keys import ( BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, ) _dynamic_imports: typing.Dict[str, str] = { "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions": ".api_keys", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps": ".api_keys", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit": ".api_keys", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled": ".api_keys", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions": ".api_keys", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed": ".api_keys", "api_keys": ".api_keys", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed", "api_keys", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/000077500000000000000000000000001523660243400277045ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/__init__.py000066400000000000000000000056411523660243400320230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, ) _dynamic_imports: typing.Dict[str, str] = { "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions": ".types", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps": ".types", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit": ".types", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled": ".types", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions": ".types", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/client.py000066400000000000000000000507431523660243400315450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.workspace_api_key_list_response_model import WorkspaceApiKeyListResponseModel from ...types.workspace_create_api_key_response_model import WorkspaceCreateApiKeyResponseModel from .raw_client import AsyncRawApiKeysClient, RawApiKeysClient from .types.body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissions import ( BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_allowed_ips import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_character_limit import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_is_enabled import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissions import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_third_party_disable_allowed import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ApiKeysClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawApiKeysClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawApiKeysClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawApiKeysClient """ return self._raw_client def list( self, service_account_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceApiKeyListResponseModel: """ Get all API keys for a service account Parameters ---------- service_account_user_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceApiKeyListResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.api_keys.list( service_account_user_id="service_account_user_id", ) """ _response = self._raw_client.list(service_account_user_id, request_options=request_options) return _response.data def create( self, service_account_user_id: str, *, name: str, permissions: BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, character_limit: typing.Optional[int] = OMIT, allowed_ips: typing.Optional[typing.Sequence[str]] = OMIT, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceCreateApiKeyResponseModel: """ Create a new API key for a service account Parameters ---------- service_account_user_id : str name : str permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions The permissions of the XI API. character_limit : typing.Optional[int] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[typing.Sequence[str]] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[bool] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateApiKeyResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.api_keys.create( service_account_user_id="service_account_user_id", name="name", ) """ _response = self._raw_client.create( service_account_user_id, name=name, permissions=permissions, character_limit=character_limit, allowed_ips=allowed_ips, third_party_disable_allowed=third_party_disable_allowed, request_options=request_options, ) return _response.data def delete( self, service_account_user_id: str, api_key_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.api_keys.delete( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) """ _response = self._raw_client.delete(service_account_user_id, api_key_id, request_options=request_options) return _response.data def update( self, service_account_user_id: str, api_key_id: str, *, is_enabled: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled ] = OMIT, name: typing.Optional[str] = OMIT, permissions: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions ] = OMIT, character_limit: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit ] = OMIT, allowed_ips: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps ] = OMIT, third_party_disable_allowed: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Update an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str is_enabled : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled] Whether to enable or disable the API key. name : typing.Optional[str] The name of the XI API key to use (used for identification purposes only). permissions : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions] The permissions of the XI API. character_limit : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.api_keys.update( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) """ _response = self._raw_client.update( service_account_user_id, api_key_id, is_enabled=is_enabled, name=name, permissions=permissions, character_limit=character_limit, allowed_ips=allowed_ips, third_party_disable_allowed=third_party_disable_allowed, request_options=request_options, ) return _response.data class AsyncApiKeysClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawApiKeysClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawApiKeysClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawApiKeysClient """ return self._raw_client async def list( self, service_account_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceApiKeyListResponseModel: """ Get all API keys for a service account Parameters ---------- service_account_user_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceApiKeyListResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.api_keys.list( service_account_user_id="service_account_user_id", ) asyncio.run(main()) """ _response = await self._raw_client.list(service_account_user_id, request_options=request_options) return _response.data async def create( self, service_account_user_id: str, *, name: str, permissions: BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, character_limit: typing.Optional[int] = OMIT, allowed_ips: typing.Optional[typing.Sequence[str]] = OMIT, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceCreateApiKeyResponseModel: """ Create a new API key for a service account Parameters ---------- service_account_user_id : str name : str permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions The permissions of the XI API. character_limit : typing.Optional[int] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[typing.Sequence[str]] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[bool] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateApiKeyResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.api_keys.create( service_account_user_id="service_account_user_id", name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( service_account_user_id, name=name, permissions=permissions, character_limit=character_limit, allowed_ips=allowed_ips, third_party_disable_allowed=third_party_disable_allowed, request_options=request_options, ) return _response.data async def delete( self, service_account_user_id: str, api_key_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.api_keys.delete( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(service_account_user_id, api_key_id, request_options=request_options) return _response.data async def update( self, service_account_user_id: str, api_key_id: str, *, is_enabled: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled ] = OMIT, name: typing.Optional[str] = OMIT, permissions: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions ] = OMIT, character_limit: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit ] = OMIT, allowed_ips: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps ] = OMIT, third_party_disable_allowed: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Update an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str is_enabled : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled] Whether to enable or disable the API key. name : typing.Optional[str] The name of the XI API key to use (used for identification purposes only). permissions : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions] The permissions of the XI API. character_limit : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.api_keys.update( service_account_user_id="service_account_user_id", api_key_id="api_key_id", ) asyncio.run(main()) """ _response = await self._raw_client.update( service_account_user_id, api_key_id, is_enabled=is_enabled, name=name, permissions=permissions, character_limit=character_limit, allowed_ips=allowed_ips, third_party_disable_allowed=third_party_disable_allowed, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/raw_client.py000066400000000000000000001025401523660243400324070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.workspace_api_key_list_response_model import WorkspaceApiKeyListResponseModel from ...types.workspace_create_api_key_response_model import WorkspaceCreateApiKeyResponseModel from .types.body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissions import ( BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_allowed_ips import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_character_limit import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_is_enabled import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissions import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, ) from .types.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_third_party_disable_allowed import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawApiKeysClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, service_account_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[WorkspaceApiKeyListResponseModel]: """ Get all API keys for a service account Parameters ---------- service_account_user_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceApiKeyListResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceApiKeyListResponseModel, construct_type( type_=WorkspaceApiKeyListResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, service_account_user_id: str, *, name: str, permissions: BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, character_limit: typing.Optional[int] = OMIT, allowed_ips: typing.Optional[typing.Sequence[str]] = OMIT, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceCreateApiKeyResponseModel]: """ Create a new API key for a service account Parameters ---------- service_account_user_id : str name : str permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions The permissions of the XI API. character_limit : typing.Optional[int] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[typing.Sequence[str]] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[bool] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceCreateApiKeyResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys", method="POST", json={ "name": name, "permissions": convert_and_respect_annotation_metadata( object_=permissions, annotation=BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, direction="write", ), "character_limit": character_limit, "allowed_ips": allowed_ips, "third_party_disable_allowed": third_party_disable_allowed, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateApiKeyResponseModel, construct_type( type_=WorkspaceCreateApiKeyResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, service_account_user_id: str, api_key_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys/{jsonable_encoder(api_key_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, service_account_user_id: str, api_key_id: str, *, is_enabled: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled ] = OMIT, name: typing.Optional[str] = OMIT, permissions: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions ] = OMIT, character_limit: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit ] = OMIT, allowed_ips: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps ] = OMIT, third_party_disable_allowed: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Update an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str is_enabled : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled] Whether to enable or disable the API key. name : typing.Optional[str] The name of the XI API key to use (used for identification purposes only). permissions : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions] The permissions of the XI API. character_limit : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys/{jsonable_encoder(api_key_id)}", method="PATCH", json={ "is_enabled": convert_and_respect_annotation_metadata( object_=is_enabled, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, direction="write", ), "name": name, "permissions": convert_and_respect_annotation_metadata( object_=permissions, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, direction="write", ), "character_limit": convert_and_respect_annotation_metadata( object_=character_limit, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, direction="write", ), "allowed_ips": convert_and_respect_annotation_metadata( object_=allowed_ips, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, direction="write", ), "third_party_disable_allowed": convert_and_respect_annotation_metadata( object_=third_party_disable_allowed, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawApiKeysClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, service_account_user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[WorkspaceApiKeyListResponseModel]: """ Get all API keys for a service account Parameters ---------- service_account_user_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceApiKeyListResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceApiKeyListResponseModel, construct_type( type_=WorkspaceApiKeyListResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, service_account_user_id: str, *, name: str, permissions: BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, character_limit: typing.Optional[int] = OMIT, allowed_ips: typing.Optional[typing.Sequence[str]] = OMIT, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceCreateApiKeyResponseModel]: """ Create a new API key for a service account Parameters ---------- service_account_user_id : str name : str permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions The permissions of the XI API. character_limit : typing.Optional[int] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[typing.Sequence[str]] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[bool] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceCreateApiKeyResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys", method="POST", json={ "name": name, "permissions": convert_and_respect_annotation_metadata( object_=permissions, annotation=BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, direction="write", ), "character_limit": character_limit, "allowed_ips": allowed_ips, "third_party_disable_allowed": third_party_disable_allowed, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateApiKeyResponseModel, construct_type( type_=WorkspaceCreateApiKeyResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, service_account_user_id: str, api_key_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys/{jsonable_encoder(api_key_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, service_account_user_id: str, api_key_id: str, *, is_enabled: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled ] = OMIT, name: typing.Optional[str] = OMIT, permissions: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions ] = OMIT, character_limit: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit ] = OMIT, allowed_ips: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps ] = OMIT, third_party_disable_allowed: typing.Optional[ BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Update an existing API key for a service account Parameters ---------- service_account_user_id : str api_key_id : str is_enabled : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled] Whether to enable or disable the API key. name : typing.Optional[str] The name of the XI API key to use (used for identification purposes only). permissions : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions] The permissions of the XI API. character_limit : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit] The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit. allowed_ips : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps] List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it. third_party_disable_allowed : typing.Optional[BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed] Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/service-accounts/{jsonable_encoder(service_account_user_id)}/api-keys/{jsonable_encoder(api_key_id)}", method="PATCH", json={ "is_enabled": convert_and_respect_annotation_metadata( object_=is_enabled, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, direction="write", ), "name": name, "permissions": convert_and_respect_annotation_metadata( object_=permissions, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, direction="write", ), "character_limit": convert_and_respect_annotation_metadata( object_=character_limit, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, direction="write", ), "allowed_ips": convert_and_respect_annotation_metadata( object_=allowed_ips, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, direction="write", ), "third_party_disable_allowed": convert_and_respect_annotation_metadata( object_=third_party_disable_allowed, annotation=BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/000077500000000000000000000000001523660243400310505ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/__init__.py000066400000000000000000000106021523660243400331600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissions import ( BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions, ) from .body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_allowed_ips import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps, ) from .body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_character_limit import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit, ) from .body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_is_enabled import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled, ) from .body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissions import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions, ) from .body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_third_party_disable_allowed import ( BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed, ) _dynamic_imports: typing.Dict[str, str] = { "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions": ".body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps": ".body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_allowed_ips", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit": ".body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_character_limit", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled": ".body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_is_enabled", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions": ".body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed": ".body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_third_party_disable_allowed", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions", "BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed", ] 691218683a4cc82e985853c7f19d8a5daa059582.paxheader00006660000000000000000000000313152366024340020247xustar00rootroot00000000000000203 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissions.py 691218683a4cc82e985853c7f19d8a5daa059582.data000066400000000000000000000004511523660243400171100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....types.permission_type import PermissionType BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions = typing.Union[ typing.List[PermissionType], typing.Literal["all"] ] 5938128fcc4408a11a686bc96d2ad166f0438563.paxheader00006660000000000000000000000325152366024340020226xustar00rootroot00000000000000213 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_allowed_ips.py 5938128fcc4408a11a686bc96d2ad166f0438563.data000066400000000000000000000004151523660243400170640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchAllowedIps = typing.Union[ typing.List[str], typing.Literal["clear"], typing.Literal["no_update"] ] 4db55d7429379225ec93ec42b1549649c62449bd.paxheader00006660000000000000000000000331152366024340020242xustar00rootroot00000000000000217 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_character_limit.py 4db55d7429379225ec93ec42b1549649c62449bd.data000066400000000000000000000004041523660243400171010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchCharacterLimit = typing.Union[ int, typing.Literal["clear"], typing.Literal["no_update"] ] babb495d9fa2f5ff216f22e1488d28e0c1159f5e.paxheader00006660000000000000000000000324152366024340020667xustar00rootroot00000000000000212 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_is_enabled.py babb495d9fa2f5ff216f22e1488d28e0c1159f5e.data000066400000000000000000000003471523660243400175320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchIsEnabled = typing.Union[ bool, typing.Literal["no_update"] ] 8349e4113cb61ba70b7cf82c67c34ab0f080bde3.paxheader00006660000000000000000000000325152366024340020560xustar00rootroot00000000000000213 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissions.py 8349e4113cb61ba70b7cf82c67c34ab0f080bde3.data000066400000000000000000000005151523660243400174170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....types.permission_type import PermissionType BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions = typing.Union[ typing.List[PermissionType], typing.Literal["all"], typing.Literal["no_update"] ] a1abd2b817ef31340cecbad534887cae188e056c.paxheader00006660000000000000000000000345152366024340020726xustar00rootroot00000000000000229 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/api_keys/types/body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_third_party_disable_allowed.py a1abd2b817ef31340cecbad534887cae188e056c.data000066400000000000000000000004211523660243400175570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchThirdPartyDisableAllowed = ( typing.Union[bool, typing.Literal["clear"], typing.Literal["no_update"]] ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/client.py000066400000000000000000000157521523660243400277420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.default_sharing_group_config import DefaultSharingGroupConfig from ..types.workspace_create_service_account_response_model import WorkspaceCreateServiceAccountResponseModel from ..types.workspace_service_account_list_response_model import WorkspaceServiceAccountListResponseModel from .raw_client import AsyncRawServiceAccountsClient, RawServiceAccountsClient if typing.TYPE_CHECKING: from .api_keys.client import ApiKeysClient, AsyncApiKeysClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ServiceAccountsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawServiceAccountsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._api_keys: typing.Optional[ApiKeysClient] = None @property def with_raw_response(self) -> RawServiceAccountsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawServiceAccountsClient """ return self._raw_client def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceServiceAccountListResponseModel: """ List all service accounts in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceServiceAccountListResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def create( self, *, name: str, default_sharing_groups: typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceCreateServiceAccountResponseModel: """ Create a new service account in the workspace. By default, a workspace can have up to 20 service accounts. Enterprise customers may request an increase to this limit, up to 100. Parameters ---------- name : str default_sharing_groups : typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] List of groups with their permission levels to share with by default. Each entry should specify a group_id and a permission_level (admin, editor, or viewer). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateServiceAccountResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.service_accounts.create( name="name", ) """ _response = self._raw_client.create( name=name, default_sharing_groups=default_sharing_groups, request_options=request_options ) return _response.data @property def api_keys(self): if self._api_keys is None: from .api_keys.client import ApiKeysClient # noqa: E402 self._api_keys = ApiKeysClient(client_wrapper=self._client_wrapper) return self._api_keys class AsyncServiceAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawServiceAccountsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._api_keys: typing.Optional[AsyncApiKeysClient] = None @property def with_raw_response(self) -> AsyncRawServiceAccountsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawServiceAccountsClient """ return self._raw_client async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceServiceAccountListResponseModel: """ List all service accounts in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceServiceAccountListResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def create( self, *, name: str, default_sharing_groups: typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceCreateServiceAccountResponseModel: """ Create a new service account in the workspace. By default, a workspace can have up to 20 service accounts. Enterprise customers may request an increase to this limit, up to 100. Parameters ---------- name : str default_sharing_groups : typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] List of groups with their permission levels to share with by default. Each entry should specify a group_id and a permission_level (admin, editor, or viewer). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateServiceAccountResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.service_accounts.create( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, default_sharing_groups=default_sharing_groups, request_options=request_options ) return _response.data @property def api_keys(self): if self._api_keys is None: from .api_keys.client import AsyncApiKeysClient # noqa: E402 self._api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper) return self._api_keys elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/service_accounts/raw_client.py000066400000000000000000000266161523660243400306140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.default_sharing_group_config import DefaultSharingGroupConfig from ..types.workspace_create_service_account_response_model import WorkspaceCreateServiceAccountResponseModel from ..types.workspace_service_account_list_response_model import WorkspaceServiceAccountListResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawServiceAccountsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[WorkspaceServiceAccountListResponseModel]: """ List all service accounts in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceServiceAccountListResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/service-accounts", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceServiceAccountListResponseModel, construct_type( type_=WorkspaceServiceAccountListResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, default_sharing_groups: typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceCreateServiceAccountResponseModel]: """ Create a new service account in the workspace. By default, a workspace can have up to 20 service accounts. Enterprise customers may request an increase to this limit, up to 100. Parameters ---------- name : str default_sharing_groups : typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] List of groups with their permission levels to share with by default. Each entry should specify a group_id and a permission_level (admin, editor, or viewer). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceCreateServiceAccountResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/service-accounts", method="POST", json={ "name": name, "default_sharing_groups": convert_and_respect_annotation_metadata( object_=default_sharing_groups, annotation=typing.Sequence[DefaultSharingGroupConfig], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateServiceAccountResponseModel, construct_type( type_=WorkspaceCreateServiceAccountResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawServiceAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[WorkspaceServiceAccountListResponseModel]: """ List all service accounts in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceServiceAccountListResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/service-accounts", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceServiceAccountListResponseModel, construct_type( type_=WorkspaceServiceAccountListResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, default_sharing_groups: typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceCreateServiceAccountResponseModel]: """ Create a new service account in the workspace. By default, a workspace can have up to 20 service accounts. Enterprise customers may request an increase to this limit, up to 100. Parameters ---------- name : str default_sharing_groups : typing.Optional[typing.Sequence[DefaultSharingGroupConfig]] List of groups with their permission levels to share with by default. Each entry should specify a group_id and a permission_level (admin, editor, or viewer). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceCreateServiceAccountResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/service-accounts", method="POST", json={ "name": name, "default_sharing_groups": convert_and_respect_annotation_metadata( object_=default_sharing_groups, annotation=typing.Sequence[DefaultSharingGroupConfig], direction="write", ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateServiceAccountResponseModel, construct_type( type_=WorkspaceCreateServiceAccountResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/000077500000000000000000000000001523660243400253355ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/__init__.py000066400000000000000000000012411523660243400274440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file """ElevenLabs Speech Engine SDK module.""" from .resource import SpeechEngineResource, verify_speech_engine_jwt from .server import SpeechEngineServer from .session import SpeechEngineSession from .types import ( CLOSE, DISCONNECTED, ERROR, INIT, USER_TRANSCRIPT, ConversationMessage, WebSocketLike, ) __all__ = [ "ConversationMessage", "SpeechEngineResource", "SpeechEngineServer", "SpeechEngineSession", "WebSocketLike", "verify_speech_engine_jwt", "CLOSE", "DISCONNECTED", "ERROR", "INIT", "USER_TRANSCRIPT", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/client.py000066400000000000000000000503311523660243400271670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.agent_call_limits import AgentCallLimits from ..types.agent_sort_by import AgentSortBy from ..types.asr_conversational_config import AsrConversationalConfig from ..types.base_turn_config import BaseTurnConfig from ..types.conversation_config_input import ConversationConfigInput from ..types.list_speech_engines_response import ListSpeechEnginesResponse from ..types.privacy_config_input import PrivacyConfigInput from ..types.sort_direction import SortDirection from ..types.speech_engine_config import SpeechEngineConfig from ..types.speech_engine_conversation_initiation_client_data_config import SpeechEngineConversationInitiationClientDataConfig from ..types.speech_engine_response import SpeechEngineResponse from ..types.tts_conversational_config_input import TtsConversationalConfigInput from .raw_client import AsyncRawSpeechEngineClient, RawSpeechEngineClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SpeechEngineClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSpeechEngineClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSpeechEngineClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSpeechEngineClient """ return self._raw_client def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListSpeechEnginesResponse: """ Returns a paginated list of Speech Engine resources. Parameters ---------- page_size : typing.Optional[int] How many Speech Engines to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search term to filter Speech Engines by name sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListSpeechEnginesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_engine.list( page_size=1, search="search", sort_direction="asc", sort_by="name", cursor="cursor", ) """ _response = self._raw_client.list( page_size=page_size, search=search, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data def create( self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResponse: """ Create a new Speech Engine resource Parameters ---------- speech_engine : SpeechEngineConfig Speech engine WebSocket configuration name : typing.Optional[str] Name of the speech engine asr : typing.Optional[AsrConversationalConfig] ASR configuration tts : typing.Optional[TtsConversationalConfigInput] TTS configuration turn : typing.Optional[BaseTurnConfig] Turn detection configuration conversation : typing.Optional[ConversationConfigInput] Conversation configuration (client events, etc.) privacy : typing.Optional[PrivacyConfigInput] Privacy settings (recording, retention, zero retention mode) call_limits : typing.Optional[AgentCallLimits] Concurrency and daily conversation limits for this speech engine language : typing.Optional[str] Language for the speech engine tags : typing.Optional[typing.Sequence[str]] Tags for categorization request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- from elevenlabs import ElevenLabs, SpeechEngineConfig client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_engine.create( speech_engine=SpeechEngineConfig( ws_url="ws_url", ), ) """ _response = self._raw_client.create( speech_engine=speech_engine, name=name, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, overrides=overrides, request_options=request_options, ) return _response.data def get( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SpeechEngineResponse: """ Retrieve a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_engine.get( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.get(speech_engine_id, request_options=request_options) return _response.data def delete(self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_engine.delete( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.delete(speech_engine_id, request_options=request_options) return _response.data def update( self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResponse: """ Update a Speech Engine resource (partial update) Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) name : typing.Optional[str] speech_engine : typing.Optional[SpeechEngineConfig] asr : typing.Optional[AsrConversationalConfig] tts : typing.Optional[TtsConversationalConfigInput] turn : typing.Optional[BaseTurnConfig] conversation : typing.Optional[ConversationConfigInput] privacy : typing.Optional[PrivacyConfigInput] call_limits : typing.Optional[AgentCallLimits] language : typing.Optional[str] tags : typing.Optional[typing.Sequence[str]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_engine.update( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) """ _response = self._raw_client.update( speech_engine_id, name=name, speech_engine=speech_engine, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, request_options=request_options, ) return _response.data class AsyncSpeechEngineClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSpeechEngineClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSpeechEngineClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSpeechEngineClient """ return self._raw_client async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ListSpeechEnginesResponse: """ Returns a paginated list of Speech Engine resources. Parameters ---------- page_size : typing.Optional[int] How many Speech Engines to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search term to filter Speech Engines by name sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListSpeechEnginesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_engine.list( page_size=1, search="search", sort_direction="asc", sort_by="name", cursor="cursor", ) asyncio.run(main()) """ _response = await self._raw_client.list( page_size=page_size, search=search, sort_direction=sort_direction, sort_by=sort_by, cursor=cursor, request_options=request_options, ) return _response.data async def create( self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResponse: """ Create a new Speech Engine resource Parameters ---------- speech_engine : SpeechEngineConfig Speech engine WebSocket configuration name : typing.Optional[str] Name of the speech engine asr : typing.Optional[AsrConversationalConfig] ASR configuration tts : typing.Optional[TtsConversationalConfigInput] TTS configuration turn : typing.Optional[BaseTurnConfig] Turn detection configuration conversation : typing.Optional[ConversationConfigInput] Conversation configuration (client events, etc.) privacy : typing.Optional[PrivacyConfigInput] Privacy settings (recording, retention, zero retention mode) call_limits : typing.Optional[AgentCallLimits] Concurrency and daily conversation limits for this speech engine language : typing.Optional[str] Language for the speech engine tags : typing.Optional[typing.Sequence[str]] Tags for categorization request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, SpeechEngineConfig client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_engine.create( speech_engine=SpeechEngineConfig( ws_url="ws_url", ), ) asyncio.run(main()) """ _response = await self._raw_client.create( speech_engine=speech_engine, name=name, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, overrides=overrides, request_options=request_options, ) return _response.data async def get( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> SpeechEngineResponse: """ Retrieve a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_engine.get( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.get(speech_engine_id, request_options=request_options) return _response.data async def delete(self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) 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.speech_engine.delete( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.delete(speech_engine_id, request_options=request_options) return _response.data async def update( self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResponse: """ Update a Speech Engine resource (partial update) Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) name : typing.Optional[str] speech_engine : typing.Optional[SpeechEngineConfig] asr : typing.Optional[AsrConversationalConfig] tts : typing.Optional[TtsConversationalConfigInput] turn : typing.Optional[BaseTurnConfig] conversation : typing.Optional[ConversationConfigInput] privacy : typing.Optional[PrivacyConfigInput] call_limits : typing.Optional[AgentCallLimits] language : typing.Optional[str] tags : typing.Optional[typing.Sequence[str]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechEngineResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_engine.update( speech_engine_id="seng_3701k3ttaq12ewp8b7qv5rfyszkz", ) asyncio.run(main()) """ _response = await self._raw_client.update( speech_engine_id, name=name, speech_engine=speech_engine, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/raw_client.py000066400000000000000000001026371523660243400300470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.agent_call_limits import AgentCallLimits from ..types.agent_sort_by import AgentSortBy from ..types.asr_conversational_config import AsrConversationalConfig from ..types.base_turn_config import BaseTurnConfig from ..types.conversation_config_input import ConversationConfigInput from ..types.list_speech_engines_response import ListSpeechEnginesResponse from ..types.privacy_config_input import PrivacyConfigInput from ..types.sort_direction import SortDirection from ..types.speech_engine_config import SpeechEngineConfig from ..types.speech_engine_conversation_initiation_client_data_config import SpeechEngineConversationInitiationClientDataConfig from ..types.speech_engine_response import SpeechEngineResponse from ..types.tts_conversational_config_input import TtsConversationalConfigInput # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSpeechEngineClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListSpeechEnginesResponse]: """ Returns a paginated list of Speech Engine resources. Parameters ---------- page_size : typing.Optional[int] How many Speech Engines to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search term to filter Speech Engines by name sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListSpeechEnginesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/speech-engine", method="GET", params={ "page_size": page_size, "search": search, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListSpeechEnginesResponse, construct_type( type_=ListSpeechEnginesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechEngineResponse]: """ Create a new Speech Engine resource Parameters ---------- speech_engine : SpeechEngineConfig Speech engine WebSocket configuration name : typing.Optional[str] Name of the speech engine asr : typing.Optional[AsrConversationalConfig] ASR configuration tts : typing.Optional[TtsConversationalConfigInput] TTS configuration turn : typing.Optional[BaseTurnConfig] Turn detection configuration conversation : typing.Optional[ConversationConfigInput] Conversation configuration (client events, etc.) privacy : typing.Optional[PrivacyConfigInput] Privacy settings (recording, retention, zero retention mode) call_limits : typing.Optional[AgentCallLimits] Concurrency and daily conversation limits for this speech engine language : typing.Optional[str] Language for the speech engine tags : typing.Optional[typing.Sequence[str]] Tags for categorization request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechEngineResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/speech-engine", method="POST", json={ "name": name, "speech_engine": convert_and_respect_annotation_metadata( object_=speech_engine, annotation=SpeechEngineConfig, direction="write" ), "asr": convert_and_respect_annotation_metadata( object_=asr, annotation=AsrConversationalConfig, direction="write" ), "tts": convert_and_respect_annotation_metadata( object_=tts, annotation=TtsConversationalConfigInput, direction="write" ), "turn": convert_and_respect_annotation_metadata( object_=turn, annotation=BaseTurnConfig, direction="write" ), "conversation": convert_and_respect_annotation_metadata( object_=conversation, annotation=ConversationConfigInput, direction="write" ), "privacy": convert_and_respect_annotation_metadata( object_=privacy, annotation=PrivacyConfigInput, direction="write" ), "call_limits": convert_and_respect_annotation_metadata( object_=call_limits, annotation=AgentCallLimits, direction="write" ), "language": language, "tags": tags, "overrides": convert_and_respect_annotation_metadata( object_=overrides, annotation=SpeechEngineConversationInitiationClientDataConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SpeechEngineResponse]: """ Retrieve a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechEngineResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ Delete a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechEngineResponse]: """ Update a Speech Engine resource (partial update) Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) name : typing.Optional[str] speech_engine : typing.Optional[SpeechEngineConfig] asr : typing.Optional[AsrConversationalConfig] tts : typing.Optional[TtsConversationalConfigInput] turn : typing.Optional[BaseTurnConfig] conversation : typing.Optional[ConversationConfigInput] privacy : typing.Optional[PrivacyConfigInput] call_limits : typing.Optional[AgentCallLimits] language : typing.Optional[str] tags : typing.Optional[typing.Sequence[str]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechEngineResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="PATCH", json={ "name": name, "speech_engine": convert_and_respect_annotation_metadata( object_=speech_engine, annotation=SpeechEngineConfig, direction="write" ), "asr": convert_and_respect_annotation_metadata( object_=asr, annotation=AsrConversationalConfig, direction="write" ), "tts": convert_and_respect_annotation_metadata( object_=tts, annotation=TtsConversationalConfigInput, direction="write" ), "turn": convert_and_respect_annotation_metadata( object_=turn, annotation=BaseTurnConfig, direction="write" ), "conversation": convert_and_respect_annotation_metadata( object_=conversation, annotation=ConversationConfigInput, direction="write" ), "privacy": convert_and_respect_annotation_metadata( object_=privacy, annotation=PrivacyConfigInput, direction="write" ), "call_limits": convert_and_respect_annotation_metadata( object_=call_limits, annotation=AgentCallLimits, direction="write" ), "language": language, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSpeechEngineClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[AgentSortBy] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListSpeechEnginesResponse]: """ Returns a paginated list of Speech Engine resources. Parameters ---------- page_size : typing.Optional[int] How many Speech Engines to return at maximum. Can not exceed 100, defaults to 30. search : typing.Optional[str] Search term to filter Speech Engines by name sort_direction : typing.Optional[SortDirection] The direction to sort the results sort_by : typing.Optional[AgentSortBy] The field to sort the results by cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListSpeechEnginesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/speech-engine", method="GET", params={ "page_size": page_size, "search": search, "sort_direction": sort_direction, "sort_by": sort_by, "cursor": cursor, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListSpeechEnginesResponse, construct_type( type_=ListSpeechEnginesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechEngineResponse]: """ Create a new Speech Engine resource Parameters ---------- speech_engine : SpeechEngineConfig Speech engine WebSocket configuration name : typing.Optional[str] Name of the speech engine asr : typing.Optional[AsrConversationalConfig] ASR configuration tts : typing.Optional[TtsConversationalConfigInput] TTS configuration turn : typing.Optional[BaseTurnConfig] Turn detection configuration conversation : typing.Optional[ConversationConfigInput] Conversation configuration (client events, etc.) privacy : typing.Optional[PrivacyConfigInput] Privacy settings (recording, retention, zero retention mode) call_limits : typing.Optional[AgentCallLimits] Concurrency and daily conversation limits for this speech engine language : typing.Optional[str] Language for the speech engine tags : typing.Optional[typing.Sequence[str]] Tags for categorization request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechEngineResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/speech-engine", method="POST", json={ "name": name, "speech_engine": convert_and_respect_annotation_metadata( object_=speech_engine, annotation=SpeechEngineConfig, direction="write" ), "asr": convert_and_respect_annotation_metadata( object_=asr, annotation=AsrConversationalConfig, direction="write" ), "tts": convert_and_respect_annotation_metadata( object_=tts, annotation=TtsConversationalConfigInput, direction="write" ), "turn": convert_and_respect_annotation_metadata( object_=turn, annotation=BaseTurnConfig, direction="write" ), "conversation": convert_and_respect_annotation_metadata( object_=conversation, annotation=ConversationConfigInput, direction="write" ), "privacy": convert_and_respect_annotation_metadata( object_=privacy, annotation=PrivacyConfigInput, direction="write" ), "call_limits": convert_and_respect_annotation_metadata( object_=call_limits, annotation=AgentCallLimits, direction="write" ), "language": language, "tags": tags, "overrides": convert_and_respect_annotation_metadata( object_=overrides, annotation=SpeechEngineConversationInitiationClientDataConfig, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SpeechEngineResponse]: """ Retrieve a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechEngineResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ Delete a Speech Engine resource Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechEngineResponse]: """ Update a Speech Engine resource (partial update) Parameters ---------- speech_engine_id : str The speech engine ID (accepts seng_ or agent_ prefix) name : typing.Optional[str] speech_engine : typing.Optional[SpeechEngineConfig] asr : typing.Optional[AsrConversationalConfig] tts : typing.Optional[TtsConversationalConfigInput] turn : typing.Optional[BaseTurnConfig] conversation : typing.Optional[ConversationConfigInput] privacy : typing.Optional[PrivacyConfigInput] call_limits : typing.Optional[AgentCallLimits] language : typing.Optional[str] tags : typing.Optional[typing.Sequence[str]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechEngineResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/speech-engine/{jsonable_encoder(speech_engine_id)}", method="PATCH", json={ "name": name, "speech_engine": convert_and_respect_annotation_metadata( object_=speech_engine, annotation=SpeechEngineConfig, direction="write" ), "asr": convert_and_respect_annotation_metadata( object_=asr, annotation=AsrConversationalConfig, direction="write" ), "tts": convert_and_respect_annotation_metadata( object_=tts, annotation=TtsConversationalConfigInput, direction="write" ), "turn": convert_and_respect_annotation_metadata( object_=turn, annotation=BaseTurnConfig, direction="write" ), "conversation": convert_and_respect_annotation_metadata( object_=conversation, annotation=ConversationConfigInput, direction="write" ), "privacy": convert_and_respect_annotation_metadata( object_=privacy, annotation=PrivacyConfigInput, direction="write" ), "call_limits": convert_and_respect_annotation_metadata( object_=call_limits, annotation=AgentCallLimits, direction="write" ), "language": language, "tags": tags, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechEngineResponse, construct_type( type_=SpeechEngineResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/resource.py000066400000000000000000000146641523660243400275510ustar00rootroot00000000000000"""SpeechEngineResource — client-facing handle for a speech engine instance.""" import base64 import hashlib import hmac import json import logging import time import typing from .server import SpeechEngineServer from .session import SpeechEngineSession from .types import WebSocketLike from ..types.speech_engine_response import SpeechEngineResponse logger = logging.getLogger("elevenlabs.speech_engine") _ISSUER = "https://api.elevenlabs.io/convai/speech-engine" _SUBJECT = "convai_speech_engine_upstream" _LEEWAY_SECONDS = 60 def _base64url_decode(data: str) -> bytes: padded = data.replace("-", "+").replace("_", "/") remainder = len(padded) % 4 if remainder: padded += "=" * (4 - remainder) return base64.b64decode(padded) def verify_speech_engine_jwt(value: str, api_key: str) -> typing.Dict[str, typing.Any]: """Verify an HS256 JWT from the ElevenLabs Speech Engine API. The HMAC secret is the SHA-256 hash of the API key. Returns the decoded payload on success, raises :class:`ValueError` on failure. """ token = value.strip() if token.lower().startswith("bearer "): token = token[7:].strip() parts = token.split(".") if len(parts) != 3: raise ValueError("Invalid JWT: expected 3 parts") header_b64, payload_b64, signature_b64 = parts try: payload = json.loads(_base64url_decode(payload_b64)) except Exception: raise ValueError("Invalid JWT: failed to decode payload") trimmed_key = api_key.strip() secret = hashlib.sha256(trimmed_key.encode("utf-8")).digest() expected_sig = hmac.new( secret, f"{header_b64}.{payload_b64}".encode(), hashlib.sha256 ).digest() actual_sig = _base64url_decode(signature_b64) if not hmac.compare_digest(expected_sig, actual_sig): raise ValueError( "Invalid JWT: signature mismatch — make sure the API key used " "by your Speech Engine server matches the one used to create " "the engine." ) if payload.get("iss") != _ISSUER: raise ValueError( f'Invalid JWT: expected issuer "{_ISSUER}", got "{payload.get("iss")}"' ) if payload.get("sub") != _SUBJECT: raise ValueError( f'Invalid JWT: expected subject "{_SUBJECT}", got "{payload.get("sub")}"' ) now = int(time.time()) exp = payload.get("exp") if not isinstance(exp, (int, float)): raise ValueError("Invalid JWT: missing exp claim") iat = payload.get("iat") if not isinstance(iat, (int, float)): raise ValueError("Invalid JWT: missing iat claim") if exp + _LEEWAY_SECONDS < now: raise ValueError("Invalid JWT: token has expired") if iat - _LEEWAY_SECONDS > now: raise ValueError("Invalid JWT: iat is in the future") return payload class SpeechEngineResource: """Represents a speech engine instance. Returned by ``await client.speech_engine.get("seng_123")``. Use :meth:`serve` to start a standalone WebSocket server, or :meth:`create_session` to wrap an existing WebSocket for custom server integration (FastAPI, Starlette, etc.). Example:: engine = await elevenlabs.speech_engine.get("seng_123") async def on_transcript(transcript, session): stream = await openai.responses.create(...) await session.send_response(stream) await engine.serve( port=3001, debug=True, on_transcript=on_transcript, ) """ def __init__( self, engine_id: str, client_wrapper: typing.Any = None, response: typing.Optional[SpeechEngineResponse] = None, ) -> None: self.engine_id = engine_id self._client_wrapper = client_wrapper # Full API response, accessible as engine.config.asr, engine.config.overrides, etc. # None when the resource is constructed directly without an API call. self.config: typing.Optional[SpeechEngineResponse] = response def _get_api_key(self) -> typing.Optional[str]: if self._client_wrapper is None: return None headers = self._client_wrapper.get_headers() return headers.get("xi-api-key") def verify_request( self, headers: typing.Dict[str, typing.Any] ) -> bool: """Verify that an incoming request is from the ElevenLabs API. Checks the ``X-Elevenlabs-Speech-Engine-Authorization`` header for a valid JWT signed with the SHA-256 hash of the API key. Only needed when managing the WebSocket upgrade yourself. When using :meth:`serve`, verification is handled automatically. """ api_key = self._get_api_key() if not api_key: return False raw = headers.get("x-elevenlabs-speech-engine-authorization") if isinstance(raw, list): raw = raw[0] if raw else None if not raw: return False try: verify_speech_engine_jwt(raw, api_key) return True except ValueError: return False async def serve( self, *, port: int = 3001, path: typing.Optional[str] = None, debug: bool = False, disable_auth: bool = False, **handlers: typing.Any, ) -> None: """Start a standalone WebSocket server. Blocks until stopped. :param disable_auth: If ``True``, skip verification of the ``X-Elevenlabs-Speech-Engine-Authorization`` JWT on incoming connections. **Insecure** — only enable this if the server is protected by an IP allowlist scoped to ElevenLabs' egress ranges. Without one, anyone on the internet can open a session and consume your compute and downstream LLM quota. """ api_key = self._get_api_key() server = SpeechEngineServer( port=port, path=path, debug=debug, api_key=api_key, disable_auth=disable_auth, **handlers, ) await server.serve() def create_session( self, ws: WebSocketLike, *, debug: bool = False, ) -> SpeechEngineSession: """Wrap *ws* in a :class:`SpeechEngineSession`. Use this for custom server integration (e.g. FastAPI, Starlette). Wire handlers via :meth:`~SpeechEngineSession.on` then ``await session.run()``. """ return SpeechEngineSession(ws, debug=debug) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/server.py000066400000000000000000000140701523660243400272170ustar00rootroot00000000000000"""SpeechEngineServer — standalone WebSocket server for Speech Engine.""" import asyncio import http import os import typing import warnings from .session import SpeechEngineSession, _make_log, _wire_handlers from .types import WebSocketLike class SpeechEngineServer: """Standalone WebSocket server that produces :class:`SpeechEngineSession` instances for each incoming connection from the ElevenLabs Speech Engine API. Every incoming connection is verified against the ElevenLabs API using the configured API key before being accepted, unless ``disable_auth`` is set to ``True``. Example:: server = SpeechEngineServer( port=3001, api_key="sk_...", debug=True, on_transcript=handle_transcript, ) await server.serve() """ def __init__( self, *, port: int = 3001, path: typing.Optional[str] = None, api_key: typing.Optional[str] = None, debug: bool = False, disable_auth: bool = False, **handlers: typing.Any, ) -> None: """Initialize a Speech Engine server. :param disable_auth: If ``True``, skip verification of the ``X-Elevenlabs-Speech-Engine-Authorization`` JWT on incoming connections. **Insecure** — only enable this if the server is protected by an IP allowlist scoped to ElevenLabs' egress ranges. Without one, anyone on the internet can open a session and consume your compute and downstream LLM quota. """ self._port = port self._path = path self._api_key = api_key self._debug = debug self._disable_auth = disable_auth self._handlers = handlers self._stop_event = None # type: typing.Optional[asyncio.Event] self._server = None # type: typing.Any self._log = _make_log(debug) def handle_connection(self, ws: WebSocketLike) -> SpeechEngineSession: """Wrap *ws* in a :class:`SpeechEngineSession` with the server's handlers wired up. Use this when you manage your own WebSocket server and want to wrap individual connections. The returned session's :meth:`run` must still be awaited by the caller. """ self._log("creating new session") session = SpeechEngineSession(ws, debug=self._debug) _wire_handlers(session, self._handlers) return session async def serve(self) -> None: """Start the WebSocket server. Blocks until :meth:`stop` is called.""" from .resource import verify_speech_engine_jwt # noqa: E402 # Use the new asyncio API explicitly: `websockets.serve` was still # the legacy server on websockets 13.x and only became the asyncio # one in 14.0. The process_request callback below relies on the # asyncio signature (connection, request) and connection.respond(). from websockets.asyncio.server import serve as _ws_serve # noqa: E402 api_key = self._api_key or os.environ.get("ELEVENLABS_API_KEY") if not api_key and not self._disable_auth: raise RuntimeError( "SpeechEngineServer requires an API key to verify incoming " "connections. Pass api_key= or set the ELEVENLABS_API_KEY " "environment variable. To run without authentication, pass " "disable_auth=True — but only behind an IP allowlist." ) if self._disable_auth: warnings.warn( "SpeechEngineServer: authentication is disabled — incoming " "connections will NOT be verified. Make sure the server is " "protected by either IP allowlist restricting traffic to " "ElevenLabs or custom header values.", UserWarning, stacklevel=2, ) self._stop_event = asyncio.Event() def _process_request( connection: typing.Any, request: typing.Any ) -> typing.Any: if self._path is not None and request.path != self._path: self._log( "rejected connection — path mismatch: " "expected %s, got %s", self._path, request.path, ) return connection.respond( http.HTTPStatus.NOT_FOUND, "not found\n" ) if self._disable_auth: return None header_value = request.headers.get( "x-elevenlabs-speech-engine-authorization" ) if not header_value: self._log( "rejected connection — missing " "X-Elevenlabs-Speech-Engine-Authorization header" ) return connection.respond( http.HTTPStatus.UNAUTHORIZED, "missing authorization header\n", ) try: verify_speech_engine_jwt(header_value, typing.cast(str, api_key)) except ValueError as e: self._log("rejected connection — %s", e) return connection.respond( http.HTTPStatus.UNAUTHORIZED, "authorization failed\n", ) return None async def _handler(websocket: typing.Any) -> None: self._log("verified connection, accepting WebSocket") session = self.handle_connection(websocket) await session.run() self._server = await _ws_serve( _handler, "", self._port, process_request=_process_request, ) self._log("speech engine server listening on port %d", self._port) try: await self._stop_event.wait() finally: self._server.close() await self._server.wait_closed() async def stop(self) -> None: """Signal the server to shut down gracefully.""" if self._stop_event is not None: self._stop_event.set() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/session.py000066400000000000000000000444211523660243400273770ustar00rootroot00000000000000"""SpeechEngineSession — WebSocket session for Speech Engine conversations.""" import asyncio import json import logging import typing from .types import ConversationMessage, WebSocketLike, wrap_websocket logger = logging.getLogger("elevenlabs.speech_engine") def _make_log( debug: bool, ) -> typing.Callable[..., None]: """Return a per-instance log function, mirroring the JS SDK pattern.""" if debug: def _log(msg: str, *args: typing.Any) -> None: print("[SpeechEngine]", msg % args if args else msg) return _log return lambda *_args, **_kw: None Callback = typing.Callable[..., typing.Any] # --------------------------------------------------------------------------- # LLM stream text extraction # --------------------------------------------------------------------------- def _get(obj: typing.Any, key: str) -> typing.Any: """Attribute-or-key access helper for LLM stream chunks.""" if isinstance(obj, dict): return obj.get(key) return getattr(obj, key, None) def _extract_text(chunk: typing.Any) -> typing.Optional[str]: """Extract text content from an LLM stream chunk. Handles plain strings and common LLM streaming formats: - OpenAI Responses API (``response.output_text.delta``) - OpenAI Chat Completions API (``choices[0].delta.content``) - Anthropic Messages API (``content_block_delta`` with ``text_delta``) - Google Gemini API (``candidates[0].content.parts[0].text``) """ if isinstance(chunk, str): return chunk if chunk is None or isinstance(chunk, (int, float, bool)): return None # OpenAI Responses API if _get(chunk, "type") == "response.output_text.delta": delta = _get(chunk, "delta") if isinstance(delta, str): return delta # OpenAI Chat Completions API choices = _get(chunk, "choices") if isinstance(choices, (list, tuple)) and len(choices) > 0: delta = _get(choices[0], "delta") if delta is not None: content = _get(delta, "content") if isinstance(content, str): return content # Anthropic Messages API if _get(chunk, "type") == "content_block_delta": delta = _get(chunk, "delta") if delta is not None: if _get(delta, "type") == "text_delta": text = _get(delta, "text") if isinstance(text, str): return text # Google Gemini API candidates = _get(chunk, "candidates") if isinstance(candidates, (list, tuple)) and len(candidates) > 0: content = _get(candidates[0], "content") if content is not None: parts = _get(content, "parts") if isinstance(parts, (list, tuple)) and len(parts) > 0: text = _get(parts[0], "text") if isinstance(text, str): return text return None # --------------------------------------------------------------------------- # Handler wiring (kwargs -> event emitter) # --------------------------------------------------------------------------- def _wire_handlers( session: "SpeechEngineSession", handlers: typing.Dict[str, typing.Any], ) -> None: """Wire keyword-argument handlers onto *session* events.""" on_init = handlers.get("on_init") on_transcript = handlers.get("on_transcript") on_close = handlers.get("on_close") on_disconnect = handlers.get("on_disconnect") on_error = handlers.get("on_error") if on_init: async def _init_handler(conversation_id: str) -> None: result = on_init(conversation_id, session) if asyncio.iscoroutine(result): await result session.on("init", _init_handler) if on_transcript: async def _transcript_handler( transcript: typing.List[ConversationMessage], ) -> None: result = on_transcript(transcript, session) if asyncio.iscoroutine(result): await result session.on("user_transcript", _transcript_handler) if on_close: async def _close_handler() -> None: result = on_close(session) if asyncio.iscoroutine(result): await result session.on("close", _close_handler) if on_disconnect: async def _disconnect_handler() -> None: result = on_disconnect(session) if asyncio.iscoroutine(result): await result session.on("disconnected", _disconnect_handler) if on_error: async def _error_handler(err: Exception) -> None: result = on_error(err, session) if asyncio.iscoroutine(result): await result session.on("error", _error_handler) # --------------------------------------------------------------------------- # SpeechEngineSession # --------------------------------------------------------------------------- class SpeechEngineSession: """Wraps a WebSocket connection from the ElevenLabs Speech Engine API. Each connection represents one conversation. The session emits events for transcripts and lifecycle changes, and provides methods to send LLM responses back. When a new transcript arrives the previous transcript's handler task is cancelled automatically, interrupting any in-flight LLM call. Example:: session = SpeechEngineSession(ws, debug=True) async def handle(transcript): stream = await openai.responses.create(...) await session.send_response(stream) session.on("user_transcript", handle) await session.run() """ def __init__( self, ws: typing.Any, *, debug: bool = False, ) -> None: self._ws = wrap_websocket(ws) self._conversation_id = None # type: typing.Optional[str] self._current_task = None # type: typing.Optional[asyncio.Task] # type: ignore[type-arg] self._current_event_id = None # type: typing.Optional[int] self._in_transcript_handler = False self._closed = False self._event_handlers = {} # type: typing.Dict[str, typing.List[Callback]] self._once_handlers = {} # type: typing.Dict[str, typing.List[Callback]] self._log = _make_log(debug) # ------------------------------------------------------------------ # Event emitter interface # ------------------------------------------------------------------ def on(self, event: str, handler: Callback) -> "SpeechEngineSession": """Register *handler* for *event*.""" self._event_handlers.setdefault(event, []).append(handler) return self def off(self, event: str, handler: Callback) -> "SpeechEngineSession": """Remove *handler* from *event*.""" handlers = self._event_handlers.get(event, []) try: handlers.remove(handler) except ValueError: pass return self def once(self, event: str, handler: Callback) -> "SpeechEngineSession": """Register *handler* for *event*, removed after the first call.""" self._once_handlers.setdefault(event, []).append(handler) return self # ------------------------------------------------------------------ # Properties # ------------------------------------------------------------------ @property def conversation_id(self) -> typing.Optional[str]: """The conversation ID assigned by the Speech Engine API. Available after the ``init`` event fires. """ return self._conversation_id @property def is_open(self) -> bool: """Whether the session is still open.""" return not self._closed # ------------------------------------------------------------------ # Main message loop # ------------------------------------------------------------------ async def run(self) -> None: """Run the receive loop until the WebSocket closes. This is the main entry point after constructing a session. It processes incoming messages and dispatches events to registered handlers. """ try: while not self._closed: try: raw = await self._ws.recv() except asyncio.CancelledError: raise except Exception: self._log("WebSocket connection lost") break try: if isinstance(raw, bytes): raw = raw.decode("utf-8") msg = json.loads(raw) except (ValueError, TypeError, UnicodeDecodeError) as e: await self._emit("error", e) continue if not isinstance(msg, dict): await self._emit( "error", ValueError(f"expected JSON object, got {type(msg).__name__}"), ) continue await self._handle_message(msg) except asyncio.CancelledError: raise finally: if not self._closed: self._closed = True await self._cancel_current_and_wait() await self._emit("disconnected") # ------------------------------------------------------------------ # Sending responses # ------------------------------------------------------------------ async def send_response( self, response: typing.Any, ) -> None: """Send an LLM response back for TTS synthesis. Accepts: * A plain **string** — sent as a single agent response. * An **async iterator** yielding strings or LLM stream event objects (OpenAI, Anthropic, Gemini formats are auto-detected). This method is a coroutine so the caller can ``await`` it to know when the full response has been sent. """ if self._closed: raise RuntimeError("Cannot send response: session is closed") if not self._in_transcript_handler: logger.warning( "send_response() called outside of an on_transcript handler. " "Responses can only be sent in reply to a user transcript. " "To have the agent speak first, set a first message in your " "Speech Engine conversation config on the client." ) return event_id = self._current_event_id if isinstance(response, str): self._log( 'sending string response: "%s", event_id=%s', response, event_id, ) await self._send_agent_response(response, False, event_id) await self._send_agent_response("", True, event_id) else: self._log( "starting streamed response, event_id=%s", event_id, ) await self._stream_response(response, event_id) def close(self) -> None: """Close the session and the underlying WebSocket connection.""" if self._closed: return self._closed = True self._cancel_current() try: asyncio.ensure_future(self._ws.close()) except RuntimeError: # No running event loop — best-effort. pass # ------------------------------------------------------------------ # Internals # ------------------------------------------------------------------ async def _handle_message(self, msg: typing.Dict[str, typing.Any]) -> None: msg_type = msg.get("type") if msg_type == "init": self._conversation_id = msg.get("conversation_id") self._log( "session initialized, conversation_id=%s", self._conversation_id, ) await self._emit("init", self._conversation_id) elif msg_type == "user_transcript": incoming_event_id = msg.get("event_id") if ( incoming_event_id is not None and incoming_event_id == self._current_event_id and self._current_task is not None and not self._current_task.done() ): self._log( "skipping duplicate transcript, event_id=%s", incoming_event_id, ) return was_active = ( self._current_task is not None and not self._current_task.done() ) await self._cancel_current_and_wait() if was_active: self._log( "interrupted: cancelling previous response " "(event_id=%s) for new transcript (event_id=%s)", self._current_event_id, incoming_event_id, ) self._current_event_id = incoming_event_id transcript_data = msg.get("user_transcript") or [] try: transcript = [ ConversationMessage(role=m["role"], content=m["content"]) for m in transcript_data ] except (KeyError, TypeError) as e: await self._emit("error", e) return self._log( "received transcript, event_id=%s, messages=%d", self._current_event_id, len(transcript), ) handlers = list( self._event_handlers.get("user_transcript", []) ) once_handlers = self._once_handlers.pop("user_transcript", []) all_handlers = handlers + once_handlers if all_handlers: self._current_task = asyncio.create_task( self._run_transcript_handlers(all_handlers, transcript) ) # Yield so the handler task can start before the next # message is read. This mirrors the JS behaviour where # emitter.emit() invokes listeners synchronously. await asyncio.sleep(0) elif msg_type == "ping": await self._send({"type": "pong"}) elif msg_type == "close": self._closed = True self._in_transcript_handler = False await self._cancel_current_and_wait() await self._emit("close") elif msg_type == "error": await self._emit("error", Exception(msg.get("message", ""))) # Unknown types are silently ignored for forward compatibility. async def _run_transcript_handlers( self, handlers: typing.List[Callback], transcript: typing.List[ConversationMessage], ) -> None: self._in_transcript_handler = True try: for handler in handlers: result = handler(transcript) if asyncio.iscoroutine(result): await result except asyncio.CancelledError: raise except Exception as e: await self._emit("error", e) finally: self._in_transcript_handler = False async def _stream_response( self, stream: typing.Any, event_id: typing.Optional[int] = None ) -> None: chunks = 0 try: async for chunk in stream: if self._closed: self._log( "stream stopped: session closed after %d chunks, " "event_id=%s", chunks, event_id, ) return text = _extract_text(chunk) if text: chunks += 1 await self._send_agent_response(text, False, event_id) if not self._closed: self._log( "stream complete: %d chunks sent, event_id=%s", chunks, event_id, ) await self._send_agent_response("", True, event_id) except asyncio.CancelledError: raise except Exception as e: await self._emit("error", e) if not self._closed: await self._send_agent_response("", True, event_id) async def _send_agent_response( self, content: str, is_final: bool, event_id: typing.Optional[int] = None, ) -> None: if event_id is None: event_id = self._current_event_id await self._send( { "type": "agent_response", "content": content, "event_id": event_id, "is_final": is_final, } ) async def _send(self, msg: typing.Dict[str, typing.Any]) -> None: if self._closed: return try: await self._ws.send(json.dumps(msg)) except asyncio.CancelledError: raise except Exception: # Send failed — the recv loop will detect the closed connection. pass async def _emit(self, event: str, *args: typing.Any) -> None: handlers = list(self._event_handlers.get(event, [])) once_handlers = self._once_handlers.pop(event, []) all_handlers = handlers + once_handlers for handler in all_handlers: try: result = handler(*args) if asyncio.iscoroutine(result): await result except asyncio.CancelledError: raise except Exception as e: if event != "error": await self._emit("error", e) else: logger.exception("unhandled error in error handler: %s", e) async def _cancel_current_and_wait(self) -> None: """Cancel the current handler task and wait for cleanup.""" task = self._current_task self._current_task = None if task is not None and not task.done(): task.cancel() try: await task except (asyncio.CancelledError, Exception): pass def _cancel_current(self) -> None: """Cancel the current handler task (fire-and-forget).""" if self._current_task is not None and not self._current_task.done(): self._current_task.cancel() self._current_task = None elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine/types.py000066400000000000000000000066521523660243400270640ustar00rootroot00000000000000"""Types for the Speech Engine module.""" import typing import pydantic # --------------------------------------------------------------------------- # Event name constants # --------------------------------------------------------------------------- INIT = "init" USER_TRANSCRIPT = "user_transcript" CLOSE = "close" ERROR = "error" DISCONNECTED = "disconnected" # --------------------------------------------------------------------------- # Wire protocol — incoming (ElevenLabs API -> developer server) # --------------------------------------------------------------------------- # # InitMessage: {"type": "init", "conversation_id": "..."} # UserTranscriptMessage: {"type": "user_transcript", "user_transcript": [...], "event_id": N} # PingMessage: {"type": "ping"} # CloseMessage: {"type": "close"} # ErrorMessage: {"type": "error", "message": "..."} # # --------------------------------------------------------------------------- # Wire protocol — outgoing (developer server -> ElevenLabs API) # --------------------------------------------------------------------------- # # AgentResponseMessage: {"type": "agent_response", "content": "...", "event_id": N, "is_final": bool} # PongMessage: {"type": "pong"} # # --------------------------------------------------------------------------- # ConversationMessage # --------------------------------------------------------------------------- class ConversationMessage(pydantic.BaseModel): """A single message in a speech engine conversation. Attributes: role: Either ``"user"`` or ``"agent"``. content: The text content of the message. """ role: str content: str # --------------------------------------------------------------------------- # WebSocket abstraction # --------------------------------------------------------------------------- class WebSocketLike(typing.Protocol): """Protocol for WebSocket-like objects. Compatible with ``websockets.WebSocketServerProtocol`` and FastAPI/Starlette ``WebSocket`` out of the box (auto-detected). """ async def recv(self) -> typing.Union[str, bytes]: ... # pragma: no cover async def send(self, data: str) -> None: ... # pragma: no cover async def close(self) -> None: ... # pragma: no cover class _ASGIWebSocketAdapter: """Adapts a FastAPI/Starlette WebSocket to the :class:`WebSocketLike` interface expected by :class:`~.session.SpeechEngineSession`.""" def __init__(self, ws: typing.Any) -> None: self._ws = ws async def recv(self) -> typing.Union[str, bytes]: return await self._ws.receive_text() async def send(self, data: str) -> None: await self._ws.send_text(data) async def close(self) -> None: await self._ws.close() def wrap_websocket(ws: typing.Any) -> WebSocketLike: """Return a :class:`WebSocketLike` wrapper for *ws*. If *ws* already has ``recv``/``send`` (e.g. the ``websockets`` library), it is returned as-is. If it has ``receive_text``/``send_text`` (e.g. FastAPI/Starlette), it is wrapped with :class:`_ASGIWebSocketAdapter`. """ if hasattr(ws, "recv"): return ws if hasattr(ws, "receive_text"): return _ASGIWebSocketAdapter(ws) raise TypeError( f"Cannot wrap {type(ws).__name__}: expected a websockets-style " f"object (recv/send) or an ASGI-style object (receive_text/send_text)" ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_custom.py000066400000000000000000000232101523660243400272770ustar00rootroot00000000000000import typing from .core import RequestOptions from .speech_engine.client import AsyncSpeechEngineClient as AutogeneratedAsyncSpeechEngineClient from .speech_engine.client import SpeechEngineClient as AutogeneratedSpeechEngineClient from .speech_engine.resource import SpeechEngineResource from .types.agent_call_limits import AgentCallLimits from .types.asr_conversational_config import AsrConversationalConfig from .types.base_turn_config import BaseTurnConfig from .types.conversation_config_input import ConversationConfigInput from .types.privacy_config_input import PrivacyConfigInput from .types.speech_engine_config import SpeechEngineConfig from .types.speech_engine_conversation_initiation_client_data_config import SpeechEngineConversationInitiationClientDataConfig from .types.tts_conversational_config_input import TtsConversationalConfigInput OMIT = typing.cast(typing.Any, ...) class SpeechEngineClient(AutogeneratedSpeechEngineClient): """Extends the generated SpeechEngineClient with WebSocket server integration.""" def create( # type: ignore[override] self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Create a Speech Engine resource. Makes an API call to create the engine, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = super().create( speech_engine=speech_engine, name=name, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, overrides=overrides, request_options=request_options, ) return SpeechEngineResource( engine_id=response.speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) def get( # type: ignore[override] self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Retrieve a Speech Engine resource. Makes an API call to validate the engine exists, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = super().get(speech_engine_id, request_options=request_options) return SpeechEngineResource( engine_id=speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) def update( # type: ignore[override] self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Update a Speech Engine resource. Makes an API call to update the engine, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = super().update( speech_engine_id, name=name, speech_engine=speech_engine, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, request_options=request_options, ) return SpeechEngineResource( engine_id=speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) class AsyncSpeechEngineClient(AutogeneratedAsyncSpeechEngineClient): """Extends the generated AsyncSpeechEngineClient with WebSocket server integration.""" async def create( # type: ignore[override] self, *, speech_engine: SpeechEngineConfig, name: typing.Optional[str] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, overrides: typing.Optional[SpeechEngineConversationInitiationClientDataConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Create a Speech Engine resource. Makes an API call to create the engine, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = await super().create( speech_engine=speech_engine, name=name, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, overrides=overrides, request_options=request_options, ) return SpeechEngineResource( engine_id=response.speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) async def get( # type: ignore[override] self, speech_engine_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Retrieve a Speech Engine resource. Makes an API call to validate the engine exists, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = await super().get(speech_engine_id, request_options=request_options) return SpeechEngineResource( engine_id=speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) async def update( # type: ignore[override] self, speech_engine_id: str, *, name: typing.Optional[str] = OMIT, speech_engine: typing.Optional[SpeechEngineConfig] = OMIT, asr: typing.Optional[AsrConversationalConfig] = OMIT, tts: typing.Optional[TtsConversationalConfigInput] = OMIT, turn: typing.Optional[BaseTurnConfig] = OMIT, conversation: typing.Optional[ConversationConfigInput] = OMIT, privacy: typing.Optional[PrivacyConfigInput] = OMIT, call_limits: typing.Optional[AgentCallLimits] = OMIT, language: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechEngineResource: """Update a Speech Engine resource. Makes an API call to update the engine, then returns a :class:`SpeechEngineResource` with WebSocket integration methods (:meth:`~SpeechEngineResource.serve`, :meth:`~SpeechEngineResource.create_session`, :meth:`~SpeechEngineResource.verify_request`). """ response = await super().update( speech_engine_id, name=name, speech_engine=speech_engine, asr=asr, tts=tts, turn=turn, conversation=conversation, privacy=privacy, call_limits=call_limits, language=language, tags=tags, request_options=request_options, ) return SpeechEngineResource( engine_id=speech_engine_id, client_wrapper=self._raw_client._client_wrapper, response=response, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/000077500000000000000000000000001523660243400272555ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/__init__.py000066400000000000000000000022131523660243400313640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveUpstreamMessage, SendUpstreamMessage _dynamic_imports: typing.Dict[str, str] = {"ReceiveUpstreamMessage": ".types", "SendUpstreamMessage": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveUpstreamMessage", "SendUpstreamMessage"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/types/000077500000000000000000000000001523660243400304215ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/types/__init__.py000066400000000000000000000023621523660243400325350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_upstream_message import ReceiveUpstreamMessage from .send_upstream_message import SendUpstreamMessage _dynamic_imports: typing.Dict[str, str] = { "ReceiveUpstreamMessage": ".receive_upstream_message", "SendUpstreamMessage": ".send_upstream_message", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveUpstreamMessage", "SendUpstreamMessage"] receive_upstream_message.py000066400000000000000000000007031523660243400357620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.close_payload import ClosePayload from ...types.error_payload import ErrorPayload from ...types.init_payload import InitPayload from ...types.ping_payload import PingPayload from ...types.user_transcript_payload import UserTranscriptPayload ReceiveUpstreamMessage = typing.Union[InitPayload, UserTranscriptPayload, PingPayload, ClosePayload, ErrorPayload] send_upstream_message.py000066400000000000000000000004061523660243400352710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_engine_upstream/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.agent_response_payload import AgentResponsePayload from ...types.pong_payload import PongPayload SendUpstreamMessage = typing.Union[AgentResponsePayload, PongPayload] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/000077500000000000000000000000001523660243400260415ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/__init__.py000066400000000000000000000031001523660243400301440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( SpeechToSpeechConvertRequestOutputFormat, SpeechToSpeechRequestFileFormat, SpeechToSpeechStreamRequestFileFormat, SpeechToSpeechStreamRequestOutputFormat, ) _dynamic_imports: typing.Dict[str, str] = { "SpeechToSpeechConvertRequestOutputFormat": ".types", "SpeechToSpeechRequestFileFormat": ".types", "SpeechToSpeechStreamRequestFileFormat": ".types", "SpeechToSpeechStreamRequestOutputFormat": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "SpeechToSpeechConvertRequestOutputFormat", "SpeechToSpeechRequestFileFormat", "SpeechToSpeechStreamRequestFileFormat", "SpeechToSpeechStreamRequestOutputFormat", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/client.py000066400000000000000000000537651523660243400277110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from .raw_client import AsyncRawSpeechToSpeechClient, RawSpeechToSpeechClient from .types.speech_to_speech_convert_request_output_format import SpeechToSpeechConvertRequestOutputFormat from .types.speech_to_speech_request_file_format import SpeechToSpeechRequestFileFormat from .types.speech_to_speech_stream_request_file_format import SpeechToSpeechStreamRequestFileFormat from .types.speech_to_speech_stream_request_output_format import SpeechToSpeechStreamRequestOutputFormat # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SpeechToSpeechClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSpeechToSpeechClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSpeechToSpeechClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSpeechToSpeechClient """ return self._raw_client def convert( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Transform audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechRequestFileFormat] 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. Returns ------- typing.Iterator[bytes] The generated audio file Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", model_id="eleven_multilingual_sts_v2", ) """ with self._raw_client.convert( voice_id, audio=audio, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, voice_settings=voice_settings, seed=seed, remove_background_noise=remove_background_noise, file_format=file_format, request_options=request_options, ) as r: yield from r.data def stream( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Stream audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechStreamRequestFileFormat] 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. Returns ------- typing.Iterator[bytes] Streaming audio data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", model_id="eleven_multilingual_sts_v2", ) """ with self._raw_client.stream( voice_id, audio=audio, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, voice_settings=voice_settings, seed=seed, remove_background_noise=remove_background_noise, file_format=file_format, request_options=request_options, ) as r: yield from r.data class AsyncSpeechToSpeechClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSpeechToSpeechClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSpeechToSpeechClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSpeechToSpeechClient """ return self._raw_client async def convert( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Transform audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechRequestFileFormat] 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. Returns ------- typing.AsyncIterator[bytes] The generated audio file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", model_id="eleven_multilingual_sts_v2", ) asyncio.run(main()) """ async with self._raw_client.convert( voice_id, audio=audio, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, voice_settings=voice_settings, seed=seed, remove_background_noise=remove_background_noise, file_format=file_format, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def stream( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Stream audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechStreamRequestFileFormat] 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. Returns ------- typing.AsyncIterator[bytes] Streaming audio data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", model_id="eleven_multilingual_sts_v2", ) asyncio.run(main()) """ async with self._raw_client.stream( voice_id, audio=audio, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, voice_settings=voice_settings, seed=seed, remove_background_noise=remove_background_noise, file_format=file_format, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/raw_client.py000066400000000000000000000710641523660243400305520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from .types.speech_to_speech_convert_request_output_format import SpeechToSpeechConvertRequestOutputFormat from .types.speech_to_speech_request_file_format import SpeechToSpeechRequestFileFormat from .types.speech_to_speech_stream_request_file_format import SpeechToSpeechStreamRequestFileFormat from .types.speech_to_speech_stream_request_output_format import SpeechToSpeechStreamRequestOutputFormat from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSpeechToSpeechClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def convert( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Transform audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechRequestFileFormat] 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated audio file """ with self._client_wrapper.httpx_client.stream( f"v1/speech-to-speech/{jsonable_encoder(voice_id)}", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, data={ "model_id": model_id, "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechStreamRequestFileFormat] 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data """ with self._client_wrapper.httpx_client.stream( f"v1/speech-to-speech/{jsonable_encoder(voice_id)}/stream", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, data={ "model_id": model_id, "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawSpeechToSpeechClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def convert( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Transform audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechRequestFileFormat] 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated audio file """ async with self._client_wrapper.httpx_client.stream( f"v1/speech-to-speech/{jsonable_encoder(voice_id)}", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, data={ "model_id": model_id, "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream( self, voice_id: str, *, audio: core.File, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[SpeechToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, voice_settings: typing.Optional[str] = OMIT, seed: typing.Optional[int] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, file_format: typing.Optional[SpeechToSpeechStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream audio from one voice to another. Maintain full control over emotion, timing and delivery. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. audio : 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[SpeechToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. voice_settings : typing.Optional[str] Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. 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[SpeechToSpeechStreamRequestFileFormat] 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data """ async with self._client_wrapper.httpx_client.stream( f"v1/speech-to-speech/{jsonable_encoder(voice_id)}/stream", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, data={ "model_id": model_id, "voice_settings": voice_settings, "seed": seed, "remove_background_noise": remove_background_noise, "file_format": file_format, }, files={ "audio": audio, }, request_options=request_options, omit=OMIT, force_multipart=True, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types/000077500000000000000000000000001523660243400272055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types/__init__.py000066400000000000000000000036051523660243400313220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .speech_to_speech_convert_request_output_format import SpeechToSpeechConvertRequestOutputFormat from .speech_to_speech_request_file_format import SpeechToSpeechRequestFileFormat from .speech_to_speech_stream_request_file_format import SpeechToSpeechStreamRequestFileFormat from .speech_to_speech_stream_request_output_format import SpeechToSpeechStreamRequestOutputFormat _dynamic_imports: typing.Dict[str, str] = { "SpeechToSpeechConvertRequestOutputFormat": ".speech_to_speech_convert_request_output_format", "SpeechToSpeechRequestFileFormat": ".speech_to_speech_request_file_format", "SpeechToSpeechStreamRequestFileFormat": ".speech_to_speech_stream_request_file_format", "SpeechToSpeechStreamRequestOutputFormat": ".speech_to_speech_stream_request_output_format", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "SpeechToSpeechConvertRequestOutputFormat", "SpeechToSpeechRequestFileFormat", "SpeechToSpeechStreamRequestFileFormat", "SpeechToSpeechStreamRequestOutputFormat", ] speech_to_speech_convert_request_output_format.py000066400000000000000000000014551523660243400413050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToSpeechConvertRequestOutputFormat = typing.Union[ typing.Literal[ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000", ], typing.Any, ] speech_to_speech_request_file_format.py000066400000000000000000000002641523660243400371210ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToSpeechRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] speech_to_speech_stream_request_file_format.py000066400000000000000000000002721523660243400404730ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToSpeechStreamRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] speech_to_speech_stream_request_output_format.py000066400000000000000000000012321523660243400411110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToSpeechStreamRequestOutputFormat = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/000077500000000000000000000000001523660243400255565ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/__init__.py000066400000000000000000000046341523660243400276760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( SpeechToTextConvertRequestEntityDetection, SpeechToTextConvertRequestEntityRedaction, SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestModelId, SpeechToTextConvertRequestMultichannelOutputStyle, SpeechToTextConvertRequestTimestampsGranularity, SpeechToTextConvertRequestWebhookMetadata, SpeechToTextConvertResponse, ) from . import transcripts from .transcripts import TranscriptsGetResponse _dynamic_imports: typing.Dict[str, str] = { "SpeechToTextConvertRequestEntityDetection": ".types", "SpeechToTextConvertRequestEntityRedaction": ".types", "SpeechToTextConvertRequestFileFormat": ".types", "SpeechToTextConvertRequestModelId": ".types", "SpeechToTextConvertRequestMultichannelOutputStyle": ".types", "SpeechToTextConvertRequestTimestampsGranularity": ".types", "SpeechToTextConvertRequestWebhookMetadata": ".types", "SpeechToTextConvertResponse": ".types", "TranscriptsGetResponse": ".transcripts", "transcripts": ".transcripts", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestEntityRedaction", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestModelId", "SpeechToTextConvertRequestMultichannelOutputStyle", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", "SpeechToTextConvertResponse", "TranscriptsGetResponse", "transcripts", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/client.py000066400000000000000000000746331523660243400274230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.additional_formats import AdditionalFormats from .raw_client import AsyncRawSpeechToTextClient, RawSpeechToTextClient from .types.speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .types.speech_to_text_convert_request_entity_redaction import SpeechToTextConvertRequestEntityRedaction from .types.speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .types.speech_to_text_convert_request_model_id import SpeechToTextConvertRequestModelId from .types.speech_to_text_convert_request_multichannel_output_style import ( SpeechToTextConvertRequestMultichannelOutputStyle, ) from .types.speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .types.speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata from .types.speech_to_text_convert_response import SpeechToTextConvertResponse if typing.TYPE_CHECKING: from .transcripts.client import AsyncTranscriptsClient, TranscriptsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SpeechToTextClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSpeechToTextClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._transcripts: typing.Optional[TranscriptsClient] = None @property def with_raw_response(self) -> RawSpeechToTextClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSpeechToTextClient """ return self._raw_client def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextConvertResponse: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechToTextConvertResponse Synchronous transcription result Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_to_text.convert( token="token", enable_logging=True, model_id="scribe_v2", ) """ _response = self._raw_client.convert( model_id=model_id, token=token, enable_logging=enable_logging, file=file, language_code=language_code, tag_audio_events=tag_audio_events, num_speakers=num_speakers, timestamps_granularity=timestamps_granularity, diarize=diarize, diarization_threshold=diarization_threshold, additional_formats=additional_formats, file_format=file_format, cloud_storage_url=cloud_storage_url, source_url=source_url, webhook=webhook, webhook_id=webhook_id, temperature=temperature, seed=seed, use_multi_channel=use_multi_channel, multichannel_output_style=multichannel_output_style, webhook_metadata=webhook_metadata, entity_detection=entity_detection, no_verbatim=no_verbatim, use_speaker_library=use_speaker_library, detect_speaker_roles=detect_speaker_roles, entity_redaction=entity_redaction, entity_redaction_mode=entity_redaction_mode, keyterms=keyterms, request_options=request_options, ) return _response.data @property def transcripts(self): if self._transcripts is None: from .transcripts.client import TranscriptsClient # noqa: E402 self._transcripts = TranscriptsClient(client_wrapper=self._client_wrapper) return self._transcripts class AsyncSpeechToTextClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSpeechToTextClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._transcripts: typing.Optional[AsyncTranscriptsClient] = None @property def with_raw_response(self) -> AsyncRawSpeechToTextClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSpeechToTextClient """ return self._raw_client async def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextConvertResponse: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SpeechToTextConvertResponse Synchronous transcription result Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_to_text.convert( token="token", enable_logging=True, model_id="scribe_v2", ) asyncio.run(main()) """ _response = await self._raw_client.convert( model_id=model_id, token=token, enable_logging=enable_logging, file=file, language_code=language_code, tag_audio_events=tag_audio_events, num_speakers=num_speakers, timestamps_granularity=timestamps_granularity, diarize=diarize, diarization_threshold=diarization_threshold, additional_formats=additional_formats, file_format=file_format, cloud_storage_url=cloud_storage_url, source_url=source_url, webhook=webhook, webhook_id=webhook_id, temperature=temperature, seed=seed, use_multi_channel=use_multi_channel, multichannel_output_style=multichannel_output_style, webhook_metadata=webhook_metadata, entity_detection=entity_detection, no_verbatim=no_verbatim, use_speaker_library=use_speaker_library, detect_speaker_roles=detect_speaker_roles, entity_redaction=entity_redaction, entity_redaction_mode=entity_redaction_mode, keyterms=keyterms, request_options=request_options, ) return _response.data @property def transcripts(self): if self._transcripts is None: from .transcripts.client import AsyncTranscriptsClient # noqa: E402 self._transcripts = AsyncTranscriptsClient(client_wrapper=self._client_wrapper) return self._transcripts elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/raw_client.py000066400000000000000000001012231523660243400302560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import json import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.additional_formats import AdditionalFormats from .types.speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .types.speech_to_text_convert_request_entity_redaction import SpeechToTextConvertRequestEntityRedaction from .types.speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .types.speech_to_text_convert_request_model_id import SpeechToTextConvertRequestModelId from .types.speech_to_text_convert_request_multichannel_output_style import ( SpeechToTextConvertRequestMultichannelOutputStyle, ) from .types.speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .types.speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata from .types.speech_to_text_convert_response import SpeechToTextConvertResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSpeechToTextClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechToTextConvertResponse]: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SpeechToTextConvertResponse] Synchronous transcription result """ _response = self._client_wrapper.httpx_client.request( "v1/speech-to-text", method="POST", params={ "token": token, "enable_logging": enable_logging, }, data={ "model_id": model_id, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "diarization_threshold": diarization_threshold, "file_format": file_format, "cloud_storage_url": cloud_storage_url, "source_url": source_url, "webhook": webhook, "webhook_id": webhook_id, "temperature": temperature, "seed": seed, "use_multi_channel": use_multi_channel, "multichannel_output_style": multichannel_output_style, "webhook_metadata": json.dumps(jsonable_encoder(webhook_metadata)), "entity_detection": json.dumps(jsonable_encoder(entity_detection)), "no_verbatim": no_verbatim, "use_speaker_library": use_speaker_library, "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), **( {"additional_formats": (None, json.dumps(jsonable_encoder(additional_formats)), "application/json")} if additional_formats is not OMIT else {} ), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechToTextConvertResponse, construct_type( type_=SpeechToTextConvertResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSpeechToTextClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def convert( self, *, model_id: SpeechToTextConvertRequestModelId, token: typing.Optional[str] = None, enable_logging: typing.Optional[bool] = None, file: typing.Optional[core.File] = OMIT, language_code: typing.Optional[str] = OMIT, tag_audio_events: typing.Optional[bool] = OMIT, num_speakers: typing.Optional[int] = OMIT, timestamps_granularity: typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] = OMIT, diarize: typing.Optional[bool] = OMIT, diarization_threshold: typing.Optional[float] = OMIT, additional_formats: typing.Optional[AdditionalFormats] = OMIT, file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, source_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, webhook_id: typing.Optional[str] = OMIT, temperature: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, multichannel_output_style: typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, no_verbatim: typing.Optional[bool] = OMIT, use_speaker_library: typing.Optional[bool] = OMIT, detect_speaker_roles: typing.Optional[bool] = OMIT, entity_redaction: typing.Optional[SpeechToTextConvertRequestEntityRedaction] = OMIT, entity_redaction_mode: typing.Optional[str] = OMIT, keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechToTextConvertResponse]: """ Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. When use_multi_channel is true and the provided audio has multiple channels, a 'transcripts' object with separate transcripts for each channel is returned; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Otherwise, returns a single transcript. The optional webhook_metadata parameter allows you to attach custom data that will be included in webhook responses for request correlation and tracking. Parameters ---------- model_id : SpeechToTextConvertRequestModelId The ID of the model to use for transcription. token : typing.Optional[str] A single-use authentication token created via POST /v1/single-use-token/batch_scribe. This token can only be used once and expires after 15 minutes. Alternative to API key or bearer token authentication for frontend clients. enable_logging : typing.Optional[bool] When enable_logging is set to false zero retention mode will be used for the request. This will mean log and transcript storage features are unavailable for this request. Zero retention mode may only be used by enterprise customers. file : typing.Optional[core.File] See core.File for more documentation language_code : typing.Optional[str] An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. tag_audio_events : typing.Optional[bool] Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. num_speakers : typing.Optional[int] The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. timestamps_granularity : typing.Optional[SpeechToTextConvertRequestTimestampsGranularity] The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. diarize : typing.Optional[bool] Whether to annotate which speaker is currently talking in the uploaded file. diarization_threshold : typing.Optional[float] Diarization threshold to apply during speaker diarization. A higher value means there will be a lower chance of one speaker being diarized as two different speakers but also a higher chance of two different speakers being diarized as one speaker (less total speakers predicted). A low value means there will be a higher chance of one speaker being diarized as two different speakers but also a lower chance of two different speakers being diarized as one speaker (more total speakers predicted). Can only be set when diarize=True and num_speakers=None. Defaults to None, in which case we will choose a threshold based on the model_id (0.22 usually). 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] [Deprecated] This parameter is deprecated and will be removed in the future. Use 'source_url' instead.The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters. source_url : typing.Optional[str] The URL of an audio or video file to transcribe. Supports hosted video or audio files, YouTube video URLs, TikTok video URLs, and other video hosting services. webhook : typing.Optional[bool] Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. webhook_id : typing.Optional[str] Optional specific webhook ID to send the transcription result to. Only valid when webhook is set to true. If not provided, transcription will be sent to all configured speech-to-text webhooks. temperature : typing.Optional[float] Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 2147483647. use_multi_channel : typing.Optional[bool] Whether the audio file contains multiple channels where each channel contains a single speaker. When enabled, each channel is transcribed independently. By default a separate transcript is returned per channel; set multichannel_output_style='combined' to instead receive a single transcript with all channels merged and sorted by time. Each word in the response includes a 'channel_index' field indicating which channel it was spoken on. A maximum of 5 channels is supported. Each channel is billed independently at the full audio duration, so cost scales linearly with the number of channels. multichannel_output_style : typing.Optional[SpeechToTextConvertRequestMultichannelOutputStyle] Controls the response shape when use_multi_channel is enabled. 'separate' (default) returns one transcript per channel under 'transcripts'. 'combined' merges all channels into a single transcript whose words are sorted by start time, each carrying a 'channel_index' - matching the single-channel response shape. 'combined' requires timestamps (timestamps_granularity must not be 'none') and does not support entity detection or redaction. webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. no_verbatim : typing.Optional[bool] If true, the transcription will not have any filler words, false starts and non-speech sounds. Only supported with scribe_v2 model. use_speaker_library : typing.Optional[bool] Whether to use the speaker library for identifying known speakers during diarization. When enabled and diarize is true, detected speakers will be matched against registered speakers in the workspace's speaker library. detect_speaker_roles : typing.Optional[bool] Whether to detect speaker roles (agent vs customer). Requires diarize=true. Cannot be used with use_multi_channel=true. When enabled, speaker_id values will be 'agent' and 'customer' instead of 'speaker_0', 'speaker_1', etc. Usage incurs an additional 10% surcharge on base transcription cost. entity_redaction : typing.Optional[SpeechToTextConvertRequestEntityRedaction] Redact entities from the transcript text. Accepts the same format as entity_detection: 'all', a category ('pii', 'phi'), or specific entity types. Must be a subset of entity_detection. When redaction is enabled, the entities field will not be returned. Usage of this parameter will incur an additional 30% surcharge on the base transcription cost. entity_redaction_mode : typing.Optional[str] How to format redacted entities. 'redacted' replaces with {REDACTED}, 'entity_type' replaces with {ENTITY_TYPE}, 'enumerated_entity_type' replaces with {ENTITY_TYPE_N} where N enumerates each occurrence. Only used when entity_redaction is set. keyterms : typing.Optional[typing.List[str]] A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 1000. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"]. The following characters are not supported: `<`, `>`, `{`, `}`, `[`, `]`, `\\`. Usage of this parameter will incur an additional 20% surcharge on the base transcription cost. When more than 100 keyterms are provided, a minimum billable duration of 20 seconds applies per request. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SpeechToTextConvertResponse] Synchronous transcription result """ _response = await self._client_wrapper.httpx_client.request( "v1/speech-to-text", method="POST", params={ "token": token, "enable_logging": enable_logging, }, data={ "model_id": model_id, "language_code": language_code, "tag_audio_events": tag_audio_events, "num_speakers": num_speakers, "timestamps_granularity": timestamps_granularity, "diarize": diarize, "diarization_threshold": diarization_threshold, "file_format": file_format, "cloud_storage_url": cloud_storage_url, "source_url": source_url, "webhook": webhook, "webhook_id": webhook_id, "temperature": temperature, "seed": seed, "use_multi_channel": use_multi_channel, "multichannel_output_style": multichannel_output_style, "webhook_metadata": json.dumps(jsonable_encoder(webhook_metadata)), "entity_detection": json.dumps(jsonable_encoder(entity_detection)), "no_verbatim": no_verbatim, "use_speaker_library": use_speaker_library, "detect_speaker_roles": detect_speaker_roles, "entity_redaction": json.dumps(jsonable_encoder(entity_redaction)), "entity_redaction_mode": entity_redaction_mode, "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), **( {"additional_formats": (None, json.dumps(jsonable_encoder(additional_formats)), "application/json")} if additional_formats is not OMIT else {} ), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeechToTextConvertResponse, construct_type( type_=SpeechToTextConvertResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/000077500000000000000000000000001523660243400301325ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/__init__.py000066400000000000000000000020761523660243400322500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import TranscriptsGetResponse _dynamic_imports: typing.Dict[str, str] = {"TranscriptsGetResponse": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptsGetResponse"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/client.py000066400000000000000000000121361523660243400317650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawTranscriptsClient, RawTranscriptsClient from .types.transcripts_get_response import TranscriptsGetResponse class TranscriptsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTranscriptsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTranscriptsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTranscriptsClient """ return self._raw_client def get( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> TranscriptsGetResponse: """ Retrieve a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TranscriptsGetResponse The transcript data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_to_text.transcripts.get( transcription_id="transcription_id", ) """ _response = self._raw_client.get(transcription_id, request_options=request_options) return _response.data def delete(self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to delete request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Delete completed successfully. Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.speech_to_text.transcripts.delete( transcription_id="transcription_id", ) """ _response = self._raw_client.delete(transcription_id, request_options=request_options) return _response.data class AsyncTranscriptsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTranscriptsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTranscriptsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTranscriptsClient """ return self._raw_client async def get( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> TranscriptsGetResponse: """ Retrieve a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- TranscriptsGetResponse The transcript data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_to_text.transcripts.get( transcription_id="transcription_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(transcription_id, request_options=request_options) return _response.data async def delete( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to delete request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Delete completed successfully. Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.speech_to_text.transcripts.delete( transcription_id="transcription_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(transcription_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/raw_client.py000066400000000000000000000305011523660243400326320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.not_found_error import NotFoundError from ...errors.unauthorized_error import UnauthorizedError from ...errors.unprocessable_entity_error import UnprocessableEntityError from .types.transcripts_get_response import TranscriptsGetResponse from pydantic import ValidationError class RawTranscriptsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[TranscriptsGetResponse]: """ Retrieve a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[TranscriptsGetResponse] The transcript data """ _response = self._client_wrapper.httpx_client.request( f"v1/speech-to-text/transcripts/{jsonable_encoder(transcription_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TranscriptsGetResponse, construct_type( type_=TranscriptsGetResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to delete request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Delete completed successfully. """ _response = self._client_wrapper.httpx_client.request( f"v1/speech-to-text/transcripts/{jsonable_encoder(transcription_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTranscriptsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[TranscriptsGetResponse]: """ Retrieve a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to retrieve request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[TranscriptsGetResponse] The transcript data """ _response = await self._client_wrapper.httpx_client.request( f"v1/speech-to-text/transcripts/{jsonable_encoder(transcription_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( TranscriptsGetResponse, construct_type( type_=TranscriptsGetResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete a previously generated transcript by its ID. Parameters ---------- transcription_id : str The unique ID of the transcript to delete request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Delete completed successfully. """ _response = await self._client_wrapper.httpx_client.request( f"v1/speech-to-text/transcripts/{jsonable_encoder(transcription_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/types/000077500000000000000000000000001523660243400312765ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/types/__init__.py000066400000000000000000000021441523660243400334100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .transcripts_get_response import TranscriptsGetResponse _dynamic_imports: typing.Dict[str, str] = {"TranscriptsGetResponse": ".transcripts_get_response"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["TranscriptsGetResponse"] transcripts_get_response.py000066400000000000000000000005761523660243400367320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/transcripts/types# This file was auto-generated by Fern from our API Definition. import typing from ....types.multichannel_speech_to_text_response_model import MultichannelSpeechToTextResponseModel from ....types.speech_to_text_chunk_response_model import SpeechToTextChunkResponseModel TranscriptsGetResponse = typing.Union[SpeechToTextChunkResponseModel, MultichannelSpeechToTextResponseModel] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types/000077500000000000000000000000001523660243400267225ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types/__init__.py000066400000000000000000000056561523660243400310470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .speech_to_text_convert_request_entity_redaction import SpeechToTextConvertRequestEntityRedaction from .speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .speech_to_text_convert_request_model_id import SpeechToTextConvertRequestModelId from .speech_to_text_convert_request_multichannel_output_style import ( SpeechToTextConvertRequestMultichannelOutputStyle, ) from .speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata from .speech_to_text_convert_response import SpeechToTextConvertResponse _dynamic_imports: typing.Dict[str, str] = { "SpeechToTextConvertRequestEntityDetection": ".speech_to_text_convert_request_entity_detection", "SpeechToTextConvertRequestEntityRedaction": ".speech_to_text_convert_request_entity_redaction", "SpeechToTextConvertRequestFileFormat": ".speech_to_text_convert_request_file_format", "SpeechToTextConvertRequestModelId": ".speech_to_text_convert_request_model_id", "SpeechToTextConvertRequestMultichannelOutputStyle": ".speech_to_text_convert_request_multichannel_output_style", "SpeechToTextConvertRequestTimestampsGranularity": ".speech_to_text_convert_request_timestamps_granularity", "SpeechToTextConvertRequestWebhookMetadata": ".speech_to_text_convert_request_webhook_metadata", "SpeechToTextConvertResponse": ".speech_to_text_convert_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestEntityRedaction", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestModelId", "SpeechToTextConvertRequestMultichannelOutputStyle", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", "SpeechToTextConvertResponse", ] speech_to_text_convert_request_entity_detection.py000066400000000000000000000002401523660243400411700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestEntityDetection = typing.Union[str, typing.List[str]] speech_to_text_convert_request_entity_redaction.py000066400000000000000000000002401523660243400411620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestEntityRedaction = typing.Union[str, typing.List[str]] speech_to_text_convert_request_file_format.py000066400000000000000000000002711523660243400401110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any] speech_to_text_convert_request_model_id.py000066400000000000000000000002671523660243400374030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestModelId = typing.Union[typing.Literal["scribe_v2", "scribe_v1"], typing.Any] speech_to_text_convert_request_multichannel_output_style.py000066400000000000000000000003051523660243400431430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestMultichannelOutputStyle = typing.Union[typing.Literal["separate", "combined"], typing.Any] speech_to_text_convert_request_timestamps_granularity.py000066400000000000000000000003101523660243400424230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestTimestampsGranularity = typing.Union[typing.Literal["none", "word", "character"], typing.Any] speech_to_text_convert_request_webhook_metadata.py000066400000000000000000000002541523660243400411210ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextConvertRequestWebhookMetadata = typing.Union[str, typing.Dict[str, typing.Any]] speech_to_text_convert_response.py000066400000000000000000000010051523660243400357040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.multichannel_speech_to_text_response_model import MultichannelSpeechToTextResponseModel from ...types.speech_to_text_chunk_response_model import SpeechToTextChunkResponseModel from ...types.speech_to_text_webhook_response_model import SpeechToTextWebhookResponseModel SpeechToTextConvertResponse = typing.Union[ SpeechToTextChunkResponseModel, MultichannelSpeechToTextResponseModel, SpeechToTextWebhookResponseModel ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/speech_to_text_custom.py000066400000000000000000000066641523660243400275360ustar00rootroot00000000000000import typing from elevenlabs.speech_to_text.client import SpeechToTextClient as AutogeneratedSpeechToTextClient from elevenlabs.speech_to_text.client import AsyncSpeechToTextClient as AutogeneratedAsyncSpeechToTextClient from elevenlabs.realtime import ScribeRealtime class SpeechToTextClient(AutogeneratedSpeechToTextClient): """ A client to handle ElevenLabs speech-to-text functionality. Extends the autogenerated client to include realtime transcription. """ def __init__(self, **kwargs: typing.Any) -> None: super().__init__(**kwargs) self._realtime: typing.Optional[ScribeRealtime] = None @property def realtime(self) -> ScribeRealtime: """ Access the realtime speech-to-text transcription API. Returns: ScribeRealtime instance for creating WebSocket connections Example: ```python from elevenlabs import ElevenLabs, RealtimeEvents, AudioFormat client = ElevenLabs(api_key="your-api-key") # URL-based streaming connection = await client.speech_to_text.realtime.connect({ "url": "https://stream.example.com/audio.mp3" }) connection.on(RealtimeEvents.PARTIAL_TRANSCRIPT, lambda data: print(data)) # Manual audio chunks connection = await client.speech_to_text.realtime.connect({ "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000 }) ``` """ if not self._realtime: # Extract API key from client wrapper api_key = self._client_wrapper.get_headers().get("xi-api-key", "") base_url = self._client_wrapper.get_base_url() self._realtime = ScribeRealtime(api_key=api_key, base_url=base_url) return self._realtime class AsyncSpeechToTextClient(AutogeneratedAsyncSpeechToTextClient): """ An async client to handle ElevenLabs speech-to-text functionality. Extends the autogenerated async client to include realtime transcription. """ def __init__(self, **kwargs: typing.Any) -> None: super().__init__(**kwargs) self._realtime: typing.Optional[ScribeRealtime] = None @property def realtime(self) -> ScribeRealtime: """ Access the realtime speech-to-text transcription API. Returns: ScribeRealtime instance for creating WebSocket connections Example: ```python from elevenlabs import AsyncElevenLabs, RealtimeEvents, AudioFormat client = AsyncElevenLabs(api_key="your-api-key") # URL-based streaming connection = await client.speech_to_text.realtime.connect({ "url": "https://stream.example.com/audio.mp3" }) connection.on(RealtimeEvents.PARTIAL_TRANSCRIPT, lambda data: print(data)) # Manual audio chunks connection = await client.speech_to_text.realtime.connect({ "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000 }) ``` """ if not self._realtime: # Extract API key from client wrapper api_key = self._client_wrapper.get_headers().get("xi-api-key", "") base_url = self._client_wrapper.get_base_url() self._realtime = ScribeRealtime(api_key=api_key, base_url=base_url) return self._realtime elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/000077500000000000000000000000001523660243400240505ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/__init__.py000066400000000000000000000064641523660243400261730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization, BodyCreatePodcastV1StudioPodcastsPostDurationScale, BodyCreatePodcastV1StudioPodcastsPostMode, BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin, BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, BodyCreatePodcastV1StudioPodcastsPostSource, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url, ) from . import projects from .projects import ( ProjectsCreateRequestApplyTextNormalization, ProjectsCreateRequestFiction, ProjectsCreateRequestSourceType, ProjectsCreateRequestTargetAudience, ) _dynamic_imports: typing.Dict[str, str] = { "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization": ".types", "BodyCreatePodcastV1StudioPodcastsPostDurationScale": ".types", "BodyCreatePodcastV1StudioPodcastsPostMode": ".types", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin": ".types", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation": ".types", "BodyCreatePodcastV1StudioPodcastsPostSource": ".types", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem": ".types", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text": ".types", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url": ".types", "ProjectsCreateRequestApplyTextNormalization": ".projects", "ProjectsCreateRequestFiction": ".projects", "ProjectsCreateRequestSourceType": ".projects", "ProjectsCreateRequestTargetAudience": ".projects", "projects": ".projects", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization", "BodyCreatePodcastV1StudioPodcastsPostDurationScale", "BodyCreatePodcastV1StudioPodcastsPostMode", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation", "BodyCreatePodcastV1StudioPodcastsPostSource", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url", "ProjectsCreateRequestApplyTextNormalization", "ProjectsCreateRequestFiction", "ProjectsCreateRequestSourceType", "ProjectsCreateRequestTargetAudience", "projects", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/client.py000066400000000000000000000454151523660243400257110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.podcast_project_response_model import PodcastProjectResponseModel from ..types.quality_preset_type import QualityPresetType from .raw_client import AsyncRawStudioClient, RawStudioClient from .types.body_create_podcast_v_1_studio_podcasts_post_apply_text_normalization import ( BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization, ) from .types.body_create_podcast_v_1_studio_podcasts_post_duration_scale import ( BodyCreatePodcastV1StudioPodcastsPostDurationScale, ) from .types.body_create_podcast_v_1_studio_podcasts_post_mode import BodyCreatePodcastV1StudioPodcastsPostMode from .types.body_create_podcast_v_1_studio_podcasts_post_source import BodyCreatePodcastV1StudioPodcastsPostSource if typing.TYPE_CHECKING: from .projects.client import AsyncProjectsClient, ProjectsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class StudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawStudioClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._projects: typing.Optional[ProjectsClient] = None @property def with_raw_response(self) -> RawStudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawStudioClient """ return self._raw_client def create_podcast( self, *, model_id: str, mode: BodyCreatePodcastV1StudioPodcastsPostMode, source: BodyCreatePodcastV1StudioPodcastsPostSource, safety_identifier: typing.Optional[str] = None, quality_preset: typing.Optional[QualityPresetType] = OMIT, duration_scale: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] = OMIT, language: typing.Optional[str] = OMIT, intro: typing.Optional[str] = OMIT, outro: typing.Optional[str] = OMIT, instructions_prompt: typing.Optional[str] = OMIT, highlights: typing.Optional[typing.Sequence[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, apply_text_normalization: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PodcastProjectResponseModel: """ Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs. Parameters ---------- model_id : str The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. mode : BodyCreatePodcastV1StudioPodcastsPostMode The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. source : BodyCreatePodcastV1StudioPodcastsPostSource The source content for the Podcast. safety_identifier : typing.Optional[str] Used for moderation. Your workspace must be allowlisted to use this feature. quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. duration_scale : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] Duration of the generated podcast. Must be one of: short - produces podcasts shorter than 3 minutes. default - produces podcasts roughly between 3-7 minutes. long - produces podcasts longer than 7 minutes. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). intro : typing.Optional[str] The intro text that will always be added to the beginning of the podcast. outro : typing.Optional[str] The outro text that will always be added to the end of the podcast. instructions_prompt : typing.Optional[str] Additional instructions prompt for the podcast generation used to adjust the podcast's style and tone. highlights : typing.Optional[typing.Sequence[str]] A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } apply_text_normalization : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PodcastProjectResponseModel Successful Response Examples -------- from elevenlabs import ( ElevenLabs, PodcastConversationModeData, PodcastTextSource, ) from elevenlabs.studio import ( BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.create_podcast( model_id="eleven_multilingual_v2", mode=BodyCreatePodcastV1StudioPodcastsPostMode_Conversation( conversation=PodcastConversationModeData( host_voice_id="aw1NgEzBg83R7vgmiJt6", guest_voice_id="aw1NgEzBg83R7vgmiJt7", ), ), source=PodcastTextSource( text="This is a test podcast.", ), ) """ _response = self._raw_client.create_podcast( model_id=model_id, mode=mode, source=source, safety_identifier=safety_identifier, quality_preset=quality_preset, duration_scale=duration_scale, language=language, intro=intro, outro=outro, instructions_prompt=instructions_prompt, highlights=highlights, callback_url=callback_url, apply_text_normalization=apply_text_normalization, request_options=request_options, ) return _response.data @property def projects(self): if self._projects is None: from .projects.client import ProjectsClient # noqa: E402 self._projects = ProjectsClient(client_wrapper=self._client_wrapper) return self._projects class AsyncStudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawStudioClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._projects: typing.Optional[AsyncProjectsClient] = None @property def with_raw_response(self) -> AsyncRawStudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawStudioClient """ return self._raw_client async def create_podcast( self, *, model_id: str, mode: BodyCreatePodcastV1StudioPodcastsPostMode, source: BodyCreatePodcastV1StudioPodcastsPostSource, safety_identifier: typing.Optional[str] = None, quality_preset: typing.Optional[QualityPresetType] = OMIT, duration_scale: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] = OMIT, language: typing.Optional[str] = OMIT, intro: typing.Optional[str] = OMIT, outro: typing.Optional[str] = OMIT, instructions_prompt: typing.Optional[str] = OMIT, highlights: typing.Optional[typing.Sequence[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, apply_text_normalization: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PodcastProjectResponseModel: """ Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs. Parameters ---------- model_id : str The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. mode : BodyCreatePodcastV1StudioPodcastsPostMode The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. source : BodyCreatePodcastV1StudioPodcastsPostSource The source content for the Podcast. safety_identifier : typing.Optional[str] Used for moderation. Your workspace must be allowlisted to use this feature. quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. duration_scale : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] Duration of the generated podcast. Must be one of: short - produces podcasts shorter than 3 minutes. default - produces podcasts roughly between 3-7 minutes. long - produces podcasts longer than 7 minutes. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). intro : typing.Optional[str] The intro text that will always be added to the beginning of the podcast. outro : typing.Optional[str] The outro text that will always be added to the end of the podcast. instructions_prompt : typing.Optional[str] Additional instructions prompt for the podcast generation used to adjust the podcast's style and tone. highlights : typing.Optional[typing.Sequence[str]] A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } apply_text_normalization : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PodcastProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import ( AsyncElevenLabs, PodcastConversationModeData, PodcastTextSource, ) from elevenlabs.studio import ( BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.create_podcast( model_id="eleven_multilingual_v2", mode=BodyCreatePodcastV1StudioPodcastsPostMode_Conversation( conversation=PodcastConversationModeData( host_voice_id="aw1NgEzBg83R7vgmiJt6", guest_voice_id="aw1NgEzBg83R7vgmiJt7", ), ), source=PodcastTextSource( text="This is a test podcast.", ), ) asyncio.run(main()) """ _response = await self._raw_client.create_podcast( model_id=model_id, mode=mode, source=source, safety_identifier=safety_identifier, quality_preset=quality_preset, duration_scale=duration_scale, language=language, intro=intro, outro=outro, instructions_prompt=instructions_prompt, highlights=highlights, callback_url=callback_url, apply_text_normalization=apply_text_normalization, request_options=request_options, ) return _response.data @property def projects(self): if self._projects is None: from .projects.client import AsyncProjectsClient # noqa: E402 self._projects = AsyncProjectsClient(client_wrapper=self._client_wrapper) return self._projects elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/000077500000000000000000000000001523660243400257015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/__init__.py000066400000000000000000000035271523660243400300210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( ProjectsCreateRequestApplyTextNormalization, ProjectsCreateRequestFiction, ProjectsCreateRequestSourceType, ProjectsCreateRequestTargetAudience, ) from . import chapters, content, pronunciation_dictionaries, snapshots _dynamic_imports: typing.Dict[str, str] = { "ProjectsCreateRequestApplyTextNormalization": ".types", "ProjectsCreateRequestFiction": ".types", "ProjectsCreateRequestSourceType": ".types", "ProjectsCreateRequestTargetAudience": ".types", "chapters": ".chapters", "content": ".content", "pronunciation_dictionaries": ".pronunciation_dictionaries", "snapshots": ".snapshots", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "ProjectsCreateRequestApplyTextNormalization", "ProjectsCreateRequestFiction", "ProjectsCreateRequestSourceType", "ProjectsCreateRequestTargetAudience", "chapters", "content", "pronunciation_dictionaries", "snapshots", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/000077500000000000000000000000001523660243400275125ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/__init__.py000066400000000000000000000020261523660243400316230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import snapshots _dynamic_imports: typing.Dict[str, str] = {"snapshots": ".snapshots"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["snapshots"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/client.py000066400000000000000000000455451523660243400313570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.add_chapter_response_model import AddChapterResponseModel from ....types.chapter_content_input_model import ChapterContentInputModel from ....types.chapter_with_content_response_model import ChapterWithContentResponseModel from ....types.convert_chapter_response_model import ConvertChapterResponseModel from ....types.delete_chapter_response_model import DeleteChapterResponseModel from ....types.edit_chapter_response_model import EditChapterResponseModel from ....types.get_chapters_response import GetChaptersResponse from .raw_client import AsyncRawChaptersClient, RawChaptersClient if typing.TYPE_CHECKING: from .snapshots.client import AsyncSnapshotsClient, SnapshotsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ChaptersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawChaptersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._snapshots: typing.Optional[SnapshotsClient] = None @property def with_raw_response(self) -> RawChaptersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawChaptersClient """ return self._raw_client def list(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetChaptersResponse: """ Returns a list of a Studio project's chapters. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetChaptersResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.list( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.list(project_id, request_options=request_options) return _response.data def create( self, project_id: str, *, name: str, from_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddChapterResponseModel: """ Creates a new chapter either as blank or from a URL. Parameters ---------- project_id : str The ID of the Studio project. name : str The name of the chapter, used for identification only. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddChapterResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.create( project_id="21m00Tcm4TlvDq8ikWAM", name="Chapter 1", ) """ _response = self._raw_client.create(project_id, name=name, from_url=from_url, request_options=request_options) return _response.data def get( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ChapterWithContentResponseModel: """ Returns information about a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterWithContentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get(project_id, chapter_id, request_options=request_options) return _response.data def update( self, project_id: str, chapter_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[ChapterContentInputModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditChapterResponseModel: """ Updates a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. name : typing.Optional[str] The name of the chapter, used for identification only. content : typing.Optional[ChapterContentInputModel] The chapter content to use. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditChapterResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.update( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( project_id, chapter_id, name=name, content=content, request_options=request_options ) return _response.data def delete( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteChapterResponseModel: """ Deletes a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteChapterResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.delete( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.delete(project_id, chapter_id, request_options=request_options) return _response.data def convert( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvertChapterResponseModel: """ Starts conversion of a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvertChapterResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.convert( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.convert(project_id, chapter_id, request_options=request_options) return _response.data @property def snapshots(self): if self._snapshots is None: from .snapshots.client import SnapshotsClient # noqa: E402 self._snapshots = SnapshotsClient(client_wrapper=self._client_wrapper) return self._snapshots class AsyncChaptersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawChaptersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._snapshots: typing.Optional[AsyncSnapshotsClient] = None @property def with_raw_response(self) -> AsyncRawChaptersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawChaptersClient """ return self._raw_client async def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetChaptersResponse: """ Returns a list of a Studio project's chapters. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetChaptersResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.list( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.list(project_id, request_options=request_options) return _response.data async def create( self, project_id: str, *, name: str, from_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddChapterResponseModel: """ Creates a new chapter either as blank or from a URL. Parameters ---------- project_id : str The ID of the Studio project. name : str The name of the chapter, used for identification only. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddChapterResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.create( project_id="21m00Tcm4TlvDq8ikWAM", name="Chapter 1", ) asyncio.run(main()) """ _response = await self._raw_client.create( project_id, name=name, from_url=from_url, request_options=request_options ) return _response.data async def get( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ChapterWithContentResponseModel: """ Returns information about a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterWithContentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, chapter_id, request_options=request_options) return _response.data async def update( self, project_id: str, chapter_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[ChapterContentInputModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditChapterResponseModel: """ Updates a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. name : typing.Optional[str] The name of the chapter, used for identification only. content : typing.Optional[ChapterContentInputModel] The chapter content to use. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditChapterResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.update( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( project_id, chapter_id, name=name, content=content, request_options=request_options ) return _response.data async def delete( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteChapterResponseModel: """ Deletes a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteChapterResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.delete( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.delete(project_id, chapter_id, request_options=request_options) return _response.data async def convert( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvertChapterResponseModel: """ Starts conversion of a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvertChapterResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.convert( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.convert(project_id, chapter_id, request_options=request_options) return _response.data @property def snapshots(self): if self._snapshots is None: from .snapshots.client import AsyncSnapshotsClient # noqa: E402 self._snapshots = AsyncSnapshotsClient(client_wrapper=self._client_wrapper) return self._snapshots elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/raw_client.py000066400000000000000000001005531523660243400322170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.add_chapter_response_model import AddChapterResponseModel from ....types.chapter_content_input_model import ChapterContentInputModel from ....types.chapter_with_content_response_model import ChapterWithContentResponseModel from ....types.convert_chapter_response_model import ConvertChapterResponseModel from ....types.delete_chapter_response_model import DeleteChapterResponseModel from ....types.edit_chapter_response_model import EditChapterResponseModel from ....types.get_chapters_response import GetChaptersResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawChaptersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetChaptersResponse]: """ Returns a list of a Studio project's chapters. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetChaptersResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetChaptersResponse, construct_type( type_=GetChaptersResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, project_id: str, *, name: str, from_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddChapterResponseModel]: """ Creates a new chapter either as blank or from a URL. Parameters ---------- project_id : str The ID of the Studio project. name : str The name of the chapter, used for identification only. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddChapterResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters", method="POST", json={ "name": name, "from_url": from_url, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddChapterResponseModel, construct_type( type_=AddChapterResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ChapterWithContentResponseModel]: """ Returns information about a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ChapterWithContentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterWithContentResponseModel, construct_type( type_=ChapterWithContentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, project_id: str, chapter_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[ChapterContentInputModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EditChapterResponseModel]: """ Updates a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. name : typing.Optional[str] The name of the chapter, used for identification only. content : typing.Optional[ChapterContentInputModel] The chapter content to use. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditChapterResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="POST", json={ "name": name, "content": convert_and_respect_annotation_metadata( object_=content, annotation=ChapterContentInputModel, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditChapterResponseModel, construct_type( type_=EditChapterResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteChapterResponseModel]: """ Deletes a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteChapterResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteChapterResponseModel, construct_type( type_=DeleteChapterResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def convert( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvertChapterResponseModel]: """ Starts conversion of a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvertChapterResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertChapterResponseModel, construct_type( type_=ConvertChapterResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawChaptersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetChaptersResponse]: """ Returns a list of a Studio project's chapters. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetChaptersResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetChaptersResponse, construct_type( type_=GetChaptersResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, project_id: str, *, name: str, from_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddChapterResponseModel]: """ Creates a new chapter either as blank or from a URL. Parameters ---------- project_id : str The ID of the Studio project. name : str The name of the chapter, used for identification only. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddChapterResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters", method="POST", json={ "name": name, "from_url": from_url, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddChapterResponseModel, construct_type( type_=AddChapterResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ChapterWithContentResponseModel]: """ Returns information about a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ChapterWithContentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterWithContentResponseModel, construct_type( type_=ChapterWithContentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, project_id: str, chapter_id: str, *, name: typing.Optional[str] = OMIT, content: typing.Optional[ChapterContentInputModel] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EditChapterResponseModel]: """ Updates a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. name : typing.Optional[str] The name of the chapter, used for identification only. content : typing.Optional[ChapterContentInputModel] The chapter content to use. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditChapterResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="POST", json={ "name": name, "content": convert_and_respect_annotation_metadata( object_=content, annotation=ChapterContentInputModel, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditChapterResponseModel, construct_type( type_=EditChapterResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteChapterResponseModel]: """ Deletes a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteChapterResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteChapterResponseModel, construct_type( type_=DeleteChapterResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def convert( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvertChapterResponseModel]: """ Starts conversion of a specific chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvertChapterResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertChapterResponseModel, construct_type( type_=ConvertChapterResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/snapshots/000077500000000000000000000000001523660243400315345ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/snapshots/__init__.py000066400000000000000000000001251523660243400336430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/snapshots/client.py000066400000000000000000000264731523660243400334000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.chapter_snapshot_extended_response_model import ChapterSnapshotExtendedResponseModel from .....types.chapter_snapshots_response import ChapterSnapshotsResponse from .raw_client import AsyncRawSnapshotsClient, RawSnapshotsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SnapshotsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSnapshotsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSnapshotsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSnapshotsClient """ return self._raw_client def list( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ChapterSnapshotsResponse: """ Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterSnapshotsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.list(project_id, chapter_id, request_options=request_options) return _response.data def get( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> ChapterSnapshotExtendedResponseModel: """ Returns the chapter snapshot. Parameters ---------- project_id : str The ID of the Studio project. chapter_id : str The ID of the chapter. chapter_snapshot_id : str The ID of the chapter snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterSnapshotExtendedResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get(project_id, chapter_id, chapter_snapshot_id, request_options=request_options) return _response.data def stream( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. chapter_snapshot_id : str The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[bytes] Streaming audio data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.chapters.snapshots.stream( project_id="project_id", chapter_id="chapter_id", chapter_snapshot_id="chapter_snapshot_id", ) """ with self._raw_client.stream( project_id, chapter_id, chapter_snapshot_id, convert_to_mpeg=convert_to_mpeg, request_options=request_options, ) as r: yield from r.data class AsyncSnapshotsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSnapshotsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSnapshotsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSnapshotsClient """ return self._raw_client async def list( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ChapterSnapshotsResponse: """ Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterSnapshotsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.list(project_id, chapter_id, request_options=request_options) return _response.data async def get( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> ChapterSnapshotExtendedResponseModel: """ Returns the chapter snapshot. Parameters ---------- project_id : str The ID of the Studio project. chapter_id : str The ID of the chapter. chapter_snapshot_id : str The ID of the chapter snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ChapterSnapshotExtendedResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", chapter_id="21m00Tcm4TlvDq8ikWAM", chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get( project_id, chapter_id, chapter_snapshot_id, request_options=request_options ) return _response.data async def stream( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. chapter_snapshot_id : str The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[bytes] Streaming audio data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.chapters.snapshots.stream( project_id="project_id", chapter_id="chapter_id", chapter_snapshot_id="chapter_snapshot_id", ) asyncio.run(main()) """ async with self._raw_client.stream( project_id, chapter_id, chapter_snapshot_id, convert_to_mpeg=convert_to_mpeg, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/chapters/snapshots/raw_client.py000066400000000000000000000456061523660243400342500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.chapter_snapshot_extended_response_model import ChapterSnapshotExtendedResponseModel from .....types.chapter_snapshots_response import ChapterSnapshotsResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSnapshotsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ChapterSnapshotsResponse]: """ Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ChapterSnapshotsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterSnapshotsResponse, construct_type( type_=ChapterSnapshotsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ChapterSnapshotExtendedResponseModel]: """ Returns the chapter snapshot. Parameters ---------- project_id : str The ID of the Studio project. chapter_id : str The ID of the chapter. chapter_snapshot_id : str The ID of the chapter snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ChapterSnapshotExtendedResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots/{jsonable_encoder(chapter_snapshot_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterSnapshotExtendedResponseModel, construct_type( type_=ChapterSnapshotExtendedResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def stream( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. chapter_snapshot_id : str The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data """ with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots/{jsonable_encoder(chapter_snapshot_id)}/stream", method="POST", json={ "convert_to_mpeg": convert_to_mpeg, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawSnapshotsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, project_id: str, chapter_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ChapterSnapshotsResponse]: """ Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ChapterSnapshotsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterSnapshotsResponse, construct_type( type_=ChapterSnapshotsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ChapterSnapshotExtendedResponseModel]: """ Returns the chapter snapshot. Parameters ---------- project_id : str The ID of the Studio project. chapter_id : str The ID of the chapter. chapter_snapshot_id : str The ID of the chapter snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ChapterSnapshotExtendedResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots/{jsonable_encoder(chapter_snapshot_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ChapterSnapshotExtendedResponseModel, construct_type( type_=ChapterSnapshotExtendedResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def stream( self, project_id: str, chapter_id: str, chapter_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. chapter_id : str The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. chapter_snapshot_id : str The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data """ async with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/chapters/{jsonable_encoder(chapter_id)}/snapshots/{jsonable_encoder(chapter_snapshot_id)}/stream", method="POST", json={ "convert_to_mpeg": convert_to_mpeg, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/client.py000066400000000000000000001401601523660243400275330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ... import core from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.add_project_response_model import AddProjectResponseModel from ...types.convert_project_response_model import ConvertProjectResponseModel from ...types.delete_project_response_model import DeleteProjectResponseModel from ...types.edit_project_response_model import EditProjectResponseModel from ...types.get_projects_response import GetProjectsResponse from ...types.project_extended_response import ProjectExtendedResponse from ...types.project_muted_tracks_response_model import ProjectMutedTracksResponseModel from ...types.quality_preset_type import QualityPresetType from .raw_client import AsyncRawProjectsClient, RawProjectsClient from .types.projects_create_request_apply_text_normalization import ProjectsCreateRequestApplyTextNormalization from .types.projects_create_request_fiction import ProjectsCreateRequestFiction from .types.projects_create_request_source_type import ProjectsCreateRequestSourceType from .types.projects_create_request_target_audience import ProjectsCreateRequestTargetAudience if typing.TYPE_CHECKING: from .chapters.client import AsyncChaptersClient, ChaptersClient from .content.client import AsyncContentClient, ContentClient from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient, PronunciationDictionariesClient from .snapshots.client import AsyncSnapshotsClient, SnapshotsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ProjectsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawProjectsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._pronunciation_dictionaries: typing.Optional[PronunciationDictionariesClient] = None self._content: typing.Optional[ContentClient] = None self._snapshots: typing.Optional[SnapshotsClient] = None self._chapters: typing.Optional[ChaptersClient] = None @property def with_raw_response(self) -> RawProjectsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawProjectsClient """ return self._raw_client def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetProjectsResponse: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetProjectsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddProjectResponseModel: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.create( name="name", ) """ _response = self._raw_client.create( name=name, default_title_voice_id=default_title_voice_id, default_paragraph_voice_id=default_paragraph_voice_id, default_model_id=default_model_id, from_url=from_url, from_document=from_document, from_content_json=from_content_json, quality_preset=quality_preset, title=title, author=author, description=description, genres=genres, target_audience=target_audience, language=language, content_type=content_type, original_publication_date=original_publication_date, mature_content=mature_content, isbn_number=isbn_number, acx_volume_normalization=acx_volume_normalization, volume_normalization=volume_normalization, pronunciation_dictionary_locators=pronunciation_dictionary_locators, callback_url=callback_url, fiction=fiction, apply_text_normalization=apply_text_normalization, auto_convert=auto_convert, auto_assign_voices=auto_assign_voices, source_type=source_type, voice_settings=voice_settings, create_publishing_read=create_publishing_read, request_options=request_options, ) return _response.data def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ProjectExtendedResponse: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectExtendedResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.get( project_id="21m00Tcm4TlvDq8ikWAM", share_id="share_id", ) """ _response = self._raw_client.get(project_id, share_id=share_id, request_options=request_options) return _response.data def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.update( project_id="21m00Tcm4TlvDq8ikWAM", name="Project 1", default_title_voice_id="21m00Tcm4TlvDq8ikWAM", default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( project_id, name=name, default_title_voice_id=default_title_voice_id, default_paragraph_voice_id=default_paragraph_voice_id, title=title, author=author, isbn_number=isbn_number, volume_normalization=volume_normalization, request_options=request_options, ) return _response.data def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteProjectResponseModel: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.delete( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.delete(project_id, request_options=request_options) return _response.data def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvertProjectResponseModel: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvertProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.convert( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.convert(project_id, request_options=request_options) return _response.data def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectMutedTracksResponseModel: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectMutedTracksResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.get_muted_tracks( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get_muted_tracks(project_id, request_options=request_options) return _response.data @property def pronunciation_dictionaries(self): if self._pronunciation_dictionaries is None: from .pronunciation_dictionaries.client import PronunciationDictionariesClient # noqa: E402 self._pronunciation_dictionaries = PronunciationDictionariesClient(client_wrapper=self._client_wrapper) return self._pronunciation_dictionaries @property def content(self): if self._content is None: from .content.client import ContentClient # noqa: E402 self._content = ContentClient(client_wrapper=self._client_wrapper) return self._content @property def snapshots(self): if self._snapshots is None: from .snapshots.client import SnapshotsClient # noqa: E402 self._snapshots = SnapshotsClient(client_wrapper=self._client_wrapper) return self._snapshots @property def chapters(self): if self._chapters is None: from .chapters.client import ChaptersClient # noqa: E402 self._chapters = ChaptersClient(client_wrapper=self._client_wrapper) return self._chapters class AsyncProjectsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawProjectsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._pronunciation_dictionaries: typing.Optional[AsyncPronunciationDictionariesClient] = None self._content: typing.Optional[AsyncContentClient] = None self._snapshots: typing.Optional[AsyncSnapshotsClient] = None self._chapters: typing.Optional[AsyncChaptersClient] = None @property def with_raw_response(self) -> AsyncRawProjectsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawProjectsClient """ return self._raw_client async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetProjectsResponse: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetProjectsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddProjectResponseModel: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.create( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, default_title_voice_id=default_title_voice_id, default_paragraph_voice_id=default_paragraph_voice_id, default_model_id=default_model_id, from_url=from_url, from_document=from_document, from_content_json=from_content_json, quality_preset=quality_preset, title=title, author=author, description=description, genres=genres, target_audience=target_audience, language=language, content_type=content_type, original_publication_date=original_publication_date, mature_content=mature_content, isbn_number=isbn_number, acx_volume_normalization=acx_volume_normalization, volume_normalization=volume_normalization, pronunciation_dictionary_locators=pronunciation_dictionary_locators, callback_url=callback_url, fiction=fiction, apply_text_normalization=apply_text_normalization, auto_convert=auto_convert, auto_assign_voices=auto_assign_voices, source_type=source_type, voice_settings=voice_settings, create_publishing_read=create_publishing_read, request_options=request_options, ) return _response.data async def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ProjectExtendedResponse: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectExtendedResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.get( project_id="21m00Tcm4TlvDq8ikWAM", share_id="share_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, share_id=share_id, request_options=request_options) return _response.data async def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.update( project_id="21m00Tcm4TlvDq8ikWAM", name="Project 1", default_title_voice_id="21m00Tcm4TlvDq8ikWAM", default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( project_id, name=name, default_title_voice_id=default_title_voice_id, default_paragraph_voice_id=default_paragraph_voice_id, title=title, author=author, isbn_number=isbn_number, volume_normalization=volume_normalization, request_options=request_options, ) return _response.data async def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteProjectResponseModel: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.delete( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.delete(project_id, request_options=request_options) return _response.data async def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ConvertProjectResponseModel: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ConvertProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.convert( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.convert(project_id, request_options=request_options) return _response.data async def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectMutedTracksResponseModel: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectMutedTracksResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.get_muted_tracks( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get_muted_tracks(project_id, request_options=request_options) return _response.data @property def pronunciation_dictionaries(self): if self._pronunciation_dictionaries is None: from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient # noqa: E402 self._pronunciation_dictionaries = AsyncPronunciationDictionariesClient(client_wrapper=self._client_wrapper) return self._pronunciation_dictionaries @property def content(self): if self._content is None: from .content.client import AsyncContentClient # noqa: E402 self._content = AsyncContentClient(client_wrapper=self._client_wrapper) return self._content @property def snapshots(self): if self._snapshots is None: from .snapshots.client import AsyncSnapshotsClient # noqa: E402 self._snapshots = AsyncSnapshotsClient(client_wrapper=self._client_wrapper) return self._snapshots @property def chapters(self): if self._chapters is None: from .chapters.client import AsyncChaptersClient # noqa: E402 self._chapters = AsyncChaptersClient(client_wrapper=self._client_wrapper) return self._chapters elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/content/000077500000000000000000000000001523660243400273535ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/content/__init__.py000066400000000000000000000001251523660243400314620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/content/client.py000066400000000000000000000167171523660243400312170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.edit_project_response_model import EditProjectResponseModel from .raw_client import AsyncRawContentClient, RawContentClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ContentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawContentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawContentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawContentClient """ return self._raw_client def update( self, project_id: str, *, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: """ Updates Studio project content. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditProjectResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.content.update( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.update( project_id, from_url=from_url, from_document=from_document, from_content_json=from_content_json, auto_convert=auto_convert, request_options=request_options, ) return _response.data class AsyncContentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawContentClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawContentClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawContentClient """ return self._raw_client async def update( self, project_id: str, *, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditProjectResponseModel: """ Updates Studio project content. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditProjectResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.content.update( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.update( project_id, from_url=from_url, from_document=from_document, from_content_json=from_content_json, auto_convert=auto_convert, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/content/raw_client.py000066400000000000000000000235351523660243400320640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.edit_project_response_model import EditProjectResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawContentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def update( self, project_id: str, *, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EditProjectResponseModel]: """ Updates Studio project content. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/content", method="POST", data={ "from_url": from_url, "from_content_json": from_content_json, "auto_convert": auto_convert, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawContentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def update( self, project_id: str, *, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, auto_convert: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EditProjectResponseModel]: """ Updates Studio project content. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/content", method="POST", data={ "from_url": from_url, "from_content_json": from_content_json, "auto_convert": auto_convert, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/pronunciation_dictionaries/000077500000000000000000000000001523660243400333265ustar00rootroot00000000000000__init__.py000066400000000000000000000001251523660243400353560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/pronunciation_dictionaries# This file was auto-generated by Fern from our API Definition. # isort: skip_file client.py000066400000000000000000000165031523660243400351040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/pronunciation_dictionaries# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.create_pronunciation_dictionary_response_model import CreatePronunciationDictionaryResponseModel from ....types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from .raw_client import AsyncRawPronunciationDictionariesClient, RawPronunciationDictionariesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class PronunciationDictionariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPronunciationDictionariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawPronunciationDictionariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPronunciationDictionariesClient """ return self._raw_client def create( self, project_id: str, *, pronunciation_dictionary_locators: typing.Sequence[PronunciationDictionaryVersionLocator], invalidate_affected_text: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreatePronunciationDictionaryResponseModel: """ Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. invalidate_affected_text : typing.Optional[bool] This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreatePronunciationDictionaryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs, PronunciationDictionaryVersionLocator client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.pronunciation_dictionaries.create( project_id="21m00Tcm4TlvDq8ikWAM", pronunciation_dictionary_locators=[ PronunciationDictionaryVersionLocator( pronunciation_dictionary_id="pronunciation_dictionary_id", ) ], ) """ _response = self._raw_client.create( project_id, pronunciation_dictionary_locators=pronunciation_dictionary_locators, invalidate_affected_text=invalidate_affected_text, request_options=request_options, ) return _response.data class AsyncPronunciationDictionariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPronunciationDictionariesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawPronunciationDictionariesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPronunciationDictionariesClient """ return self._raw_client async def create( self, project_id: str, *, pronunciation_dictionary_locators: typing.Sequence[PronunciationDictionaryVersionLocator], invalidate_affected_text: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreatePronunciationDictionaryResponseModel: """ Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. invalidate_affected_text : typing.Optional[bool] This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- CreatePronunciationDictionaryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, PronunciationDictionaryVersionLocator client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.pronunciation_dictionaries.create( project_id="21m00Tcm4TlvDq8ikWAM", pronunciation_dictionary_locators=[ PronunciationDictionaryVersionLocator( pronunciation_dictionary_id="pronunciation_dictionary_id", ) ], ) asyncio.run(main()) """ _response = await self._raw_client.create( project_id, pronunciation_dictionary_locators=pronunciation_dictionary_locators, invalidate_affected_text=invalidate_affected_text, request_options=request_options, ) return _response.data raw_client.py000066400000000000000000000230461523660243400357550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/pronunciation_dictionaries# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.create_pronunciation_dictionary_response_model import CreatePronunciationDictionaryResponseModel from ....types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawPronunciationDictionariesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, project_id: str, *, pronunciation_dictionary_locators: typing.Sequence[PronunciationDictionaryVersionLocator], invalidate_affected_text: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreatePronunciationDictionaryResponseModel]: """ Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. invalidate_affected_text : typing.Optional[bool] This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[CreatePronunciationDictionaryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/pronunciation-dictionaries", method="POST", json={ "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "invalidate_affected_text": invalidate_affected_text, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreatePronunciationDictionaryResponseModel, construct_type( type_=CreatePronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawPronunciationDictionariesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, project_id: str, *, pronunciation_dictionary_locators: typing.Sequence[PronunciationDictionaryVersionLocator], invalidate_affected_text: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreatePronunciationDictionaryResponseModel]: """ Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. pronunciation_dictionary_locators : typing.Sequence[PronunciationDictionaryVersionLocator] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. invalidate_affected_text : typing.Optional[bool] This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[CreatePronunciationDictionaryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/pronunciation-dictionaries", method="POST", json={ "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "invalidate_affected_text": invalidate_affected_text, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( CreatePronunciationDictionaryResponseModel, construct_type( type_=CreatePronunciationDictionaryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/raw_client.py000066400000000000000000001730471523660243400304160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.add_project_response_model import AddProjectResponseModel from ...types.convert_project_response_model import ConvertProjectResponseModel from ...types.delete_project_response_model import DeleteProjectResponseModel from ...types.edit_project_response_model import EditProjectResponseModel from ...types.get_projects_response import GetProjectsResponse from ...types.project_extended_response import ProjectExtendedResponse from ...types.project_muted_tracks_response_model import ProjectMutedTracksResponseModel from ...types.quality_preset_type import QualityPresetType from .types.projects_create_request_apply_text_normalization import ProjectsCreateRequestApplyTextNormalization from .types.projects_create_request_fiction import ProjectsCreateRequestFiction from .types.projects_create_request_source_type import ProjectsCreateRequestSourceType from .types.projects_create_request_target_audience import ProjectsCreateRequestTargetAudience from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawProjectsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[GetProjectsResponse]: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetProjectsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/studio/projects", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetProjectsResponse, construct_type( type_=GetProjectsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddProjectResponseModel]: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/studio/projects", method="POST", data={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, "from_content_json": from_content_json, "quality_preset": quality_preset, "title": title, "author": author, "description": description, "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, "original_publication_date": original_publication_date, "mature_content": mature_content, "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddProjectResponseModel, construct_type( type_=AddProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ProjectExtendedResponse]: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectExtendedResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="GET", params={ "share_id": share_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectExtendedResponse, construct_type( type_=ProjectExtendedResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EditProjectResponseModel]: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="POST", json={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "title": title, "author": author, "isbn_number": isbn_number, "volume_normalization": volume_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteProjectResponseModel]: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteProjectResponseModel, construct_type( type_=DeleteProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ConvertProjectResponseModel]: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ConvertProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertProjectResponseModel, construct_type( type_=ConvertProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ProjectMutedTracksResponseModel]: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectMutedTracksResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/muted-tracks", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectMutedTracksResponseModel, construct_type( type_=ProjectMutedTracksResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawProjectsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetProjectsResponse]: """ Returns a list of your Studio projects with metadata. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetProjectsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/studio/projects", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetProjectsResponse, construct_type( type_=GetProjectsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, name: str, default_title_voice_id: typing.Optional[str] = OMIT, default_paragraph_voice_id: typing.Optional[str] = OMIT, default_model_id: typing.Optional[str] = OMIT, from_url: typing.Optional[str] = OMIT, from_document: typing.Optional[core.File] = OMIT, from_content_json: typing.Optional[str] = OMIT, quality_preset: typing.Optional[QualityPresetType] = OMIT, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, description: typing.Optional[str] = OMIT, genres: typing.Optional[typing.List[str]] = OMIT, target_audience: typing.Optional[ProjectsCreateRequestTargetAudience] = OMIT, language: typing.Optional[str] = OMIT, content_type: typing.Optional[str] = OMIT, original_publication_date: typing.Optional[str] = OMIT, mature_content: typing.Optional[bool] = OMIT, isbn_number: typing.Optional[str] = OMIT, acx_volume_normalization: typing.Optional[bool] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, fiction: typing.Optional[ProjectsCreateRequestFiction] = OMIT, apply_text_normalization: typing.Optional[ProjectsCreateRequestApplyTextNormalization] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_assign_voices: typing.Optional[bool] = OMIT, source_type: typing.Optional[ProjectsCreateRequestSourceType] = OMIT, voice_settings: typing.Optional[typing.List[str]] = OMIT, create_publishing_read: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddProjectResponseModel]: """ Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. Parameters ---------- name : str The name of the Studio project, used for identification only. default_title_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : typing.Optional[str] The voice_id that corresponds to the default voice used for new paragraphs. default_model_id : typing.Optional[str] The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. from_url : typing.Optional[str] An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. from_document : typing.Optional[core.File] See core.File for more documentation from_content_json : typing.Optional[str] An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. description : typing.Optional[str] An optional description of the Studio project. genres : typing.Optional[typing.List[str]] An optional list of genres associated with the Studio project. target_audience : typing.Optional[ProjectsCreateRequestTargetAudience] An optional target audience of the Studio project. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). content_type : typing.Optional[str] An optional content type of the Studio project. original_publication_date : typing.Optional[str] An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. mature_content : typing.Optional[bool] An optional specification of whether this Studio project contains mature content. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. acx_volume_normalization : typing.Optional[bool] [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements pronunciation_dictionary_locators : typing.Optional[typing.List[str]] A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } fiction : typing.Optional[ProjectsCreateRequestFiction] An optional specification of whether the content of this Studio project is fiction. apply_text_normalization : typing.Optional[ProjectsCreateRequestApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. auto_convert : typing.Optional[bool] Whether to auto convert the Studio project to audio or not. auto_assign_voices : typing.Optional[bool] [Alpha Feature] Whether automatically assign voices to phrases in the create Project. source_type : typing.Optional[ProjectsCreateRequestSourceType] The type of Studio project to create. voice_settings : typing.Optional[typing.List[str]] Optional voice settings overrides for the project, encoded as a list of JSON strings. Example: ["{\\"voice_id\\": \\"21m00Tcm4TlvDq8ikWAM\\", \\"stability\\": 0.7, \\"similarity_boost\\": 0.8, \\"style\\": 0.5, \\"speed\\": 1.0, \\"use_speaker_boost\\": true}"] create_publishing_read : typing.Optional[bool] If true, creates a corresponding read for direct publishing in draft state request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/studio/projects", method="POST", data={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "default_model_id": default_model_id, "from_url": from_url, "from_content_json": from_content_json, "quality_preset": quality_preset, "title": title, "author": author, "description": description, "genres": genres, "target_audience": target_audience, "language": language, "content_type": content_type, "original_publication_date": original_publication_date, "mature_content": mature_content, "isbn_number": isbn_number, "acx_volume_normalization": acx_volume_normalization, "volume_normalization": volume_normalization, "pronunciation_dictionary_locators": pronunciation_dictionary_locators, "callback_url": callback_url, "fiction": fiction, "apply_text_normalization": apply_text_normalization, "auto_convert": auto_convert, "auto_assign_voices": auto_assign_voices, "source_type": source_type, "voice_settings": voice_settings, "create_publishing_read": create_publishing_read, }, files={ **({"from_document": from_document} if from_document is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddProjectResponseModel, construct_type( type_=AddProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, *, share_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ProjectExtendedResponse]: """ Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. share_id : typing.Optional[str] The share ID of the project request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectExtendedResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="GET", params={ "share_id": share_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectExtendedResponse, construct_type( type_=ProjectExtendedResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, project_id: str, *, name: str, default_title_voice_id: str, default_paragraph_voice_id: str, title: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, isbn_number: typing.Optional[str] = OMIT, volume_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EditProjectResponseModel]: """ Updates the specified Studio project by setting the values of the parameters passed. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. name : str The name of the Studio project, used for identification only. default_title_voice_id : str The voice_id that corresponds to the default voice used for new titles. default_paragraph_voice_id : str The voice_id that corresponds to the default voice used for new paragraphs. title : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. author : typing.Optional[str] An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. isbn_number : typing.Optional[str] An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. volume_normalization : typing.Optional[bool] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="POST", json={ "name": name, "default_title_voice_id": default_title_voice_id, "default_paragraph_voice_id": default_paragraph_voice_id, "title": title, "author": author, "isbn_number": isbn_number, "volume_normalization": volume_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditProjectResponseModel, construct_type( type_=EditProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteProjectResponseModel]: """ Deletes a Studio project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteProjectResponseModel, construct_type( type_=DeleteProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def convert( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ConvertProjectResponseModel]: """ Starts conversion of a Studio project and all of its chapters. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ConvertProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/convert", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ConvertProjectResponseModel, construct_type( type_=ConvertProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_muted_tracks( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ProjectMutedTracksResponseModel]: """ Returns a list of chapter IDs that have muted tracks in a project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectMutedTracksResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/muted-tracks", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectMutedTracksResponseModel, construct_type( type_=ProjectMutedTracksResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/snapshots/000077500000000000000000000000001523660243400277235ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/snapshots/__init__.py000066400000000000000000000001251523660243400320320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/snapshots/client.py000066400000000000000000000271301523660243400315560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.project_snapshot_extended_response_model import ProjectSnapshotExtendedResponseModel from ....types.project_snapshots_response import ProjectSnapshotsResponse from .raw_client import AsyncRawSnapshotsClient, RawSnapshotsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SnapshotsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSnapshotsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSnapshotsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSnapshotsClient """ return self._raw_client def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectSnapshotsResponse: """ Retrieves a list of snapshots for a Studio project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectSnapshotsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.list(project_id, request_options=request_options) return _response.data def get( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectSnapshotExtendedResponseModel: """ Returns the project snapshot. Parameters ---------- project_id : str The ID of the Studio project. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectSnapshotExtendedResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", project_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get(project_id, project_snapshot_id, request_options=request_options) return _response.data def stream( self, project_id: str, project_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Stream the audio from a Studio project snapshot. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[bytes] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.snapshots.stream( project_id="project_id", project_snapshot_id="project_snapshot_id", ) """ with self._raw_client.stream( project_id, project_snapshot_id, convert_to_mpeg=convert_to_mpeg, request_options=request_options ) as r: yield from r.data def stream_archive( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Returns a compressed archive of the Studio project's audio. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[bytes] Streaming archive data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.studio.projects.snapshots.stream_archive( project_id="project_id", project_snapshot_id="project_snapshot_id", ) """ with self._raw_client.stream_archive(project_id, project_snapshot_id, request_options=request_options) as r: yield from r.data class AsyncSnapshotsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSnapshotsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSnapshotsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSnapshotsClient """ return self._raw_client async def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectSnapshotsResponse: """ Retrieves a list of snapshots for a Studio project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectSnapshotsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.snapshots.list( project_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.list(project_id, request_options=request_options) return _response.data async def get( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> ProjectSnapshotExtendedResponseModel: """ Returns the project snapshot. Parameters ---------- project_id : str The ID of the Studio project. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ProjectSnapshotExtendedResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.snapshots.get( project_id="21m00Tcm4TlvDq8ikWAM", project_snapshot_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get(project_id, project_snapshot_id, request_options=request_options) return _response.data async def stream( self, project_id: str, project_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Stream the audio from a Studio project snapshot. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[bytes] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.snapshots.stream( project_id="project_id", project_snapshot_id="project_snapshot_id", ) asyncio.run(main()) """ async with self._raw_client.stream( project_id, project_snapshot_id, convert_to_mpeg=convert_to_mpeg, request_options=request_options ) as r: async for _chunk in r.data: yield _chunk async def stream_archive( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Returns a compressed archive of the Studio project's audio. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[bytes] Streaming archive data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.studio.projects.snapshots.stream_archive( project_id="project_id", project_snapshot_id="project_snapshot_id", ) asyncio.run(main()) """ async with self._raw_client.stream_archive( project_id, project_snapshot_id, request_options=request_options ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/snapshots/raw_client.py000066400000000000000000000551071523660243400324340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.project_snapshot_extended_response_model import ProjectSnapshotExtendedResponseModel from ....types.project_snapshots_response import ProjectSnapshotsResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSnapshotsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ProjectSnapshotsResponse]: """ Retrieves a list of snapshots for a Studio project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectSnapshotsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectSnapshotsResponse, construct_type( type_=ProjectSnapshotsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ProjectSnapshotExtendedResponseModel]: """ Returns the project snapshot. Parameters ---------- project_id : str The ID of the Studio project. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ProjectSnapshotExtendedResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectSnapshotExtendedResponseModel, construct_type( type_=ProjectSnapshotExtendedResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def stream( self, project_id: str, project_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream the audio from a Studio project snapshot. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Successful Response """ with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}/stream", method="POST", json={ "convert_to_mpeg": convert_to_mpeg, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream_archive( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Returns a compressed archive of the Studio project's audio. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming archive data """ with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}/archive", method="POST", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawSnapshotsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ProjectSnapshotsResponse]: """ Retrieves a list of snapshots for a Studio project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectSnapshotsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectSnapshotsResponse, construct_type( type_=ProjectSnapshotsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ProjectSnapshotExtendedResponseModel]: """ Returns the project snapshot. Parameters ---------- project_id : str The ID of the Studio project. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ProjectSnapshotExtendedResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ProjectSnapshotExtendedResponseModel, construct_type( type_=ProjectSnapshotExtendedResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def stream( self, project_id: str, project_snapshot_id: str, *, convert_to_mpeg: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream the audio from a Studio project snapshot. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. convert_to_mpeg : typing.Optional[bool] Whether to convert the audio to mpeg format. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Successful Response """ async with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}/stream", method="POST", json={ "convert_to_mpeg": convert_to_mpeg, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream_archive( self, project_id: str, project_snapshot_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Returns a compressed archive of the Studio project's audio. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. project_snapshot_id : str The ID of the Studio project snapshot. request_options : typing.Optional[RequestOptions] Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming archive data """ async with self._client_wrapper.httpx_client.stream( f"v1/studio/projects/{jsonable_encoder(project_id)}/snapshots/{jsonable_encoder(project_snapshot_id)}/archive", method="POST", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types/000077500000000000000000000000001523660243400270455ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types/__init__.py000066400000000000000000000035051523660243400311610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .projects_create_request_apply_text_normalization import ProjectsCreateRequestApplyTextNormalization from .projects_create_request_fiction import ProjectsCreateRequestFiction from .projects_create_request_source_type import ProjectsCreateRequestSourceType from .projects_create_request_target_audience import ProjectsCreateRequestTargetAudience _dynamic_imports: typing.Dict[str, str] = { "ProjectsCreateRequestApplyTextNormalization": ".projects_create_request_apply_text_normalization", "ProjectsCreateRequestFiction": ".projects_create_request_fiction", "ProjectsCreateRequestSourceType": ".projects_create_request_source_type", "ProjectsCreateRequestTargetAudience": ".projects_create_request_target_audience", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "ProjectsCreateRequestApplyTextNormalization", "ProjectsCreateRequestFiction", "ProjectsCreateRequestSourceType", "ProjectsCreateRequestTargetAudience", ] projects_create_request_apply_text_normalization.py000066400000000000000000000003231523660243400415010ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types# This file was auto-generated by Fern from our API Definition. import typing ProjectsCreateRequestApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off", "apply_english"], typing.Any ] projects_create_request_fiction.py000066400000000000000000000002621523660243400357770ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types# This file was auto-generated by Fern from our API Definition. import typing ProjectsCreateRequestFiction = typing.Union[typing.Literal["fiction", "non-fiction"], typing.Any] projects_create_request_source_type.py000066400000000000000000000003351523660243400367060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types# This file was auto-generated by Fern from our API Definition. import typing ProjectsCreateRequestSourceType = typing.Union[ typing.Literal["blank", "book", "article", "genfm", "video", "screenplay"], typing.Any ] projects_create_request_target_audience.py000066400000000000000000000003251523660243400374670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/projects/types# This file was auto-generated by Fern from our API Definition. import typing ProjectsCreateRequestTargetAudience = typing.Union[ typing.Literal["children", "young adult", "adult", "all ages"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/raw_client.py000066400000000000000000000476221523660243400265640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.podcast_project_response_model import PodcastProjectResponseModel from ..types.quality_preset_type import QualityPresetType from .types.body_create_podcast_v_1_studio_podcasts_post_apply_text_normalization import ( BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization, ) from .types.body_create_podcast_v_1_studio_podcasts_post_duration_scale import ( BodyCreatePodcastV1StudioPodcastsPostDurationScale, ) from .types.body_create_podcast_v_1_studio_podcasts_post_mode import BodyCreatePodcastV1StudioPodcastsPostMode from .types.body_create_podcast_v_1_studio_podcasts_post_source import BodyCreatePodcastV1StudioPodcastsPostSource from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawStudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create_podcast( self, *, model_id: str, mode: BodyCreatePodcastV1StudioPodcastsPostMode, source: BodyCreatePodcastV1StudioPodcastsPostSource, safety_identifier: typing.Optional[str] = None, quality_preset: typing.Optional[QualityPresetType] = OMIT, duration_scale: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] = OMIT, language: typing.Optional[str] = OMIT, intro: typing.Optional[str] = OMIT, outro: typing.Optional[str] = OMIT, instructions_prompt: typing.Optional[str] = OMIT, highlights: typing.Optional[typing.Sequence[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, apply_text_normalization: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PodcastProjectResponseModel]: """ Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs. Parameters ---------- model_id : str The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. mode : BodyCreatePodcastV1StudioPodcastsPostMode The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. source : BodyCreatePodcastV1StudioPodcastsPostSource The source content for the Podcast. safety_identifier : typing.Optional[str] Used for moderation. Your workspace must be allowlisted to use this feature. quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. duration_scale : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] Duration of the generated podcast. Must be one of: short - produces podcasts shorter than 3 minutes. default - produces podcasts roughly between 3-7 minutes. long - produces podcasts longer than 7 minutes. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). intro : typing.Optional[str] The intro text that will always be added to the beginning of the podcast. outro : typing.Optional[str] The outro text that will always be added to the end of the podcast. instructions_prompt : typing.Optional[str] Additional instructions prompt for the podcast generation used to adjust the podcast's style and tone. highlights : typing.Optional[typing.Sequence[str]] A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } apply_text_normalization : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PodcastProjectResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/studio/podcasts", method="POST", json={ "model_id": model_id, "mode": convert_and_respect_annotation_metadata( object_=mode, annotation=BodyCreatePodcastV1StudioPodcastsPostMode, direction="write" ), "source": convert_and_respect_annotation_metadata( object_=source, annotation=BodyCreatePodcastV1StudioPodcastsPostSource, direction="write" ), "quality_preset": quality_preset, "duration_scale": duration_scale, "language": language, "intro": intro, "outro": outro, "instructions_prompt": instructions_prompt, "highlights": highlights, "callback_url": callback_url, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", "safety-identifier": str(safety_identifier) if safety_identifier is not None else None, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PodcastProjectResponseModel, construct_type( type_=PodcastProjectResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawStudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create_podcast( self, *, model_id: str, mode: BodyCreatePodcastV1StudioPodcastsPostMode, source: BodyCreatePodcastV1StudioPodcastsPostSource, safety_identifier: typing.Optional[str] = None, quality_preset: typing.Optional[QualityPresetType] = OMIT, duration_scale: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] = OMIT, language: typing.Optional[str] = OMIT, intro: typing.Optional[str] = OMIT, outro: typing.Optional[str] = OMIT, instructions_prompt: typing.Optional[str] = OMIT, highlights: typing.Optional[typing.Sequence[str]] = OMIT, callback_url: typing.Optional[str] = OMIT, apply_text_normalization: typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PodcastProjectResponseModel]: """ Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs. Parameters ---------- model_id : str The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. mode : BodyCreatePodcastV1StudioPodcastsPostMode The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. source : BodyCreatePodcastV1StudioPodcastsPostSource The source content for the Podcast. safety_identifier : typing.Optional[str] Used for moderation. Your workspace must be allowlisted to use this feature. quality_preset : typing.Optional[QualityPresetType] Output quality of the generated audio. Must be one of: 'standard' - standard output format, 128kbps with 44.1kHz sample rate. 'high' - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. 'ultra' - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. 'ultra_lossless' - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. duration_scale : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale] Duration of the generated podcast. Must be one of: short - produces podcasts shorter than 3 minutes. default - produces podcasts roughly between 3-7 minutes. long - produces podcasts longer than 7 minutes. language : typing.Optional[str] An optional language of the Studio project. Two-letter language code (ISO 639-1). intro : typing.Optional[str] The intro text that will always be added to the beginning of the podcast. outro : typing.Optional[str] The outro text that will always be added to the end of the podcast. instructions_prompt : typing.Optional[str] Additional instructions prompt for the podcast generation used to adjust the podcast's style and tone. highlights : typing.Optional[typing.Sequence[str]] A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters. callback_url : typing.Optional[str] A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion Messages: 1. When project was converted successfully: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "success", project_snapshot_id: "22m00Tcm4TlvDq8ikMAT", error_details: None, } } 2. When project conversion failed: { type: "project_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", conversion_status: "error", project_snapshot_id: None, error_details: "Error details if conversion failed" } } 3. When chapter was converted successfully: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "success", chapter_snapshot_id: "23m00Tcm4TlvDq8ikMAV", error_details: None, } } 4. When chapter conversion failed: { type: "chapter_conversion_status", event_timestamp: 1234567890, data: { request_id: "1234567890", project_id: "21m00Tcm4TlvDq8ikWAM", chapter_id: "22m00Tcm4TlvDq8ikMAT", conversion_status: "error", chapter_snapshot_id: None, error_details: "Error details if conversion failed" } } apply_text_normalization : typing.Optional[BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization] This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PodcastProjectResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/studio/podcasts", method="POST", json={ "model_id": model_id, "mode": convert_and_respect_annotation_metadata( object_=mode, annotation=BodyCreatePodcastV1StudioPodcastsPostMode, direction="write" ), "source": convert_and_respect_annotation_metadata( object_=source, annotation=BodyCreatePodcastV1StudioPodcastsPostSource, direction="write" ), "quality_preset": quality_preset, "duration_scale": duration_scale, "language": language, "intro": intro, "outro": outro, "instructions_prompt": instructions_prompt, "highlights": highlights, "callback_url": callback_url, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", "safety-identifier": str(safety_identifier) if safety_identifier is not None else None, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PodcastProjectResponseModel, construct_type( type_=PodcastProjectResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types/000077500000000000000000000000001523660243400252145ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types/__init__.py000066400000000000000000000067221523660243400273340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_create_podcast_v_1_studio_podcasts_post_apply_text_normalization import ( BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization, ) from .body_create_podcast_v_1_studio_podcasts_post_duration_scale import ( BodyCreatePodcastV1StudioPodcastsPostDurationScale, ) from .body_create_podcast_v_1_studio_podcasts_post_mode import ( BodyCreatePodcastV1StudioPodcastsPostMode, BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin, BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, ) from .body_create_podcast_v_1_studio_podcasts_post_source import BodyCreatePodcastV1StudioPodcastsPostSource from .body_create_podcast_v_1_studio_podcasts_post_source_two_item import ( BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url, ) _dynamic_imports: typing.Dict[str, str] = { "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization": ".body_create_podcast_v_1_studio_podcasts_post_apply_text_normalization", "BodyCreatePodcastV1StudioPodcastsPostDurationScale": ".body_create_podcast_v_1_studio_podcasts_post_duration_scale", "BodyCreatePodcastV1StudioPodcastsPostMode": ".body_create_podcast_v_1_studio_podcasts_post_mode", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin": ".body_create_podcast_v_1_studio_podcasts_post_mode", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation": ".body_create_podcast_v_1_studio_podcasts_post_mode", "BodyCreatePodcastV1StudioPodcastsPostSource": ".body_create_podcast_v_1_studio_podcasts_post_source", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem": ".body_create_podcast_v_1_studio_podcasts_post_source_two_item", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text": ".body_create_podcast_v_1_studio_podcasts_post_source_two_item", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url": ".body_create_podcast_v_1_studio_podcasts_post_source_two_item", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization", "BodyCreatePodcastV1StudioPodcastsPostDurationScale", "BodyCreatePodcastV1StudioPodcastsPostMode", "BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin", "BodyCreatePodcastV1StudioPodcastsPostMode_Conversation", "BodyCreatePodcastV1StudioPodcastsPostSource", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text", "BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url", ] body_create_podcast_v_1_studio_podcasts_post_apply_text_normalization.py000066400000000000000000000003431523660243400440240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types# This file was auto-generated by Fern from our API Definition. import typing BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off", "apply_english"], typing.Any ] body_create_podcast_v_1_studio_podcasts_post_duration_scale.py000066400000000000000000000003201523660243400416540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types# This file was auto-generated by Fern from our API Definition. import typing BodyCreatePodcastV1StudioPodcastsPostDurationScale = typing.Union[ typing.Literal["short", "default", "long"], typing.Any ] body_create_podcast_v_1_studio_podcasts_post_mode.py000066400000000000000000000035771523660243400376250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ...types.podcast_bulletin_mode_data import PodcastBulletinModeData from ...types.podcast_conversation_mode_data import PodcastConversationModeData class BodyCreatePodcastV1StudioPodcastsPostMode_Conversation(UncheckedBaseModel): """ The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. """ type: typing.Literal["conversation"] = "conversation" conversation: PodcastConversationModeData 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 BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin(UncheckedBaseModel): """ The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. """ type: typing.Literal["bulletin"] = "bulletin" bulletin: PodcastBulletinModeData 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 BodyCreatePodcastV1StudioPodcastsPostMode = typing_extensions.Annotated[ typing.Union[ BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, BodyCreatePodcastV1StudioPodcastsPostMode_Bulletin ], UnionMetadata(discriminant="type"), ] body_create_podcast_v_1_studio_podcasts_post_source.py000066400000000000000000000007621523660243400401720ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.podcast_text_source import PodcastTextSource from ...types.podcast_url_source import PodcastUrlSource from .body_create_podcast_v_1_studio_podcasts_post_source_two_item import ( BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem, ) BodyCreatePodcastV1StudioPodcastsPostSource = typing.Union[ PodcastTextSource, PodcastUrlSource, typing.List[BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem] ] body_create_podcast_v_1_studio_podcasts_post_source_two_item.py000066400000000000000000000026171523660243400421020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/studio/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" text: 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 BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" url: 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 BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem = typing_extensions.Annotated[ typing.Union[ BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Text, BodyCreatePodcastV1StudioPodcastsPostSourceTwoItem_Url ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/000077500000000000000000000000001523660243400261005ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/__init__.py000066400000000000000000000044341523660243400302160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyTextToDialogueFullWithTimestampsApplyTextNormalization, BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization, BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization, BodyTextToDialogueStreamWithTimestampsApplyTextNormalization, TextToDialogueConvertRequestOutputFormat, TextToDialogueConvertWithTimestampsRequestOutputFormat, ) _dynamic_imports: typing.Dict[str, str] = { "BodyTextToDialogueFullWithTimestampsApplyTextNormalization": ".types", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization": ".types", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization": ".types", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization": ".types", "TextToDialogueConvertRequestOutputFormat": ".types", "TextToDialogueConvertWithTimestampsRequestOutputFormat": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyTextToDialogueFullWithTimestampsApplyTextNormalization", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization", "TextToDialogueConvertRequestOutputFormat", "TextToDialogueConvertWithTimestampsRequestOutputFormat", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/client.py000066400000000000000000001334271523660243400277420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.allowed_output_formats import AllowedOutputFormats from ..types.audio_with_timestamps_and_voice_segments_response_model import ( AudioWithTimestampsAndVoiceSegmentsResponseModel, ) from ..types.dialogue_input import DialogueInput from ..types.model_settings_response_model import ModelSettingsResponseModel from ..types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from ..types.streaming_audio_chunk_with_timestamps_and_voice_segments_response_model import ( StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, ) from .raw_client import AsyncRawTextToDialogueClient, RawTextToDialogueClient from .types.body_text_to_dialogue_full_with_timestamps_apply_text_normalization import ( BodyTextToDialogueFullWithTimestampsApplyTextNormalization, ) from .types.body_text_to_dialogue_multi_voice_streaming_v_1_text_to_dialogue_stream_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization, ) from .types.body_text_to_dialogue_multi_voice_v_1_text_to_dialogue_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization, ) from .types.body_text_to_dialogue_stream_with_timestamps_apply_text_normalization import ( BodyTextToDialogueStreamWithTimestampsApplyTextNormalization, ) from .types.text_to_dialogue_convert_request_output_format import TextToDialogueConvertRequestOutputFormat from .types.text_to_dialogue_convert_with_timestamps_request_output_format import ( TextToDialogueConvertWithTimestampsRequestOutputFormat, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TextToDialogueClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTextToDialogueClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTextToDialogueClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTextToDialogueClient """ return self._raw_client def convert( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns audio. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.Iterator[bytes] The generated audio file Examples -------- from elevenlabs import DialogueInput, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_dialogue.convert( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ), ], ) """ with self._raw_client.convert( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: yield from r.data def stream( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.Iterator[bytes] Streaming audio data Examples -------- from elevenlabs import DialogueInput, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_dialogue.stream( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ), ], ) """ with self._raw_client.stream( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: yield from r.data def stream_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel] Stream of transcription chunks Examples -------- from elevenlabs import DialogueInput, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) response = client.text_to_dialogue.stream_with_timestamps( output_format="mp3_22050_32", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I'm doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ), ], ) for chunk in response: yield chunk """ with self._raw_client.stream_with_timestamps( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: yield from r.data def convert_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioWithTimestampsAndVoiceSegmentsResponseModel: """ Generate dialogue from text with precise character-level timing information for audio-text synchronization. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioWithTimestampsAndVoiceSegmentsResponseModel Successful Response Examples -------- from elevenlabs import DialogueInput, ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_dialogue.convert_with_timestamps( output_format="alaw_8000", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I'm doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ), ], ) """ _response = self._raw_client.convert_with_timestamps( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) return _response.data class AsyncTextToDialogueClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTextToDialogueClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTextToDialogueClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTextToDialogueClient """ return self._raw_client async def convert( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns audio. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.AsyncIterator[bytes] The generated audio file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DialogueInput client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_dialogue.convert( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ), ], ) asyncio.run(main()) """ async with self._raw_client.convert( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def stream( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.AsyncIterator[bytes] Streaming audio data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DialogueInput client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_dialogue.stream( inputs=[ DialogueInput( text="[giggling] Knock knock", voice_id="JBFqnCBsd6RMkjVDRZzb", ), DialogueInput( text="[curious] Who is there?", voice_id="Aw4FAjKCGjjNkVhN1Xmq", ), ], ) asyncio.run(main()) """ async with self._raw_client.stream( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def stream_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel] Stream of transcription chunks Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DialogueInput client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: response = await client.text_to_dialogue.stream_with_timestamps( output_format="mp3_22050_32", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I'm doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ), ], ) async for chunk in response: yield chunk asyncio.run(main()) """ async with self._raw_client.stream_with_timestamps( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def convert_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioWithTimestampsAndVoiceSegmentsResponseModel: """ Generate dialogue from text with precise character-level timing information for audio-text synchronization. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioWithTimestampsAndVoiceSegmentsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, DialogueInput client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_dialogue.convert_with_timestamps( output_format="alaw_8000", enable_logging=True, inputs=[ DialogueInput( text="Hello, how are you?", voice_id="bYTqZQo3Jz7LQtmGTgwi", ), DialogueInput( text="I'm doing well, thank you!", voice_id="6lCwbsX1yVjD49QmpkTR", ), ], ) asyncio.run(main()) """ _response = await self._raw_client.convert_with_timestamps( inputs=inputs, output_format=output_format, enable_logging=enable_logging, model_id=model_id, language_code=language_code, settings=settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, apply_text_normalization=apply_text_normalization, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/raw_client.py000066400000000000000000001730001523660243400306020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import json import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.allowed_output_formats import AllowedOutputFormats from ..types.audio_with_timestamps_and_voice_segments_response_model import ( AudioWithTimestampsAndVoiceSegmentsResponseModel, ) from ..types.dialogue_input import DialogueInput from ..types.model_settings_response_model import ModelSettingsResponseModel from ..types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from ..types.streaming_audio_chunk_with_timestamps_and_voice_segments_response_model import ( StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, ) from .types.body_text_to_dialogue_full_with_timestamps_apply_text_normalization import ( BodyTextToDialogueFullWithTimestampsApplyTextNormalization, ) from .types.body_text_to_dialogue_multi_voice_streaming_v_1_text_to_dialogue_stream_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization, ) from .types.body_text_to_dialogue_multi_voice_v_1_text_to_dialogue_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization, ) from .types.body_text_to_dialogue_stream_with_timestamps_apply_text_normalization import ( BodyTextToDialogueStreamWithTimestampsApplyTextNormalization, ) from .types.text_to_dialogue_convert_request_output_format import TextToDialogueConvertRequestOutputFormat from .types.text_to_dialogue_convert_with_timestamps_request_output_format import ( TextToDialogueConvertWithTimestampsRequestOutputFormat, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTextToDialogueClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def convert( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns audio. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated audio file """ with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data """ with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue/stream", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]]]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[HttpResponse[typing.Iterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]]] Stream of transcription chunks """ with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue/stream/with-timestamps", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[ typing.Iterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel] ]: try: if 200 <= _response.status_code < 300: def _iter(): for _text in _response.iter_lines(): try: if len(_text) == 0: continue yield typing.cast( StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, construct_type( type_=StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return HttpResponse(response=_response, data=_iter()) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def convert_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioWithTimestampsAndVoiceSegmentsResponseModel]: """ Generate dialogue from text with precise character-level timing information for audio-text synchronization. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioWithTimestampsAndVoiceSegmentsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/text-to-dialogue/with-timestamps", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioWithTimestampsAndVoiceSegmentsResponseModel, construct_type( type_=AudioWithTimestampsAndVoiceSegmentsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTextToDialogueClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def convert( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns audio. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated audio file """ async with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[ BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data """ async with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue/stream", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[AllowedOutputFormats] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[ AsyncHttpResponse[typing.AsyncIterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]] ]: """ Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel]]] Stream of transcription chunks """ async with self._client_wrapper.httpx_client.stream( "v1/text-to-dialogue/stream/with-timestamps", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[ typing.AsyncIterator[StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel] ]: try: if 200 <= _response.status_code < 300: async def _iter(): async for _text in _response.aiter_lines(): try: if len(_text) == 0: continue yield typing.cast( StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, construct_type( type_=StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return AsyncHttpResponse(response=_response, data=_iter()) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def convert_with_timestamps( self, *, inputs: typing.Sequence[DialogueInput], output_format: typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] = None, enable_logging: typing.Optional[bool] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, settings: typing.Optional[ModelSettingsResponseModel] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, apply_text_normalization: typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioWithTimestampsAndVoiceSegmentsResponseModel]: """ Generate dialogue from text with precise character-level timing information for audio-text synchronization. Parameters ---------- inputs : typing.Sequence[DialogueInput] A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error. output_format : typing.Optional[TextToDialogueConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. 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. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. settings : typing.Optional[ModelSettingsResponseModel] Settings controlling the dialogue generation. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. apply_text_normalization : typing.Optional[BodyTextToDialogueFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioWithTimestampsAndVoiceSegmentsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/text-to-dialogue/with-timestamps", method="POST", params={ "output_format": output_format, "enable_logging": enable_logging, }, json={ "inputs": convert_and_respect_annotation_metadata( object_=inputs, annotation=typing.Sequence[DialogueInput], direction="write" ), "model_id": model_id, "language_code": language_code, "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=ModelSettingsResponseModel, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "apply_text_normalization": apply_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioWithTimestampsAndVoiceSegmentsResponseModel, construct_type( type_=AudioWithTimestampsAndVoiceSegmentsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types/000077500000000000000000000000001523660243400272445ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types/__init__.py000066400000000000000000000063041523660243400313600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_text_to_dialogue_full_with_timestamps_apply_text_normalization import ( BodyTextToDialogueFullWithTimestampsApplyTextNormalization, ) from .body_text_to_dialogue_multi_voice_streaming_v_1_text_to_dialogue_stream_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization, ) from .body_text_to_dialogue_multi_voice_v_1_text_to_dialogue_post_apply_text_normalization import ( BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization, ) from .body_text_to_dialogue_stream_with_timestamps_apply_text_normalization import ( BodyTextToDialogueStreamWithTimestampsApplyTextNormalization, ) from .text_to_dialogue_convert_request_output_format import TextToDialogueConvertRequestOutputFormat from .text_to_dialogue_convert_with_timestamps_request_output_format import ( TextToDialogueConvertWithTimestampsRequestOutputFormat, ) _dynamic_imports: typing.Dict[str, str] = { "BodyTextToDialogueFullWithTimestampsApplyTextNormalization": ".body_text_to_dialogue_full_with_timestamps_apply_text_normalization", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization": ".body_text_to_dialogue_multi_voice_streaming_v_1_text_to_dialogue_stream_post_apply_text_normalization", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization": ".body_text_to_dialogue_multi_voice_v_1_text_to_dialogue_post_apply_text_normalization", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization": ".body_text_to_dialogue_stream_with_timestamps_apply_text_normalization", "TextToDialogueConvertRequestOutputFormat": ".text_to_dialogue_convert_request_output_format", "TextToDialogueConvertWithTimestampsRequestOutputFormat": ".text_to_dialogue_convert_with_timestamps_request_output_format", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyTextToDialogueFullWithTimestampsApplyTextNormalization", "BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization", "BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization", "BodyTextToDialogueStreamWithTimestampsApplyTextNormalization", "TextToDialogueConvertRequestOutputFormat", "TextToDialogueConvertWithTimestampsRequestOutputFormat", ] body_text_to_dialogue_full_with_timestamps_apply_text_normalization.py000066400000000000000000000003211523660243400456510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToDialogueFullWithTimestampsApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off"], typing.Any ] 66568c8ad53f2329da9a98fa19b814e8334dbe18.paxheader00006660000000000000000000000275152366024340020473xustar00rootroot00000000000000189 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types/body_text_to_dialogue_multi_voice_streaming_v_1_text_to_dialogue_stream_post_apply_text_normalization.py 66568c8ad53f2329da9a98fa19b814e8334dbe18.data000066400000000000000000000003541523660243400173270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPostApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off"], typing.Any ] body_text_to_dialogue_multi_voice_v_1_text_to_dialogue_post_apply_text_normalization.py000066400000000000000000000003351523660243400511630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToDialogueMultiVoiceV1TextToDialoguePostApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off"], typing.Any ] body_text_to_dialogue_stream_with_timestamps_apply_text_normalization.py000066400000000000000000000003231523660243400462040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToDialogueStreamWithTimestampsApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off"], typing.Any ] text_to_dialogue_convert_request_output_format.py000066400000000000000000000014551523660243400414030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types# This file was auto-generated by Fern from our API Definition. import typing TextToDialogueConvertRequestOutputFormat = typing.Union[ typing.Literal[ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000", ], typing.Any, ] text_to_dialogue_convert_with_timestamps_request_output_format.py000066400000000000000000000014731523660243400447040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_dialogue/types# This file was auto-generated by Fern from our API Definition. import typing TextToDialogueConvertWithTimestampsRequestOutputFormat = typing.Union[ typing.Literal[ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_sound_effects/000077500000000000000000000000001523660243400271365ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_sound_effects/__init__.py000066400000000000000000000001251523660243400312450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_sound_effects/client.py000066400000000000000000000165551523660243400310020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.allowed_output_formats import AllowedOutputFormats from ..types.sfx_model_id import SfxModelId from .raw_client import AsyncRawTextToSoundEffectsClient, RawTextToSoundEffectsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TextToSoundEffectsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTextToSoundEffectsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTextToSoundEffectsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTextToSoundEffectsClient """ return self._raw_client def convert( self, *, text: str, output_format: typing.Optional[AllowedOutputFormats] = None, loop: typing.Optional[bool] = OMIT, duration_seconds: typing.Optional[float] = OMIT, prompt_influence: typing.Optional[float] = OMIT, model_id: typing.Optional[SfxModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects models in the world. Parameters ---------- text : str The text that will get converted into a sound effect. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. loop : typing.Optional[bool] Whether to create a sound effect that loops smoothly. Only available for the 'eleven_text_to_sound_v2 model'. duration_seconds : typing.Optional[float] The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 30. If set to None we will guess the optimal duration using the prompt. Defaults to None. prompt_influence : typing.Optional[float] A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3. model_id : typing.Optional[SfxModelId] The model ID to use for the sound generation. 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. Returns ------- typing.Iterator[bytes] The generated sound effect as an MP3 file Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_sound_effects.convert( text="Spacious braam suitable for high-impact movie trailer moments", ) """ with self._raw_client.convert( text=text, output_format=output_format, loop=loop, duration_seconds=duration_seconds, prompt_influence=prompt_influence, model_id=model_id, request_options=request_options, ) as r: yield from r.data class AsyncTextToSoundEffectsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTextToSoundEffectsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTextToSoundEffectsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTextToSoundEffectsClient """ return self._raw_client async def convert( self, *, text: str, output_format: typing.Optional[AllowedOutputFormats] = None, loop: typing.Optional[bool] = OMIT, duration_seconds: typing.Optional[float] = OMIT, prompt_influence: typing.Optional[float] = OMIT, model_id: typing.Optional[SfxModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects models in the world. Parameters ---------- text : str The text that will get converted into a sound effect. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. loop : typing.Optional[bool] Whether to create a sound effect that loops smoothly. Only available for the 'eleven_text_to_sound_v2 model'. duration_seconds : typing.Optional[float] The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 30. If set to None we will guess the optimal duration using the prompt. Defaults to None. prompt_influence : typing.Optional[float] A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3. model_id : typing.Optional[SfxModelId] The model ID to use for the sound generation. 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. Returns ------- typing.AsyncIterator[bytes] The generated sound effect as an MP3 file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_sound_effects.convert( text="Spacious braam suitable for high-impact movie trailer moments", ) asyncio.run(main()) """ async with self._raw_client.convert( text=text, output_format=output_format, loop=loop, duration_seconds=duration_seconds, prompt_influence=prompt_influence, model_id=model_id, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_sound_effects/raw_client.py000066400000000000000000000247731523660243400316540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.allowed_output_formats import AllowedOutputFormats from ..types.sfx_model_id import SfxModelId from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTextToSoundEffectsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def convert( self, *, text: str, output_format: typing.Optional[AllowedOutputFormats] = None, loop: typing.Optional[bool] = OMIT, duration_seconds: typing.Optional[float] = OMIT, prompt_influence: typing.Optional[float] = OMIT, model_id: typing.Optional[SfxModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects models in the world. Parameters ---------- text : str The text that will get converted into a sound effect. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. loop : typing.Optional[bool] Whether to create a sound effect that loops smoothly. Only available for the 'eleven_text_to_sound_v2 model'. duration_seconds : typing.Optional[float] The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 30. If set to None we will guess the optimal duration using the prompt. Defaults to None. prompt_influence : typing.Optional[float] A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3. model_id : typing.Optional[SfxModelId] The model ID to use for the sound generation. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated sound effect as an MP3 file """ with self._client_wrapper.httpx_client.stream( "v1/sound-generation", method="POST", params={ "output_format": output_format, }, json={ "text": text, "loop": loop, "duration_seconds": duration_seconds, "prompt_influence": prompt_influence, "model_id": model_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawTextToSoundEffectsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def convert( self, *, text: str, output_format: typing.Optional[AllowedOutputFormats] = None, loop: typing.Optional[bool] = OMIT, duration_seconds: typing.Optional[float] = OMIT, prompt_influence: typing.Optional[float] = OMIT, model_id: typing.Optional[SfxModelId] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects models in the world. Parameters ---------- text : str The text that will get converted into a sound effect. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. loop : typing.Optional[bool] Whether to create a sound effect that loops smoothly. Only available for the 'eleven_text_to_sound_v2 model'. duration_seconds : typing.Optional[float] The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 30. If set to None we will guess the optimal duration using the prompt. Defaults to None. prompt_influence : typing.Optional[float] A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3. model_id : typing.Optional[SfxModelId] The model ID to use for the sound generation. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated sound effect as an MP3 file """ async with self._client_wrapper.httpx_client.stream( "v1/sound-generation", method="POST", params={ "output_format": output_format, }, json={ "text": text, "loop": loop, "duration_seconds": duration_seconds, "prompt_influence": prompt_influence, "model_id": model_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/000077500000000000000000000000001523660243400255565ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/__init__.py000066400000000000000000000046051523660243400276740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( BodyTextToSpeechFullApplyTextNormalization, BodyTextToSpeechFullWithTimestampsApplyTextNormalization, BodyTextToSpeechStreamApplyTextNormalization, BodyTextToSpeechStreamWithTimestampsApplyTextNormalization, TextToSpeechConvertRequestOutputFormat, TextToSpeechConvertWithTimestampsRequestOutputFormat, TextToSpeechStreamRequestOutputFormat, TextToSpeechStreamWithTimestampsRequestOutputFormat, ) _dynamic_imports: typing.Dict[str, str] = { "BodyTextToSpeechFullApplyTextNormalization": ".types", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization": ".types", "BodyTextToSpeechStreamApplyTextNormalization": ".types", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization": ".types", "TextToSpeechConvertRequestOutputFormat": ".types", "TextToSpeechConvertWithTimestampsRequestOutputFormat": ".types", "TextToSpeechStreamRequestOutputFormat": ".types", "TextToSpeechStreamWithTimestampsRequestOutputFormat": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyTextToSpeechFullApplyTextNormalization", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization", "BodyTextToSpeechStreamApplyTextNormalization", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization", "TextToSpeechConvertRequestOutputFormat", "TextToSpeechConvertWithTimestampsRequestOutputFormat", "TextToSpeechStreamRequestOutputFormat", "TextToSpeechStreamWithTimestampsRequestOutputFormat", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/client.py000066400000000000000000002205551523660243400274170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.audio_with_timestamps_response import AudioWithTimestampsResponse from ..types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from ..types.streaming_audio_chunk_with_timestamps_response import StreamingAudioChunkWithTimestampsResponse from ..types.voice_settings import VoiceSettings from .raw_client import AsyncRawTextToSpeechClient, RawTextToSpeechClient from .types.body_text_to_speech_full_apply_text_normalization import BodyTextToSpeechFullApplyTextNormalization from .types.body_text_to_speech_full_with_timestamps_apply_text_normalization import ( BodyTextToSpeechFullWithTimestampsApplyTextNormalization, ) from .types.body_text_to_speech_stream_apply_text_normalization import BodyTextToSpeechStreamApplyTextNormalization from .types.body_text_to_speech_stream_with_timestamps_apply_text_normalization import ( BodyTextToSpeechStreamWithTimestampsApplyTextNormalization, ) from .types.text_to_speech_convert_request_output_format import TextToSpeechConvertRequestOutputFormat from .types.text_to_speech_convert_with_timestamps_request_output_format import ( TextToSpeechConvertWithTimestampsRequestOutputFormat, ) from .types.text_to_speech_stream_request_output_format import TextToSpeechStreamRequestOutputFormat from .types.text_to_speech_stream_with_timestamps_request_output_format import ( TextToSpeechStreamWithTimestampsRequestOutputFormat, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TextToSpeechClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTextToSpeechClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTextToSpeechClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTextToSpeechClient """ return self._raw_client def convert( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Converts text into speech using a voice of your choice and returns audio. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.Iterator[bytes] The generated audio file Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) """ with self._raw_client.convert( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: yield from r.data def convert_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioWithTimestampsResponse: """ Generate speech from text with precise character-level timing information for audio-text synchronization. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioWithTimestampsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_speech.convert_with_timestamps( voice_id="21m00Tcm4TlvDq8ikWAM", enable_logging=True, optimize_streaming_latency=1, output_format="alaw_8000", text="This is a test for the API of ElevenLabs.", ) """ _response = self._raw_client.convert_with_timestamps( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) return _response.data def stream( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Converts text into speech using a voice of your choice and returns audio as an audio stream. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.Iterator[bytes] Streaming audio data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) """ with self._raw_client.stream( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: yield from r.data def stream_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[StreamingAudioChunkWithTimestampsResponse]: """ Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[StreamingAudioChunkWithTimestampsResponse] Stream of transcription chunks Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) response = client.text_to_speech.stream_with_timestamps( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) for chunk in response: yield chunk """ with self._raw_client.stream_with_timestamps( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: yield from r.data class AsyncTextToSpeechClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTextToSpeechClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTextToSpeechClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTextToSpeechClient """ return self._raw_client async def convert( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Converts text into speech using a voice of your choice and returns audio. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.AsyncIterator[bytes] The generated audio file Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_speech.convert( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) asyncio.run(main()) """ async with self._raw_client.convert( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def convert_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioWithTimestampsResponse: """ Generate speech from text with precise character-level timing information for audio-text synchronization. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AudioWithTimestampsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_speech.convert_with_timestamps( voice_id="21m00Tcm4TlvDq8ikWAM", enable_logging=True, optimize_streaming_latency=1, output_format="alaw_8000", text="This is a test for the API of ElevenLabs.", ) asyncio.run(main()) """ _response = await self._raw_client.convert_with_timestamps( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) return _response.data async def stream( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Converts text into speech using a voice of your choice and returns audio as an audio stream. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.AsyncIterator[bytes] Streaming audio data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_speech.stream( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) asyncio.run(main()) """ async with self._raw_client.stream( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk async def stream_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[StreamingAudioChunkWithTimestampsResponse]: """ Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[StreamingAudioChunkWithTimestampsResponse] Stream of transcription chunks Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: response = await client.text_to_speech.stream_with_timestamps( voice_id="JBFqnCBsd6RMkjVDRZzb", output_format="mp3_44100_128", text="The first move is what sets everything in motion.", model_id="eleven_multilingual_v2", ) async for chunk in response: yield chunk asyncio.run(main()) """ async with self._raw_client.stream_with_timestamps( voice_id, text=text, enable_logging=enable_logging, optimize_streaming_latency=optimize_streaming_latency, output_format=output_format, model_id=model_id, language_code=language_code, voice_settings=voice_settings, pronunciation_dictionary_locators=pronunciation_dictionary_locators, seed=seed, previous_text=previous_text, next_text=next_text, previous_request_ids=previous_request_ids, next_request_ids=next_request_ids, use_pvc_as_ivc=use_pvc_as_ivc, apply_text_normalization=apply_text_normalization, apply_language_text_normalization=apply_language_text_normalization, request_options=request_options, ) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/raw_client.py000066400000000000000000002612011523660243400302610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import json import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.audio_with_timestamps_response import AudioWithTimestampsResponse from ..types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator from ..types.streaming_audio_chunk_with_timestamps_response import StreamingAudioChunkWithTimestampsResponse from ..types.voice_settings import VoiceSettings from .types.body_text_to_speech_full_apply_text_normalization import BodyTextToSpeechFullApplyTextNormalization from .types.body_text_to_speech_full_with_timestamps_apply_text_normalization import ( BodyTextToSpeechFullWithTimestampsApplyTextNormalization, ) from .types.body_text_to_speech_stream_apply_text_normalization import BodyTextToSpeechStreamApplyTextNormalization from .types.body_text_to_speech_stream_with_timestamps_apply_text_normalization import ( BodyTextToSpeechStreamWithTimestampsApplyTextNormalization, ) from .types.text_to_speech_convert_request_output_format import TextToSpeechConvertRequestOutputFormat from .types.text_to_speech_convert_with_timestamps_request_output_format import ( TextToSpeechConvertWithTimestampsRequestOutputFormat, ) from .types.text_to_speech_stream_request_output_format import TextToSpeechStreamRequestOutputFormat from .types.text_to_speech_stream_with_timestamps_request_output_format import ( TextToSpeechStreamWithTimestampsRequestOutputFormat, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTextToSpeechClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def convert( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Converts text into speech using a voice of your choice and returns audio. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] The generated audio file """ with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() def convert_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioWithTimestampsResponse]: """ Generate speech from text with precise character-level timing information for audio-text synchronization. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AudioWithTimestampsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/with-timestamps", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioWithTimestampsResponse, construct_type( type_=AudioWithTimestampsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.contextmanager def stream( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Converts text into speech using a voice of your choice and returns audio as an audio stream. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data """ with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/stream", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() @contextlib.contextmanager def stream_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[StreamingAudioChunkWithTimestampsResponse]]]: """ Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.Iterator[HttpResponse[typing.Iterator[StreamingAudioChunkWithTimestampsResponse]]] Stream of transcription chunks """ with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/stream/with-timestamps", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: def _stream() -> HttpResponse[typing.Iterator[StreamingAudioChunkWithTimestampsResponse]]: try: if 200 <= _response.status_code < 300: def _iter(): for _text in _response.iter_lines(): try: if len(_text) == 0: continue yield typing.cast( StreamingAudioChunkWithTimestampsResponse, construct_type( type_=StreamingAudioChunkWithTimestampsResponse, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return HttpResponse(response=_response, data=_iter()) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawTextToSpeechClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def convert( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Converts text into speech using a voice of your choice and returns audio. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] The generated audio file """ async with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() async def convert_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioWithTimestampsResponse]: """ Generate speech from text with precise character-level timing information for audio-text synchronization. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechFullWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AudioWithTimestampsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/with-timestamps", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AudioWithTimestampsResponse, construct_type( type_=AudioWithTimestampsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) @contextlib.asynccontextmanager async def stream( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Converts text into speech using a voice of your choice and returns audio as an audio stream. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data """ async with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/stream", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() @contextlib.asynccontextmanager async def stream_with_timestamps( self, voice_id: str, *, text: str, enable_logging: typing.Optional[bool] = None, optimize_streaming_latency: typing.Optional[int] = None, output_format: typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] = None, model_id: typing.Optional[str] = OMIT, language_code: typing.Optional[str] = OMIT, voice_settings: typing.Optional[VoiceSettings] = OMIT, pronunciation_dictionary_locators: typing.Optional[ typing.Sequence[PronunciationDictionaryVersionLocator] ] = OMIT, seed: typing.Optional[int] = OMIT, previous_text: typing.Optional[str] = OMIT, next_text: typing.Optional[str] = OMIT, previous_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_request_ids: typing.Optional[typing.Sequence[str]] = OMIT, use_pvc_as_ivc: typing.Optional[bool] = OMIT, apply_text_normalization: typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] = OMIT, apply_language_text_normalization: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamingAudioChunkWithTimestampsResponse]]]: """ Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken. Parameters ---------- voice_id : str ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. text : str The text that will get converted into speech. 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. optimize_streaming_latency : typing.Optional[int] You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: 0 - default mode (no latency optimizations) 1 - normal latency optimizations (about 50% of possible latency improvement of option 3) 2 - strong latency optimizations (about 75% of possible latency improvement of option 3) 3 - max latency optimizations 4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). Defaults to None. output_format : typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[str] Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. language_code : typing.Optional[str] Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models. voice_settings : typing.Optional[VoiceSettings] Voice settings overriding stored settings for the given voice. They are applied only on the given request. pronunciation_dictionary_locators : typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]] A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request seed : typing.Optional[int] If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. previous_text : typing.Optional[str] The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. next_text : typing.Optional[str] The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. previous_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. next_request_ids : typing.Optional[typing.Sequence[str]] A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. use_pvc_as_ivc : typing.Optional[bool] If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. apply_text_normalization : typing.Optional[BodyTextToSpeechStreamWithTimestampsApplyTextNormalization] This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. apply_language_text_normalization : typing.Optional[bool] This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. request_options : typing.Optional[RequestOptions] Request-specific configuration. Yields ------ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[StreamingAudioChunkWithTimestampsResponse]]] Stream of transcription chunks """ async with self._client_wrapper.httpx_client.stream( f"v1/text-to-speech/{jsonable_encoder(voice_id)}/stream/with-timestamps", method="POST", params={ "enable_logging": enable_logging, "optimize_streaming_latency": optimize_streaming_latency, "output_format": output_format, }, json={ "text": text, "model_id": model_id, "language_code": language_code, "voice_settings": convert_and_respect_annotation_metadata( object_=voice_settings, annotation=VoiceSettings, direction="write" ), "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( object_=pronunciation_dictionary_locators, annotation=typing.Sequence[PronunciationDictionaryVersionLocator], direction="write", ), "seed": seed, "previous_text": previous_text, "next_text": next_text, "previous_request_ids": previous_request_ids, "next_request_ids": next_request_ids, "use_pvc_as_ivc": use_pvc_as_ivc, "apply_text_normalization": apply_text_normalization, "apply_language_text_normalization": apply_language_text_normalization, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[StreamingAudioChunkWithTimestampsResponse]]: try: if 200 <= _response.status_code < 300: async def _iter(): async for _text in _response.aiter_lines(): try: if len(_text) == 0: continue yield typing.cast( StreamingAudioChunkWithTimestampsResponse, construct_type( type_=StreamingAudioChunkWithTimestampsResponse, # type: ignore object_=json.loads(_text), ), ) except Exception: pass return return AsyncHttpResponse(response=_response, data=_iter()) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types/000077500000000000000000000000001523660243400267225ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types/__init__.py000066400000000000000000000064661523660243400310470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_text_to_speech_full_apply_text_normalization import BodyTextToSpeechFullApplyTextNormalization from .body_text_to_speech_full_with_timestamps_apply_text_normalization import ( BodyTextToSpeechFullWithTimestampsApplyTextNormalization, ) from .body_text_to_speech_stream_apply_text_normalization import BodyTextToSpeechStreamApplyTextNormalization from .body_text_to_speech_stream_with_timestamps_apply_text_normalization import ( BodyTextToSpeechStreamWithTimestampsApplyTextNormalization, ) from .text_to_speech_convert_request_output_format import TextToSpeechConvertRequestOutputFormat from .text_to_speech_convert_with_timestamps_request_output_format import ( TextToSpeechConvertWithTimestampsRequestOutputFormat, ) from .text_to_speech_stream_request_output_format import TextToSpeechStreamRequestOutputFormat from .text_to_speech_stream_with_timestamps_request_output_format import ( TextToSpeechStreamWithTimestampsRequestOutputFormat, ) _dynamic_imports: typing.Dict[str, str] = { "BodyTextToSpeechFullApplyTextNormalization": ".body_text_to_speech_full_apply_text_normalization", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization": ".body_text_to_speech_full_with_timestamps_apply_text_normalization", "BodyTextToSpeechStreamApplyTextNormalization": ".body_text_to_speech_stream_apply_text_normalization", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization": ".body_text_to_speech_stream_with_timestamps_apply_text_normalization", "TextToSpeechConvertRequestOutputFormat": ".text_to_speech_convert_request_output_format", "TextToSpeechConvertWithTimestampsRequestOutputFormat": ".text_to_speech_convert_with_timestamps_request_output_format", "TextToSpeechStreamRequestOutputFormat": ".text_to_speech_stream_request_output_format", "TextToSpeechStreamWithTimestampsRequestOutputFormat": ".text_to_speech_stream_with_timestamps_request_output_format", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "BodyTextToSpeechFullApplyTextNormalization", "BodyTextToSpeechFullWithTimestampsApplyTextNormalization", "BodyTextToSpeechStreamApplyTextNormalization", "BodyTextToSpeechStreamWithTimestampsApplyTextNormalization", "TextToSpeechConvertRequestOutputFormat", "TextToSpeechConvertWithTimestampsRequestOutputFormat", "TextToSpeechStreamRequestOutputFormat", "TextToSpeechStreamWithTimestampsRequestOutputFormat", ] body_text_to_speech_full_apply_text_normalization.py000066400000000000000000000002731523660243400415120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToSpeechFullApplyTextNormalization = typing.Union[typing.Literal["auto", "on", "off"], typing.Any] body_text_to_speech_full_with_timestamps_apply_text_normalization.py000066400000000000000000000003111523660243400450040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToSpeechFullWithTimestampsApplyTextNormalization = typing.Union[typing.Literal["auto", "on", "off"], typing.Any] body_text_to_speech_stream_apply_text_normalization.py000066400000000000000000000002751523660243400420450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToSpeechStreamApplyTextNormalization = typing.Union[typing.Literal["auto", "on", "off"], typing.Any] body_text_to_speech_stream_with_timestamps_apply_text_normalization.py000066400000000000000000000003211523660243400453360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing BodyTextToSpeechStreamWithTimestampsApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off"], typing.Any ] text_to_speech_convert_request_output_format.py000066400000000000000000000014531523660243400405350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechConvertRequestOutputFormat = typing.Union[ typing.Literal[ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000", ], typing.Any, ] text_to_speech_convert_with_timestamps_request_output_format.py000066400000000000000000000014711523660243400440360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechConvertWithTimestampsRequestOutputFormat = typing.Union[ typing.Literal[ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000", ], typing.Any, ] text_to_speech_stream_request_output_format.py000066400000000000000000000012301523660243400403410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechStreamRequestOutputFormat = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] text_to_speech_stream_with_timestamps_request_output_format.py000066400000000000000000000012461523660243400436510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_speech/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechStreamWithTimestampsRequestOutputFormat = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/000077500000000000000000000000001523660243400254145ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/__init__.py000066400000000000000000000022221523660243400275230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import VoiceDesignRequestModelModelId from . import preview _dynamic_imports: typing.Dict[str, str] = {"VoiceDesignRequestModelModelId": ".types", "preview": ".preview"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["VoiceDesignRequestModelModelId", "preview"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/client.py000066400000000000000000001044331523660243400272510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.allowed_output_formats import AllowedOutputFormats from ..types.voice import Voice from ..types.voice_design_preview_response import VoiceDesignPreviewResponse from .raw_client import AsyncRawTextToVoiceClient, RawTextToVoiceClient from .types.voice_design_request_model_model_id import VoiceDesignRequestModelModelId if typing.TYPE_CHECKING: from .preview.client import AsyncPreviewClient, PreviewClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class TextToVoiceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTextToVoiceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._preview: typing.Optional[PreviewClient] = None @property def with_raw_response(self) -> RawTextToVoiceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTextToVoiceClient """ return self._raw_client def create_previews( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, quality: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, should_enhance: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Create a voice from a text prompt. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] The output format of the generated audio. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. quality : typing.Optional[float] Higher quality results in better voice output but less variety. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_voice.create_previews( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) """ _response = self._raw_client.create_previews( voice_description=voice_description, output_format=output_format, text=text, auto_generate_text=auto_generate_text, loudness=loudness, quality=quality, seed=seed, guidance_scale=guidance_scale, should_enhance=should_enhance, request_options=request_options, ) return _response.data def create( self, *, voice_name: str, voice_description: str, generated_voice_id: str, labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Voice: """ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix. Parameters ---------- voice_name : str Name to use for the created voice. voice_description : str Description to use for the created voice. generated_voice_id : str The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews. labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] Optional, metadata to add to the created voice. Defaults to None. played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]] List of voice ids that the user has played but not selected. Used for RLHF. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Voice Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_voice.create( voice_name="Sassy squeaky mouse", voice_description="A sassy squeaky mouse", generated_voice_id="37HceQefKmEi3bGovXjL", ) """ _response = self._raw_client.create( voice_name=voice_name, voice_description=voice_description, generated_voice_id=generated_voice_id, labels=labels, played_not_selected_voice_ids=played_not_selected_voice_ids, request_options=request_options, ) return _response.data def design( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, should_enhance: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, quality: typing.Optional[float] = OMIT, reference_audio_base_64: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[VoiceDesignRequestModelModelId] Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. quality : typing.Optional[float] Higher quality results in better voice output but less variety. reference_audio_base_64 : typing.Optional[str] Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_voice.design( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) """ _response = self._raw_client.design( voice_description=voice_description, output_format=output_format, model_id=model_id, text=text, auto_generate_text=auto_generate_text, loudness=loudness, seed=seed, guidance_scale=guidance_scale, stream_previews=stream_previews, should_enhance=should_enhance, remixing_session_id=remixing_session_id, remixing_session_iteration_id=remixing_session_iteration_id, quality=quality, reference_audio_base_64=reference_audio_base_64, prompt_strength=prompt_strength, request_options=request_options, ) return _response.data def remix( self, voice_id: str, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. voice_description : str Description of the changes to make to the voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_voice.remix( voice_id="21m00Tcm4TlvDq8ikWAM", output_format="mp3_22050_32", voice_description="Make the voice have a higher pitch.", ) """ _response = self._raw_client.remix( voice_id, voice_description=voice_description, output_format=output_format, text=text, auto_generate_text=auto_generate_text, loudness=loudness, seed=seed, guidance_scale=guidance_scale, stream_previews=stream_previews, remixing_session_id=remixing_session_id, remixing_session_iteration_id=remixing_session_iteration_id, prompt_strength=prompt_strength, request_options=request_options, ) return _response.data @property def preview(self): if self._preview is None: from .preview.client import PreviewClient # noqa: E402 self._preview = PreviewClient(client_wrapper=self._client_wrapper) return self._preview class AsyncTextToVoiceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTextToVoiceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._preview: typing.Optional[AsyncPreviewClient] = None @property def with_raw_response(self) -> AsyncRawTextToVoiceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTextToVoiceClient """ return self._raw_client async def create_previews( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, quality: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, should_enhance: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Create a voice from a text prompt. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] The output format of the generated audio. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. quality : typing.Optional[float] Higher quality results in better voice output but less variety. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_voice.create_previews( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) asyncio.run(main()) """ _response = await self._raw_client.create_previews( voice_description=voice_description, output_format=output_format, text=text, auto_generate_text=auto_generate_text, loudness=loudness, quality=quality, seed=seed, guidance_scale=guidance_scale, should_enhance=should_enhance, request_options=request_options, ) return _response.data async def create( self, *, voice_name: str, voice_description: str, generated_voice_id: str, labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Voice: """ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix. Parameters ---------- voice_name : str Name to use for the created voice. voice_description : str Description to use for the created voice. generated_voice_id : str The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews. labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] Optional, metadata to add to the created voice. Defaults to None. played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]] List of voice ids that the user has played but not selected. Used for RLHF. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Voice Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_voice.create( voice_name="Sassy squeaky mouse", voice_description="A sassy squeaky mouse", generated_voice_id="37HceQefKmEi3bGovXjL", ) asyncio.run(main()) """ _response = await self._raw_client.create( voice_name=voice_name, voice_description=voice_description, generated_voice_id=generated_voice_id, labels=labels, played_not_selected_voice_ids=played_not_selected_voice_ids, request_options=request_options, ) return _response.data async def design( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, should_enhance: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, quality: typing.Optional[float] = OMIT, reference_audio_base_64: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[VoiceDesignRequestModelModelId] Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. quality : typing.Optional[float] Higher quality results in better voice output but less variety. reference_audio_base_64 : typing.Optional[str] Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_voice.design( output_format="mp3_22050_32", voice_description="A sassy squeaky mouse", ) asyncio.run(main()) """ _response = await self._raw_client.design( voice_description=voice_description, output_format=output_format, model_id=model_id, text=text, auto_generate_text=auto_generate_text, loudness=loudness, seed=seed, guidance_scale=guidance_scale, stream_previews=stream_previews, should_enhance=should_enhance, remixing_session_id=remixing_session_id, remixing_session_iteration_id=remixing_session_iteration_id, quality=quality, reference_audio_base_64=reference_audio_base_64, prompt_strength=prompt_strength, request_options=request_options, ) return _response.data async def remix( self, voice_id: str, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> VoiceDesignPreviewResponse: """ Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. voice_description : str Description of the changes to make to the voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceDesignPreviewResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_voice.remix( voice_id="21m00Tcm4TlvDq8ikWAM", output_format="mp3_22050_32", voice_description="Make the voice have a higher pitch.", ) asyncio.run(main()) """ _response = await self._raw_client.remix( voice_id, voice_description=voice_description, output_format=output_format, text=text, auto_generate_text=auto_generate_text, loudness=loudness, seed=seed, guidance_scale=guidance_scale, stream_previews=stream_previews, remixing_session_id=remixing_session_id, remixing_session_iteration_id=remixing_session_iteration_id, prompt_strength=prompt_strength, request_options=request_options, ) return _response.data @property def preview(self): if self._preview is None: from .preview.client import AsyncPreviewClient # noqa: E402 self._preview = AsyncPreviewClient(client_wrapper=self._client_wrapper) return self._preview elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/preview/000077500000000000000000000000001523660243400270755ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/preview/__init__.py000066400000000000000000000001251523660243400312040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/preview/client.py000066400000000000000000000065741523660243400307410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawPreviewClient, RawPreviewClient class PreviewClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPreviewClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawPreviewClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPreviewClient """ return self._raw_client def stream( self, generated_voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Stream a voice preview that was created via the /v1/text-to-voice/design endpoint. Parameters ---------- generated_voice_id : str The generated_voice_id to stream. 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. Returns ------- typing.Iterator[bytes] Streaming audio data Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.text_to_voice.preview.stream( generated_voice_id="generated_voice_id", ) """ with self._raw_client.stream(generated_voice_id, request_options=request_options) as r: yield from r.data class AsyncPreviewClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPreviewClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawPreviewClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPreviewClient """ return self._raw_client async def stream( self, generated_voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Stream a voice preview that was created via the /v1/text-to-voice/design endpoint. Parameters ---------- generated_voice_id : str The generated_voice_id to stream. 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. Returns ------- typing.AsyncIterator[bytes] Streaming audio data Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.text_to_voice.preview.stream( generated_voice_id="generated_voice_id", ) asyncio.run(main()) """ async with self._raw_client.stream(generated_voice_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/preview/raw_client.py000066400000000000000000000145671523660243400316130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError class RawPreviewClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def stream( self, generated_voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Stream a voice preview that was created via the /v1/text-to-voice/design endpoint. Parameters ---------- generated_voice_id : str The generated_voice_id to stream. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Streaming audio data """ with self._client_wrapper.httpx_client.stream( f"v1/text-to-voice/{jsonable_encoder(generated_voice_id)}/stream", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawPreviewClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def stream( self, generated_voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Stream a voice preview that was created via the /v1/text-to-voice/design endpoint. Parameters ---------- generated_voice_id : str The generated_voice_id to stream. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Streaming audio data """ async with self._client_wrapper.httpx_client.stream( f"v1/text-to-voice/{jsonable_encoder(generated_voice_id)}/stream", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/raw_client.py000066400000000000000000001264641523660243400301320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.allowed_output_formats import AllowedOutputFormats from ..types.voice import Voice from ..types.voice_design_preview_response import VoiceDesignPreviewResponse from .types.voice_design_request_model_model_id import VoiceDesignRequestModelModelId from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawTextToVoiceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create_previews( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, quality: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, should_enhance: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[VoiceDesignPreviewResponse]: """ Create a voice from a text prompt. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] The output format of the generated audio. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. quality : typing.Optional[float] Higher quality results in better voice output but less variety. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/text-to-voice/create-previews", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "quality": quality, "seed": seed, "guidance_scale": guidance_scale, "should_enhance": should_enhance, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, voice_name: str, voice_description: str, generated_voice_id: str, labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Voice]: """ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix. Parameters ---------- voice_name : str Name to use for the created voice. voice_description : str Description to use for the created voice. generated_voice_id : str The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews. labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] Optional, metadata to add to the created voice. Defaults to None. played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]] List of voice ids that the user has played but not selected. Used for RLHF. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[Voice] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/text-to-voice", method="POST", json={ "voice_name": voice_name, "voice_description": voice_description, "generated_voice_id": generated_voice_id, "labels": labels, "played_not_selected_voice_ids": played_not_selected_voice_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Voice, construct_type( type_=Voice, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def design( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, should_enhance: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, quality: typing.Optional[float] = OMIT, reference_audio_base_64: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[VoiceDesignPreviewResponse]: """ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[VoiceDesignRequestModelModelId] Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. quality : typing.Optional[float] Higher quality results in better voice output but less variety. reference_audio_base_64 : typing.Optional[str] Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/text-to-voice/design", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "model_id": model_id, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "seed": seed, "guidance_scale": guidance_scale, "stream_previews": stream_previews, "should_enhance": should_enhance, "remixing_session_id": remixing_session_id, "remixing_session_iteration_id": remixing_session_iteration_id, "quality": quality, "reference_audio_base64": reference_audio_base_64, "prompt_strength": prompt_strength, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def remix( self, voice_id: str, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[VoiceDesignPreviewResponse]: """ Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. voice_description : str Description of the changes to make to the voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/text-to-voice/{jsonable_encoder(voice_id)}/remix", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "seed": seed, "guidance_scale": guidance_scale, "stream_previews": stream_previews, "remixing_session_id": remixing_session_id, "remixing_session_iteration_id": remixing_session_iteration_id, "prompt_strength": prompt_strength, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawTextToVoiceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create_previews( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, quality: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, should_enhance: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[VoiceDesignPreviewResponse]: """ Create a voice from a text prompt. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] The output format of the generated audio. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. quality : typing.Optional[float] Higher quality results in better voice output but less variety. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/text-to-voice/create-previews", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "quality": quality, "seed": seed, "guidance_scale": guidance_scale, "should_enhance": should_enhance, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, voice_name: str, voice_description: str, generated_voice_id: str, labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Voice]: """ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix. Parameters ---------- voice_name : str Name to use for the created voice. voice_description : str Description to use for the created voice. generated_voice_id : str The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews. labels : typing.Optional[typing.Dict[str, typing.Optional[str]]] Optional, metadata to add to the created voice. Defaults to None. played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]] List of voice ids that the user has played but not selected. Used for RLHF. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[Voice] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/text-to-voice", method="POST", json={ "voice_name": voice_name, "voice_description": voice_description, "generated_voice_id": generated_voice_id, "labels": labels, "played_not_selected_voice_ids": played_not_selected_voice_ids, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Voice, construct_type( type_=Voice, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def design( self, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, should_enhance: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, quality: typing.Optional[float] = OMIT, reference_audio_base_64: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[VoiceDesignPreviewResponse]: """ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_description : str Description to use for the created voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. model_id : typing.Optional[VoiceDesignRequestModelModelId] Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. should_enhance : typing.Optional[bool] Whether to enhance the voice description using AI to add more detail and improve voice generation quality. When enabled, the system will automatically expand simple prompts into more detailed voice descriptions. Defaults to False remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. quality : typing.Optional[float] Higher quality results in better voice output but less variety. reference_audio_base_64 : typing.Optional[str] Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/text-to-voice/design", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "model_id": model_id, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "seed": seed, "guidance_scale": guidance_scale, "stream_previews": stream_previews, "should_enhance": should_enhance, "remixing_session_id": remixing_session_id, "remixing_session_iteration_id": remixing_session_iteration_id, "quality": quality, "reference_audio_base64": reference_audio_base_64, "prompt_strength": prompt_strength, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def remix( self, voice_id: str, *, voice_description: str, output_format: typing.Optional[AllowedOutputFormats] = None, text: typing.Optional[str] = OMIT, auto_generate_text: typing.Optional[bool] = OMIT, loudness: typing.Optional[float] = OMIT, seed: typing.Optional[int] = OMIT, guidance_scale: typing.Optional[float] = OMIT, stream_previews: typing.Optional[bool] = OMIT, remixing_session_id: typing.Optional[str] = OMIT, remixing_session_iteration_id: typing.Optional[str] = OMIT, prompt_strength: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[VoiceDesignPreviewResponse]: """ Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. voice_description : str Description of the changes to make to the voice. output_format : typing.Optional[AllowedOutputFormats] Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. text : typing.Optional[str] Text to generate, text length has to be between 100 and 1000. auto_generate_text : typing.Optional[bool] Whether to automatically generate a text suitable for the voice description. loudness : typing.Optional[float] Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. seed : typing.Optional[int] Random number that controls the voice generation. Same seed with same inputs produces same voice. guidance_scale : typing.Optional[float] Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. stream_previews : typing.Optional[bool] Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. remixing_session_id : typing.Optional[str] The remixing session id. remixing_session_iteration_id : typing.Optional[str] The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. prompt_strength : typing.Optional[float] Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[VoiceDesignPreviewResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/text-to-voice/{jsonable_encoder(voice_id)}/remix", method="POST", params={ "output_format": output_format, }, json={ "voice_description": voice_description, "text": text, "auto_generate_text": auto_generate_text, "loudness": loudness, "seed": seed, "guidance_scale": guidance_scale, "stream_previews": stream_previews, "remixing_session_id": remixing_session_id, "remixing_session_iteration_id": remixing_session_iteration_id, "prompt_strength": prompt_strength, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceDesignPreviewResponse, construct_type( type_=VoiceDesignPreviewResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/types/000077500000000000000000000000001523660243400265605ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/types/__init__.py000066400000000000000000000022221523660243400306670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .voice_design_request_model_model_id import VoiceDesignRequestModelModelId _dynamic_imports: typing.Dict[str, str] = {"VoiceDesignRequestModelModelId": ".voice_design_request_model_model_id"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["VoiceDesignRequestModelModelId"] voice_design_request_model_model_id.py000066400000000000000000000003111523660243400362700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/text_to_voice/types# This file was auto-generated by Fern from our API Definition. import typing VoiceDesignRequestModelModelId = typing.Union[typing.Literal["eleven_multilingual_ttv_v2", "eleven_ttv_v3"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/000077500000000000000000000000001523660243400240445ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/__init__.py000066400000000000000000000020321523660243400261520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import single_use _dynamic_imports: typing.Dict[str, str] = {"single_use": ".single_use"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["single_use"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/client.py000066400000000000000000000037011523660243400256750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawTokensClient, RawTokensClient if typing.TYPE_CHECKING: from .single_use.client import AsyncSingleUseClient, SingleUseClient class TokensClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTokensClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._single_use: typing.Optional[SingleUseClient] = None @property def with_raw_response(self) -> RawTokensClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawTokensClient """ return self._raw_client @property def single_use(self): if self._single_use is None: from .single_use.client import SingleUseClient # noqa: E402 self._single_use = SingleUseClient(client_wrapper=self._client_wrapper) return self._single_use class AsyncTokensClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTokensClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._single_use: typing.Optional[AsyncSingleUseClient] = None @property def with_raw_response(self) -> AsyncRawTokensClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawTokensClient """ return self._raw_client @property def single_use(self): if self._single_use is None: from .single_use.client import AsyncSingleUseClient # noqa: E402 self._single_use = AsyncSingleUseClient(client_wrapper=self._client_wrapper) return self._single_use elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/raw_client.py000066400000000000000000000006311523660243400265450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawTokensClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawTokensClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/single_use/000077500000000000000000000000001523660243400262015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/single_use/__init__.py000066400000000000000000000001251523660243400303100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/single_use/client.py000066400000000000000000000063361523660243400300410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.single_use_token_response_model import SingleUseTokenResponseModel from ...types.single_use_token_type import SingleUseTokenType from .raw_client import AsyncRawSingleUseClient, RawSingleUseClient class SingleUseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSingleUseClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSingleUseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSingleUseClient """ return self._raw_client def create( self, token_type: SingleUseTokenType, *, request_options: typing.Optional[RequestOptions] = None ) -> SingleUseTokenResponseModel: """ Generate a time limited single-use token with embedded authentication for frontend clients. Parameters ---------- token_type : SingleUseTokenType request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SingleUseTokenResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.tokens.single_use.create( token_type="realtime_scribe", ) """ _response = self._raw_client.create(token_type, request_options=request_options) return _response.data class AsyncSingleUseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSingleUseClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSingleUseClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSingleUseClient """ return self._raw_client async def create( self, token_type: SingleUseTokenType, *, request_options: typing.Optional[RequestOptions] = None ) -> SingleUseTokenResponseModel: """ Generate a time limited single-use token with embedded authentication for frontend clients. Parameters ---------- token_type : SingleUseTokenType request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- SingleUseTokenResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.tokens.single_use.create( token_type="realtime_scribe", ) asyncio.run(main()) """ _response = await self._raw_client.create(token_type, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/tokens/single_use/raw_client.py000066400000000000000000000124461523660243400307110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.single_use_token_response_model import SingleUseTokenResponseModel from ...types.single_use_token_type import SingleUseTokenType from pydantic import ValidationError class RawSingleUseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, token_type: SingleUseTokenType, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SingleUseTokenResponseModel]: """ Generate a time limited single-use token with embedded authentication for frontend clients. Parameters ---------- token_type : SingleUseTokenType request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[SingleUseTokenResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/single-use-token/{jsonable_encoder(token_type)}", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SingleUseTokenResponseModel, construct_type( type_=SingleUseTokenResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSingleUseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, token_type: SingleUseTokenType, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SingleUseTokenResponseModel]: """ Generate a time limited single-use token with embedded authentication for frontend clients. Parameters ---------- token_type : SingleUseTokenType request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[SingleUseTokenResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/single-use-token/{jsonable_encoder(token_type)}", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SingleUseTokenResponseModel, construct_type( type_=SingleUseTokenResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/000077500000000000000000000000001523660243400237055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/__init__.py000066400000000000000000013471271523660243400260350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .account_change_activity_id import AccountChangeActivityId from .actor_model import ActorModel from .add_chapter_response_model import AddChapterResponseModel from .add_knowledge_base_response_model import AddKnowledgeBaseResponseModel from .add_project_request import AddProjectRequest from .add_project_response_model import AddProjectResponseModel from .add_pronunciation_dictionary_response_model import AddPronunciationDictionaryResponseModel 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 from .add_workspace_group_member_response_model import AddWorkspaceGroupMemberResponseModel from .add_workspace_invite_response_model import AddWorkspaceInviteResponseModel from .additional_format_response_model import AdditionalFormatResponseModel from .additional_formats import AdditionalFormats from .adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel from .age import Age from .agent_analysis_items_input import AgentAnalysisItemsInput from .agent_analysis_items_input_data_collection_item import ( AgentAnalysisItemsInputDataCollectionItem, AgentAnalysisItemsInputDataCollectionItem_System, AgentAnalysisItemsInputDataCollectionItem_User, ) from .agent_analysis_items_input_evaluation_criteria_item import ( AgentAnalysisItemsInputEvaluationCriteriaItem, AgentAnalysisItemsInputEvaluationCriteriaItem_System, AgentAnalysisItemsInputEvaluationCriteriaItem_User, ) from .agent_analysis_items_output import AgentAnalysisItemsOutput from .agent_analysis_items_output_data_collection_item import ( AgentAnalysisItemsOutputDataCollectionItem, AgentAnalysisItemsOutputDataCollectionItem_System, AgentAnalysisItemsOutputDataCollectionItem_User, ) from .agent_analysis_items_output_evaluation_criteria_item import ( AgentAnalysisItemsOutputEvaluationCriteriaItem, AgentAnalysisItemsOutputEvaluationCriteriaItem_System, AgentAnalysisItemsOutputEvaluationCriteriaItem_User, ) from .agent_branch_basic_info import AgentBranchBasicInfo from .agent_branch_response import AgentBranchResponse from .agent_branch_summary import AgentBranchSummary from .agent_call_limits import AgentCallLimits from .agent_config import AgentConfig from .agent_config_api_model_workflow_override_input import AgentConfigApiModelWorkflowOverrideInput from .agent_config_api_model_workflow_override_output import AgentConfigApiModelWorkflowOverrideOutput from .agent_config_override_config import AgentConfigOverrideConfig from .agent_config_override_input import AgentConfigOverrideInput from .agent_config_override_output import AgentConfigOverrideOutput from .agent_definition_source import AgentDefinitionSource from .agent_deployment_percentage_strategy import AgentDeploymentPercentageStrategy from .agent_deployment_request import AgentDeploymentRequest from .agent_deployment_request_item import AgentDeploymentRequestItem from .agent_deployment_response import AgentDeploymentResponse from .agent_failure_response_example import AgentFailureResponseExample from .agent_knowledge_base_rag_chunk_response_model import AgentKnowledgeBaseRagChunkResponseModel from .agent_knowledge_base_rag_query_request_model import AgentKnowledgeBaseRagQueryRequestModel from .agent_knowledge_base_rag_query_response_model import AgentKnowledgeBaseRagQueryResponseModel from .agent_metadata import AgentMetadata from .agent_metadata_db_model import AgentMetadataDbModel from .agent_metadata_response_model import AgentMetadataResponseModel from .agent_platform_settings_request_model import AgentPlatformSettingsRequestModel from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel from .agent_response_payload import AgentResponsePayload from .agent_simulated_chat_test_response_model import AgentSimulatedChatTestResponseModel from .agent_sort_by import AgentSortBy from .agent_successful_response_example import AgentSuccessfulResponseExample from .agent_summary_batch_successful_response_model import AgentSummaryBatchSuccessfulResponseModel from .agent_summary_response_model import AgentSummaryResponseModel from .agent_test_entity_type import AgentTestEntityType from .agent_test_folder_path_segment_response_model import AgentTestFolderPathSegmentResponseModel from .agent_testing_settings import AgentTestingSettings from .agent_topic_response_model import AgentTopicResponseModel from .agent_transfer_input import AgentTransferInput from .agent_transfer_op import AgentTransferOp, AgentTransferOp_Pop, AgentTransferOp_Push, AgentTransferOp_Replace from .agent_transfer_op_pop import AgentTransferOpPop from .agent_transfer_op_push import AgentTransferOpPush from .agent_transfer_op_replace import AgentTransferOpReplace from .agent_transfer_output import AgentTransferOutput from .agent_trust_context import AgentTrustContext from .agent_version_metadata import AgentVersionMetadata from .agent_version_parents import AgentVersionParents from .agent_workflow_request_model import AgentWorkflowRequestModel from .agent_workflow_request_model_nodes_value import ( AgentWorkflowRequestModelNodesValue, AgentWorkflowRequestModelNodesValue_End, AgentWorkflowRequestModelNodesValue_OverrideAgent, AgentWorkflowRequestModelNodesValue_PhoneNumber, AgentWorkflowRequestModelNodesValue_StandaloneAgent, AgentWorkflowRequestModelNodesValue_Start, AgentWorkflowRequestModelNodesValue_Tool, ) from .agent_workflow_response_model import AgentWorkflowResponseModel from .agent_workflow_response_model_nodes_value import ( AgentWorkflowResponseModelNodesValue, AgentWorkflowResponseModelNodesValue_End, AgentWorkflowResponseModelNodesValue_OverrideAgent, AgentWorkflowResponseModelNodesValue_PhoneNumber, AgentWorkflowResponseModelNodesValue_StandaloneAgent, AgentWorkflowResponseModelNodesValue_Start, AgentWorkflowResponseModelNodesValue_Tool, ) from .agent_workspace_overrides_input import AgentWorkspaceOverridesInput from .agent_workspace_overrides_output import AgentWorkspaceOverridesOutput from .alerting_monitor_config import AlertingMonitorConfig from .alerting_settings import AlertingSettings from .alerting_settings_response import AlertingSettingsResponse from .alerting_webhook_header import AlertingWebhookHeader from .alerting_webhook_method import AlertingWebhookMethod from .alerting_webhook_notifier import AlertingWebhookNotifier from .alerting_webhook_notifier_response import AlertingWebhookNotifierResponse from .alignment import Alignment from .allowed_output_formats import AllowedOutputFormats from .allowlist_item import AllowlistItem from .analysis_charging import AnalysisCharging from .analysis_property import AnalysisProperty from .analysis_property_constant_value import AnalysisPropertyConstantValue from .analysis_property_type import AnalysisPropertyType from .analysis_run_snapshot import AnalysisRunSnapshot from .analysis_running_total import AnalysisRunningTotal from .analysis_scope import AnalysisScope from .analysis_type import AnalysisType from .api_integration_o_auth_2_auth_code_response import ApiIntegrationOAuth2AuthCodeResponse from .api_integration_o_auth_2_auth_code_response_scope_separator import ( ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ) from .api_integration_o_auth_2_custom_app_response import ApiIntegrationOAuth2CustomAppResponse from .api_integration_o_auth_2_custom_app_response_scope_separator import ( ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ) from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .api_integration_webhook_overrides_request_headers_value import ( ApiIntegrationWebhookOverridesRequestHeadersValue, ) from .api_integration_webhook_overrides_schema_overrides_value import ( ApiIntegrationWebhookOverridesSchemaOverridesValue, ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant, ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable, ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm, ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit, ) from .api_integration_webhook_tool_config_input import ApiIntegrationWebhookToolConfigInput from .api_integration_webhook_tool_config_output import ApiIntegrationWebhookToolConfigOutput from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems from .array_json_schema_property_input_property_kind import ArrayJsonSchemaPropertyInputPropertyKind from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems from .asr_conversational_config import AsrConversationalConfig from .asr_conversational_config_override import AsrConversationalConfigOverride from .asr_conversational_config_override_config import AsrConversationalConfigOverrideConfig from .asr_conversational_config_workflow_override import AsrConversationalConfigWorkflowOverride from .asr_input_format import AsrInputFormat from .asr_provider import AsrProvider from .asr_quality import AsrQuality from .asset_transcription import AssetTranscription from .asset_transcription_data import AssetTranscriptionData from .asset_transcription_status import AssetTranscriptionStatus from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput from .ast_and_operator_node_input import AstAndOperatorNodeInput from .ast_and_operator_node_output import AstAndOperatorNodeOutput from .ast_boolean_node_input import AstBooleanNodeInput from .ast_boolean_node_output import AstBooleanNodeOutput from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput from .ast_division_operator_node_input import AstDivisionOperatorNodeInput from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput from .ast_dynamic_variable_node_input import AstDynamicVariableNodeInput from .ast_dynamic_variable_node_output import AstDynamicVariableNodeOutput from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput from .ast_node_input import ( AstNodeInput, AstNodeInput_AddOperator, AstNodeInput_AndOperator, AstNodeInput_BooleanLiteral, AstNodeInput_ConditionalOperator, AstNodeInput_DivOperator, AstNodeInput_DynamicVariable, AstNodeInput_EqOperator, AstNodeInput_GtOperator, AstNodeInput_GteOperator, AstNodeInput_Llm, AstNodeInput_LtOperator, AstNodeInput_LteOperator, AstNodeInput_MulOperator, AstNodeInput_NeqOperator, AstNodeInput_NullLiteral, AstNodeInput_NumberLiteral, AstNodeInput_OrOperator, AstNodeInput_StringLiteral, AstNodeInput_SubOperator, ) from .ast_node_input_llm import AstNodeInputLlm from .ast_node_output import ( AstNodeOutput, AstNodeOutput_AddOperator, AstNodeOutput_AndOperator, AstNodeOutput_BooleanLiteral, AstNodeOutput_ConditionalOperator, AstNodeOutput_DivOperator, AstNodeOutput_DynamicVariable, AstNodeOutput_EqOperator, AstNodeOutput_GtOperator, AstNodeOutput_GteOperator, AstNodeOutput_Llm, AstNodeOutput_LtOperator, AstNodeOutput_LteOperator, AstNodeOutput_MulOperator, AstNodeOutput_NeqOperator, AstNodeOutput_NullLiteral, AstNodeOutput_NumberLiteral, AstNodeOutput_OrOperator, AstNodeOutput_StringLiteral, AstNodeOutput_SubOperator, ) from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput from .ast_null_node_input import AstNullNodeInput from .ast_null_node_output import AstNullNodeOutput from .ast_number_node_input import AstNumberNodeInput from .ast_number_node_input_value import AstNumberNodeInputValue from .ast_number_node_output import AstNumberNodeOutput from .ast_number_node_output_value import AstNumberNodeOutputValue from .ast_or_operator_node_input import AstOrOperatorNodeInput from .ast_or_operator_node_output import AstOrOperatorNodeOutput from .ast_string_node_input import AstStringNodeInput from .ast_string_node_output import AstStringNodeOutput from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput from .astllm_node_input import AstllmNodeInput from .astllm_node_input_prompt import AstllmNodeInputPrompt from .astllm_node_input_value_schema import AstllmNodeInputValueSchema from .astllm_node_output import AstllmNodeOutput from .async_conversation_metadata import AsyncConversationMetadata from .async_conversation_metadata_delivery_status import AsyncConversationMetadataDeliveryStatus from .attached_system_data_collection_ref import AttachedSystemDataCollectionRef from .attached_system_evaluation_ref import AttachedSystemEvaluationRef from .attached_system_evaluation_ref_analysis_item_id import AttachedSystemEvaluationRefAnalysisItemId from .attached_test_model import AttachedTestModel from .attached_user_data_collection_ref import AttachedUserDataCollectionRef from .attached_user_evaluation_ref import AttachedUserEvaluationRef from .audio_analysis import AudioAnalysis from .audio_analysis_result import AudioAnalysisResult from .audio_analysis_status import AudioAnalysisStatus from .audio_format_enum import AudioFormatEnum from .audio_isolation_history_item_response_model import AudioIsolationHistoryItemResponseModel from .audio_key_moment import AudioKeyMoment 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_output_multi import AudioOutputMulti from .audio_ref_chunk import AudioRefChunk from .audio_segment import AudioSegment from .audio_with_timestamps_and_voice_segments_response_model import ( AudioWithTimestampsAndVoiceSegmentsResponseModel, ) from .audio_with_timestamps_response import AudioWithTimestampsResponse from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_dependencies_mcp_servers_item import ( AuthConnectionDependenciesMcpServersItem, AuthConnectionDependenciesMcpServersItem_Available, AuthConnectionDependenciesMcpServersItem_Unknown, ) from .auth_connection_dependencies_tools_item import ( AuthConnectionDependenciesToolsItem, AuthConnectionDependenciesToolsItem_Available, AuthConnectionDependenciesToolsItem_Unknown, ) from .auth_connection_locator import AuthConnectionLocator from .auth_connection_status import AuthConnectionStatus from .auth_settings import AuthSettings from .authentication_activity_id import AuthenticationActivityId from .authorization_method import AuthorizationMethod from .auto_generation_metadata import AutoGenerationMetadata from .auto_sync_info import AutoSyncInfo from .background_sound_config import BackgroundSoundConfig from .background_sound_config_workflow_override import BackgroundSoundConfigWorkflowOverride from .background_sound_preset_id import BackgroundSoundPresetId from .background_sound_source_type import BackgroundSoundSourceType from .backup_llm_default import BackupLlmDefault from .backup_llm_disabled import BackupLlmDisabled from .backup_llm_override import BackupLlmOverride from .bad_request_error_body import BadRequestErrorBody from .base_turn_config import BaseTurnConfig from .basic_auth_response import BasicAuthResponse from .batch_call_detailed_response import BatchCallDetailedResponse from .batch_call_recipient_status import BatchCallRecipientStatus from .batch_call_response import BatchCallResponse from .batch_call_status import BatchCallStatus from .batch_call_whats_app_params import BatchCallWhatsAppParams from .batch_failure_response_model import BatchFailureResponseModel from .bearer_auth_response import BearerAuthResponse from .behavior_override import BehaviorOverride from .billing_period import BillingPeriod from .branch_protection_status import BranchProtectionStatus from .breakdown_types import BreakdownTypes from .bucketing_status import BucketingStatus from .built_in_tools_input import BuiltInToolsInput from .built_in_tools_output import BuiltInToolsOutput from .built_in_tools_workflow_override_input import BuiltInToolsWorkflowOverrideInput from .built_in_tools_workflow_override_output import BuiltInToolsWorkflowOverrideOutput from .cancel_calendar_event_params import CancelCalendarEventParams from .cancel_group_session_for_all_params import CancelGroupSessionForAllParams from .cancel_group_session_registration_params import CancelGroupSessionRegistrationParams from .canvas_placement import CanvasPlacement from .caption_style_character_animation_model import CaptionStyleCharacterAnimationModel from .caption_style_character_animation_model_enter_type import CaptionStyleCharacterAnimationModelEnterType from .caption_style_character_animation_model_exit_type import CaptionStyleCharacterAnimationModelExitType from .caption_style_horizontal_placement_model import CaptionStyleHorizontalPlacementModel from .caption_style_horizontal_placement_model_align import CaptionStyleHorizontalPlacementModelAlign from .caption_style_model import CaptionStyleModel from .caption_style_model_text_align import CaptionStyleModelTextAlign from .caption_style_model_text_blend_mode import CaptionStyleModelTextBlendMode from .caption_style_model_text_style import CaptionStyleModelTextStyle from .caption_style_model_text_transform import CaptionStyleModelTextTransform from .caption_style_model_text_weight import CaptionStyleModelTextWeight from .caption_style_section_animation_model import CaptionStyleSectionAnimationModel from .caption_style_section_animation_model_enter_type import CaptionStyleSectionAnimationModelEnterType from .caption_style_section_animation_model_exit_type import CaptionStyleSectionAnimationModelExitType from .caption_style_template_model import CaptionStyleTemplateModel from .caption_style_vertical_placement_model import CaptionStyleVerticalPlacementModel from .caption_style_vertical_placement_model_align import CaptionStyleVerticalPlacementModelAlign from .caption_style_word_animation_model import CaptionStyleWordAnimationModel from .caption_style_word_animation_model_enter_type import CaptionStyleWordAnimationModelEnterType from .caption_style_word_animation_model_exit_type import CaptionStyleWordAnimationModelExitType from .chapter_content_block_extendable_node_response_model import ChapterContentBlockExtendableNodeResponseModel from .chapter_content_block_input_model import ChapterContentBlockInputModel from .chapter_content_block_input_model_sub_type import ChapterContentBlockInputModelSubType from .chapter_content_block_response_model import ChapterContentBlockResponseModel from .chapter_content_block_response_model_nodes_item import ( ChapterContentBlockResponseModelNodesItem, ChapterContentBlockResponseModelNodesItem_Other, ChapterContentBlockResponseModelNodesItem_TtsNode, ) from .chapter_content_block_tts_node_response_model import ChapterContentBlockTtsNodeResponseModel from .chapter_content_input_model import ChapterContentInputModel from .chapter_content_paragraph_tts_node_input_model import ChapterContentParagraphTtsNodeInputModel from .chapter_content_response_model import ChapterContentResponseModel from .chapter_response import ChapterResponse from .chapter_snapshot_extended_response_model import ChapterSnapshotExtendedResponseModel from .chapter_snapshot_response import ChapterSnapshotResponse from .chapter_snapshots_response import ChapterSnapshotsResponse from .chapter_state import ChapterState from .chapter_statistics_response import ChapterStatisticsResponse from .chapter_with_content_response_model import ChapterWithContentResponseModel from .chapter_with_content_response_model_state import ChapterWithContentResponseModelState from .character_age import CharacterAge from .character_alignment_model import CharacterAlignmentModel from .character_alignment_response_model import CharacterAlignmentResponseModel from .character_gender import CharacterGender from .character_metadata_response_model import CharacterMetadataResponseModel from .character_refresh_period import CharacterRefreshPeriod from .character_response_model import CharacterResponseModel from .character_role import CharacterRole from .character_usage_response import CharacterUsageResponse from .chat_source_medium import ChatSourceMedium from .check_service_availability_params import CheckServiceAvailabilityParams from .client_event import ClientEvent from .client_tool_config_input import ClientToolConfigInput from .client_tool_config_output import ClientToolConfigOutput from .clip_animation import ClipAnimation from .clip_animation_enter_effect import ClipAnimationEnterEffect from .clip_animation_exit_effect import ClipAnimationExitEffect from .close_connection import CloseConnection from .close_context import CloseContext from .close_payload import ClosePayload from .close_socket import CloseSocket from .column_filter import ColumnFilter from .column_filter_operation import ColumnFilterOperation from .column_filter_values_item import ColumnFilterValuesItem from .column_unit import ColumnUnit from .committed_transcript_entities_payload import CommittedTranscriptEntitiesPayload from .committed_transcript_payload import CommittedTranscriptPayload from .committed_transcript_with_timestamps_payload import CommittedTranscriptWithTimestampsPayload from .compile_procedures_response_model import CompileProceduresResponseModel from .compile_procedures_validation_error_response_model import CompileProceduresValidationErrorResponseModel from .composition_plan import CompositionPlan from .composition_plan_chunks_item import CompositionPlanChunksItem from .config_entity_type import ConfigEntityType from .conflict_section import ConflictSection from .constant_schema_override import ConstantSchemaOverride from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue from .content_config import ContentConfig from .content_format import ContentFormat from .content_guardrail_input import ContentGuardrailInput from .content_guardrail_input_trigger_action import ( ContentGuardrailInputTriggerAction, ContentGuardrailInputTriggerAction_EndCall, ContentGuardrailInputTriggerAction_Retry, ) from .content_guardrail_output import ContentGuardrailOutput from .content_guardrail_output_trigger_action import ( ContentGuardrailOutputTriggerAction, ContentGuardrailOutputTriggerAction_EndCall, ContentGuardrailOutputTriggerAction_Retry, ) from .content_threshold_guardrail import ContentThresholdGuardrail from .content_threshold_guardrail_threshold import ContentThresholdGuardrailThreshold from .contextual_update_info import ContextualUpdateInfo from .contributor import Contributor from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_file_upload_response_model import ConvAiFileUploadResponseModel from .conv_ai_secret_locator import ConvAiSecretLocator from .conv_ai_stored_secret_dependencies import ConvAiStoredSecretDependencies from .conv_ai_stored_secret_dependencies_agents_item import ( ConvAiStoredSecretDependenciesAgentsItem, ConvAiStoredSecretDependenciesAgentsItem_Available, ConvAiStoredSecretDependenciesAgentsItem_Unknown, ) from .conv_ai_stored_secret_dependencies_mcp_servers_item import ( ConvAiStoredSecretDependenciesMcpServersItem, ConvAiStoredSecretDependenciesMcpServersItem_Available, ConvAiStoredSecretDependenciesMcpServersItem_Unknown, ) from .conv_ai_stored_secret_dependencies_tools_item import ( ConvAiStoredSecretDependenciesToolsItem, ConvAiStoredSecretDependenciesToolsItem_Available, ConvAiStoredSecretDependenciesToolsItem_Unknown, ) from .conv_ai_user_secret_db_model import ConvAiUserSecretDbModel from .conv_ai_webhooks import ConvAiWebhooks from .conv_ai_workspace_stored_secret_config import ConvAiWorkspaceStoredSecretConfig from .conversation_asr_usage_model import ConversationAsrUsageModel from .conversation_charging_common_model import ConversationChargingCommonModel from .conversation_config_client_override_config_input import ConversationConfigClientOverrideConfigInput from .conversation_config_client_override_config_output import ConversationConfigClientOverrideConfigOutput from .conversation_config_client_override_input import ConversationConfigClientOverrideInput from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .conversation_config_input import ConversationConfigInput from .conversation_config_output import ConversationConfigOutput from .conversation_config_override import ConversationConfigOverride from .conversation_config_override_config import ConversationConfigOverrideConfig from .conversation_config_workflow_override_input import ConversationConfigWorkflowOverrideInput from .conversation_config_workflow_override_output import ConversationConfigWorkflowOverrideOutput from .conversation_deletion_settings import ConversationDeletionSettings from .conversation_feedback_type import ConversationFeedbackType from .conversation_history_analysis_common_model import ConversationHistoryAnalysisCommonModel from .conversation_history_batch_call_model import ConversationHistoryBatchCallModel from .conversation_history_eleven_assistant_common_model import ConversationHistoryElevenAssistantCommonModel from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel from .conversation_history_evaluation_criteria_result_common_model import ( ConversationHistoryEvaluationCriteriaResultCommonModel, ) from .conversation_history_exotel_phone_call_model import ConversationHistoryExotelPhoneCallModel from .conversation_history_feedback_common_model import ConversationHistoryFeedbackCommonModel from .conversation_history_metadata_common_model import ConversationHistoryMetadataCommonModel from .conversation_history_metadata_common_model_phone_call import ( ConversationHistoryMetadataCommonModelPhoneCall, ConversationHistoryMetadataCommonModelPhoneCall_Exotel, ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ) from .conversation_history_multivoice_message_model import ConversationHistoryMultivoiceMessageModel from .conversation_history_multivoice_message_part_model import ConversationHistoryMultivoiceMessagePartModel from .conversation_history_rag_usage_common_model import ConversationHistoryRagUsageCommonModel from .conversation_history_redaction_config import ConversationHistoryRedactionConfig from .conversation_history_sip_trunking_phone_call_model import ConversationHistorySipTrunkingPhoneCallModel from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_input import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, ) from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_output import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ) from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_history_transcript_common_model_input_role import ( ConversationHistoryTranscriptCommonModelInputRole, ) from .conversation_history_transcript_common_model_input_tool_results_item import ( ConversationHistoryTranscriptCommonModelInputToolResultsItem, ) from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_history_transcript_common_model_output_role import ( ConversationHistoryTranscriptCommonModelOutputRole, ) from .conversation_history_transcript_common_model_output_tool_results_item import ( ConversationHistoryTranscriptCommonModelOutputToolResultsItem, ) from .conversation_history_transcript_file_input_response_model import ( ConversationHistoryTranscriptFileInputResponseModel, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_other_tools_result_common_model_type import ( ConversationHistoryTranscriptOtherToolsResultCommonModelType, ) from .conversation_history_transcript_response_model import ConversationHistoryTranscriptResponseModel from .conversation_history_transcript_response_model_role import ConversationHistoryTranscriptResponseModelRole from .conversation_history_transcript_response_model_tool_results_item import ( ConversationHistoryTranscriptResponseModelToolResultsItem, ) from .conversation_history_transcript_system_tool_result_common_model_input import ( ConversationHistoryTranscriptSystemToolResultCommonModelInput, ) from .conversation_history_transcript_system_tool_result_common_model_input_result import ( ConversationHistoryTranscriptSystemToolResultCommonModelInputResult, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess, ) from .conversation_history_transcript_system_tool_result_common_model_output import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ) from .conversation_history_transcript_system_tool_result_common_model_output_result import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess, ) from .conversation_history_transcript_tool_call_api_integration_webhook_details_input import ( ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput, ) from .conversation_history_transcript_tool_call_api_integration_webhook_details_output import ( ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput, ) from .conversation_history_transcript_tool_call_client_details import ( ConversationHistoryTranscriptToolCallClientDetails, ) from .conversation_history_transcript_tool_call_common_model_input import ( ConversationHistoryTranscriptToolCallCommonModelInput, ) from .conversation_history_transcript_tool_call_common_model_input_tool_details import ( ConversationHistoryTranscriptToolCallCommonModelInputToolDetails, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook, ) from .conversation_history_transcript_tool_call_common_model_output import ( ConversationHistoryTranscriptToolCallCommonModelOutput, ) from .conversation_history_transcript_tool_call_common_model_output_tool_details import ( ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook, ) from .conversation_history_transcript_tool_call_mcp_details import ConversationHistoryTranscriptToolCallMcpDetails from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) from .conversation_history_twilio_phone_call_model import ConversationHistoryTwilioPhoneCallModel from .conversation_initiation_client_data_config_input import ConversationInitiationClientDataConfigInput from .conversation_initiation_client_data_config_output import ConversationInitiationClientDataConfigOutput from .conversation_initiation_client_data_internal import ConversationInitiationClientDataInternal from .conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from .conversation_initiation_client_data_request_output import ConversationInitiationClientDataRequestOutput from .conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook from .conversation_initiation_client_data_webhook_request_headers_value import ( ConversationInitiationClientDataWebhookRequestHeadersValue, ) from .conversation_initiation_source import ConversationInitiationSource from .conversation_initiation_source_info import ConversationInitiationSourceInfo from .conversation_product import ConversationProduct from .conversation_reasoning_model import ConversationReasoningModel from .conversation_sentiment_analysis import ConversationSentimentAnalysis from .conversation_sentiment_analysis_overall_label import ConversationSentimentAnalysisOverallLabel from .conversation_signed_url_response_model import ConversationSignedUrlResponseModel from .conversation_simulation_specification import ConversationSimulationSpecification from .conversation_source import ConversationSource from .conversation_summary_response_model import ConversationSummaryResponseModel from .conversation_summary_response_model_status import ConversationSummaryResponseModelStatus from .conversation_tag_response_model import ConversationTagResponseModel from .conversation_token_purpose import ConversationTokenPurpose from .conversation_token_response_model import ConversationTokenResponseModel from .conversation_tts_usage_model import ConversationTtsUsageModel from .conversation_turn_metrics import ConversationTurnMetrics from .conversation_user_response_model import ConversationUserResponseModel from .conversation_voice_reward_model import ConversationVoiceRewardModel from .conversation_voice_usage_model import ConversationVoiceUsageModel from .conversational_config import ConversationalConfig from .conversational_config_api_model_workflow_override_input import ( ConversationalConfigApiModelWorkflowOverrideInput, ) from .conversational_config_api_model_workflow_override_output import ( ConversationalConfigApiModelWorkflowOverrideOutput, ) from .convert_chapter_response_model import ConvertChapterResponseModel from .convert_project_response_model import ConvertProjectResponseModel from .crawl_status import CrawlStatus from .crawl_type import CrawlType from .create_agent_branch_response_model import CreateAgentBranchResponseModel from .create_agent_procedure_params import CreateAgentProcedureParams from .create_agent_response_model import CreateAgentResponseModel from .create_agent_rule_params import CreateAgentRuleParams from .create_agent_test_folder_response_model import CreateAgentTestFolderResponseModel from .create_agent_test_response_model import CreateAgentTestResponseModel from .create_asset_params import CreateAssetParams from .create_audio_native_project_request import CreateAudioNativeProjectRequest from .create_auth_connection_environment_variable_request import CreateAuthConnectionEnvironmentVariableRequest from .create_basic_auth_request import CreateBasicAuthRequest from .create_bearer_auth_request import CreateBearerAuthRequest from .create_client_appointment_params import CreateClientAppointmentParams from .create_client_interaction_params import CreateClientInteractionParams from .create_client_params import CreateClientParams from .create_crawl_job_response_model import CreateCrawlJobResponseModel from .create_custom_header_auth_request import CreateCustomHeaderAuthRequest from .create_exotel_phone_number_request import CreateExotelPhoneNumberRequest from .create_holiday_params import CreateHolidayParams from .create_location_params import CreateLocationParams from .create_mtls_auth_request import CreateMtlsAuthRequest from .create_o_auth_2_client_creds_request import CreateOAuth2ClientCredsRequest from .create_o_auth_2_jwt_request import CreateOAuth2JwtRequest from .create_o_auth_2_jwt_request_algorithm import CreateOAuth2JwtRequestAlgorithm from .create_o_auth_2_jwt_request_token_response_field import CreateOAuth2JwtRequestTokenResponseField from .create_order_request import CreateOrderRequest from .create_order_response import CreateOrderResponse from .create_phone_number_response_model import CreatePhoneNumberResponseModel from .create_previously_generated_voice_request import CreatePreviouslyGeneratedVoiceRequest from .create_private_key_jwt_request import CreatePrivateKeyJwtRequest from .create_private_key_jwt_request_algorithm import CreatePrivateKeyJwtRequestAlgorithm from .create_procedure_request_model import CreateProcedureRequestModel from .create_procedure_response_model import CreateProcedureResponseModel from .create_product_params import CreateProductParams from .create_pronunciation_dictionary_response_model import CreatePronunciationDictionaryResponseModel from .create_response_unit_test_request import CreateResponseUnitTestRequest from .create_secret_environment_variable_request import CreateSecretEnvironmentVariableRequest from .create_service_params import CreateServiceParams from .create_simulation_test_request import CreateSimulationTestRequest from .create_sip_trunk_phone_number_request import CreateSipTrunkPhoneNumberRequest from .create_staff_params import CreateStaffParams from .create_string_environment_variable_request import CreateStringEnvironmentVariableRequest from .create_tool_call_unit_test_request import CreateToolCallUnitTestRequest from .create_transcript_request import CreateTranscriptRequest from .create_transfer_rule_params import CreateTransferRuleParams from .create_twilio_phone_number_request import CreateTwilioPhoneNumberRequest from .criteria_scoring_mode import CriteriaScoringMode from .cue_options_request import CueOptionsRequest from .currency import Currency from .custom_guardrail_config import CustomGuardrailConfig from .custom_guardrail_config_model import CustomGuardrailConfigModel from .custom_guardrail_config_trigger_action import ( CustomGuardrailConfigTriggerAction, CustomGuardrailConfigTriggerAction_EndCall, CustomGuardrailConfigTriggerAction_Retry, ) from .custom_guardrail_input import CustomGuardrailInput from .custom_guardrail_output import CustomGuardrailOutput from .custom_guardrails_config_input import CustomGuardrailsConfigInput from .custom_guardrails_config_output import CustomGuardrailsConfigOutput from .custom_header_auth_response import CustomHeaderAuthResponse from .custom_llm import CustomLlm from .custom_llm_api_key import CustomLlmApiKey from .custom_llm_auth_connection import CustomLlmAuthConnection from .custom_llm_request_headers_value import CustomLlmRequestHeadersValue from .custom_llmapi_type import CustomLlmapiType from .custom_sip_header import CustomSipHeader from .custom_sip_header_with_dynamic_variable import CustomSipHeaderWithDynamicVariable from .custom_tool_api_schema_config import CustomToolApiSchemaConfig from .dashboard_call_success_chart_model import DashboardCallSuccessChartModel from .dashboard_criteria_chart_model import DashboardCriteriaChartModel from .dashboard_data_collection_chart_model import DashboardDataCollectionChartModel from .data_collection_result_common_model import DataCollectionResultCommonModel from .default_sharing_group_config import DefaultSharingGroupConfig from .default_sharing_group_config_permission_level import DefaultSharingGroupConfigPermissionLevel from .default_sharing_group_response_model import DefaultSharingGroupResponseModel from .default_sharing_group_response_model_permission_level import DefaultSharingGroupResponseModelPermissionLevel from .delete_agent_procedure_params import DeleteAgentProcedureParams from .delete_agent_rule_params import DeleteAgentRuleParams from .delete_asset_params import DeleteAssetParams from .delete_calendar_event_params import DeleteCalendarEventParams from .delete_chapter_request import DeleteChapterRequest from .delete_chapter_response_model import DeleteChapterResponseModel from .delete_client_interaction_params import DeleteClientInteractionParams from .delete_client_params import DeleteClientParams from .delete_dubbing_response_model import DeleteDubbingResponseModel from .delete_group_session_params import DeleteGroupSessionParams from .delete_history_item_response import DeleteHistoryItemResponse from .delete_holiday_params import DeleteHolidayParams from .delete_location_params import DeleteLocationParams from .delete_product_params import DeleteProductParams from .delete_project_request import DeleteProjectRequest from .delete_project_response_model import DeleteProjectResponseModel from .delete_sample_response import DeleteSampleResponse from .delete_service_params import DeleteServiceParams from .delete_staff_params import DeleteStaffParams from .delete_transfer_rule_params import DeleteTransferRuleParams 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_webhook_response_model import DeleteWorkspaceWebhookResponseModel from .deliverable_info import DeliverableInfo from .dependent_available_agent_identifier import DependentAvailableAgentIdentifier from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel from .dependent_available_mcp_server_identifier import DependentAvailableMcpServerIdentifier from .dependent_available_mcp_server_identifier_access_level import DependentAvailableMcpServerIdentifierAccessLevel from .dependent_available_tool_identifier import DependentAvailableToolIdentifier from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel from .dependent_branch_info import DependentBranchInfo from .dependent_integration_connection_identifier import DependentIntegrationConnectionIdentifier from .dependent_phone_number_identifier import DependentPhoneNumberIdentifier from .dependent_unknown_agent_identifier import DependentUnknownAgentIdentifier from .dependent_unknown_mcp_server_identifier import DependentUnknownMcpServerIdentifier from .dependent_unknown_tool_identifier import DependentUnknownToolIdentifier from .detailed_music_response import DetailedMusicResponse from .detailed_music_response_composition_plan import DetailedMusicResponseCompositionPlan from .detected_entity import DetectedEntity from .device_model import DeviceModel from .dialogue_input import DialogueInput from .dialogue_input_response_model import DialogueInputResponseModel from .dialogue_text_alignment import DialogueTextAlignment from .direct_publishing_read_response_model import DirectPublishingReadResponseModel from .direct_publishing_read_response_model_display_mode import DirectPublishingReadResponseModelDisplayMode from .direct_publishing_read_response_model_genre_item import DirectPublishingReadResponseModelGenreItem from .direct_publishing_read_response_model_payout_type import DirectPublishingReadResponseModelPayoutType from .direct_publishing_read_response_model_target_audience import DirectPublishingReadResponseModelTargetAudience from .discount_response_model import DiscountResponseModel from .do_dubbing_response import DoDubbingResponse from .document_usage_mode_enum import DocumentUsageModeEnum from .docx_export_options import DocxExportOptions from .dtmf_input_config import DtmfInputConfig from .dub_order_item_request import DubOrderItemRequest from .dubbed_segment import DubbedSegment from .dubbing_bulk_source_segment_update_response import DubbingBulkSourceSegmentUpdateResponse from .dubbing_bulk_target_segment_update_response import DubbingBulkTargetSegmentUpdateResponse from .dubbing_error import DubbingError from .dubbing_language_list_response import DubbingLanguageListResponse from .dubbing_language_outputs import DubbingLanguageOutputs from .dubbing_language_response import DubbingLanguageResponse from .dubbing_language_response_status import DubbingLanguageResponseStatus from .dubbing_media_metadata import DubbingMediaMetadata from .dubbing_media_reference import DubbingMediaReference from .dubbing_metadata_page_response_model import DubbingMetadataPageResponseModel from .dubbing_metadata_response import DubbingMetadataResponse from .dubbing_project_list_response import DubbingProjectListResponse from .dubbing_project_response import DubbingProjectResponse from .dubbing_project_response_status import DubbingProjectResponseStatus from .dubbing_regenerate_response import DubbingRegenerateResponse from .dubbing_render_response_model import DubbingRenderResponseModel from .dubbing_resource import DubbingResource from .dubbing_segment_update_request import DubbingSegmentUpdateRequest from .dubbing_source_media_info import DubbingSourceMediaInfo from .dubbing_source_segment_update_response import DubbingSourceSegmentUpdateResponse from .dubbing_source_transcript_response import DubbingSourceTranscriptResponse from .dubbing_target_segment_update_request import DubbingTargetSegmentUpdateRequest from .dubbing_target_segment_update_response import DubbingTargetSegmentUpdateResponse from .dubbing_target_transcript_response import DubbingTargetTranscriptResponse from .dubbing_target_transcript_segment import DubbingTargetTranscriptSegment from .dubbing_transcript import DubbingTranscript from .dubbing_transcript_character import DubbingTranscriptCharacter from .dubbing_transcript_response_model import DubbingTranscriptResponseModel from .dubbing_transcript_revision_response import DubbingTranscriptRevisionResponse from .dubbing_transcript_segment import DubbingTranscriptSegment from .dubbing_transcript_utterance import DubbingTranscriptUtterance from .dubbing_transcript_word import DubbingTranscriptWord from .dubbing_transcripts_response_model import DubbingTranscriptsResponseModel from .dubbing_transcripts_response_model_transcript_format import DubbingTranscriptsResponseModelTranscriptFormat from .dummy_tool_result_model import DummyToolResultModel from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variable_nested_value_type_input import DynamicVariableNestedValueTypeInput from .dynamic_variable_nested_value_type_output import DynamicVariableNestedValueTypeOutput from .dynamic_variable_schema_override import DynamicVariableSchemaOverride from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel from .dynamic_variables_config import DynamicVariablesConfig from .dynamic_variables_config_workflow_override import DynamicVariablesConfigWorkflowOverride from .edit_chapter_response_model import EditChapterResponseModel from .edit_project_response_model import EditProjectResponseModel from .edit_voice_response_model import EditVoiceResponseModel from .edit_voice_settings_request import EditVoiceSettingsRequest 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 .end_call_tool_result_model import EndCallToolResultModel from .end_call_trigger_action import EndCallTriggerAction from .end_procedure_tool_config_input import EndProcedureToolConfigInput from .end_procedure_tool_config_output import EndProcedureToolConfigOutput from .end_procedure_tool_error_status import EndProcedureToolErrorStatus from .entity_management_activity_id import EntityManagementActivityId from .entry_behavior import EntryBehavior from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator from .environment_variable_auth_connection_value import EnvironmentVariableAuthConnectionValue from .environment_variable_auth_connection_value_request import EnvironmentVariableAuthConnectionValueRequest from .environment_variable_response import EnvironmentVariableResponse from .environment_variable_response_type import EnvironmentVariableResponseType from .environment_variable_response_values import EnvironmentVariableResponseValues from .environment_variable_secret_value import EnvironmentVariableSecretValue from .environment_variable_secret_value_request import EnvironmentVariableSecretValueRequest from .environment_variables_list_response import EnvironmentVariablesListResponse from .error_payload import ErrorPayload from .evaluation_criteria_summary_result import EvaluationCriteriaSummaryResult from .evaluation_settings_input import EvaluationSettingsInput from .evaluation_settings_output import EvaluationSettingsOutput from .evaluation_success_result import EvaluationSuccessResult from .exact_parameter_evaluation_strategy import ExactParameterEvaluationStrategy from .exotel_api_subdomain import ExotelApiSubdomain from .exotel_outbound_call_response import ExotelOutboundCallResponse from .export_options import ( ExportOptions, ExportOptions_Docx, ExportOptions_Html, ExportOptions_Pdf, ExportOptions_SegmentedJson, ExportOptions_Srt, ExportOptions_Txt, ) from .external_file_sync_info import ExternalFileSyncInfo from .external_folder_sync_info import ExternalFolderSyncInfo from .external_sync_job_trigger import ExternalSyncJobTrigger from .external_sync_job_type import ExternalSyncJobType from .external_sync_provider import ExternalSyncProvider from .feature_status_common_model import FeatureStatusCommonModel from .features_usage_common_model import FeaturesUsageCommonModel from .feedback_item import FeedbackItem from .field_conflict import FieldConflict from .file_input_config import FileInputConfig from .file_input_config_workflow_override import FileInputConfigWorkflowOverride from .file_refresh_status import FileRefreshStatus from .final_output import FinalOutput from .final_output_multi import FinalOutputMulti from .final_transcript import FinalTranscript from .final_transcript_with_timestamps import FinalTranscriptWithTimestamps from .final_transcript_with_timestamps_words_item import FinalTranscriptWithTimestampsWordsItem from .final_transcript_with_timestamps_words_item_characters_item import ( FinalTranscriptWithTimestampsWordsItemCharactersItem, ) from .final_transcript_with_timestamps_words_item_type import FinalTranscriptWithTimestampsWordsItemType from .fine_tuning_response import FineTuningResponse from .fine_tuning_response_state_value import FineTuningResponseStateValue from .finetune_created_by import FinetuneCreatedBy from .finetune_visibility import FinetuneVisibility from .flush_context import FlushContext from .focus_guardrail import FocusGuardrail from .forced_alignment_character_response_model import ForcedAlignmentCharacterResponseModel from .forced_alignment_response_model import ForcedAlignmentResponseModel from .forced_alignment_word_response_model import ForcedAlignmentWordResponseModel from .frustrated_conversation_ref import FrustratedConversationRef from .frustrated_conversation_ref_overall_label import FrustratedConversationRefOverallLabel from .gender import Gender from .generate_voice_request import GenerateVoiceRequest from .generation_chunk_input import GenerationChunkInput from .generation_chunk_input_condition_strength import GenerationChunkInputConditionStrength from .generation_chunk_input_context_adherence import GenerationChunkInputContextAdherence from .generation_chunk_output import GenerationChunkOutput from .generation_chunk_output_condition_strength import GenerationChunkOutputConditionStrength from .generation_chunk_output_context_adherence import GenerationChunkOutputContextAdherence from .generation_config import GenerationConfig from .generation_source_context import GenerationSourceContext from .genesys_bot_outcome import GenesysBotOutcome from .genesys_region import GenesysRegion from .get_agent_embed_response_model import GetAgentEmbedResponseModel from .get_agent_knowledgebase_size_response_model import GetAgentKnowledgebaseSizeResponseModel from .get_agent_link_response_model import GetAgentLinkResponseModel from .get_agent_response_model import GetAgentResponseModel from .get_agent_response_model_phone_numbers_item import ( GetAgentResponseModelPhoneNumbersItem, GetAgentResponseModelPhoneNumbersItem_Exotel, GetAgentResponseModelPhoneNumbersItem_SipTrunk, GetAgentResponseModelPhoneNumbersItem_Twilio, ) from .get_agent_test_folder_response_model import GetAgentTestFolderResponseModel from .get_agent_topics_response_model import GetAgentTopicsResponseModel from .get_agents_page_response_model import GetAgentsPageResponseModel from .get_analytics_summary_params import GetAnalyticsSummaryParams from .get_appointment_by_confirmation_number_params import GetAppointmentByConfirmationNumberParams from .get_audio_isolation_history_response_model import GetAudioIsolationHistoryResponseModel from .get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel from .get_booking_page_settings_params import GetBookingPageSettingsParams from .get_booking_slug_status_params import GetBookingSlugStatusParams from .get_chapter_request import GetChapterRequest from .get_chapter_snapshots_request import GetChapterSnapshotsRequest from .get_chapters_request import GetChaptersRequest from .get_chapters_response import GetChaptersResponse from .get_client_appointments_params import GetClientAppointmentsParams from .get_client_by_phone_params import GetClientByPhoneParams from .get_conv_ai_dashboard_settings_response_model import GetConvAiDashboardSettingsResponseModel from .get_conv_ai_dashboard_settings_response_model_charts_item import ( GetConvAiDashboardSettingsResponseModelChartsItem, GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, ) from .get_conv_ai_settings_response_model import GetConvAiSettingsResponseModel from .get_conversation_response_model import GetConversationResponseModel from .get_conversation_response_model_status import GetConversationResponseModelStatus from .get_conversation_tags_page_response_model import GetConversationTagsPageResponseModel from .get_conversation_users_page_response_model import GetConversationUsersPageResponseModel from .get_conversations_page_response_model import GetConversationsPageResponseModel from .get_crawl_job_response_model import GetCrawlJobResponseModel from .get_knowledge_base_dependent_agents_response_model import GetKnowledgeBaseDependentAgentsResponseModel from .get_knowledge_base_dependent_agents_response_model_agents_item import ( GetKnowledgeBaseDependentAgentsResponseModelAgentsItem, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown, ) from .get_knowledge_base_file_response_model import GetKnowledgeBaseFileResponseModel from .get_knowledge_base_folder_response_model import GetKnowledgeBaseFolderResponseModel from .get_knowledge_base_list_response_model import GetKnowledgeBaseListResponseModel from .get_knowledge_base_list_response_model_documents_item import ( GetKnowledgeBaseListResponseModelDocumentsItem, GetKnowledgeBaseListResponseModelDocumentsItem_File, GetKnowledgeBaseListResponseModelDocumentsItem_Folder, GetKnowledgeBaseListResponseModelDocumentsItem_Text, GetKnowledgeBaseListResponseModelDocumentsItem_Url, ) from .get_knowledge_base_summary_file_response_model import GetKnowledgeBaseSummaryFileResponseModel from .get_knowledge_base_summary_file_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown, ) from .get_knowledge_base_summary_folder_response_model import GetKnowledgeBaseSummaryFolderResponseModel from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown, ) from .get_knowledge_base_summary_text_response_model import GetKnowledgeBaseSummaryTextResponseModel from .get_knowledge_base_summary_text_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown, ) from .get_knowledge_base_summary_url_response_model import GetKnowledgeBaseSummaryUrlResponseModel from .get_knowledge_base_summary_url_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown, ) from .get_knowledge_base_text_response_model import GetKnowledgeBaseTextResponseModel from .get_knowledge_base_url_response_model import GetKnowledgeBaseUrlResponseModel from .get_library_voices_response import GetLibraryVoicesResponse from .get_live_count_response import GetLiveCountResponse from .get_or_create_rag_index_request_model import GetOrCreateRagIndexRequestModel from .get_phone_number_exotel_response_model import GetPhoneNumberExotelResponseModel from .get_phone_number_inbound_sip_trunk_config_response_model import ( GetPhoneNumberInboundSipTrunkConfigResponseModel, ) from .get_phone_number_outbound_sip_trunk_config_response_model import ( GetPhoneNumberOutboundSipTrunkConfigResponseModel, ) from .get_phone_number_response import GetPhoneNumberResponse from .get_phone_number_sip_trunk_response_model import GetPhoneNumberSipTrunkResponseModel from .get_phone_number_twilio_response_model import GetPhoneNumberTwilioResponseModel from .get_project_request import GetProjectRequest from .get_projects_request import GetProjectsRequest from .get_projects_response import GetProjectsResponse from .get_pronunciation_dictionaries_metadata_response_model import ( GetPronunciationDictionariesMetadataResponseModel, ) from .get_pronunciation_dictionaries_response import GetPronunciationDictionariesResponse from .get_pronunciation_dictionary_metadata_response import GetPronunciationDictionaryMetadataResponse from .get_pronunciation_dictionary_metadata_response_permission_on_resource import ( GetPronunciationDictionaryMetadataResponsePermissionOnResource, ) from .get_pronunciation_dictionary_response import GetPronunciationDictionaryResponse from .get_pronunciation_dictionary_with_rules_response_model import GetPronunciationDictionaryWithRulesResponseModel from .get_pronunciation_dictionary_with_rules_response_model_permission_on_resource import ( GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource, ) from .get_pronunciation_dictionary_with_rules_response_model_rules_item import ( GetPronunciationDictionaryWithRulesResponseModelRulesItem, GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias, GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme, ) from .get_response_unit_test_response_model import GetResponseUnitTestResponseModel from .get_schedule_params import GetScheduleParams from .get_secret_dependencies_response_model import GetSecretDependenciesResponseModel from .get_secret_dependencies_response_model_dependencies import GetSecretDependenciesResponseModelDependencies from .get_secret_dependencies_response_model_dependencies_one_item import ( GetSecretDependenciesResponseModelDependenciesOneItem, GetSecretDependenciesResponseModelDependenciesOneItem_Available, GetSecretDependenciesResponseModelDependenciesOneItem_Unknown, ) from .get_secret_dependencies_response_model_dependencies_zero_item import ( GetSecretDependenciesResponseModelDependenciesZeroItem, GetSecretDependenciesResponseModelDependenciesZeroItem_Available, GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown, ) from .get_simulation_test_response_model import GetSimulationTestResponseModel from .get_sip_log_messages_response import GetSipLogMessagesResponse from .get_speech_history_response import GetSpeechHistoryResponse from .get_test_invocations_page_response_model import GetTestInvocationsPageResponseModel from .get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel from .get_tests_page_response_model import GetTestsPageResponseModel from .get_tests_summaries_by_ids_response_model import GetTestsSummariesByIdsResponseModel from .get_tool_call_unit_test_response_model import GetToolCallUnitTestResponseModel from .get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel from .get_tool_dependent_agents_response_model_agents_item import ( GetToolDependentAgentsResponseModelAgentsItem, GetToolDependentAgentsResponseModelAgentsItem_Available, GetToolDependentAgentsResponseModelAgentsItem_Unknown, ) from .get_tool_executions_page_response_model import GetToolExecutionsPageResponseModel from .get_voice_accents_response_model import GetVoiceAccentsResponseModel from .get_voices_response import GetVoicesResponse from .get_voices_v_2_response import GetVoicesV2Response from .get_whats_app_account_response import GetWhatsAppAccountResponse from .get_workspace_secrets_response_model import GetWorkspaceSecretsResponseModel from .group_management_activity_id import GroupManagementActivityId from .guardrail_execution_mode import GuardrailExecutionMode from .guardrail_type import GuardrailType from .guardrails_v_1_input import GuardrailsV1Input from .guardrails_v_1_output import GuardrailsV1Output from .history_alignment_response_model import HistoryAlignmentResponseModel from .history_alignments_response_model import HistoryAlignmentsResponseModel from .history_item_response import HistoryItemResponse from .html_export_options import HtmlExportOptions from .http_request_model import HttpRequestModel from .http_validation_error import HttpValidationError from .icon import Icon from .image_analysis import ImageAnalysis from .image_analysis_result import ImageAnalysisResult from .image_analysis_status import ImageAnalysisStatus from .image_avatar import ImageAvatar from .image_subject import ImageSubject from .inbound_sip_trunk_config_request_model import InboundSipTrunkConfigRequestModel from .init_payload import InitPayload from .initialise_context import InitialiseContext from .initialize_connection import InitializeConnection from .initialize_connection_multi import InitializeConnectionMulti from .input_audio_chunk_payload import InputAudioChunkPayload from .integration_type import IntegrationType from .interaction_budget import InteractionBudget from .internal_alerting_webhook_notifier import InternalAlertingWebhookNotifier from .invoice_response import InvoiceResponse from .invoice_response_payment_intent_status import InvoiceResponsePaymentIntentStatus from .invoice_response_payment_intent_statusses_item import InvoiceResponsePaymentIntentStatussesItem from .item_id import ItemId from .kb_external_sync_job import KbExternalSyncJob from .keep_context_alive import KeepContextAlive from .knowledge_base_bulk_delete_successful_response_model import KnowledgeBaseBulkDeleteSuccessfulResponseModel from .knowledge_base_content_search_response_model import KnowledgeBaseContentSearchResponseModel from .knowledge_base_content_search_result import KnowledgeBaseContentSearchResult from .knowledge_base_content_search_result_document import ( KnowledgeBaseContentSearchResultDocument, KnowledgeBaseContentSearchResultDocument_File, KnowledgeBaseContentSearchResultDocument_Folder, KnowledgeBaseContentSearchResultDocument_Text, KnowledgeBaseContentSearchResultDocument_Url, ) from .knowledge_base_deleted_response_model import KnowledgeBaseDeletedResponseModel from .knowledge_base_dependent_type import KnowledgeBaseDependentType from .knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel from .knowledge_base_document_chunks_response_model import KnowledgeBaseDocumentChunksResponseModel from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_document_type import KnowledgeBaseDocumentType from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .knowledge_base_locator import KnowledgeBaseLocator from .knowledge_base_rag_chunk_model import KnowledgeBaseRagChunkModel from .knowledge_base_rag_tool_config import KnowledgeBaseRagToolConfig from .knowledge_base_rag_tool_result_model import KnowledgeBaseRagToolResultModel from .knowledge_base_rag_tool_status import KnowledgeBaseRagToolStatus from .knowledge_base_sort_by import KnowledgeBaseSortBy from .knowledge_base_source_file_url_response_model import KnowledgeBaseSourceFileUrlResponseModel from .knowledge_base_summary_batch_successful_response_model import KnowledgeBaseSummaryBatchSuccessfulResponseModel from .knowledge_base_summary_batch_successful_response_model_data import ( KnowledgeBaseSummaryBatchSuccessfulResponseModelData, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url, ) from .knowledge_base_tool_config import KnowledgeBaseToolConfig from .knowledge_base_tool_info import KnowledgeBaseToolInfo from .knowledge_base_tool_result_model import KnowledgeBaseToolResultModel from .knowledge_base_tool_status import KnowledgeBaseToolStatus from .language_added_response import LanguageAddedResponse from .language_detection_tool_config import LanguageDetectionToolConfig from .language_detection_tool_result_model import LanguageDetectionToolResultModel from .language_info import LanguageInfo from .language_pair_info import LanguagePairInfo from .language_preset_input import LanguagePresetInput from .language_preset_output import LanguagePresetOutput from .language_preset_translation import LanguagePresetTranslation from .language_response import LanguageResponse from .languages_response import LanguagesResponse, LanguagesResponse_Pair, LanguagesResponse_Single from .leave_message_params import LeaveMessageParams from .library_voice_response import LibraryVoiceResponse from .library_voice_response_category import LibraryVoiceResponseCategory from .list_agent_procedures_params import ListAgentProceduresParams from .list_agent_references_params import ListAgentReferencesParams from .list_agent_rules_params import ListAgentRulesParams from .list_assets_params import ListAssetsParams from .list_auth_connections_response import ListAuthConnectionsResponse from .list_auth_connections_response_auth_connections_item import ( ListAuthConnectionsResponseAuthConnectionsItem, ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode, ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp, ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth, ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth, ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth, ListAuthConnectionsResponseAuthConnectionsItem_Mtls, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt, ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt, ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth, ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth, ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret, ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth, ) from .list_calendar_events_params import ListCalendarEventsParams from .list_client_interactions_params import ListClientInteractionsParams from .list_clients_params import ListClientsParams from .list_crawl_jobs_response_model import ListCrawlJobsResponseModel from .list_customer_facing_agents_params import ListCustomerFacingAgentsParams from .list_group_sessions_params import ListGroupSessionsParams from .list_holidays_params import ListHolidaysParams from .list_locations_params import ListLocationsParams from .list_mcp_tools_response_model import ListMcpToolsResponseModel from .list_orders_response import ListOrdersResponse from .list_procedures_response_model import ListProceduresResponseModel from .list_products_params import ListProductsParams from .list_response_agent_branch_summary import ListResponseAgentBranchSummary from .list_response_meta import ListResponseMeta from .list_services_params import ListServicesParams from .list_speech_engines_response import ListSpeechEnginesResponse from .list_staff_params import ListStaffParams from .list_transfer_rules_params import ListTransferRulesParams from .list_whats_app_accounts_response import ListWhatsAppAccountsResponse from .literal_json_schema_property import LiteralJsonSchemaProperty from .literal_json_schema_property_constant_value import LiteralJsonSchemaPropertyConstantValue from .literal_json_schema_property_type import LiteralJsonSchemaPropertyType from .livekit_stack_type import LivekitStackType from .llm import Llm from .llm_category_usage import LlmCategoryUsage from .llm_deprecation_config_model import LlmDeprecationConfigModel from .llm_deprecation_info_model import LlmDeprecationInfoModel from .llm_info_model_input import LlmInfoModelInput from .llm_info_model_output import LlmInfoModelOutput from .llm_input_output_tokens_usage import LlmInputOutputTokensUsage from .llm_list_response_model_input import LlmListResponseModelInput from .llm_list_response_model_output import LlmListResponseModelOutput from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty from .llm_literal_json_schema_property_type import LlmLiteralJsonSchemaPropertyType from .llm_parameter_evaluation_strategy import LlmParameterEvaluationStrategy from .llm_reasoning_effort import LlmReasoningEffort from .llm_schema_override import LlmSchemaOverride from .llm_tokens_category_usage import LlmTokensCategoryUsage from .llm_usage_calculator_llm_response_model import LlmUsageCalculatorLlmResponseModel from .llm_usage_calculator_response_model import LlmUsageCalculatorResponseModel from .llm_usage_input import LlmUsageInput from .llm_usage_output import LlmUsageOutput from .load_memory_entry_tool_error_status import LoadMemoryEntryToolErrorStatus from .loadable_memory_entry import LoadableMemoryEntry from .lock_reason import LockReason from .manual_source import ManualSource from .manual_verification_file_response import ManualVerificationFileResponse from .manual_verification_response import ManualVerificationResponse from .match_anything_parameter_evaluation_strategy import MatchAnythingParameterEvaluationStrategy from .mcp_approval_policy import McpApprovalPolicy from .mcp_server_config_input import McpServerConfigInput from .mcp_server_config_input_auth_connection import McpServerConfigInputAuthConnection from .mcp_server_config_input_request_headers_value import McpServerConfigInputRequestHeadersValue from .mcp_server_config_input_request_meta_value import McpServerConfigInputRequestMetaValue from .mcp_server_config_input_secret_token import McpServerConfigInputSecretToken from .mcp_server_config_input_url import McpServerConfigInputUrl from .mcp_server_config_output import McpServerConfigOutput from .mcp_server_config_output_auth_connection import McpServerConfigOutputAuthConnection from .mcp_server_config_output_request_headers_value import McpServerConfigOutputRequestHeadersValue from .mcp_server_config_output_request_meta_value import McpServerConfigOutputRequestMetaValue from .mcp_server_config_output_secret_token import McpServerConfigOutputSecretToken from .mcp_server_config_output_url import McpServerConfigOutputUrl from .mcp_server_metadata_response_model import McpServerMetadataResponseModel from .mcp_server_response_model import McpServerResponseModel from .mcp_server_response_model_dependent_agents_item import ( McpServerResponseModelDependentAgentsItem, McpServerResponseModelDependentAgentsItem_Available, McpServerResponseModelDependentAgentsItem_Unknown, ) from .mcp_server_transport import McpServerTransport from .mcp_servers_response_model import McpServersResponseModel from .mcp_tool_approval_hash import McpToolApprovalHash from .mcp_tool_approval_policy import McpToolApprovalPolicy from .mcp_tool_config_override_input import McpToolConfigOverrideInput from .mcp_tool_config_override_input_input_overrides_value import ( McpToolConfigOverrideInputInputOverridesValue, McpToolConfigOverrideInputInputOverridesValue_Constant, McpToolConfigOverrideInputInputOverridesValue_DynamicVariable, McpToolConfigOverrideInputInputOverridesValue_Llm, McpToolConfigOverrideInputInputOverridesValue_Omit, ) from .mcp_tool_config_override_input_tool_call_sound import McpToolConfigOverrideInputToolCallSound from .mcp_tool_config_override_output import McpToolConfigOverrideOutput from .mcp_tool_config_override_output_input_overrides_value import ( McpToolConfigOverrideOutputInputOverridesValue, McpToolConfigOverrideOutputInputOverridesValue_Constant, McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable, McpToolConfigOverrideOutputInputOverridesValue_Llm, McpToolConfigOverrideOutputInputOverridesValue_Omit, ) from .mcp_tool_config_override_output_tool_call_sound import McpToolConfigOverrideOutputToolCallSound from .media_codec import MediaCodec from .media_id import MediaId from .memory_entry_search_result import MemoryEntrySearchResult from .memory_entry_search_result_source import MemoryEntrySearchResultSource from .merge_preview_response_model import MergePreviewResponseModel from .merge_preview_response_model_phone_numbers_item import ( MergePreviewResponseModelPhoneNumbersItem, MergePreviewResponseModelPhoneNumbersItem_Exotel, MergePreviewResponseModelPhoneNumbersItem_SipTrunk, MergePreviewResponseModelPhoneNumbersItem_Twilio, ) from .message_search_sort_by import MessageSearchSortBy from .messages_search_response import MessagesSearchResponse from .messages_search_result import MessagesSearchResult from .metric_record import MetricRecord from .metric_type import MetricType from .mock_no_match_behavior import MockNoMatchBehavior from .mocking_strategy import MockingStrategy from .model import Model from .model_rates_response_model import ModelRatesResponseModel from .model_settings_response_model import ModelSettingsResponseModel from .moderation_config import ModerationConfig from .moderation_guardrail_input import ModerationGuardrailInput from .moderation_guardrail_output import ModerationGuardrailOutput from .mtls_auth_response import MtlsAuthResponse from .multichannel_speech_to_text_response_model import MultichannelSpeechToTextResponseModel from .multipart_music_response import MultipartMusicResponse from .music_allowed_output_formats import MusicAllowedOutputFormats from .music_explore_song_source_context import MusicExploreSongSourceContext from .music_finetune_failure_reason import MusicFinetuneFailureReason from .music_finetune_page_response_model import MusicFinetunePageResponseModel from .music_finetune_response_model import MusicFinetuneResponseModel from .music_finetune_status import MusicFinetuneStatus from .music_generation_mode import MusicGenerationMode from .music_only_output_formats import MusicOnlyOutputFormats from .music_output_format import MusicOutputFormat from .music_prompt import MusicPrompt from .music_upload_response import MusicUploadResponse from .music_upload_response_composition_plan import MusicUploadResponseCompositionPlan from .non_streaming_output_formats import NonStreamingOutputFormats from .normalized_alignment import NormalizedAlignment from .numeric_distribution_aggregate import NumericDistributionAggregate from .o_auth_2_client_creds_response import OAuth2ClientCredsResponse from .o_auth_2_jwt_response import OAuth2JwtResponse from .o_auth_2_jwt_response_algorithm import OAuth2JwtResponseAlgorithm from .o_auth_2_jwt_response_token_response_field import OAuth2JwtResponseTokenResponseField from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue from .object_json_schema_property_input_property_kind import ObjectJsonSchemaPropertyInputPropertyKind from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue from .omit_schema_override import OmitSchemaOverride from .open_ai_audio_format import OpenAiAudioFormat from .opener_config import OpenerConfig from .opt_in_sms_reminder_params import OptInSmsReminderParams from .opt_out_sms_reminder_params import OptOutSmsReminderParams from .orb_avatar import OrbAvatar from .orchestrator_tool_mock_behavior_config import OrchestratorToolMockBehaviorConfig from .order_deliverables_response import OrderDeliverablesResponse from .order_id import OrderId from .order_item_info import OrderItemInfo from .order_item_kind import OrderItemKind from .order_item_request_input import ( OrderItemRequestInput, OrderItemRequestInput_Dub, OrderItemRequestInput_Subtitles, OrderItemRequestInput_Transcription, ) from .order_item_request_output import ( OrderItemRequestOutput, OrderItemRequestOutput_Dub, OrderItemRequestOutput_Subtitles, OrderItemRequestOutput_Transcription, ) from .order_media_response import OrderMediaResponse from .order_response import OrderResponse from .order_state import OrderState from .order_summary import OrderSummary from .outbound_call_recipient import OutboundCallRecipient from .outbound_call_recipient_response_model import OutboundCallRecipientResponseModel from .outbound_sip_trunk_config_request_model import OutboundSipTrunkConfigRequestModel from .output_format import OutputFormat from .paired_languages_response import PairedLanguagesResponse from .partial_transcript_payload import PartialTranscriptPayload from .patch_workspace_webhook_response_model import PatchWorkspaceWebhookResponseModel from .pdf_export_options import PdfExportOptions from .pending_blocks_metadata_model import PendingBlocksMetadataModel from .pending_cancellation_response_model import PendingCancellationResponseModel from .pending_clip_task import PendingClipTask from .pending_clip_task_type import PendingClipTaskType from .pending_external_audios_metadata_model import PendingExternalAudiosMetadataModel from .pending_subscription_switch_response_model import PendingSubscriptionSwitchResponseModel from .pending_subscription_switch_response_model_next_tier import PendingSubscriptionSwitchResponseModelNextTier from .permission_type import PermissionType from .phone_number_agent_info import PhoneNumberAgentInfo from .phone_number_dynamic_variable_transfer_destination import PhoneNumberDynamicVariableTransferDestination from .phone_number_transfer import PhoneNumberTransfer from .phone_number_transfer_custom_sip_headers_item import ( PhoneNumberTransferCustomSipHeadersItem, PhoneNumberTransferCustomSipHeadersItem_Dynamic, PhoneNumberTransferCustomSipHeadersItem_Static, ) from .phone_number_transfer_destination import PhoneNumberTransferDestination from .phone_number_transfer_post_dial_digits import ( PhoneNumberTransferPostDialDigits, PhoneNumberTransferPostDialDigits_Dynamic, PhoneNumberTransferPostDialDigits_Static, ) from .phone_number_transfer_transfer_destination import ( PhoneNumberTransferTransferDestination, PhoneNumberTransferTransferDestination_Phone, PhoneNumberTransferTransferDestination_PhoneDynamicVariable, PhoneNumberTransferTransferDestination_SipUri, PhoneNumberTransferTransferDestination_SipUriDynamicVariable, ) from .ping_payload import PingPayload from .platform_category import PlatformCategory from .platform_category_usage import PlatformCategoryUsage from .platform_usage import PlatformUsage from .play_dtmf_result_error_model import PlayDtmfResultErrorModel from .play_dtmf_result_success_model import PlayDtmfResultSuccessModel from .play_dtmf_tool_config import PlayDtmfToolConfig from .podcast_bulletin_mode import PodcastBulletinMode from .podcast_bulletin_mode_data import PodcastBulletinModeData from .podcast_conversation_mode import PodcastConversationMode from .podcast_conversation_mode_data import PodcastConversationModeData from .podcast_project_response_model import PodcastProjectResponseModel from .podcast_text_source import PodcastTextSource from .podcast_url_source import PodcastUrlSource from .pong_payload import PongPayload from .position_input import PositionInput from .position_output import PositionOutput from .post_agent_avatar_response_model import PostAgentAvatarResponseModel from .post_dial_digits_dynamic_variable import PostDialDigitsDynamicVariable from .post_dial_digits_static import PostDialDigitsStatic from .post_workspace_secret_response_model import PostWorkspaceSecretResponseModel from .pre_tool_speech_mode import PreToolSpeechMode from .preview_audio_db_model import PreviewAudioDbModel from .price import Price from .privacy_config_input import PrivacyConfigInput from .privacy_config_output import PrivacyConfigOutput from .private_key_jwt_response import PrivateKeyJwtResponse from .private_key_jwt_response_algorithm import PrivateKeyJwtResponseAlgorithm from .procedure_at_version_input import ProcedureAtVersionInput from .procedure_at_version_output import ProcedureAtVersionOutput from .procedure_at_version_response_model import ProcedureAtVersionResponseModel from .procedure_draft_response_model import ProcedureDraftResponseModel from .procedure_list_item_response_model import ProcedureListItemResponseModel from .procedure_ref_response_model import ProcedureRefResponseModel from .procedure_type import ProcedureType from .procedure_validation_error import ProcedureValidationError from .project_creation_meta_response_model import ProjectCreationMetaResponseModel from .project_creation_meta_response_model_status import ProjectCreationMetaResponseModelStatus from .project_creation_meta_type import ProjectCreationMetaType from .project_extended_response import ProjectExtendedResponse from .project_extended_response_access_level import ProjectExtendedResponseAccessLevel from .project_extended_response_apply_text_normalization import ProjectExtendedResponseApplyTextNormalization from .project_extended_response_aspect_ratio import ProjectExtendedResponseAspectRatio from .project_extended_response_assets_item import ( ProjectExtendedResponseAssetsItem, ProjectExtendedResponseAssetsItem_Audio, ProjectExtendedResponseAssetsItem_Image, ProjectExtendedResponseAssetsItem_Video, ) from .project_extended_response_fiction import ProjectExtendedResponseFiction from .project_extended_response_source_type import ProjectExtendedResponseSourceType from .project_extended_response_target_audience import ProjectExtendedResponseTargetAudience from .project_external_audio_response_model import ProjectExternalAudioResponseModel from .project_external_audio_response_model_source_context import ( ProjectExternalAudioResponseModelSourceContext, ProjectExternalAudioResponseModelSourceContext_MusicExploreSong, ProjectExternalAudioResponseModelSourceContext_Sfx, ProjectExternalAudioResponseModelSourceContext_Song, ) from .project_image_response_model import ProjectImageResponseModel from .project_muted_tracks_response_model import ProjectMutedTracksResponseModel from .project_response import ProjectResponse from .project_response_access_level import ProjectResponseAccessLevel from .project_response_aspect_ratio import ProjectResponseAspectRatio from .project_response_fiction import ProjectResponseFiction from .project_response_source_type import ProjectResponseSourceType from .project_response_target_audience import ProjectResponseTargetAudience from .project_snapshot_extended_response_model import ProjectSnapshotExtendedResponseModel from .project_snapshot_response import ProjectSnapshotResponse from .project_snapshots_response import ProjectSnapshotsResponse from .project_state import ProjectState from .project_video_response_model import ProjectVideoResponseModel from .project_video_thumbnail_sheet_response_model import ProjectVideoThumbnailSheetResponseModel from .project_voice_response_model import ProjectVoiceResponseModel from .prompt_agent import PromptAgent from .prompt_agent_api_model_input import PromptAgentApiModelInput from .prompt_agent_api_model_input_backup_llm_config import ( PromptAgentApiModelInputBackupLlmConfig, PromptAgentApiModelInputBackupLlmConfig_Default, PromptAgentApiModelInputBackupLlmConfig_Disabled, PromptAgentApiModelInputBackupLlmConfig_Override, ) from .prompt_agent_api_model_input_tools_item import ( PromptAgentApiModelInputToolsItem, PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelInputToolsItem_Client, PromptAgentApiModelInputToolsItem_Mcp, PromptAgentApiModelInputToolsItem_Smb, PromptAgentApiModelInputToolsItem_System, PromptAgentApiModelInputToolsItem_Webhook, ) from .prompt_agent_api_model_output import PromptAgentApiModelOutput from .prompt_agent_api_model_output_backup_llm_config import ( PromptAgentApiModelOutputBackupLlmConfig, PromptAgentApiModelOutputBackupLlmConfig_Default, PromptAgentApiModelOutputBackupLlmConfig_Disabled, PromptAgentApiModelOutputBackupLlmConfig_Override, ) from .prompt_agent_api_model_output_tools_item import ( PromptAgentApiModelOutputToolsItem, PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelOutputToolsItem_Client, PromptAgentApiModelOutputToolsItem_Mcp, PromptAgentApiModelOutputToolsItem_Smb, PromptAgentApiModelOutputToolsItem_System, PromptAgentApiModelOutputToolsItem_Webhook, ) from .prompt_agent_api_model_override_config import PromptAgentApiModelOverrideConfig from .prompt_agent_api_model_override_input import PromptAgentApiModelOverrideInput from .prompt_agent_api_model_override_output import PromptAgentApiModelOverrideOutput from .prompt_agent_api_model_workflow_override_input import PromptAgentApiModelWorkflowOverrideInput from .prompt_agent_api_model_workflow_override_input_backup_llm_config import ( PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig, ) from .prompt_agent_api_model_workflow_override_input_tools_item import ( PromptAgentApiModelWorkflowOverrideInputToolsItem, PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideInputToolsItem_Client, PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideInputToolsItem_System, PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook, ) from .prompt_agent_api_model_workflow_override_output import PromptAgentApiModelWorkflowOverrideOutput from .prompt_agent_api_model_workflow_override_output_backup_llm_config import ( PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig, ) from .prompt_agent_api_model_workflow_override_output_tools_item import ( PromptAgentApiModelWorkflowOverrideOutputToolsItem, PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideOutputToolsItem_System, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook, ) from .prompt_agent_db_model import PromptAgentDbModel from .prompt_evaluation_criteria import PromptEvaluationCriteria from .prompt_injection_guardrail import PromptInjectionGuardrail from .pronunciation_dictionary_alias_rule_request_model import PronunciationDictionaryAliasRuleRequestModel from .pronunciation_dictionary_alias_rule_response_model import PronunciationDictionaryAliasRuleResponseModel from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .pronunciation_dictionary_locator_response_model import PronunciationDictionaryLocatorResponseModel from .pronunciation_dictionary_phoneme_rule_request_model import PronunciationDictionaryPhonemeRuleRequestModel from .pronunciation_dictionary_phoneme_rule_response_model import PronunciationDictionaryPhonemeRuleResponseModel 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 .quality_preset_type import QualityPresetType from .query_params_json_schema import QueryParamsJsonSchema from .quote_info import QuoteInfo from .rag_chunk_metadata import RagChunkMetadata from .rag_config_input import RagConfigInput from .rag_config_output import RagConfigOutput from .rag_config_workflow_override_input import RagConfigWorkflowOverrideInput from .rag_config_workflow_override_output import RagConfigWorkflowOverrideOutput from .rag_document_index_response_model import RagDocumentIndexResponseModel from .rag_document_index_usage import RagDocumentIndexUsage from .rag_document_indexes_response_model import RagDocumentIndexesResponseModel from .rag_index_batch_successful_response_model import RagIndexBatchSuccessfulResponseModel from .rag_index_overview_embedding_model_response_model import RagIndexOverviewEmbeddingModelResponseModel from .rag_index_overview_response_model import RagIndexOverviewResponseModel from .rag_index_status import RagIndexStatus from .rag_retrieval_info import RagRetrievalInfo from .read_legal_terms import ReadLegalTerms from .read_metadata_chapter_db_model import ReadMetadataChapterDbModel from .reader_resource_response_model import ReaderResourceResponseModel from .reader_resource_response_model_resource_type import ReaderResourceResponseModelResourceType from .realtime_voice_settings import RealtimeVoiceSettings from .recording_response import RecordingResponse from .reference_video import ReferenceVideo from .referenced_tool_common_model import ReferencedToolCommonModel from .referenced_tool_common_model_type import ReferencedToolCommonModelType from .refresh_token_auth_response import RefreshTokenAuthResponse from .regex_parameter_evaluation_strategy import RegexParameterEvaluationStrategy from .region_config_request import RegionConfigRequest from .regional_processing_surcharge_info import RegionalProcessingSurchargeInfo from .register_for_group_session_params import RegisterForGroupSessionParams from .register_media_response import RegisterMediaResponse from .remove_member_from_group_request import RemoveMemberFromGroupRequest from .remove_order_item_response import RemoveOrderItemResponse from .render import Render from .render_status import RenderStatus from .render_type import RenderType from .replicate_voice_to_isolated_environment_response_model import ReplicateVoiceToIsolatedEnvironmentResponseModel from .report_knowledge_gap_params import ReportKnowledgeGapParams from .request_pvc_manual_verification_response_model import RequestPvcManualVerificationResponseModel from .required_constraint import RequiredConstraint from .required_constraints import RequiredConstraints from .resource_access_info import ResourceAccessInfo from .resource_access_info_access_source import ResourceAccessInfoAccessSource from .resource_access_info_anonymous_access_level_override import ResourceAccessInfoAnonymousAccessLevelOverride from .resource_access_info_role import ResourceAccessInfoRole from .resource_metadata_response_model import ResourceMetadataResponseModel from .resource_metadata_response_model_anonymous_access_level_override import ( ResourceMetadataResponseModelAnonymousAccessLevelOverride, ) from .response_filter import ResponseFilter from .response_filter_mode import ResponseFilterMode from .response_unit_test_model import ResponseUnitTestModel from .restore_calendar_event_params import RestoreCalendarEventParams from .retry_trigger_action import RetryTriggerAction from .review_response_model import ReviewResponseModel from .review_response_model_reject_reasons_item import ReviewResponseModelRejectReasonsItem from .review_response_model_review_status import ReviewResponseModelReviewStatus from .review_status import ReviewStatus from .run_subagent_tool_config_input import RunSubagentToolConfigInput from .run_subagent_tool_config_output import RunSubagentToolConfigOutput from .safety_common_model_input import SafetyCommonModelInput from .safety_common_model_output import SafetyCommonModelOutput from .safety_evaluation import SafetyEvaluation from .safety_response_model import SafetyResponseModel from .safety_rule import SafetyRule from .sample_config_db_model import SampleConfigDbModel from .sample_config_db_model_parent_type import SampleConfigDbModelParentType from .save_voice_preview_request import SaveVoicePreviewRequest from .say_node_literal_message_input import SayNodeLiteralMessageInput from .say_node_literal_message_output import SayNodeLiteralMessageOutput from .say_node_prompt_message_input import SayNodePromptMessageInput from .say_node_prompt_message_output import SayNodePromptMessageOutput from .schedule_group_session_params import ScheduleGroupSessionParams from .scim_group_response_model import ScimGroupResponseModel from .scoped_analysis_result import ScopedAnalysisResult from .scribe_auth_error_payload import ScribeAuthErrorPayload from .scribe_chunk_size_exceeded_error_payload import ScribeChunkSizeExceededErrorPayload from .scribe_error_payload import ScribeErrorPayload from .scribe_input_error_payload import ScribeInputErrorPayload from .scribe_insufficient_audio_activity_error_payload import ScribeInsufficientAudioActivityErrorPayload from .scribe_invalid_request_error import ScribeInvalidRequestError from .scribe_queue_overflow_error_payload import ScribeQueueOverflowErrorPayload from .scribe_quota_exceeded_error_payload import ScribeQuotaExceededErrorPayload from .scribe_rate_limited_error_payload import ScribeRateLimitedErrorPayload from .scribe_resource_exhausted_error_payload import ScribeResourceExhaustedErrorPayload from .scribe_session_time_limit_exceeded_error_payload import ScribeSessionTimeLimitExceededErrorPayload from .scribe_throttled_error_payload import ScribeThrottledErrorPayload from .scribe_transcriber_error_payload import ScribeTranscriberErrorPayload from .scribe_unaccepted_terms_error_payload import ScribeUnacceptedTermsErrorPayload from .search_clients_params import SearchClientsParams from .search_highlight_segment import SearchHighlightSegment from .search_strategy import SearchStrategy from .seat_type import SeatType from .secret_dependency_resource_type import SecretDependencyResourceType from .secret_dependency_type import SecretDependencyType from .section_source import SectionSource from .segment_create_response import SegmentCreateResponse from .segment_delete_response import SegmentDeleteResponse from .segment_dub_response import SegmentDubResponse from .segment_migration_response import SegmentMigrationResponse from .segment_subtitle_frame import SegmentSubtitleFrame from .segment_transcription_response import SegmentTranscriptionResponse from .segment_translation_response import SegmentTranslationResponse from .segment_update_response import SegmentUpdateResponse from .segmented_json_export_options import SegmentedJsonExportOptions from .send_text import SendText from .send_text_multi import SendTextMulti from .sentiment_aggregate import SentimentAggregate from .sentiment_analysis_settings import SentimentAnalysisSettings from .session_started_payload import SessionStartedPayload from .session_started_payload_config import SessionStartedPayloadConfig from .session_started_payload_config_commit_strategy import SessionStartedPayloadConfigCommitStrategy from .set_booking_slug_params import SetBookingSlugParams from .severity_id import SeverityId from .sfx_model_id import SfxModelId from .sfx_source_context import SfxSourceContext from .share_option_response_model import ShareOptionResponseModel from .share_option_response_model_type import ShareOptionResponseModelType from .similar_voice import SimilarVoice from .similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse from .simulation_library_settings import SimulationLibrarySettings from .simulation_test_model import SimulationTestModel from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .single_languages_response import SingleLanguagesResponse from .single_test_run_request_model import SingleTestRunRequestModel from .single_use_token_response_model import SingleUseTokenResponseModel from .single_use_token_type import SingleUseTokenType from .sip_log_message import SipLogMessage from .sip_log_message_direction import SipLogMessageDirection from .sip_media_encryption_enum import SipMediaEncryptionEnum from .sip_trunk_credentials_request_model import SipTrunkCredentialsRequestModel from .sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse from .sip_trunk_transport_enum import SipTrunkTransportEnum from .sip_uri_dynamic_variable_transfer_destination import SipUriDynamicVariableTransferDestination from .sip_uri_transfer_destination import SipUriTransferDestination from .skip_turn_tool_config import SkipTurnToolConfig from .skip_turn_tool_response_model import SkipTurnToolResponseModel from .slack_bot_auth_response import SlackBotAuthResponse from .smb_client_access_config import SmbClientAccessConfig from .sms_conversation_info import SmsConversationInfo from .sms_conversation_info_direction import SmsConversationInfoDirection from .soft_timeout_config import SoftTimeoutConfig from .soft_timeout_config_override import SoftTimeoutConfigOverride from .soft_timeout_config_override_config import SoftTimeoutConfigOverrideConfig from .soft_timeout_config_workflow_override import SoftTimeoutConfigWorkflowOverride from .song_metadata import SongMetadata from .song_section import SongSection from .song_source_context import SongSourceContext from .sort_direction import SortDirection from .speaker_audio_response_model import SpeakerAudioResponseModel from .speaker_created_response import SpeakerCreatedResponse from .speaker_response_model import SpeakerResponseModel from .speaker_segment import SpeakerSegment from .speaker_separation_response_model import SpeakerSeparationResponseModel from .speaker_separation_response_model_status import SpeakerSeparationResponseModelStatus from .speaker_track import SpeakerTrack from .speaker_updated_response import SpeakerUpdatedResponse from .speech_engine_config import SpeechEngineConfig from .speech_engine_config_request_headers_value import SpeechEngineConfigRequestHeadersValue from .speech_engine_conversation_initiation_client_data_config import ( SpeechEngineConversationInitiationClientDataConfig, ) from .speech_engine_response import SpeechEngineResponse from .speech_engine_summary_response import SpeechEngineSummaryResponse from .speech_history_item_response import SpeechHistoryItemResponse from .speech_history_item_response_source import SpeechHistoryItemResponseSource from .speech_history_item_response_voice_category import SpeechHistoryItemResponseVoiceCategory from .speech_to_text_character_response_model import SpeechToTextCharacterResponseModel from .speech_to_text_chunk_response_model import SpeechToTextChunkResponseModel from .speech_to_text_webhook_response_model import SpeechToTextWebhookResponseModel from .speech_to_text_word_response_model import SpeechToTextWordResponseModel from .speech_to_text_word_response_model_type import SpeechToTextWordResponseModelType from .spelling_patience import SpellingPatience from .srt_export_options import SrtExportOptions from .start_procedure_tool_config_input import StartProcedureToolConfigInput from .start_procedure_tool_config_output import StartProcedureToolConfigOutput from .start_procedure_tool_error_status import StartProcedureToolErrorStatus from .start_pvc_voice_training_response_model import StartPvcVoiceTrainingResponseModel from .start_speaker_separation_response_model import StartSpeakerSeparationResponseModel from .status_id import StatusId from .streaming_audio_chunk_with_timestamps_and_voice_segments_response_model import ( StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, ) from .streaming_audio_chunk_with_timestamps_response import StreamingAudioChunkWithTimestampsResponse from .studio_agent_settings_model import StudioAgentSettingsModel from .studio_agent_tool_settings_model import StudioAgentToolSettingsModel from .studio_clip_reference import StudioClipReference from .studio_clip_reference_clip_type import StudioClipReferenceClipType from .studio_text_style_outline_model import StudioTextStyleOutlineModel from .studio_text_style_shadow_model import StudioTextStyleShadowModel from .sub_agent_input import SubAgentInput from .sub_agent_output import SubAgentOutput from .subagent_run_result_details import SubagentRunResultDetails from .submit_business_info_params import SubmitBusinessInfoParams from .submit_order_response import SubmitOrderResponse from .subscription import Subscription from .subscription_max_credit_limit_extension import SubscriptionMaxCreditLimitExtension from .subscription_pending_change import SubscriptionPendingChange from .subscription_response import SubscriptionResponse from .subscription_response_max_credit_limit_extension import SubscriptionResponseMaxCreditLimitExtension from .subscription_status_type import SubscriptionStatusType from .subtitle_order_item_request import SubtitleOrderItemRequest from .suggested_audio_tag import SuggestedAudioTag from .supported_voice import SupportedVoice from .system_evaluation_criteria import SystemEvaluationCriteria from .system_tool_config_input import SystemToolConfigInput from .system_tool_config_input_params import ( SystemToolConfigInputParams, SystemToolConfigInputParams_EndCall, SystemToolConfigInputParams_EndProcedure, SystemToolConfigInputParams_KnowledgeBase, SystemToolConfigInputParams_KnowledgeBaseRag, SystemToolConfigInputParams_LanguageDetection, SystemToolConfigInputParams_PlayKeypadTouchTone, SystemToolConfigInputParams_RunSubagent, SystemToolConfigInputParams_SkipTurn, SystemToolConfigInputParams_StartProcedure, SystemToolConfigInputParams_TransferToAgent, SystemToolConfigInputParams_TransferToNumber, SystemToolConfigInputParams_VoicemailDetection, ) from .system_tool_config_output import SystemToolConfigOutput from .system_tool_config_output_params import ( SystemToolConfigOutputParams, SystemToolConfigOutputParams_EndCall, SystemToolConfigOutputParams_EndProcedure, SystemToolConfigOutputParams_KnowledgeBase, SystemToolConfigOutputParams_KnowledgeBaseRag, SystemToolConfigOutputParams_LanguageDetection, SystemToolConfigOutputParams_PlayKeypadTouchTone, SystemToolConfigOutputParams_RunSubagent, SystemToolConfigOutputParams_SkipTurn, SystemToolConfigOutputParams_StartProcedure, SystemToolConfigOutputParams_TransferToAgent, SystemToolConfigOutputParams_TransferToNumber, SystemToolConfigOutputParams_VoicemailDetection, ) from .telephony_call_config import TelephonyCallConfig from .telephony_direction import TelephonyDirection from .telephony_provider import TelephonyProvider from .test_condition_rationale_common_model import TestConditionRationaleCommonModel from .test_condition_result_common_model import TestConditionResultCommonModel from .test_from_conversation_metadata_input import TestFromConversationMetadataInput from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .test_invocation_summary_response_model import TestInvocationSummaryResponseModel from .test_run_metadata import TestRunMetadata from .test_run_metadata_test_type import TestRunMetadataTestType from .test_run_result_bucket import TestRunResultBucket from .test_run_result_summary import TestRunResultSummary from .test_run_status import TestRunStatus from .test_sharing_mode import TestSharingMode from .test_tool_result_model import TestToolResultModel from .test_type import TestType from .tests_feature_usage_common_model import TestsFeatureUsageCommonModel from .text_normalisation_type import TextNormalisationType from .text_to_dialogue_websocket_apply_text_normalization_enum import ( TextToDialogueWebsocketApplyTextNormalizationEnum, ) from .text_to_dialogue_websocket_audio_chunk import TextToDialogueWebsocketAudioChunk from .text_to_dialogue_websocket_audio_chunk_multi import TextToDialogueWebsocketAudioChunkMulti from .text_to_dialogue_websocket_client_message import TextToDialogueWebsocketClientMessage from .text_to_dialogue_websocket_client_message_multi import TextToDialogueWebsocketClientMessageMulti from .text_to_dialogue_websocket_error import TextToDialogueWebsocketError from .text_to_dialogue_websocket_final import TextToDialogueWebsocketFinal from .text_to_dialogue_websocket_final_audio_for_turn import TextToDialogueWebsocketFinalAudioForTurn from .text_to_dialogue_websocket_final_audio_for_turn_multi import TextToDialogueWebsocketFinalAudioForTurnMulti from .text_to_dialogue_websocket_final_multi import TextToDialogueWebsocketFinalMulti from .text_to_dialogue_websocket_output_format_enum import TextToDialogueWebsocketOutputFormatEnum from .text_to_dialogue_websocket_voice_input import TextToDialogueWebsocketVoiceInput from .text_to_dialogue_websocket_voice_settings import TextToDialogueWebsocketVoiceSettings from .text_to_speech_apply_text_normalization_enum import TextToSpeechApplyTextNormalizationEnum from .text_to_speech_output_format_enum import TextToSpeechOutputFormatEnum from .text_to_speech_request import TextToSpeechRequest from .text_to_speech_stream_request import TextToSpeechStreamRequest from .text_to_speech_stream_with_timestamps_request import TextToSpeechStreamWithTimestampsRequest from .text_to_speech_with_timestamps_request import TextToSpeechWithTimestampsRequest from .threshold_guardrail import ThresholdGuardrail from .time_range import TimeRange from .to_dialogue_settings_response_model import ToDialogueSettingsResponseModel from .token_response_model import TokenResponseModel from .tool import Tool from .tool_annotations import ToolAnnotations from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_call_unit_test_model import ToolCallUnitTestModel from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution import ToolExecution from .tool_execution_mode import ToolExecutionMode from .tool_execution_response_model import ToolExecutionResponseModel from .tool_execution_response_model_tool_call_details import ( ToolExecutionResponseModelToolCallDetails, ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook, ToolExecutionResponseModelToolCallDetails_Client, ToolExecutionResponseModelToolCallDetails_Mcp, ToolExecutionResponseModelToolCallDetails_Webhook, ) from .tool_execution_task_support import ToolExecutionTaskSupport from .tool_interruption_mode import ToolInterruptionMode from .tool_mock_config import ToolMockConfig from .tool_request_model import ToolRequestModel from .tool_request_model_tool_config import ( ToolRequestModelToolConfig, ToolRequestModelToolConfig_Client, ToolRequestModelToolConfig_Mcp, ToolRequestModelToolConfig_System, ToolRequestModelToolConfig_Webhook, ) from .tool_response_mock_config_input import ToolResponseMockConfigInput from .tool_response_mock_config_output import ToolResponseMockConfigOutput from .tool_response_model import ToolResponseModel from .tool_response_model_tool_config import ( ToolResponseModelToolConfig, ToolResponseModelToolConfig_Client, ToolResponseModelToolConfig_Mcp, ToolResponseModelToolConfig_System, ToolResponseModelToolConfig_Webhook, ) from .tool_sort_by import ToolSortBy from .tool_type import ToolType from .tool_type_filter import ToolTypeFilter from .tool_usage_stats_response_model import ToolUsageStatsResponseModel from .tools_response_model import ToolsResponseModel from .topic_discovery_settings import TopicDiscoverySettings from .topic_evaluation_criteria_aggregate import TopicEvaluationCriteriaAggregate from .topic_metrics_aggregate import TopicMetricsAggregate from .topic_sentiment_aggregate import TopicSentimentAggregate from .transcript_message import TranscriptMessage from .transcript_message_role import TranscriptMessageRole from .transcription_order_item_request import TranscriptionOrderItemRequest from .transcription_word import TranscriptionWord from .transcription_word_type import TranscriptionWordType from .transfer_branch_info_defaulting_to_main import TransferBranchInfoDefaultingToMain from .transfer_branch_info_traffic_split import TransferBranchInfoTrafficSplit from .transfer_to_agent_tool_config_input import TransferToAgentToolConfigInput from .transfer_to_agent_tool_config_output import TransferToAgentToolConfigOutput from .transfer_to_agent_tool_result_error_model import TransferToAgentToolResultErrorModel from .transfer_to_agent_tool_result_success_model_input import TransferToAgentToolResultSuccessModelInput from .transfer_to_agent_tool_result_success_model_input_branch_info import ( TransferToAgentToolResultSuccessModelInputBranchInfo, TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit, ) from .transfer_to_agent_tool_result_success_model_output import TransferToAgentToolResultSuccessModelOutput from .transfer_to_agent_tool_result_success_model_output_branch_info import ( TransferToAgentToolResultSuccessModelOutputBranchInfo, TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit, ) from .transfer_to_number_result_error_model import TransferToNumberResultErrorModel from .transfer_to_number_result_exotel_success_model import TransferToNumberResultExotelSuccessModel from .transfer_to_number_result_sip_success_model import TransferToNumberResultSipSuccessModel from .transfer_to_number_result_twilio_success_model import TransferToNumberResultTwilioSuccessModel from .transfer_to_number_tool_config_input import TransferToNumberToolConfigInput from .transfer_to_number_tool_config_output import TransferToNumberToolConfigOutput from .transfer_type_enum import TransferTypeEnum from .translate_audio_output_error import TranslateAudioOutputError from .translate_audio_payload import TranslateAudioPayload from .translate_auth_error import TranslateAuthError from .translate_end_of_stream_payload import TranslateEndOfStreamPayload from .translate_error_payload import TranslateErrorPayload from .translate_final_transcript_payload import TranslateFinalTranscriptPayload from .translate_input_audio_chunk_payload import TranslateInputAudioChunkPayload from .translate_input_error import TranslateInputError from .translate_input_format_enum import TranslateInputFormatEnum from .translate_output_format_enum import TranslateOutputFormatEnum from .translate_partial_transcript_payload import TranslatePartialTranscriptPayload from .translate_queue_overflow_error import TranslateQueueOverflowError from .translate_rate_limited_error import TranslateRateLimitedError from .translate_session_started_payload import TranslateSessionStartedPayload from .translate_status_payload import TranslateStatusPayload from .translate_transcriber_error import TranslateTranscriberError from .translate_translation_error import TranslateTranslationError from .translate_translation_payload import TranslateTranslationPayload from .translated_string import TranslatedString from .trigger_user_verification_params import TriggerUserVerificationParams from .triggered_guardrail_common_model import TriggeredGuardrailCommonModel from .tts_conversational_config_input import TtsConversationalConfigInput from .tts_conversational_config_output import TtsConversationalConfigOutput from .tts_conversational_config_override import TtsConversationalConfigOverride from .tts_conversational_config_override_config import TtsConversationalConfigOverrideConfig from .tts_conversational_config_workflow_override_input import TtsConversationalConfigWorkflowOverrideInput from .tts_conversational_config_workflow_override_output import TtsConversationalConfigWorkflowOverrideOutput from .tts_conversational_model import TtsConversationalModel from .tts_model_family import TtsModelFamily from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency from .tts_output_format import TtsOutputFormat from .turn_config import TurnConfig from .turn_config_override import TurnConfigOverride from .turn_config_override_config import TurnConfigOverrideConfig from .turn_config_workflow_override import TurnConfigWorkflowOverride from .turn_eagerness import TurnEagerness from .turn_mode import TurnMode from .turn_model import TurnModel from .twilio_edge_location import TwilioEdgeLocation from .twilio_outbound_call_response import TwilioOutboundCallResponse from .twilio_region_id import TwilioRegionId from .txt_export_options import TxtExportOptions from .unit_test_run_response_model import UnitTestRunResponseModel from .unit_test_run_response_model_test_info import ( UnitTestRunResponseModelTestInfo, UnitTestRunResponseModelTestInfo_Llm, UnitTestRunResponseModelTestInfo_Simulation, UnitTestRunResponseModelTestInfo_Tool, ) from .unit_test_summary_response_model import UnitTestSummaryResponseModel from .unit_test_tool_call_evaluation_model_input import UnitTestToolCallEvaluationModelInput from .unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput from .unit_test_tool_call_parameter import UnitTestToolCallParameter from .unit_test_tool_call_parameter_eval import ( UnitTestToolCallParameterEval, UnitTestToolCallParameterEval_Anything, UnitTestToolCallParameterEval_Exact, UnitTestToolCallParameterEval_Llm, UnitTestToolCallParameterEval_Regex, ) from .unit_test_workflow_node_transition_evaluation_node_id import UnitTestWorkflowNodeTransitionEvaluationNodeId from .update_agent_procedure_params import UpdateAgentProcedureParams from .update_agent_rule_params import UpdateAgentRuleParams from .update_asset_params import UpdateAssetParams from .update_audio_native_project_request import UpdateAudioNativeProjectRequest from .update_basic_auth_request import UpdateBasicAuthRequest from .update_bearer_auth_request import UpdateBearerAuthRequest from .update_booking_page_appearance_params import UpdateBookingPageAppearanceParams from .update_booking_page_settings_params import UpdateBookingPageSettingsParams from .update_business_info_params import UpdateBusinessInfoParams from .update_calendar_event_params import UpdateCalendarEventParams from .update_chapter_request import UpdateChapterRequest from .update_client_params import UpdateClientParams from .update_customer_facing_config_params import UpdateCustomerFacingConfigParams from .update_group_session_seats_params import UpdateGroupSessionSeatsParams from .update_holiday_params import UpdateHolidayParams from .update_location_params import UpdateLocationParams from .update_o_auth_2_client_creds_request import UpdateOAuth2ClientCredsRequest from .update_o_auth_2_jwt_request import UpdateOAuth2JwtRequest from .update_o_auth_2_jwt_request_algorithm import UpdateOAuth2JwtRequestAlgorithm from .update_o_auth_2_jwt_request_token_response_field import UpdateOAuth2JwtRequestTokenResponseField from .update_order_request import UpdateOrderRequest from .update_order_response import UpdateOrderResponse from .update_product_params import UpdateProductParams from .update_project_request import UpdateProjectRequest from .update_pronunciation_dictionaries_request import UpdatePronunciationDictionariesRequest from .update_response_unit_test_request import UpdateResponseUnitTestRequest from .update_service_params import UpdateServiceParams from .update_simulation_test_request import UpdateSimulationTestRequest from .update_staff_params import UpdateStaffParams from .update_tool_call_unit_test_request import UpdateToolCallUnitTestRequest from .update_transfer_rule_params import UpdateTransferRuleParams from .update_workspace_member_response_model import UpdateWorkspaceMemberResponseModel from .upsert_order_item_request import UpsertOrderItemRequest from .upsert_order_item_response import UpsertOrderItemResponse from .url_avatar import UrlAvatar from .url_model import UrlModel from .url_secret_auth_response import UrlSecretAuthResponse from .usage_aggregation_interval import UsageAggregationInterval from .usage_characters_response_model import UsageCharactersResponseModel from .user import User from .user_access_management_activity_id import UserAccessManagementActivityId from .user_feedback import UserFeedback from .user_feedback_score import UserFeedbackScore from .user_model import UserModel from .user_transcript_payload import UserTranscriptPayload from .user_type_id import UserTypeId from .users_sort_by import UsersSortBy from .utterance_response_model import UtteranceResponseModel from .uui_transfer_config import UuiTransferConfig from .uui_transfer_config_protocol_discriminator_mode import UuiTransferConfigProtocolDiscriminatorMode from .vad_config import VadConfig from .vad_config_workflow_override import VadConfigWorkflowOverride from .validate_user_verification_code_params import ValidateUserVerificationCodeParams from .validation_error import ValidationError from .validation_error_loc_item import ValidationErrorLocItem from .verbosity import Verbosity from .verification_attempt_response import VerificationAttemptResponse from .verified_voice_language_response_model import VerifiedVoiceLanguageResponseModel from .verify_pvc_voice_captcha_response_model import VerifyPvcVoiceCaptchaResponseModel from .video_analysis import VideoAnalysis from .video_analysis_result import VideoAnalysisResult from .video_analysis_status import VideoAnalysisStatus from .video_key_moment import VideoKeyMoment from .video_segment import VideoSegment from .video_subject import VideoSubject from .visited_agent_ref import VisitedAgentRef from .voice import Voice from .voice_accent_response_model import VoiceAccentResponseModel from .voice_category import VoiceCategory from .voice_design_preview_response import VoiceDesignPreviewResponse from .voice_generation_parameter_option_response import VoiceGenerationParameterOptionResponse from .voice_generation_parameter_response import VoiceGenerationParameterResponse from .voice_labelling_status import VoiceLabellingStatus from .voice_mail_detection_result_success_model import VoiceMailDetectionResultSuccessModel from .voice_preview_response_model import VoicePreviewResponseModel from .voice_recording_quality import VoiceRecordingQuality from .voice_safety_control import VoiceSafetyControl from .voice_sample import VoiceSample from .voice_sample_preview_response_model import VoiceSamplePreviewResponseModel from .voice_sample_visual_waveform_response_model import VoiceSampleVisualWaveformResponseModel from .voice_segment import VoiceSegment from .voice_settings import VoiceSettings from .voice_sharing_moderation_check_response_model import VoiceSharingModerationCheckResponseModel from .voice_sharing_response import VoiceSharingResponse from .voice_sharing_response_category import VoiceSharingResponseCategory from .voice_sharing_state import VoiceSharingState from .voice_statistics_response_model import VoiceStatisticsResponseModel from .voice_verification_response import VoiceVerificationResponse from .voicemail_detection_tool_config import VoicemailDetectionToolConfig from .voices_not_permitted_warning import VoicesNotPermittedWarning from .webhook_auth_method_type import WebhookAuthMethodType from .webhook_event_type import WebhookEventType from .webhook_hmac_settings import WebhookHmacSettings from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput from .webhook_tool_api_schema_config_input_auth_connection import WebhookToolApiSchemaConfigInputAuthConnection from .webhook_tool_api_schema_config_input_content_type import WebhookToolApiSchemaConfigInputContentType from .webhook_tool_api_schema_config_input_method import WebhookToolApiSchemaConfigInputMethod from .webhook_tool_api_schema_config_input_request_headers_value import ( WebhookToolApiSchemaConfigInputRequestHeadersValue, ) from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput from .webhook_tool_api_schema_config_output_auth_connection import WebhookToolApiSchemaConfigOutputAuthConnection from .webhook_tool_api_schema_config_output_content_type import WebhookToolApiSchemaConfigOutputContentType from .webhook_tool_api_schema_config_output_method import WebhookToolApiSchemaConfigOutputMethod from .webhook_tool_api_schema_config_output_request_headers_value import ( WebhookToolApiSchemaConfigOutputRequestHeadersValue, ) from .webhook_tool_config_input import WebhookToolConfigInput from .webhook_tool_config_output import WebhookToolConfigOutput from .webhook_transcript_format import WebhookTranscriptFormat from .webhook_usage_type import WebhookUsageType from .websocket_tts_client_message_multi import WebsocketTtsClientMessageMulti from .websocket_tts_server_message_multi import WebsocketTtsServerMessageMulti from .whats_app_auth_response import WhatsAppAuthResponse from .whats_app_conversation_info import WhatsAppConversationInfo from .whats_app_conversation_info_direction import WhatsAppConversationInfoDirection from .whats_app_outbound_call_response import WhatsAppOutboundCallResponse from .whats_app_outbound_message_response import WhatsAppOutboundMessageResponse from .whats_app_template_body_component_params import WhatsAppTemplateBodyComponentParams from .whats_app_template_button_component_params import WhatsAppTemplateButtonComponentParams from .whats_app_template_document_param import WhatsAppTemplateDocumentParam from .whats_app_template_document_param_details import WhatsAppTemplateDocumentParamDetails from .whats_app_template_header_component_params import WhatsAppTemplateHeaderComponentParams from .whats_app_template_header_component_params_parameters_item import ( WhatsAppTemplateHeaderComponentParamsParametersItem, WhatsAppTemplateHeaderComponentParamsParametersItem_Document, WhatsAppTemplateHeaderComponentParamsParametersItem_Image, WhatsAppTemplateHeaderComponentParamsParametersItem_Location, WhatsAppTemplateHeaderComponentParamsParametersItem_Text, ) from .whats_app_template_image_param import WhatsAppTemplateImageParam from .whats_app_template_image_param_details import WhatsAppTemplateImageParamDetails from .whats_app_template_location_param import WhatsAppTemplateLocationParam from .whats_app_template_location_param_details import WhatsAppTemplateLocationParamDetails from .whats_app_template_text_param import WhatsAppTemplateTextParam from .widget_config import WidgetConfig from .widget_config_avatar import ( WidgetConfigAvatar, WidgetConfigAvatar_Image, WidgetConfigAvatar_Orb, WidgetConfigAvatar_Url, ) from .widget_config_response import WidgetConfigResponse from .widget_config_response_avatar import ( WidgetConfigResponseAvatar, WidgetConfigResponseAvatar_Image, WidgetConfigResponseAvatar_Orb, WidgetConfigResponseAvatar_Url, ) from .widget_config_response_syntax_highlight_theme import WidgetConfigResponseSyntaxHighlightTheme from .widget_config_syntax_highlight_theme import WidgetConfigSyntaxHighlightTheme from .widget_end_feedback_config import WidgetEndFeedbackConfig from .widget_end_feedback_type import WidgetEndFeedbackType from .widget_expandable import WidgetExpandable from .widget_feedback_mode import WidgetFeedbackMode from .widget_language_preset import WidgetLanguagePreset from .widget_language_preset_response import WidgetLanguagePresetResponse from .widget_placement import WidgetPlacement from .widget_styles import WidgetStyles from .widget_terms_translation import WidgetTermsTranslation from .widget_text_contents import WidgetTextContents from .widget_text_contents_translation import WidgetTextContentsTranslation from .word_timestamp import WordTimestamp from .workflow_edge_model_input import WorkflowEdgeModelInput from .workflow_edge_model_input_backward_condition import ( WorkflowEdgeModelInputBackwardCondition, WorkflowEdgeModelInputBackwardCondition_Expression, WorkflowEdgeModelInputBackwardCondition_Llm, WorkflowEdgeModelInputBackwardCondition_Result, WorkflowEdgeModelInputBackwardCondition_Unconditional, ) from .workflow_edge_model_input_forward_condition import ( WorkflowEdgeModelInputForwardCondition, WorkflowEdgeModelInputForwardCondition_Expression, WorkflowEdgeModelInputForwardCondition_Llm, WorkflowEdgeModelInputForwardCondition_Result, WorkflowEdgeModelInputForwardCondition_Unconditional, ) from .workflow_edge_model_output import WorkflowEdgeModelOutput from .workflow_edge_model_output_backward_condition import ( WorkflowEdgeModelOutputBackwardCondition, WorkflowEdgeModelOutputBackwardCondition_Expression, WorkflowEdgeModelOutputBackwardCondition_Llm, WorkflowEdgeModelOutputBackwardCondition_Result, WorkflowEdgeModelOutputBackwardCondition_Unconditional, ) from .workflow_edge_model_output_forward_condition import ( WorkflowEdgeModelOutputForwardCondition, WorkflowEdgeModelOutputForwardCondition_Expression, WorkflowEdgeModelOutputForwardCondition_Llm, WorkflowEdgeModelOutputForwardCondition_Result, WorkflowEdgeModelOutputForwardCondition_Unconditional, ) from .workflow_end_node_model_input import WorkflowEndNodeModelInput from .workflow_end_node_model_output import WorkflowEndNodeModelOutput from .workflow_expression_condition_model_input import WorkflowExpressionConditionModelInput from .workflow_expression_condition_model_output import WorkflowExpressionConditionModelOutput from .workflow_features_usage_common_model import WorkflowFeaturesUsageCommonModel from .workflow_llm_condition_model_input import WorkflowLlmConditionModelInput from .workflow_llm_condition_model_output import WorkflowLlmConditionModelOutput from .workflow_override_agent_node_model_input import WorkflowOverrideAgentNodeModelInput from .workflow_override_agent_node_model_output import WorkflowOverrideAgentNodeModelOutput from .workflow_phone_number_node_model_input import WorkflowPhoneNumberNodeModelInput from .workflow_phone_number_node_model_input_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static, ) from .workflow_phone_number_node_model_input_post_dial_digits import ( WorkflowPhoneNumberNodeModelInputPostDialDigits, WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelInputPostDialDigits_Static, ) from .workflow_phone_number_node_model_input_transfer_destination import ( WorkflowPhoneNumberNodeModelInputTransferDestination, WorkflowPhoneNumberNodeModelInputTransferDestination_Phone, WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable, ) from .workflow_phone_number_node_model_output import WorkflowPhoneNumberNodeModelOutput from .workflow_phone_number_node_model_output_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static, ) from .workflow_phone_number_node_model_output_post_dial_digits import ( WorkflowPhoneNumberNodeModelOutputPostDialDigits, WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static, ) from .workflow_phone_number_node_model_output_transfer_destination import ( WorkflowPhoneNumberNodeModelOutputTransferDestination, WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone, WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable, ) from .workflow_result_condition_model_input import WorkflowResultConditionModelInput from .workflow_result_condition_model_output import WorkflowResultConditionModelOutput from .workflow_standalone_agent_node_model_input import WorkflowStandaloneAgentNodeModelInput from .workflow_standalone_agent_node_model_output import WorkflowStandaloneAgentNodeModelOutput from .workflow_start_node_model_input import WorkflowStartNodeModelInput from .workflow_start_node_model_output import WorkflowStartNodeModelOutput from .workflow_tool_edge_step_model import WorkflowToolEdgeStepModel from .workflow_tool_locator import WorkflowToolLocator from .workflow_tool_locator_schema_overrides_value import ( WorkflowToolLocatorSchemaOverridesValue, WorkflowToolLocatorSchemaOverridesValue_Constant, WorkflowToolLocatorSchemaOverridesValue_DynamicVariable, WorkflowToolLocatorSchemaOverridesValue_Llm, WorkflowToolLocatorSchemaOverridesValue_Omit, ) from .workflow_tool_max_iterations_exceeded_step_model import WorkflowToolMaxIterationsExceededStepModel from .workflow_tool_nested_tools_step_model_input import WorkflowToolNestedToolsStepModelInput from .workflow_tool_nested_tools_step_model_input_results_item import ( WorkflowToolNestedToolsStepModelInputResultsItem, ) from .workflow_tool_nested_tools_step_model_output import WorkflowToolNestedToolsStepModelOutput from .workflow_tool_nested_tools_step_model_output_results_item import ( WorkflowToolNestedToolsStepModelOutputResultsItem, ) from .workflow_tool_node_model_input import WorkflowToolNodeModelInput from .workflow_tool_node_model_output import WorkflowToolNodeModelOutput from .workflow_tool_response_model_input import WorkflowToolResponseModelInput from .workflow_tool_response_model_input_steps_item import ( WorkflowToolResponseModelInputStepsItem, WorkflowToolResponseModelInputStepsItem_Edge, WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelInputStepsItem_NestedTools, ) from .workflow_tool_response_model_output import WorkflowToolResponseModelOutput from .workflow_tool_response_model_output_steps_item import ( WorkflowToolResponseModelOutputStepsItem, WorkflowToolResponseModelOutputStepsItem_Edge, WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelOutputStepsItem_NestedTools, ) from .workflow_unconditional_model_input import WorkflowUnconditionalModelInput from .workflow_unconditional_model_output import WorkflowUnconditionalModelOutput from .workspace_analytics_query_response_model import WorkspaceAnalyticsQueryResponseModel from .workspace_analytics_query_response_model_column_types_item import ( WorkspaceAnalyticsQueryResponseModelColumnTypesItem, ) from .workspace_analytics_query_response_model_rows_item_item import ( WorkspaceAnalyticsQueryResponseModelRowsItemItem, ) from .workspace_api_key_list_response_model import WorkspaceApiKeyListResponseModel from .workspace_api_key_response_model import WorkspaceApiKeyResponseModel from .workspace_audit_log_entry_response import WorkspaceAuditLogEntryResponse from .workspace_audit_log_entry_response_activity_id import WorkspaceAuditLogEntryResponseActivityId from .workspace_audit_logs_page_response import WorkspaceAuditLogsPageResponse from .workspace_batch_calls_response import WorkspaceBatchCallsResponse from .workspace_create_api_key_response_model import WorkspaceCreateApiKeyResponseModel from .workspace_create_service_account_response_model import WorkspaceCreateServiceAccountResponseModel from .workspace_create_webhook_response_model import WorkspaceCreateWebhookResponseModel from .workspace_group_by_name_response_model import WorkspaceGroupByNameResponseModel from .workspace_group_permission import WorkspaceGroupPermission from .workspace_group_response_model import WorkspaceGroupResponseModel from .workspace_group_response_model_group_pvc_limit import WorkspaceGroupResponseModelGroupPvcLimit from .workspace_group_response_model_group_usage_limit import WorkspaceGroupResponseModelGroupUsageLimit from .workspace_member_response_model import WorkspaceMemberResponseModel from .workspace_resource_type import WorkspaceResourceType from .workspace_service_account_list_response_model import WorkspaceServiceAccountListResponseModel from .workspace_service_account_response_model import WorkspaceServiceAccountResponseModel from .workspace_webhook_event_type import WorkspaceWebhookEventType from .workspace_webhook_list_response_model import WorkspaceWebhookListResponseModel from .workspace_webhook_response_model import WorkspaceWebhookResponseModel from .workspace_webhook_usage_response_model import WorkspaceWebhookUsageResponseModel _dynamic_imports: typing.Dict[str, str] = { "AccountChangeActivityId": ".account_change_activity_id", "ActorModel": ".actor_model", "AddChapterResponseModel": ".add_chapter_response_model", "AddKnowledgeBaseResponseModel": ".add_knowledge_base_response_model", "AddProjectRequest": ".add_project_request", "AddProjectResponseModel": ".add_project_response_model", "AddPronunciationDictionaryResponseModel": ".add_pronunciation_dictionary_response_model", "AddPronunciationDictionaryResponseModelPermissionOnResource": ".add_pronunciation_dictionary_response_model_permission_on_resource", "AddSharingVoiceRequest": ".add_sharing_voice_request", "AddVoiceIvcResponseModel": ".add_voice_ivc_response_model", "AddVoiceResponseModel": ".add_voice_response_model", "AddWorkspaceGroupMemberResponseModel": ".add_workspace_group_member_response_model", "AddWorkspaceInviteResponseModel": ".add_workspace_invite_response_model", "AdditionalFormatResponseModel": ".additional_format_response_model", "AdditionalFormats": ".additional_formats", "AdhocAgentConfigOverrideForTestRequestModel": ".adhoc_agent_config_override_for_test_request_model", "Age": ".age", "AgentAnalysisItemsInput": ".agent_analysis_items_input", "AgentAnalysisItemsInputDataCollectionItem": ".agent_analysis_items_input_data_collection_item", "AgentAnalysisItemsInputDataCollectionItem_System": ".agent_analysis_items_input_data_collection_item", "AgentAnalysisItemsInputDataCollectionItem_User": ".agent_analysis_items_input_data_collection_item", "AgentAnalysisItemsInputEvaluationCriteriaItem": ".agent_analysis_items_input_evaluation_criteria_item", "AgentAnalysisItemsInputEvaluationCriteriaItem_System": ".agent_analysis_items_input_evaluation_criteria_item", "AgentAnalysisItemsInputEvaluationCriteriaItem_User": ".agent_analysis_items_input_evaluation_criteria_item", "AgentAnalysisItemsOutput": ".agent_analysis_items_output", "AgentAnalysisItemsOutputDataCollectionItem": ".agent_analysis_items_output_data_collection_item", "AgentAnalysisItemsOutputDataCollectionItem_System": ".agent_analysis_items_output_data_collection_item", "AgentAnalysisItemsOutputDataCollectionItem_User": ".agent_analysis_items_output_data_collection_item", "AgentAnalysisItemsOutputEvaluationCriteriaItem": ".agent_analysis_items_output_evaluation_criteria_item", "AgentAnalysisItemsOutputEvaluationCriteriaItem_System": ".agent_analysis_items_output_evaluation_criteria_item", "AgentAnalysisItemsOutputEvaluationCriteriaItem_User": ".agent_analysis_items_output_evaluation_criteria_item", "AgentBranchBasicInfo": ".agent_branch_basic_info", "AgentBranchResponse": ".agent_branch_response", "AgentBranchSummary": ".agent_branch_summary", "AgentCallLimits": ".agent_call_limits", "AgentConfig": ".agent_config", "AgentConfigApiModelWorkflowOverrideInput": ".agent_config_api_model_workflow_override_input", "AgentConfigApiModelWorkflowOverrideOutput": ".agent_config_api_model_workflow_override_output", "AgentConfigOverrideConfig": ".agent_config_override_config", "AgentConfigOverrideInput": ".agent_config_override_input", "AgentConfigOverrideOutput": ".agent_config_override_output", "AgentDefinitionSource": ".agent_definition_source", "AgentDeploymentPercentageStrategy": ".agent_deployment_percentage_strategy", "AgentDeploymentRequest": ".agent_deployment_request", "AgentDeploymentRequestItem": ".agent_deployment_request_item", "AgentDeploymentResponse": ".agent_deployment_response", "AgentFailureResponseExample": ".agent_failure_response_example", "AgentKnowledgeBaseRagChunkResponseModel": ".agent_knowledge_base_rag_chunk_response_model", "AgentKnowledgeBaseRagQueryRequestModel": ".agent_knowledge_base_rag_query_request_model", "AgentKnowledgeBaseRagQueryResponseModel": ".agent_knowledge_base_rag_query_response_model", "AgentMetadata": ".agent_metadata", "AgentMetadataDbModel": ".agent_metadata_db_model", "AgentMetadataResponseModel": ".agent_metadata_response_model", "AgentPlatformSettingsRequestModel": ".agent_platform_settings_request_model", "AgentPlatformSettingsResponseModel": ".agent_platform_settings_response_model", "AgentResponsePayload": ".agent_response_payload", "AgentSimulatedChatTestResponseModel": ".agent_simulated_chat_test_response_model", "AgentSortBy": ".agent_sort_by", "AgentSuccessfulResponseExample": ".agent_successful_response_example", "AgentSummaryBatchSuccessfulResponseModel": ".agent_summary_batch_successful_response_model", "AgentSummaryResponseModel": ".agent_summary_response_model", "AgentTestEntityType": ".agent_test_entity_type", "AgentTestFolderPathSegmentResponseModel": ".agent_test_folder_path_segment_response_model", "AgentTestingSettings": ".agent_testing_settings", "AgentTopicResponseModel": ".agent_topic_response_model", "AgentTransferInput": ".agent_transfer_input", "AgentTransferOp": ".agent_transfer_op", "AgentTransferOpPop": ".agent_transfer_op_pop", "AgentTransferOpPush": ".agent_transfer_op_push", "AgentTransferOpReplace": ".agent_transfer_op_replace", "AgentTransferOp_Pop": ".agent_transfer_op", "AgentTransferOp_Push": ".agent_transfer_op", "AgentTransferOp_Replace": ".agent_transfer_op", "AgentTransferOutput": ".agent_transfer_output", "AgentTrustContext": ".agent_trust_context", "AgentVersionMetadata": ".agent_version_metadata", "AgentVersionParents": ".agent_version_parents", "AgentWorkflowRequestModel": ".agent_workflow_request_model", "AgentWorkflowRequestModelNodesValue": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_End": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_OverrideAgent": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_PhoneNumber": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_StandaloneAgent": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_Start": ".agent_workflow_request_model_nodes_value", "AgentWorkflowRequestModelNodesValue_Tool": ".agent_workflow_request_model_nodes_value", "AgentWorkflowResponseModel": ".agent_workflow_response_model", "AgentWorkflowResponseModelNodesValue": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_End": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_OverrideAgent": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_PhoneNumber": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_StandaloneAgent": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_Start": ".agent_workflow_response_model_nodes_value", "AgentWorkflowResponseModelNodesValue_Tool": ".agent_workflow_response_model_nodes_value", "AgentWorkspaceOverridesInput": ".agent_workspace_overrides_input", "AgentWorkspaceOverridesOutput": ".agent_workspace_overrides_output", "AlertingMonitorConfig": ".alerting_monitor_config", "AlertingSettings": ".alerting_settings", "AlertingSettingsResponse": ".alerting_settings_response", "AlertingWebhookHeader": ".alerting_webhook_header", "AlertingWebhookMethod": ".alerting_webhook_method", "AlertingWebhookNotifier": ".alerting_webhook_notifier", "AlertingWebhookNotifierResponse": ".alerting_webhook_notifier_response", "Alignment": ".alignment", "AllowedOutputFormats": ".allowed_output_formats", "AllowlistItem": ".allowlist_item", "AnalysisCharging": ".analysis_charging", "AnalysisProperty": ".analysis_property", "AnalysisPropertyConstantValue": ".analysis_property_constant_value", "AnalysisPropertyType": ".analysis_property_type", "AnalysisRunSnapshot": ".analysis_run_snapshot", "AnalysisRunningTotal": ".analysis_running_total", "AnalysisScope": ".analysis_scope", "AnalysisType": ".analysis_type", "ApiIntegrationOAuth2AuthCodeResponse": ".api_integration_o_auth_2_auth_code_response", "ApiIntegrationOAuth2AuthCodeResponseScopeSeparator": ".api_integration_o_auth_2_auth_code_response_scope_separator", "ApiIntegrationOAuth2CustomAppResponse": ".api_integration_o_auth_2_custom_app_response", "ApiIntegrationOAuth2CustomAppResponseScopeSeparator": ".api_integration_o_auth_2_custom_app_response_scope_separator", "ApiIntegrationWebhookOverrides": ".api_integration_webhook_overrides", "ApiIntegrationWebhookOverridesRequestHeadersValue": ".api_integration_webhook_overrides_request_headers_value", "ApiIntegrationWebhookOverridesSchemaOverridesValue": ".api_integration_webhook_overrides_schema_overrides_value", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant": ".api_integration_webhook_overrides_schema_overrides_value", "ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable": ".api_integration_webhook_overrides_schema_overrides_value", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm": ".api_integration_webhook_overrides_schema_overrides_value", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit": ".api_integration_webhook_overrides_schema_overrides_value", "ApiIntegrationWebhookToolConfigInput": ".api_integration_webhook_tool_config_input", "ApiIntegrationWebhookToolConfigOutput": ".api_integration_webhook_tool_config_output", "ArrayJsonSchemaPropertyInput": ".array_json_schema_property_input", "ArrayJsonSchemaPropertyInputItems": ".array_json_schema_property_input_items", "ArrayJsonSchemaPropertyInputPropertyKind": ".array_json_schema_property_input_property_kind", "ArrayJsonSchemaPropertyOutput": ".array_json_schema_property_output", "ArrayJsonSchemaPropertyOutputItems": ".array_json_schema_property_output_items", "AsrConversationalConfig": ".asr_conversational_config", "AsrConversationalConfigOverride": ".asr_conversational_config_override", "AsrConversationalConfigOverrideConfig": ".asr_conversational_config_override_config", "AsrConversationalConfigWorkflowOverride": ".asr_conversational_config_workflow_override", "AsrInputFormat": ".asr_input_format", "AsrProvider": ".asr_provider", "AsrQuality": ".asr_quality", "AssetTranscription": ".asset_transcription", "AssetTranscriptionData": ".asset_transcription_data", "AssetTranscriptionStatus": ".asset_transcription_status", "AstAdditionOperatorNodeInput": ".ast_addition_operator_node_input", "AstAdditionOperatorNodeOutput": ".ast_addition_operator_node_output", "AstAndOperatorNodeInput": ".ast_and_operator_node_input", "AstAndOperatorNodeOutput": ".ast_and_operator_node_output", "AstBooleanNodeInput": ".ast_boolean_node_input", "AstBooleanNodeOutput": ".ast_boolean_node_output", "AstConditionalOperatorNodeInput": ".ast_conditional_operator_node_input", "AstConditionalOperatorNodeOutput": ".ast_conditional_operator_node_output", "AstDivisionOperatorNodeInput": ".ast_division_operator_node_input", "AstDivisionOperatorNodeOutput": ".ast_division_operator_node_output", "AstDynamicVariableNodeInput": ".ast_dynamic_variable_node_input", "AstDynamicVariableNodeOutput": ".ast_dynamic_variable_node_output", "AstEqualsOperatorNodeInput": ".ast_equals_operator_node_input", "AstEqualsOperatorNodeOutput": ".ast_equals_operator_node_output", "AstGreaterThanOperatorNodeInput": ".ast_greater_than_operator_node_input", "AstGreaterThanOperatorNodeOutput": ".ast_greater_than_operator_node_output", "AstGreaterThanOrEqualsOperatorNodeInput": ".ast_greater_than_or_equals_operator_node_input", "AstGreaterThanOrEqualsOperatorNodeOutput": ".ast_greater_than_or_equals_operator_node_output", "AstLessThanOperatorNodeInput": ".ast_less_than_operator_node_input", "AstLessThanOperatorNodeOutput": ".ast_less_than_operator_node_output", "AstLessThanOrEqualsOperatorNodeInput": ".ast_less_than_or_equals_operator_node_input", "AstLessThanOrEqualsOperatorNodeOutput": ".ast_less_than_or_equals_operator_node_output", "AstMultiplicationOperatorNodeInput": ".ast_multiplication_operator_node_input", "AstMultiplicationOperatorNodeOutput": ".ast_multiplication_operator_node_output", "AstNodeInput": ".ast_node_input", "AstNodeInputLlm": ".ast_node_input_llm", "AstNodeInput_AddOperator": ".ast_node_input", "AstNodeInput_AndOperator": ".ast_node_input", "AstNodeInput_BooleanLiteral": ".ast_node_input", "AstNodeInput_ConditionalOperator": ".ast_node_input", "AstNodeInput_DivOperator": ".ast_node_input", "AstNodeInput_DynamicVariable": ".ast_node_input", "AstNodeInput_EqOperator": ".ast_node_input", "AstNodeInput_GtOperator": ".ast_node_input", "AstNodeInput_GteOperator": ".ast_node_input", "AstNodeInput_Llm": ".ast_node_input", "AstNodeInput_LtOperator": ".ast_node_input", "AstNodeInput_LteOperator": ".ast_node_input", "AstNodeInput_MulOperator": ".ast_node_input", "AstNodeInput_NeqOperator": ".ast_node_input", "AstNodeInput_NullLiteral": ".ast_node_input", "AstNodeInput_NumberLiteral": ".ast_node_input", "AstNodeInput_OrOperator": ".ast_node_input", "AstNodeInput_StringLiteral": ".ast_node_input", "AstNodeInput_SubOperator": ".ast_node_input", "AstNodeOutput": ".ast_node_output", "AstNodeOutput_AddOperator": ".ast_node_output", "AstNodeOutput_AndOperator": ".ast_node_output", "AstNodeOutput_BooleanLiteral": ".ast_node_output", "AstNodeOutput_ConditionalOperator": ".ast_node_output", "AstNodeOutput_DivOperator": ".ast_node_output", "AstNodeOutput_DynamicVariable": ".ast_node_output", "AstNodeOutput_EqOperator": ".ast_node_output", "AstNodeOutput_GtOperator": ".ast_node_output", "AstNodeOutput_GteOperator": ".ast_node_output", "AstNodeOutput_Llm": ".ast_node_output", "AstNodeOutput_LtOperator": ".ast_node_output", "AstNodeOutput_LteOperator": ".ast_node_output", "AstNodeOutput_MulOperator": ".ast_node_output", "AstNodeOutput_NeqOperator": ".ast_node_output", "AstNodeOutput_NullLiteral": ".ast_node_output", "AstNodeOutput_NumberLiteral": ".ast_node_output", "AstNodeOutput_OrOperator": ".ast_node_output", "AstNodeOutput_StringLiteral": ".ast_node_output", "AstNodeOutput_SubOperator": ".ast_node_output", "AstNotEqualsOperatorNodeInput": ".ast_not_equals_operator_node_input", "AstNotEqualsOperatorNodeOutput": ".ast_not_equals_operator_node_output", "AstNullNodeInput": ".ast_null_node_input", "AstNullNodeOutput": ".ast_null_node_output", "AstNumberNodeInput": ".ast_number_node_input", "AstNumberNodeInputValue": ".ast_number_node_input_value", "AstNumberNodeOutput": ".ast_number_node_output", "AstNumberNodeOutputValue": ".ast_number_node_output_value", "AstOrOperatorNodeInput": ".ast_or_operator_node_input", "AstOrOperatorNodeOutput": ".ast_or_operator_node_output", "AstStringNodeInput": ".ast_string_node_input", "AstStringNodeOutput": ".ast_string_node_output", "AstSubtractionOperatorNodeInput": ".ast_subtraction_operator_node_input", "AstSubtractionOperatorNodeOutput": ".ast_subtraction_operator_node_output", "AstllmNodeInput": ".astllm_node_input", "AstllmNodeInputPrompt": ".astllm_node_input_prompt", "AstllmNodeInputValueSchema": ".astllm_node_input_value_schema", "AstllmNodeOutput": ".astllm_node_output", "AsyncConversationMetadata": ".async_conversation_metadata", "AsyncConversationMetadataDeliveryStatus": ".async_conversation_metadata_delivery_status", "AttachedSystemDataCollectionRef": ".attached_system_data_collection_ref", "AttachedSystemEvaluationRef": ".attached_system_evaluation_ref", "AttachedSystemEvaluationRefAnalysisItemId": ".attached_system_evaluation_ref_analysis_item_id", "AttachedTestModel": ".attached_test_model", "AttachedUserDataCollectionRef": ".attached_user_data_collection_ref", "AttachedUserEvaluationRef": ".attached_user_evaluation_ref", "AudioAnalysis": ".audio_analysis", "AudioAnalysisResult": ".audio_analysis_result", "AudioAnalysisStatus": ".audio_analysis_status", "AudioFormatEnum": ".audio_format_enum", "AudioIsolationHistoryItemResponseModel": ".audio_isolation_history_item_response_model", "AudioKeyMoment": ".audio_key_moment", "AudioNativeCreateProjectResponseModel": ".audio_native_create_project_response_model", "AudioNativeEditContentResponseModel": ".audio_native_edit_content_response_model", "AudioNativeProjectSettingsResponseModel": ".audio_native_project_settings_response_model", "AudioNativeProjectSettingsResponseModelStatus": ".audio_native_project_settings_response_model_status", "AudioOutput": ".audio_output", "AudioOutputMulti": ".audio_output_multi", "AudioRefChunk": ".audio_ref_chunk", "AudioSegment": ".audio_segment", "AudioWithTimestampsAndVoiceSegmentsResponseModel": ".audio_with_timestamps_and_voice_segments_response_model", "AudioWithTimestampsResponse": ".audio_with_timestamps_response", "AuthConnectionDependencies": ".auth_connection_dependencies", "AuthConnectionDependenciesMcpServersItem": ".auth_connection_dependencies_mcp_servers_item", "AuthConnectionDependenciesMcpServersItem_Available": ".auth_connection_dependencies_mcp_servers_item", "AuthConnectionDependenciesMcpServersItem_Unknown": ".auth_connection_dependencies_mcp_servers_item", "AuthConnectionDependenciesToolsItem": ".auth_connection_dependencies_tools_item", "AuthConnectionDependenciesToolsItem_Available": ".auth_connection_dependencies_tools_item", "AuthConnectionDependenciesToolsItem_Unknown": ".auth_connection_dependencies_tools_item", "AuthConnectionLocator": ".auth_connection_locator", "AuthConnectionStatus": ".auth_connection_status", "AuthSettings": ".auth_settings", "AuthenticationActivityId": ".authentication_activity_id", "AuthorizationMethod": ".authorization_method", "AutoGenerationMetadata": ".auto_generation_metadata", "AutoSyncInfo": ".auto_sync_info", "BackgroundSoundConfig": ".background_sound_config", "BackgroundSoundConfigWorkflowOverride": ".background_sound_config_workflow_override", "BackgroundSoundPresetId": ".background_sound_preset_id", "BackgroundSoundSourceType": ".background_sound_source_type", "BackupLlmDefault": ".backup_llm_default", "BackupLlmDisabled": ".backup_llm_disabled", "BackupLlmOverride": ".backup_llm_override", "BadRequestErrorBody": ".bad_request_error_body", "BaseTurnConfig": ".base_turn_config", "BasicAuthResponse": ".basic_auth_response", "BatchCallDetailedResponse": ".batch_call_detailed_response", "BatchCallRecipientStatus": ".batch_call_recipient_status", "BatchCallResponse": ".batch_call_response", "BatchCallStatus": ".batch_call_status", "BatchCallWhatsAppParams": ".batch_call_whats_app_params", "BatchFailureResponseModel": ".batch_failure_response_model", "BearerAuthResponse": ".bearer_auth_response", "BehaviorOverride": ".behavior_override", "BillingPeriod": ".billing_period", "BranchProtectionStatus": ".branch_protection_status", "BreakdownTypes": ".breakdown_types", "BucketingStatus": ".bucketing_status", "BuiltInToolsInput": ".built_in_tools_input", "BuiltInToolsOutput": ".built_in_tools_output", "BuiltInToolsWorkflowOverrideInput": ".built_in_tools_workflow_override_input", "BuiltInToolsWorkflowOverrideOutput": ".built_in_tools_workflow_override_output", "CancelCalendarEventParams": ".cancel_calendar_event_params", "CancelGroupSessionForAllParams": ".cancel_group_session_for_all_params", "CancelGroupSessionRegistrationParams": ".cancel_group_session_registration_params", "CanvasPlacement": ".canvas_placement", "CaptionStyleCharacterAnimationModel": ".caption_style_character_animation_model", "CaptionStyleCharacterAnimationModelEnterType": ".caption_style_character_animation_model_enter_type", "CaptionStyleCharacterAnimationModelExitType": ".caption_style_character_animation_model_exit_type", "CaptionStyleHorizontalPlacementModel": ".caption_style_horizontal_placement_model", "CaptionStyleHorizontalPlacementModelAlign": ".caption_style_horizontal_placement_model_align", "CaptionStyleModel": ".caption_style_model", "CaptionStyleModelTextAlign": ".caption_style_model_text_align", "CaptionStyleModelTextBlendMode": ".caption_style_model_text_blend_mode", "CaptionStyleModelTextStyle": ".caption_style_model_text_style", "CaptionStyleModelTextTransform": ".caption_style_model_text_transform", "CaptionStyleModelTextWeight": ".caption_style_model_text_weight", "CaptionStyleSectionAnimationModel": ".caption_style_section_animation_model", "CaptionStyleSectionAnimationModelEnterType": ".caption_style_section_animation_model_enter_type", "CaptionStyleSectionAnimationModelExitType": ".caption_style_section_animation_model_exit_type", "CaptionStyleTemplateModel": ".caption_style_template_model", "CaptionStyleVerticalPlacementModel": ".caption_style_vertical_placement_model", "CaptionStyleVerticalPlacementModelAlign": ".caption_style_vertical_placement_model_align", "CaptionStyleWordAnimationModel": ".caption_style_word_animation_model", "CaptionStyleWordAnimationModelEnterType": ".caption_style_word_animation_model_enter_type", "CaptionStyleWordAnimationModelExitType": ".caption_style_word_animation_model_exit_type", "ChapterContentBlockExtendableNodeResponseModel": ".chapter_content_block_extendable_node_response_model", "ChapterContentBlockInputModel": ".chapter_content_block_input_model", "ChapterContentBlockInputModelSubType": ".chapter_content_block_input_model_sub_type", "ChapterContentBlockResponseModel": ".chapter_content_block_response_model", "ChapterContentBlockResponseModelNodesItem": ".chapter_content_block_response_model_nodes_item", "ChapterContentBlockResponseModelNodesItem_Other": ".chapter_content_block_response_model_nodes_item", "ChapterContentBlockResponseModelNodesItem_TtsNode": ".chapter_content_block_response_model_nodes_item", "ChapterContentBlockTtsNodeResponseModel": ".chapter_content_block_tts_node_response_model", "ChapterContentInputModel": ".chapter_content_input_model", "ChapterContentParagraphTtsNodeInputModel": ".chapter_content_paragraph_tts_node_input_model", "ChapterContentResponseModel": ".chapter_content_response_model", "ChapterResponse": ".chapter_response", "ChapterSnapshotExtendedResponseModel": ".chapter_snapshot_extended_response_model", "ChapterSnapshotResponse": ".chapter_snapshot_response", "ChapterSnapshotsResponse": ".chapter_snapshots_response", "ChapterState": ".chapter_state", "ChapterStatisticsResponse": ".chapter_statistics_response", "ChapterWithContentResponseModel": ".chapter_with_content_response_model", "ChapterWithContentResponseModelState": ".chapter_with_content_response_model_state", "CharacterAge": ".character_age", "CharacterAlignmentModel": ".character_alignment_model", "CharacterAlignmentResponseModel": ".character_alignment_response_model", "CharacterGender": ".character_gender", "CharacterMetadataResponseModel": ".character_metadata_response_model", "CharacterRefreshPeriod": ".character_refresh_period", "CharacterResponseModel": ".character_response_model", "CharacterRole": ".character_role", "CharacterUsageResponse": ".character_usage_response", "ChatSourceMedium": ".chat_source_medium", "CheckServiceAvailabilityParams": ".check_service_availability_params", "ClientEvent": ".client_event", "ClientToolConfigInput": ".client_tool_config_input", "ClientToolConfigOutput": ".client_tool_config_output", "ClipAnimation": ".clip_animation", "ClipAnimationEnterEffect": ".clip_animation_enter_effect", "ClipAnimationExitEffect": ".clip_animation_exit_effect", "CloseConnection": ".close_connection", "CloseContext": ".close_context", "ClosePayload": ".close_payload", "CloseSocket": ".close_socket", "ColumnFilter": ".column_filter", "ColumnFilterOperation": ".column_filter_operation", "ColumnFilterValuesItem": ".column_filter_values_item", "ColumnUnit": ".column_unit", "CommittedTranscriptEntitiesPayload": ".committed_transcript_entities_payload", "CommittedTranscriptPayload": ".committed_transcript_payload", "CommittedTranscriptWithTimestampsPayload": ".committed_transcript_with_timestamps_payload", "CompileProceduresResponseModel": ".compile_procedures_response_model", "CompileProceduresValidationErrorResponseModel": ".compile_procedures_validation_error_response_model", "CompositionPlan": ".composition_plan", "CompositionPlanChunksItem": ".composition_plan_chunks_item", "ConfigEntityType": ".config_entity_type", "ConflictSection": ".conflict_section", "ConstantSchemaOverride": ".constant_schema_override", "ConstantSchemaOverrideConstantValue": ".constant_schema_override_constant_value", "ContentConfig": ".content_config", "ContentFormat": ".content_format", "ContentGuardrailInput": ".content_guardrail_input", "ContentGuardrailInputTriggerAction": ".content_guardrail_input_trigger_action", "ContentGuardrailInputTriggerAction_EndCall": ".content_guardrail_input_trigger_action", "ContentGuardrailInputTriggerAction_Retry": ".content_guardrail_input_trigger_action", "ContentGuardrailOutput": ".content_guardrail_output", "ContentGuardrailOutputTriggerAction": ".content_guardrail_output_trigger_action", "ContentGuardrailOutputTriggerAction_EndCall": ".content_guardrail_output_trigger_action", "ContentGuardrailOutputTriggerAction_Retry": ".content_guardrail_output_trigger_action", "ContentThresholdGuardrail": ".content_threshold_guardrail", "ContentThresholdGuardrailThreshold": ".content_threshold_guardrail_threshold", "ContextualUpdateInfo": ".contextual_update_info", "Contributor": ".contributor", "ConvAiDynamicVariable": ".conv_ai_dynamic_variable", "ConvAiEnvVarLocator": ".conv_ai_env_var_locator", "ConvAiFileUploadResponseModel": ".conv_ai_file_upload_response_model", "ConvAiSecretLocator": ".conv_ai_secret_locator", "ConvAiStoredSecretDependencies": ".conv_ai_stored_secret_dependencies", "ConvAiStoredSecretDependenciesAgentsItem": ".conv_ai_stored_secret_dependencies_agents_item", "ConvAiStoredSecretDependenciesAgentsItem_Available": ".conv_ai_stored_secret_dependencies_agents_item", "ConvAiStoredSecretDependenciesAgentsItem_Unknown": ".conv_ai_stored_secret_dependencies_agents_item", "ConvAiStoredSecretDependenciesMcpServersItem": ".conv_ai_stored_secret_dependencies_mcp_servers_item", "ConvAiStoredSecretDependenciesMcpServersItem_Available": ".conv_ai_stored_secret_dependencies_mcp_servers_item", "ConvAiStoredSecretDependenciesMcpServersItem_Unknown": ".conv_ai_stored_secret_dependencies_mcp_servers_item", "ConvAiStoredSecretDependenciesToolsItem": ".conv_ai_stored_secret_dependencies_tools_item", "ConvAiStoredSecretDependenciesToolsItem_Available": ".conv_ai_stored_secret_dependencies_tools_item", "ConvAiStoredSecretDependenciesToolsItem_Unknown": ".conv_ai_stored_secret_dependencies_tools_item", "ConvAiUserSecretDbModel": ".conv_ai_user_secret_db_model", "ConvAiWebhooks": ".conv_ai_webhooks", "ConvAiWorkspaceStoredSecretConfig": ".conv_ai_workspace_stored_secret_config", "ConversationAsrUsageModel": ".conversation_asr_usage_model", "ConversationChargingCommonModel": ".conversation_charging_common_model", "ConversationConfigClientOverrideConfigInput": ".conversation_config_client_override_config_input", "ConversationConfigClientOverrideConfigOutput": ".conversation_config_client_override_config_output", "ConversationConfigClientOverrideInput": ".conversation_config_client_override_input", "ConversationConfigClientOverrideOutput": ".conversation_config_client_override_output", "ConversationConfigInput": ".conversation_config_input", "ConversationConfigOutput": ".conversation_config_output", "ConversationConfigOverride": ".conversation_config_override", "ConversationConfigOverrideConfig": ".conversation_config_override_config", "ConversationConfigWorkflowOverrideInput": ".conversation_config_workflow_override_input", "ConversationConfigWorkflowOverrideOutput": ".conversation_config_workflow_override_output", "ConversationDeletionSettings": ".conversation_deletion_settings", "ConversationFeedbackType": ".conversation_feedback_type", "ConversationHistoryAnalysisCommonModel": ".conversation_history_analysis_common_model", "ConversationHistoryBatchCallModel": ".conversation_history_batch_call_model", "ConversationHistoryElevenAssistantCommonModel": ".conversation_history_eleven_assistant_common_model", "ConversationHistoryErrorCommonModel": ".conversation_history_error_common_model", "ConversationHistoryEvaluationCriteriaResultCommonModel": ".conversation_history_evaluation_criteria_result_common_model", "ConversationHistoryExotelPhoneCallModel": ".conversation_history_exotel_phone_call_model", "ConversationHistoryFeedbackCommonModel": ".conversation_history_feedback_common_model", "ConversationHistoryMetadataCommonModel": ".conversation_history_metadata_common_model", "ConversationHistoryMetadataCommonModelPhoneCall": ".conversation_history_metadata_common_model_phone_call", "ConversationHistoryMetadataCommonModelPhoneCall_Exotel": ".conversation_history_metadata_common_model_phone_call", "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking": ".conversation_history_metadata_common_model_phone_call", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio": ".conversation_history_metadata_common_model_phone_call", "ConversationHistoryMultivoiceMessageModel": ".conversation_history_multivoice_message_model", "ConversationHistoryMultivoiceMessagePartModel": ".conversation_history_multivoice_message_part_model", "ConversationHistoryRagUsageCommonModel": ".conversation_history_rag_usage_common_model", "ConversationHistoryRedactionConfig": ".conversation_history_redaction_config", "ConversationHistorySipTrunkingPhoneCallModel": ".conversation_history_sip_trunking_phone_call_model", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput": ".conversation_history_transcript_api_integration_webhook_tools_result_common_model_input", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput": ".conversation_history_transcript_api_integration_webhook_tools_result_common_model_output", "ConversationHistoryTranscriptCommonModelInput": ".conversation_history_transcript_common_model_input", "ConversationHistoryTranscriptCommonModelInputRole": ".conversation_history_transcript_common_model_input_role", "ConversationHistoryTranscriptCommonModelInputToolResultsItem": ".conversation_history_transcript_common_model_input_tool_results_item", "ConversationHistoryTranscriptCommonModelOutput": ".conversation_history_transcript_common_model_output", "ConversationHistoryTranscriptCommonModelOutputRole": ".conversation_history_transcript_common_model_output_role", "ConversationHistoryTranscriptCommonModelOutputToolResultsItem": ".conversation_history_transcript_common_model_output_tool_results_item", "ConversationHistoryTranscriptFileInputResponseModel": ".conversation_history_transcript_file_input_response_model", "ConversationHistoryTranscriptOtherToolsResultCommonModel": ".conversation_history_transcript_other_tools_result_common_model", "ConversationHistoryTranscriptOtherToolsResultCommonModelType": ".conversation_history_transcript_other_tools_result_common_model_type", "ConversationHistoryTranscriptResponseModel": ".conversation_history_transcript_response_model", "ConversationHistoryTranscriptResponseModelRole": ".conversation_history_transcript_response_model_role", "ConversationHistoryTranscriptResponseModelToolResultsItem": ".conversation_history_transcript_response_model_tool_results_item", "ConversationHistoryTranscriptSystemToolResultCommonModelInput": ".conversation_history_transcript_system_tool_result_common_model_input", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess": ".conversation_history_transcript_system_tool_result_common_model_input_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutput": ".conversation_history_transcript_system_tool_result_common_model_output", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess": ".conversation_history_transcript_system_tool_result_common_model_output_result", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput": ".conversation_history_transcript_tool_call_api_integration_webhook_details_input", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput": ".conversation_history_transcript_tool_call_api_integration_webhook_details_output", "ConversationHistoryTranscriptToolCallClientDetails": ".conversation_history_transcript_tool_call_client_details", "ConversationHistoryTranscriptToolCallCommonModelInput": ".conversation_history_transcript_tool_call_common_model_input", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails": ".conversation_history_transcript_tool_call_common_model_input_tool_details", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook": ".conversation_history_transcript_tool_call_common_model_input_tool_details", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client": ".conversation_history_transcript_tool_call_common_model_input_tool_details", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp": ".conversation_history_transcript_tool_call_common_model_input_tool_details", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook": ".conversation_history_transcript_tool_call_common_model_input_tool_details", "ConversationHistoryTranscriptToolCallCommonModelOutput": ".conversation_history_transcript_tool_call_common_model_output", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails": ".conversation_history_transcript_tool_call_common_model_output_tool_details", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook": ".conversation_history_transcript_tool_call_common_model_output_tool_details", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client": ".conversation_history_transcript_tool_call_common_model_output_tool_details", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp": ".conversation_history_transcript_tool_call_common_model_output_tool_details", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook": ".conversation_history_transcript_tool_call_common_model_output_tool_details", "ConversationHistoryTranscriptToolCallMcpDetails": ".conversation_history_transcript_tool_call_mcp_details", "ConversationHistoryTranscriptToolCallWebhookDetails": ".conversation_history_transcript_tool_call_webhook_details", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput": ".conversation_history_transcript_workflow_tools_result_common_model_input", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput": ".conversation_history_transcript_workflow_tools_result_common_model_output", "ConversationHistoryTwilioPhoneCallModel": ".conversation_history_twilio_phone_call_model", "ConversationInitiationClientDataConfigInput": ".conversation_initiation_client_data_config_input", "ConversationInitiationClientDataConfigOutput": ".conversation_initiation_client_data_config_output", "ConversationInitiationClientDataInternal": ".conversation_initiation_client_data_internal", "ConversationInitiationClientDataRequestInput": ".conversation_initiation_client_data_request_input", "ConversationInitiationClientDataRequestOutput": ".conversation_initiation_client_data_request_output", "ConversationInitiationClientDataWebhook": ".conversation_initiation_client_data_webhook", "ConversationInitiationClientDataWebhookRequestHeadersValue": ".conversation_initiation_client_data_webhook_request_headers_value", "ConversationInitiationSource": ".conversation_initiation_source", "ConversationInitiationSourceInfo": ".conversation_initiation_source_info", "ConversationProduct": ".conversation_product", "ConversationReasoningModel": ".conversation_reasoning_model", "ConversationSentimentAnalysis": ".conversation_sentiment_analysis", "ConversationSentimentAnalysisOverallLabel": ".conversation_sentiment_analysis_overall_label", "ConversationSignedUrlResponseModel": ".conversation_signed_url_response_model", "ConversationSimulationSpecification": ".conversation_simulation_specification", "ConversationSource": ".conversation_source", "ConversationSummaryResponseModel": ".conversation_summary_response_model", "ConversationSummaryResponseModelStatus": ".conversation_summary_response_model_status", "ConversationTagResponseModel": ".conversation_tag_response_model", "ConversationTokenPurpose": ".conversation_token_purpose", "ConversationTokenResponseModel": ".conversation_token_response_model", "ConversationTtsUsageModel": ".conversation_tts_usage_model", "ConversationTurnMetrics": ".conversation_turn_metrics", "ConversationUserResponseModel": ".conversation_user_response_model", "ConversationVoiceRewardModel": ".conversation_voice_reward_model", "ConversationVoiceUsageModel": ".conversation_voice_usage_model", "ConversationalConfig": ".conversational_config", "ConversationalConfigApiModelWorkflowOverrideInput": ".conversational_config_api_model_workflow_override_input", "ConversationalConfigApiModelWorkflowOverrideOutput": ".conversational_config_api_model_workflow_override_output", "ConvertChapterResponseModel": ".convert_chapter_response_model", "ConvertProjectResponseModel": ".convert_project_response_model", "CrawlStatus": ".crawl_status", "CrawlType": ".crawl_type", "CreateAgentBranchResponseModel": ".create_agent_branch_response_model", "CreateAgentProcedureParams": ".create_agent_procedure_params", "CreateAgentResponseModel": ".create_agent_response_model", "CreateAgentRuleParams": ".create_agent_rule_params", "CreateAgentTestFolderResponseModel": ".create_agent_test_folder_response_model", "CreateAgentTestResponseModel": ".create_agent_test_response_model", "CreateAssetParams": ".create_asset_params", "CreateAudioNativeProjectRequest": ".create_audio_native_project_request", "CreateAuthConnectionEnvironmentVariableRequest": ".create_auth_connection_environment_variable_request", "CreateBasicAuthRequest": ".create_basic_auth_request", "CreateBearerAuthRequest": ".create_bearer_auth_request", "CreateClientAppointmentParams": ".create_client_appointment_params", "CreateClientInteractionParams": ".create_client_interaction_params", "CreateClientParams": ".create_client_params", "CreateCrawlJobResponseModel": ".create_crawl_job_response_model", "CreateCustomHeaderAuthRequest": ".create_custom_header_auth_request", "CreateExotelPhoneNumberRequest": ".create_exotel_phone_number_request", "CreateHolidayParams": ".create_holiday_params", "CreateLocationParams": ".create_location_params", "CreateMtlsAuthRequest": ".create_mtls_auth_request", "CreateOAuth2ClientCredsRequest": ".create_o_auth_2_client_creds_request", "CreateOAuth2JwtRequest": ".create_o_auth_2_jwt_request", "CreateOAuth2JwtRequestAlgorithm": ".create_o_auth_2_jwt_request_algorithm", "CreateOAuth2JwtRequestTokenResponseField": ".create_o_auth_2_jwt_request_token_response_field", "CreateOrderRequest": ".create_order_request", "CreateOrderResponse": ".create_order_response", "CreatePhoneNumberResponseModel": ".create_phone_number_response_model", "CreatePreviouslyGeneratedVoiceRequest": ".create_previously_generated_voice_request", "CreatePrivateKeyJwtRequest": ".create_private_key_jwt_request", "CreatePrivateKeyJwtRequestAlgorithm": ".create_private_key_jwt_request_algorithm", "CreateProcedureRequestModel": ".create_procedure_request_model", "CreateProcedureResponseModel": ".create_procedure_response_model", "CreateProductParams": ".create_product_params", "CreatePronunciationDictionaryResponseModel": ".create_pronunciation_dictionary_response_model", "CreateResponseUnitTestRequest": ".create_response_unit_test_request", "CreateSecretEnvironmentVariableRequest": ".create_secret_environment_variable_request", "CreateServiceParams": ".create_service_params", "CreateSimulationTestRequest": ".create_simulation_test_request", "CreateSipTrunkPhoneNumberRequest": ".create_sip_trunk_phone_number_request", "CreateStaffParams": ".create_staff_params", "CreateStringEnvironmentVariableRequest": ".create_string_environment_variable_request", "CreateToolCallUnitTestRequest": ".create_tool_call_unit_test_request", "CreateTranscriptRequest": ".create_transcript_request", "CreateTransferRuleParams": ".create_transfer_rule_params", "CreateTwilioPhoneNumberRequest": ".create_twilio_phone_number_request", "CriteriaScoringMode": ".criteria_scoring_mode", "CueOptionsRequest": ".cue_options_request", "Currency": ".currency", "CustomGuardrailConfig": ".custom_guardrail_config", "CustomGuardrailConfigModel": ".custom_guardrail_config_model", "CustomGuardrailConfigTriggerAction": ".custom_guardrail_config_trigger_action", "CustomGuardrailConfigTriggerAction_EndCall": ".custom_guardrail_config_trigger_action", "CustomGuardrailConfigTriggerAction_Retry": ".custom_guardrail_config_trigger_action", "CustomGuardrailInput": ".custom_guardrail_input", "CustomGuardrailOutput": ".custom_guardrail_output", "CustomGuardrailsConfigInput": ".custom_guardrails_config_input", "CustomGuardrailsConfigOutput": ".custom_guardrails_config_output", "CustomHeaderAuthResponse": ".custom_header_auth_response", "CustomLlm": ".custom_llm", "CustomLlmApiKey": ".custom_llm_api_key", "CustomLlmAuthConnection": ".custom_llm_auth_connection", "CustomLlmRequestHeadersValue": ".custom_llm_request_headers_value", "CustomLlmapiType": ".custom_llmapi_type", "CustomSipHeader": ".custom_sip_header", "CustomSipHeaderWithDynamicVariable": ".custom_sip_header_with_dynamic_variable", "CustomToolApiSchemaConfig": ".custom_tool_api_schema_config", "DashboardCallSuccessChartModel": ".dashboard_call_success_chart_model", "DashboardCriteriaChartModel": ".dashboard_criteria_chart_model", "DashboardDataCollectionChartModel": ".dashboard_data_collection_chart_model", "DataCollectionResultCommonModel": ".data_collection_result_common_model", "DefaultSharingGroupConfig": ".default_sharing_group_config", "DefaultSharingGroupConfigPermissionLevel": ".default_sharing_group_config_permission_level", "DefaultSharingGroupResponseModel": ".default_sharing_group_response_model", "DefaultSharingGroupResponseModelPermissionLevel": ".default_sharing_group_response_model_permission_level", "DeleteAgentProcedureParams": ".delete_agent_procedure_params", "DeleteAgentRuleParams": ".delete_agent_rule_params", "DeleteAssetParams": ".delete_asset_params", "DeleteCalendarEventParams": ".delete_calendar_event_params", "DeleteChapterRequest": ".delete_chapter_request", "DeleteChapterResponseModel": ".delete_chapter_response_model", "DeleteClientInteractionParams": ".delete_client_interaction_params", "DeleteClientParams": ".delete_client_params", "DeleteDubbingResponseModel": ".delete_dubbing_response_model", "DeleteGroupSessionParams": ".delete_group_session_params", "DeleteHistoryItemResponse": ".delete_history_item_response", "DeleteHolidayParams": ".delete_holiday_params", "DeleteLocationParams": ".delete_location_params", "DeleteProductParams": ".delete_product_params", "DeleteProjectRequest": ".delete_project_request", "DeleteProjectResponseModel": ".delete_project_response_model", "DeleteSampleResponse": ".delete_sample_response", "DeleteServiceParams": ".delete_service_params", "DeleteStaffParams": ".delete_staff_params", "DeleteTransferRuleParams": ".delete_transfer_rule_params", "DeleteVoiceResponseModel": ".delete_voice_response_model", "DeleteVoiceSampleResponseModel": ".delete_voice_sample_response_model", "DeleteWorkspaceGroupMemberResponseModel": ".delete_workspace_group_member_response_model", "DeleteWorkspaceInviteResponseModel": ".delete_workspace_invite_response_model", "DeleteWorkspaceWebhookResponseModel": ".delete_workspace_webhook_response_model", "DeliverableInfo": ".deliverable_info", "DependentAvailableAgentIdentifier": ".dependent_available_agent_identifier", "DependentAvailableAgentIdentifierAccessLevel": ".dependent_available_agent_identifier_access_level", "DependentAvailableMcpServerIdentifier": ".dependent_available_mcp_server_identifier", "DependentAvailableMcpServerIdentifierAccessLevel": ".dependent_available_mcp_server_identifier_access_level", "DependentAvailableToolIdentifier": ".dependent_available_tool_identifier", "DependentAvailableToolIdentifierAccessLevel": ".dependent_available_tool_identifier_access_level", "DependentBranchInfo": ".dependent_branch_info", "DependentIntegrationConnectionIdentifier": ".dependent_integration_connection_identifier", "DependentPhoneNumberIdentifier": ".dependent_phone_number_identifier", "DependentUnknownAgentIdentifier": ".dependent_unknown_agent_identifier", "DependentUnknownMcpServerIdentifier": ".dependent_unknown_mcp_server_identifier", "DependentUnknownToolIdentifier": ".dependent_unknown_tool_identifier", "DetailedMusicResponse": ".detailed_music_response", "DetailedMusicResponseCompositionPlan": ".detailed_music_response_composition_plan", "DetectedEntity": ".detected_entity", "DeviceModel": ".device_model", "DialogueInput": ".dialogue_input", "DialogueInputResponseModel": ".dialogue_input_response_model", "DialogueTextAlignment": ".dialogue_text_alignment", "DirectPublishingReadResponseModel": ".direct_publishing_read_response_model", "DirectPublishingReadResponseModelDisplayMode": ".direct_publishing_read_response_model_display_mode", "DirectPublishingReadResponseModelGenreItem": ".direct_publishing_read_response_model_genre_item", "DirectPublishingReadResponseModelPayoutType": ".direct_publishing_read_response_model_payout_type", "DirectPublishingReadResponseModelTargetAudience": ".direct_publishing_read_response_model_target_audience", "DiscountResponseModel": ".discount_response_model", "DoDubbingResponse": ".do_dubbing_response", "DocumentUsageModeEnum": ".document_usage_mode_enum", "DocxExportOptions": ".docx_export_options", "DtmfInputConfig": ".dtmf_input_config", "DubOrderItemRequest": ".dub_order_item_request", "DubbedSegment": ".dubbed_segment", "DubbingBulkSourceSegmentUpdateResponse": ".dubbing_bulk_source_segment_update_response", "DubbingBulkTargetSegmentUpdateResponse": ".dubbing_bulk_target_segment_update_response", "DubbingError": ".dubbing_error", "DubbingLanguageListResponse": ".dubbing_language_list_response", "DubbingLanguageOutputs": ".dubbing_language_outputs", "DubbingLanguageResponse": ".dubbing_language_response", "DubbingLanguageResponseStatus": ".dubbing_language_response_status", "DubbingMediaMetadata": ".dubbing_media_metadata", "DubbingMediaReference": ".dubbing_media_reference", "DubbingMetadataPageResponseModel": ".dubbing_metadata_page_response_model", "DubbingMetadataResponse": ".dubbing_metadata_response", "DubbingProjectListResponse": ".dubbing_project_list_response", "DubbingProjectResponse": ".dubbing_project_response", "DubbingProjectResponseStatus": ".dubbing_project_response_status", "DubbingRegenerateResponse": ".dubbing_regenerate_response", "DubbingRenderResponseModel": ".dubbing_render_response_model", "DubbingResource": ".dubbing_resource", "DubbingSegmentUpdateRequest": ".dubbing_segment_update_request", "DubbingSourceMediaInfo": ".dubbing_source_media_info", "DubbingSourceSegmentUpdateResponse": ".dubbing_source_segment_update_response", "DubbingSourceTranscriptResponse": ".dubbing_source_transcript_response", "DubbingTargetSegmentUpdateRequest": ".dubbing_target_segment_update_request", "DubbingTargetSegmentUpdateResponse": ".dubbing_target_segment_update_response", "DubbingTargetTranscriptResponse": ".dubbing_target_transcript_response", "DubbingTargetTranscriptSegment": ".dubbing_target_transcript_segment", "DubbingTranscript": ".dubbing_transcript", "DubbingTranscriptCharacter": ".dubbing_transcript_character", "DubbingTranscriptResponseModel": ".dubbing_transcript_response_model", "DubbingTranscriptRevisionResponse": ".dubbing_transcript_revision_response", "DubbingTranscriptSegment": ".dubbing_transcript_segment", "DubbingTranscriptUtterance": ".dubbing_transcript_utterance", "DubbingTranscriptWord": ".dubbing_transcript_word", "DubbingTranscriptsResponseModel": ".dubbing_transcripts_response_model", "DubbingTranscriptsResponseModelTranscriptFormat": ".dubbing_transcripts_response_model_transcript_format", "DummyToolResultModel": ".dummy_tool_result_model", "DynamicVariableAssignment": ".dynamic_variable_assignment", "DynamicVariableNestedValueTypeInput": ".dynamic_variable_nested_value_type_input", "DynamicVariableNestedValueTypeOutput": ".dynamic_variable_nested_value_type_output", "DynamicVariableSchemaOverride": ".dynamic_variable_schema_override", "DynamicVariableUpdateCommonModel": ".dynamic_variable_update_common_model", "DynamicVariablesConfig": ".dynamic_variables_config", "DynamicVariablesConfigWorkflowOverride": ".dynamic_variables_config_workflow_override", "EditChapterResponseModel": ".edit_chapter_response_model", "EditProjectResponseModel": ".edit_project_response_model", "EditVoiceResponseModel": ".edit_voice_response_model", "EditVoiceSettingsRequest": ".edit_voice_settings_request", "EditVoiceSettingsResponseModel": ".edit_voice_settings_response_model", "EmbedVariant": ".embed_variant", "EmbeddingModelEnum": ".embedding_model_enum", "EndCallToolConfig": ".end_call_tool_config", "EndCallToolResultModel": ".end_call_tool_result_model", "EndCallTriggerAction": ".end_call_trigger_action", "EndProcedureToolConfigInput": ".end_procedure_tool_config_input", "EndProcedureToolConfigOutput": ".end_procedure_tool_config_output", "EndProcedureToolErrorStatus": ".end_procedure_tool_error_status", "EntityManagementActivityId": ".entity_management_activity_id", "EntryBehavior": ".entry_behavior", "EnvironmentAuthConnectionLocator": ".environment_auth_connection_locator", "EnvironmentVariableAuthConnectionValue": ".environment_variable_auth_connection_value", "EnvironmentVariableAuthConnectionValueRequest": ".environment_variable_auth_connection_value_request", "EnvironmentVariableResponse": ".environment_variable_response", "EnvironmentVariableResponseType": ".environment_variable_response_type", "EnvironmentVariableResponseValues": ".environment_variable_response_values", "EnvironmentVariableSecretValue": ".environment_variable_secret_value", "EnvironmentVariableSecretValueRequest": ".environment_variable_secret_value_request", "EnvironmentVariablesListResponse": ".environment_variables_list_response", "ErrorPayload": ".error_payload", "EvaluationCriteriaSummaryResult": ".evaluation_criteria_summary_result", "EvaluationSettingsInput": ".evaluation_settings_input", "EvaluationSettingsOutput": ".evaluation_settings_output", "EvaluationSuccessResult": ".evaluation_success_result", "ExactParameterEvaluationStrategy": ".exact_parameter_evaluation_strategy", "ExotelApiSubdomain": ".exotel_api_subdomain", "ExotelOutboundCallResponse": ".exotel_outbound_call_response", "ExportOptions": ".export_options", "ExportOptions_Docx": ".export_options", "ExportOptions_Html": ".export_options", "ExportOptions_Pdf": ".export_options", "ExportOptions_SegmentedJson": ".export_options", "ExportOptions_Srt": ".export_options", "ExportOptions_Txt": ".export_options", "ExternalFileSyncInfo": ".external_file_sync_info", "ExternalFolderSyncInfo": ".external_folder_sync_info", "ExternalSyncJobTrigger": ".external_sync_job_trigger", "ExternalSyncJobType": ".external_sync_job_type", "ExternalSyncProvider": ".external_sync_provider", "FeatureStatusCommonModel": ".feature_status_common_model", "FeaturesUsageCommonModel": ".features_usage_common_model", "FeedbackItem": ".feedback_item", "FieldConflict": ".field_conflict", "FileInputConfig": ".file_input_config", "FileInputConfigWorkflowOverride": ".file_input_config_workflow_override", "FileRefreshStatus": ".file_refresh_status", "FinalOutput": ".final_output", "FinalOutputMulti": ".final_output_multi", "FinalTranscript": ".final_transcript", "FinalTranscriptWithTimestamps": ".final_transcript_with_timestamps", "FinalTranscriptWithTimestampsWordsItem": ".final_transcript_with_timestamps_words_item", "FinalTranscriptWithTimestampsWordsItemCharactersItem": ".final_transcript_with_timestamps_words_item_characters_item", "FinalTranscriptWithTimestampsWordsItemType": ".final_transcript_with_timestamps_words_item_type", "FineTuningResponse": ".fine_tuning_response", "FineTuningResponseStateValue": ".fine_tuning_response_state_value", "FinetuneCreatedBy": ".finetune_created_by", "FinetuneVisibility": ".finetune_visibility", "FlushContext": ".flush_context", "FocusGuardrail": ".focus_guardrail", "ForcedAlignmentCharacterResponseModel": ".forced_alignment_character_response_model", "ForcedAlignmentResponseModel": ".forced_alignment_response_model", "ForcedAlignmentWordResponseModel": ".forced_alignment_word_response_model", "FrustratedConversationRef": ".frustrated_conversation_ref", "FrustratedConversationRefOverallLabel": ".frustrated_conversation_ref_overall_label", "Gender": ".gender", "GenerateVoiceRequest": ".generate_voice_request", "GenerationChunkInput": ".generation_chunk_input", "GenerationChunkInputConditionStrength": ".generation_chunk_input_condition_strength", "GenerationChunkInputContextAdherence": ".generation_chunk_input_context_adherence", "GenerationChunkOutput": ".generation_chunk_output", "GenerationChunkOutputConditionStrength": ".generation_chunk_output_condition_strength", "GenerationChunkOutputContextAdherence": ".generation_chunk_output_context_adherence", "GenerationConfig": ".generation_config", "GenerationSourceContext": ".generation_source_context", "GenesysBotOutcome": ".genesys_bot_outcome", "GenesysRegion": ".genesys_region", "GetAgentEmbedResponseModel": ".get_agent_embed_response_model", "GetAgentKnowledgebaseSizeResponseModel": ".get_agent_knowledgebase_size_response_model", "GetAgentLinkResponseModel": ".get_agent_link_response_model", "GetAgentResponseModel": ".get_agent_response_model", "GetAgentResponseModelPhoneNumbersItem": ".get_agent_response_model_phone_numbers_item", "GetAgentResponseModelPhoneNumbersItem_Exotel": ".get_agent_response_model_phone_numbers_item", "GetAgentResponseModelPhoneNumbersItem_SipTrunk": ".get_agent_response_model_phone_numbers_item", "GetAgentResponseModelPhoneNumbersItem_Twilio": ".get_agent_response_model_phone_numbers_item", "GetAgentTestFolderResponseModel": ".get_agent_test_folder_response_model", "GetAgentTopicsResponseModel": ".get_agent_topics_response_model", "GetAgentsPageResponseModel": ".get_agents_page_response_model", "GetAnalyticsSummaryParams": ".get_analytics_summary_params", "GetAppointmentByConfirmationNumberParams": ".get_appointment_by_confirmation_number_params", "GetAudioIsolationHistoryResponseModel": ".get_audio_isolation_history_response_model", "GetAudioNativeProjectSettingsResponseModel": ".get_audio_native_project_settings_response_model", "GetBookingPageSettingsParams": ".get_booking_page_settings_params", "GetBookingSlugStatusParams": ".get_booking_slug_status_params", "GetChapterRequest": ".get_chapter_request", "GetChapterSnapshotsRequest": ".get_chapter_snapshots_request", "GetChaptersRequest": ".get_chapters_request", "GetChaptersResponse": ".get_chapters_response", "GetClientAppointmentsParams": ".get_client_appointments_params", "GetClientByPhoneParams": ".get_client_by_phone_params", "GetConvAiDashboardSettingsResponseModel": ".get_conv_ai_dashboard_settings_response_model", "GetConvAiDashboardSettingsResponseModelChartsItem": ".get_conv_ai_dashboard_settings_response_model_charts_item", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess": ".get_conv_ai_dashboard_settings_response_model_charts_item", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria": ".get_conv_ai_dashboard_settings_response_model_charts_item", "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection": ".get_conv_ai_dashboard_settings_response_model_charts_item", "GetConvAiSettingsResponseModel": ".get_conv_ai_settings_response_model", "GetConversationResponseModel": ".get_conversation_response_model", "GetConversationResponseModelStatus": ".get_conversation_response_model_status", "GetConversationTagsPageResponseModel": ".get_conversation_tags_page_response_model", "GetConversationUsersPageResponseModel": ".get_conversation_users_page_response_model", "GetConversationsPageResponseModel": ".get_conversations_page_response_model", "GetCrawlJobResponseModel": ".get_crawl_job_response_model", "GetKnowledgeBaseDependentAgentsResponseModel": ".get_knowledge_base_dependent_agents_response_model", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem": ".get_knowledge_base_dependent_agents_response_model_agents_item", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available": ".get_knowledge_base_dependent_agents_response_model_agents_item", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown": ".get_knowledge_base_dependent_agents_response_model_agents_item", "GetKnowledgeBaseFileResponseModel": ".get_knowledge_base_file_response_model", "GetKnowledgeBaseFolderResponseModel": ".get_knowledge_base_folder_response_model", "GetKnowledgeBaseListResponseModel": ".get_knowledge_base_list_response_model", "GetKnowledgeBaseListResponseModelDocumentsItem": ".get_knowledge_base_list_response_model_documents_item", "GetKnowledgeBaseListResponseModelDocumentsItem_File": ".get_knowledge_base_list_response_model_documents_item", "GetKnowledgeBaseListResponseModelDocumentsItem_Folder": ".get_knowledge_base_list_response_model_documents_item", "GetKnowledgeBaseListResponseModelDocumentsItem_Text": ".get_knowledge_base_list_response_model_documents_item", "GetKnowledgeBaseListResponseModelDocumentsItem_Url": ".get_knowledge_base_list_response_model_documents_item", "GetKnowledgeBaseSummaryFileResponseModel": ".get_knowledge_base_summary_file_response_model", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem": ".get_knowledge_base_summary_file_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available": ".get_knowledge_base_summary_file_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown": ".get_knowledge_base_summary_file_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryFolderResponseModel": ".get_knowledge_base_summary_folder_response_model", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem": ".get_knowledge_base_summary_folder_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available": ".get_knowledge_base_summary_folder_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown": ".get_knowledge_base_summary_folder_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryTextResponseModel": ".get_knowledge_base_summary_text_response_model", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem": ".get_knowledge_base_summary_text_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available": ".get_knowledge_base_summary_text_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown": ".get_knowledge_base_summary_text_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryUrlResponseModel": ".get_knowledge_base_summary_url_response_model", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem": ".get_knowledge_base_summary_url_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available": ".get_knowledge_base_summary_url_response_model_dependent_agents_item", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown": ".get_knowledge_base_summary_url_response_model_dependent_agents_item", "GetKnowledgeBaseTextResponseModel": ".get_knowledge_base_text_response_model", "GetKnowledgeBaseUrlResponseModel": ".get_knowledge_base_url_response_model", "GetLibraryVoicesResponse": ".get_library_voices_response", "GetLiveCountResponse": ".get_live_count_response", "GetOrCreateRagIndexRequestModel": ".get_or_create_rag_index_request_model", "GetPhoneNumberExotelResponseModel": ".get_phone_number_exotel_response_model", "GetPhoneNumberInboundSipTrunkConfigResponseModel": ".get_phone_number_inbound_sip_trunk_config_response_model", "GetPhoneNumberOutboundSipTrunkConfigResponseModel": ".get_phone_number_outbound_sip_trunk_config_response_model", "GetPhoneNumberResponse": ".get_phone_number_response", "GetPhoneNumberSipTrunkResponseModel": ".get_phone_number_sip_trunk_response_model", "GetPhoneNumberTwilioResponseModel": ".get_phone_number_twilio_response_model", "GetProjectRequest": ".get_project_request", "GetProjectsRequest": ".get_projects_request", "GetProjectsResponse": ".get_projects_response", "GetPronunciationDictionariesMetadataResponseModel": ".get_pronunciation_dictionaries_metadata_response_model", "GetPronunciationDictionariesResponse": ".get_pronunciation_dictionaries_response", "GetPronunciationDictionaryMetadataResponse": ".get_pronunciation_dictionary_metadata_response", "GetPronunciationDictionaryMetadataResponsePermissionOnResource": ".get_pronunciation_dictionary_metadata_response_permission_on_resource", "GetPronunciationDictionaryResponse": ".get_pronunciation_dictionary_response", "GetPronunciationDictionaryWithRulesResponseModel": ".get_pronunciation_dictionary_with_rules_response_model", "GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource": ".get_pronunciation_dictionary_with_rules_response_model_permission_on_resource", "GetPronunciationDictionaryWithRulesResponseModelRulesItem": ".get_pronunciation_dictionary_with_rules_response_model_rules_item", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias": ".get_pronunciation_dictionary_with_rules_response_model_rules_item", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme": ".get_pronunciation_dictionary_with_rules_response_model_rules_item", "GetResponseUnitTestResponseModel": ".get_response_unit_test_response_model", "GetScheduleParams": ".get_schedule_params", "GetSecretDependenciesResponseModel": ".get_secret_dependencies_response_model", "GetSecretDependenciesResponseModelDependencies": ".get_secret_dependencies_response_model_dependencies", "GetSecretDependenciesResponseModelDependenciesOneItem": ".get_secret_dependencies_response_model_dependencies_one_item", "GetSecretDependenciesResponseModelDependenciesOneItem_Available": ".get_secret_dependencies_response_model_dependencies_one_item", "GetSecretDependenciesResponseModelDependenciesOneItem_Unknown": ".get_secret_dependencies_response_model_dependencies_one_item", "GetSecretDependenciesResponseModelDependenciesZeroItem": ".get_secret_dependencies_response_model_dependencies_zero_item", "GetSecretDependenciesResponseModelDependenciesZeroItem_Available": ".get_secret_dependencies_response_model_dependencies_zero_item", "GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown": ".get_secret_dependencies_response_model_dependencies_zero_item", "GetSimulationTestResponseModel": ".get_simulation_test_response_model", "GetSipLogMessagesResponse": ".get_sip_log_messages_response", "GetSpeechHistoryResponse": ".get_speech_history_response", "GetTestInvocationsPageResponseModel": ".get_test_invocations_page_response_model", "GetTestSuiteInvocationResponseModel": ".get_test_suite_invocation_response_model", "GetTestsPageResponseModel": ".get_tests_page_response_model", "GetTestsSummariesByIdsResponseModel": ".get_tests_summaries_by_ids_response_model", "GetToolCallUnitTestResponseModel": ".get_tool_call_unit_test_response_model", "GetToolDependentAgentsResponseModel": ".get_tool_dependent_agents_response_model", "GetToolDependentAgentsResponseModelAgentsItem": ".get_tool_dependent_agents_response_model_agents_item", "GetToolDependentAgentsResponseModelAgentsItem_Available": ".get_tool_dependent_agents_response_model_agents_item", "GetToolDependentAgentsResponseModelAgentsItem_Unknown": ".get_tool_dependent_agents_response_model_agents_item", "GetToolExecutionsPageResponseModel": ".get_tool_executions_page_response_model", "GetVoiceAccentsResponseModel": ".get_voice_accents_response_model", "GetVoicesResponse": ".get_voices_response", "GetVoicesV2Response": ".get_voices_v_2_response", "GetWhatsAppAccountResponse": ".get_whats_app_account_response", "GetWorkspaceSecretsResponseModel": ".get_workspace_secrets_response_model", "GroupManagementActivityId": ".group_management_activity_id", "GuardrailExecutionMode": ".guardrail_execution_mode", "GuardrailType": ".guardrail_type", "GuardrailsV1Input": ".guardrails_v_1_input", "GuardrailsV1Output": ".guardrails_v_1_output", "HistoryAlignmentResponseModel": ".history_alignment_response_model", "HistoryAlignmentsResponseModel": ".history_alignments_response_model", "HistoryItemResponse": ".history_item_response", "HtmlExportOptions": ".html_export_options", "HttpRequestModel": ".http_request_model", "HttpValidationError": ".http_validation_error", "Icon": ".icon", "ImageAnalysis": ".image_analysis", "ImageAnalysisResult": ".image_analysis_result", "ImageAnalysisStatus": ".image_analysis_status", "ImageAvatar": ".image_avatar", "ImageSubject": ".image_subject", "InboundSipTrunkConfigRequestModel": ".inbound_sip_trunk_config_request_model", "InitPayload": ".init_payload", "InitialiseContext": ".initialise_context", "InitializeConnection": ".initialize_connection", "InitializeConnectionMulti": ".initialize_connection_multi", "InputAudioChunkPayload": ".input_audio_chunk_payload", "IntegrationType": ".integration_type", "InteractionBudget": ".interaction_budget", "InternalAlertingWebhookNotifier": ".internal_alerting_webhook_notifier", "InvoiceResponse": ".invoice_response", "InvoiceResponsePaymentIntentStatus": ".invoice_response_payment_intent_status", "InvoiceResponsePaymentIntentStatussesItem": ".invoice_response_payment_intent_statusses_item", "ItemId": ".item_id", "KbExternalSyncJob": ".kb_external_sync_job", "KeepContextAlive": ".keep_context_alive", "KnowledgeBaseBulkDeleteSuccessfulResponseModel": ".knowledge_base_bulk_delete_successful_response_model", "KnowledgeBaseContentSearchResponseModel": ".knowledge_base_content_search_response_model", "KnowledgeBaseContentSearchResult": ".knowledge_base_content_search_result", "KnowledgeBaseContentSearchResultDocument": ".knowledge_base_content_search_result_document", "KnowledgeBaseContentSearchResultDocument_File": ".knowledge_base_content_search_result_document", "KnowledgeBaseContentSearchResultDocument_Folder": ".knowledge_base_content_search_result_document", "KnowledgeBaseContentSearchResultDocument_Text": ".knowledge_base_content_search_result_document", "KnowledgeBaseContentSearchResultDocument_Url": ".knowledge_base_content_search_result_document", "KnowledgeBaseDeletedResponseModel": ".knowledge_base_deleted_response_model", "KnowledgeBaseDependentType": ".knowledge_base_dependent_type", "KnowledgeBaseDocumentChunkResponseModel": ".knowledge_base_document_chunk_response_model", "KnowledgeBaseDocumentChunksResponseModel": ".knowledge_base_document_chunks_response_model", "KnowledgeBaseDocumentMetadataResponseModel": ".knowledge_base_document_metadata_response_model", "KnowledgeBaseDocumentType": ".knowledge_base_document_type", "KnowledgeBaseFolderPathSegmentResponseModel": ".knowledge_base_folder_path_segment_response_model", "KnowledgeBaseFolderPathSegmentSummaryResponseModel": ".knowledge_base_folder_path_segment_summary_response_model", "KnowledgeBaseLocator": ".knowledge_base_locator", "KnowledgeBaseRagChunkModel": ".knowledge_base_rag_chunk_model", "KnowledgeBaseRagToolConfig": ".knowledge_base_rag_tool_config", "KnowledgeBaseRagToolResultModel": ".knowledge_base_rag_tool_result_model", "KnowledgeBaseRagToolStatus": ".knowledge_base_rag_tool_status", "KnowledgeBaseSortBy": ".knowledge_base_sort_by", "KnowledgeBaseSourceFileUrlResponseModel": ".knowledge_base_source_file_url_response_model", "KnowledgeBaseSummaryBatchSuccessfulResponseModel": ".knowledge_base_summary_batch_successful_response_model", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData": ".knowledge_base_summary_batch_successful_response_model_data", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File": ".knowledge_base_summary_batch_successful_response_model_data", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder": ".knowledge_base_summary_batch_successful_response_model_data", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text": ".knowledge_base_summary_batch_successful_response_model_data", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url": ".knowledge_base_summary_batch_successful_response_model_data", "KnowledgeBaseToolConfig": ".knowledge_base_tool_config", "KnowledgeBaseToolInfo": ".knowledge_base_tool_info", "KnowledgeBaseToolResultModel": ".knowledge_base_tool_result_model", "KnowledgeBaseToolStatus": ".knowledge_base_tool_status", "LanguageAddedResponse": ".language_added_response", "LanguageDetectionToolConfig": ".language_detection_tool_config", "LanguageDetectionToolResultModel": ".language_detection_tool_result_model", "LanguageInfo": ".language_info", "LanguagePairInfo": ".language_pair_info", "LanguagePresetInput": ".language_preset_input", "LanguagePresetOutput": ".language_preset_output", "LanguagePresetTranslation": ".language_preset_translation", "LanguageResponse": ".language_response", "LanguagesResponse": ".languages_response", "LanguagesResponse_Pair": ".languages_response", "LanguagesResponse_Single": ".languages_response", "LeaveMessageParams": ".leave_message_params", "LibraryVoiceResponse": ".library_voice_response", "LibraryVoiceResponseCategory": ".library_voice_response_category", "ListAgentProceduresParams": ".list_agent_procedures_params", "ListAgentReferencesParams": ".list_agent_references_params", "ListAgentRulesParams": ".list_agent_rules_params", "ListAssetsParams": ".list_assets_params", "ListAuthConnectionsResponse": ".list_auth_connections_response", "ListAuthConnectionsResponseAuthConnectionsItem": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_Mtls": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret": ".list_auth_connections_response_auth_connections_item", "ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth": ".list_auth_connections_response_auth_connections_item", "ListCalendarEventsParams": ".list_calendar_events_params", "ListClientInteractionsParams": ".list_client_interactions_params", "ListClientsParams": ".list_clients_params", "ListCrawlJobsResponseModel": ".list_crawl_jobs_response_model", "ListCustomerFacingAgentsParams": ".list_customer_facing_agents_params", "ListGroupSessionsParams": ".list_group_sessions_params", "ListHolidaysParams": ".list_holidays_params", "ListLocationsParams": ".list_locations_params", "ListMcpToolsResponseModel": ".list_mcp_tools_response_model", "ListOrdersResponse": ".list_orders_response", "ListProceduresResponseModel": ".list_procedures_response_model", "ListProductsParams": ".list_products_params", "ListResponseAgentBranchSummary": ".list_response_agent_branch_summary", "ListResponseMeta": ".list_response_meta", "ListServicesParams": ".list_services_params", "ListSpeechEnginesResponse": ".list_speech_engines_response", "ListStaffParams": ".list_staff_params", "ListTransferRulesParams": ".list_transfer_rules_params", "ListWhatsAppAccountsResponse": ".list_whats_app_accounts_response", "LiteralJsonSchemaProperty": ".literal_json_schema_property", "LiteralJsonSchemaPropertyConstantValue": ".literal_json_schema_property_constant_value", "LiteralJsonSchemaPropertyType": ".literal_json_schema_property_type", "LivekitStackType": ".livekit_stack_type", "Llm": ".llm", "LlmCategoryUsage": ".llm_category_usage", "LlmDeprecationConfigModel": ".llm_deprecation_config_model", "LlmDeprecationInfoModel": ".llm_deprecation_info_model", "LlmInfoModelInput": ".llm_info_model_input", "LlmInfoModelOutput": ".llm_info_model_output", "LlmInputOutputTokensUsage": ".llm_input_output_tokens_usage", "LlmListResponseModelInput": ".llm_list_response_model_input", "LlmListResponseModelOutput": ".llm_list_response_model_output", "LlmLiteralJsonSchemaProperty": ".llm_literal_json_schema_property", "LlmLiteralJsonSchemaPropertyType": ".llm_literal_json_schema_property_type", "LlmParameterEvaluationStrategy": ".llm_parameter_evaluation_strategy", "LlmReasoningEffort": ".llm_reasoning_effort", "LlmSchemaOverride": ".llm_schema_override", "LlmTokensCategoryUsage": ".llm_tokens_category_usage", "LlmUsageCalculatorLlmResponseModel": ".llm_usage_calculator_llm_response_model", "LlmUsageCalculatorResponseModel": ".llm_usage_calculator_response_model", "LlmUsageInput": ".llm_usage_input", "LlmUsageOutput": ".llm_usage_output", "LoadMemoryEntryToolErrorStatus": ".load_memory_entry_tool_error_status", "LoadableMemoryEntry": ".loadable_memory_entry", "LockReason": ".lock_reason", "ManualSource": ".manual_source", "ManualVerificationFileResponse": ".manual_verification_file_response", "ManualVerificationResponse": ".manual_verification_response", "MatchAnythingParameterEvaluationStrategy": ".match_anything_parameter_evaluation_strategy", "McpApprovalPolicy": ".mcp_approval_policy", "McpServerConfigInput": ".mcp_server_config_input", "McpServerConfigInputAuthConnection": ".mcp_server_config_input_auth_connection", "McpServerConfigInputRequestHeadersValue": ".mcp_server_config_input_request_headers_value", "McpServerConfigInputRequestMetaValue": ".mcp_server_config_input_request_meta_value", "McpServerConfigInputSecretToken": ".mcp_server_config_input_secret_token", "McpServerConfigInputUrl": ".mcp_server_config_input_url", "McpServerConfigOutput": ".mcp_server_config_output", "McpServerConfigOutputAuthConnection": ".mcp_server_config_output_auth_connection", "McpServerConfigOutputRequestHeadersValue": ".mcp_server_config_output_request_headers_value", "McpServerConfigOutputRequestMetaValue": ".mcp_server_config_output_request_meta_value", "McpServerConfigOutputSecretToken": ".mcp_server_config_output_secret_token", "McpServerConfigOutputUrl": ".mcp_server_config_output_url", "McpServerMetadataResponseModel": ".mcp_server_metadata_response_model", "McpServerResponseModel": ".mcp_server_response_model", "McpServerResponseModelDependentAgentsItem": ".mcp_server_response_model_dependent_agents_item", "McpServerResponseModelDependentAgentsItem_Available": ".mcp_server_response_model_dependent_agents_item", "McpServerResponseModelDependentAgentsItem_Unknown": ".mcp_server_response_model_dependent_agents_item", "McpServerTransport": ".mcp_server_transport", "McpServersResponseModel": ".mcp_servers_response_model", "McpToolApprovalHash": ".mcp_tool_approval_hash", "McpToolApprovalPolicy": ".mcp_tool_approval_policy", "McpToolConfigOverrideInput": ".mcp_tool_config_override_input", "McpToolConfigOverrideInputInputOverridesValue": ".mcp_tool_config_override_input_input_overrides_value", "McpToolConfigOverrideInputInputOverridesValue_Constant": ".mcp_tool_config_override_input_input_overrides_value", "McpToolConfigOverrideInputInputOverridesValue_DynamicVariable": ".mcp_tool_config_override_input_input_overrides_value", "McpToolConfigOverrideInputInputOverridesValue_Llm": ".mcp_tool_config_override_input_input_overrides_value", "McpToolConfigOverrideInputInputOverridesValue_Omit": ".mcp_tool_config_override_input_input_overrides_value", "McpToolConfigOverrideInputToolCallSound": ".mcp_tool_config_override_input_tool_call_sound", "McpToolConfigOverrideOutput": ".mcp_tool_config_override_output", "McpToolConfigOverrideOutputInputOverridesValue": ".mcp_tool_config_override_output_input_overrides_value", "McpToolConfigOverrideOutputInputOverridesValue_Constant": ".mcp_tool_config_override_output_input_overrides_value", "McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable": ".mcp_tool_config_override_output_input_overrides_value", "McpToolConfigOverrideOutputInputOverridesValue_Llm": ".mcp_tool_config_override_output_input_overrides_value", "McpToolConfigOverrideOutputInputOverridesValue_Omit": ".mcp_tool_config_override_output_input_overrides_value", "McpToolConfigOverrideOutputToolCallSound": ".mcp_tool_config_override_output_tool_call_sound", "MediaCodec": ".media_codec", "MediaId": ".media_id", "MemoryEntrySearchResult": ".memory_entry_search_result", "MemoryEntrySearchResultSource": ".memory_entry_search_result_source", "MergePreviewResponseModel": ".merge_preview_response_model", "MergePreviewResponseModelPhoneNumbersItem": ".merge_preview_response_model_phone_numbers_item", "MergePreviewResponseModelPhoneNumbersItem_Exotel": ".merge_preview_response_model_phone_numbers_item", "MergePreviewResponseModelPhoneNumbersItem_SipTrunk": ".merge_preview_response_model_phone_numbers_item", "MergePreviewResponseModelPhoneNumbersItem_Twilio": ".merge_preview_response_model_phone_numbers_item", "MessageSearchSortBy": ".message_search_sort_by", "MessagesSearchResponse": ".messages_search_response", "MessagesSearchResult": ".messages_search_result", "MetricRecord": ".metric_record", "MetricType": ".metric_type", "MockNoMatchBehavior": ".mock_no_match_behavior", "MockingStrategy": ".mocking_strategy", "Model": ".model", "ModelRatesResponseModel": ".model_rates_response_model", "ModelSettingsResponseModel": ".model_settings_response_model", "ModerationConfig": ".moderation_config", "ModerationGuardrailInput": ".moderation_guardrail_input", "ModerationGuardrailOutput": ".moderation_guardrail_output", "MtlsAuthResponse": ".mtls_auth_response", "MultichannelSpeechToTextResponseModel": ".multichannel_speech_to_text_response_model", "MultipartMusicResponse": ".multipart_music_response", "MusicAllowedOutputFormats": ".music_allowed_output_formats", "MusicExploreSongSourceContext": ".music_explore_song_source_context", "MusicFinetuneFailureReason": ".music_finetune_failure_reason", "MusicFinetunePageResponseModel": ".music_finetune_page_response_model", "MusicFinetuneResponseModel": ".music_finetune_response_model", "MusicFinetuneStatus": ".music_finetune_status", "MusicGenerationMode": ".music_generation_mode", "MusicOnlyOutputFormats": ".music_only_output_formats", "MusicOutputFormat": ".music_output_format", "MusicPrompt": ".music_prompt", "MusicUploadResponse": ".music_upload_response", "MusicUploadResponseCompositionPlan": ".music_upload_response_composition_plan", "NonStreamingOutputFormats": ".non_streaming_output_formats", "NormalizedAlignment": ".normalized_alignment", "NumericDistributionAggregate": ".numeric_distribution_aggregate", "OAuth2ClientCredsResponse": ".o_auth_2_client_creds_response", "OAuth2JwtResponse": ".o_auth_2_jwt_response", "OAuth2JwtResponseAlgorithm": ".o_auth_2_jwt_response_algorithm", "OAuth2JwtResponseTokenResponseField": ".o_auth_2_jwt_response_token_response_field", "ObjectJsonSchemaPropertyInput": ".object_json_schema_property_input", "ObjectJsonSchemaPropertyInputPropertiesValue": ".object_json_schema_property_input_properties_value", "ObjectJsonSchemaPropertyInputPropertyKind": ".object_json_schema_property_input_property_kind", "ObjectJsonSchemaPropertyOutput": ".object_json_schema_property_output", "ObjectJsonSchemaPropertyOutputPropertiesValue": ".object_json_schema_property_output_properties_value", "OmitSchemaOverride": ".omit_schema_override", "OpenAiAudioFormat": ".open_ai_audio_format", "OpenerConfig": ".opener_config", "OptInSmsReminderParams": ".opt_in_sms_reminder_params", "OptOutSmsReminderParams": ".opt_out_sms_reminder_params", "OrbAvatar": ".orb_avatar", "OrchestratorToolMockBehaviorConfig": ".orchestrator_tool_mock_behavior_config", "OrderDeliverablesResponse": ".order_deliverables_response", "OrderId": ".order_id", "OrderItemInfo": ".order_item_info", "OrderItemKind": ".order_item_kind", "OrderItemRequestInput": ".order_item_request_input", "OrderItemRequestInput_Dub": ".order_item_request_input", "OrderItemRequestInput_Subtitles": ".order_item_request_input", "OrderItemRequestInput_Transcription": ".order_item_request_input", "OrderItemRequestOutput": ".order_item_request_output", "OrderItemRequestOutput_Dub": ".order_item_request_output", "OrderItemRequestOutput_Subtitles": ".order_item_request_output", "OrderItemRequestOutput_Transcription": ".order_item_request_output", "OrderMediaResponse": ".order_media_response", "OrderResponse": ".order_response", "OrderState": ".order_state", "OrderSummary": ".order_summary", "OutboundCallRecipient": ".outbound_call_recipient", "OutboundCallRecipientResponseModel": ".outbound_call_recipient_response_model", "OutboundSipTrunkConfigRequestModel": ".outbound_sip_trunk_config_request_model", "OutputFormat": ".output_format", "PairedLanguagesResponse": ".paired_languages_response", "PartialTranscriptPayload": ".partial_transcript_payload", "PatchWorkspaceWebhookResponseModel": ".patch_workspace_webhook_response_model", "PdfExportOptions": ".pdf_export_options", "PendingBlocksMetadataModel": ".pending_blocks_metadata_model", "PendingCancellationResponseModel": ".pending_cancellation_response_model", "PendingClipTask": ".pending_clip_task", "PendingClipTaskType": ".pending_clip_task_type", "PendingExternalAudiosMetadataModel": ".pending_external_audios_metadata_model", "PendingSubscriptionSwitchResponseModel": ".pending_subscription_switch_response_model", "PendingSubscriptionSwitchResponseModelNextTier": ".pending_subscription_switch_response_model_next_tier", "PermissionType": ".permission_type", "PhoneNumberAgentInfo": ".phone_number_agent_info", "PhoneNumberDynamicVariableTransferDestination": ".phone_number_dynamic_variable_transfer_destination", "PhoneNumberTransfer": ".phone_number_transfer", "PhoneNumberTransferCustomSipHeadersItem": ".phone_number_transfer_custom_sip_headers_item", "PhoneNumberTransferCustomSipHeadersItem_Dynamic": ".phone_number_transfer_custom_sip_headers_item", "PhoneNumberTransferCustomSipHeadersItem_Static": ".phone_number_transfer_custom_sip_headers_item", "PhoneNumberTransferDestination": ".phone_number_transfer_destination", "PhoneNumberTransferPostDialDigits": ".phone_number_transfer_post_dial_digits", "PhoneNumberTransferPostDialDigits_Dynamic": ".phone_number_transfer_post_dial_digits", "PhoneNumberTransferPostDialDigits_Static": ".phone_number_transfer_post_dial_digits", "PhoneNumberTransferTransferDestination": ".phone_number_transfer_transfer_destination", "PhoneNumberTransferTransferDestination_Phone": ".phone_number_transfer_transfer_destination", "PhoneNumberTransferTransferDestination_PhoneDynamicVariable": ".phone_number_transfer_transfer_destination", "PhoneNumberTransferTransferDestination_SipUri": ".phone_number_transfer_transfer_destination", "PhoneNumberTransferTransferDestination_SipUriDynamicVariable": ".phone_number_transfer_transfer_destination", "PingPayload": ".ping_payload", "PlatformCategory": ".platform_category", "PlatformCategoryUsage": ".platform_category_usage", "PlatformUsage": ".platform_usage", "PlayDtmfResultErrorModel": ".play_dtmf_result_error_model", "PlayDtmfResultSuccessModel": ".play_dtmf_result_success_model", "PlayDtmfToolConfig": ".play_dtmf_tool_config", "PodcastBulletinMode": ".podcast_bulletin_mode", "PodcastBulletinModeData": ".podcast_bulletin_mode_data", "PodcastConversationMode": ".podcast_conversation_mode", "PodcastConversationModeData": ".podcast_conversation_mode_data", "PodcastProjectResponseModel": ".podcast_project_response_model", "PodcastTextSource": ".podcast_text_source", "PodcastUrlSource": ".podcast_url_source", "PongPayload": ".pong_payload", "PositionInput": ".position_input", "PositionOutput": ".position_output", "PostAgentAvatarResponseModel": ".post_agent_avatar_response_model", "PostDialDigitsDynamicVariable": ".post_dial_digits_dynamic_variable", "PostDialDigitsStatic": ".post_dial_digits_static", "PostWorkspaceSecretResponseModel": ".post_workspace_secret_response_model", "PreToolSpeechMode": ".pre_tool_speech_mode", "PreviewAudioDbModel": ".preview_audio_db_model", "Price": ".price", "PrivacyConfigInput": ".privacy_config_input", "PrivacyConfigOutput": ".privacy_config_output", "PrivateKeyJwtResponse": ".private_key_jwt_response", "PrivateKeyJwtResponseAlgorithm": ".private_key_jwt_response_algorithm", "ProcedureAtVersionInput": ".procedure_at_version_input", "ProcedureAtVersionOutput": ".procedure_at_version_output", "ProcedureAtVersionResponseModel": ".procedure_at_version_response_model", "ProcedureDraftResponseModel": ".procedure_draft_response_model", "ProcedureListItemResponseModel": ".procedure_list_item_response_model", "ProcedureRefResponseModel": ".procedure_ref_response_model", "ProcedureType": ".procedure_type", "ProcedureValidationError": ".procedure_validation_error", "ProjectCreationMetaResponseModel": ".project_creation_meta_response_model", "ProjectCreationMetaResponseModelStatus": ".project_creation_meta_response_model_status", "ProjectCreationMetaType": ".project_creation_meta_type", "ProjectExtendedResponse": ".project_extended_response", "ProjectExtendedResponseAccessLevel": ".project_extended_response_access_level", "ProjectExtendedResponseApplyTextNormalization": ".project_extended_response_apply_text_normalization", "ProjectExtendedResponseAspectRatio": ".project_extended_response_aspect_ratio", "ProjectExtendedResponseAssetsItem": ".project_extended_response_assets_item", "ProjectExtendedResponseAssetsItem_Audio": ".project_extended_response_assets_item", "ProjectExtendedResponseAssetsItem_Image": ".project_extended_response_assets_item", "ProjectExtendedResponseAssetsItem_Video": ".project_extended_response_assets_item", "ProjectExtendedResponseFiction": ".project_extended_response_fiction", "ProjectExtendedResponseSourceType": ".project_extended_response_source_type", "ProjectExtendedResponseTargetAudience": ".project_extended_response_target_audience", "ProjectExternalAudioResponseModel": ".project_external_audio_response_model", "ProjectExternalAudioResponseModelSourceContext": ".project_external_audio_response_model_source_context", "ProjectExternalAudioResponseModelSourceContext_MusicExploreSong": ".project_external_audio_response_model_source_context", "ProjectExternalAudioResponseModelSourceContext_Sfx": ".project_external_audio_response_model_source_context", "ProjectExternalAudioResponseModelSourceContext_Song": ".project_external_audio_response_model_source_context", "ProjectImageResponseModel": ".project_image_response_model", "ProjectMutedTracksResponseModel": ".project_muted_tracks_response_model", "ProjectResponse": ".project_response", "ProjectResponseAccessLevel": ".project_response_access_level", "ProjectResponseAspectRatio": ".project_response_aspect_ratio", "ProjectResponseFiction": ".project_response_fiction", "ProjectResponseSourceType": ".project_response_source_type", "ProjectResponseTargetAudience": ".project_response_target_audience", "ProjectSnapshotExtendedResponseModel": ".project_snapshot_extended_response_model", "ProjectSnapshotResponse": ".project_snapshot_response", "ProjectSnapshotsResponse": ".project_snapshots_response", "ProjectState": ".project_state", "ProjectVideoResponseModel": ".project_video_response_model", "ProjectVideoThumbnailSheetResponseModel": ".project_video_thumbnail_sheet_response_model", "ProjectVoiceResponseModel": ".project_voice_response_model", "PromptAgent": ".prompt_agent", "PromptAgentApiModelInput": ".prompt_agent_api_model_input", "PromptAgentApiModelInputBackupLlmConfig": ".prompt_agent_api_model_input_backup_llm_config", "PromptAgentApiModelInputBackupLlmConfig_Default": ".prompt_agent_api_model_input_backup_llm_config", "PromptAgentApiModelInputBackupLlmConfig_Disabled": ".prompt_agent_api_model_input_backup_llm_config", "PromptAgentApiModelInputBackupLlmConfig_Override": ".prompt_agent_api_model_input_backup_llm_config", "PromptAgentApiModelInputToolsItem": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_Client": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_Mcp": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_Smb": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_System": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelInputToolsItem_Webhook": ".prompt_agent_api_model_input_tools_item", "PromptAgentApiModelOutput": ".prompt_agent_api_model_output", "PromptAgentApiModelOutputBackupLlmConfig": ".prompt_agent_api_model_output_backup_llm_config", "PromptAgentApiModelOutputBackupLlmConfig_Default": ".prompt_agent_api_model_output_backup_llm_config", "PromptAgentApiModelOutputBackupLlmConfig_Disabled": ".prompt_agent_api_model_output_backup_llm_config", "PromptAgentApiModelOutputBackupLlmConfig_Override": ".prompt_agent_api_model_output_backup_llm_config", "PromptAgentApiModelOutputToolsItem": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_Client": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_Mcp": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_Smb": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_System": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOutputToolsItem_Webhook": ".prompt_agent_api_model_output_tools_item", "PromptAgentApiModelOverrideConfig": ".prompt_agent_api_model_override_config", "PromptAgentApiModelOverrideInput": ".prompt_agent_api_model_override_input", "PromptAgentApiModelOverrideOutput": ".prompt_agent_api_model_override_output", "PromptAgentApiModelWorkflowOverrideInput": ".prompt_agent_api_model_workflow_override_input", "PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig": ".prompt_agent_api_model_workflow_override_input_backup_llm_config", "PromptAgentApiModelWorkflowOverrideInputToolsItem": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Client": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_System": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook": ".prompt_agent_api_model_workflow_override_input_tools_item", "PromptAgentApiModelWorkflowOverrideOutput": ".prompt_agent_api_model_workflow_override_output", "PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig": ".prompt_agent_api_model_workflow_override_output_backup_llm_config", "PromptAgentApiModelWorkflowOverrideOutputToolsItem": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_System": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook": ".prompt_agent_api_model_workflow_override_output_tools_item", "PromptAgentDbModel": ".prompt_agent_db_model", "PromptEvaluationCriteria": ".prompt_evaluation_criteria", "PromptInjectionGuardrail": ".prompt_injection_guardrail", "PronunciationDictionaryAliasRuleRequestModel": ".pronunciation_dictionary_alias_rule_request_model", "PronunciationDictionaryAliasRuleResponseModel": ".pronunciation_dictionary_alias_rule_response_model", "PronunciationDictionaryLocator": ".pronunciation_dictionary_locator", "PronunciationDictionaryLocatorResponseModel": ".pronunciation_dictionary_locator_response_model", "PronunciationDictionaryPhonemeRuleRequestModel": ".pronunciation_dictionary_phoneme_rule_request_model", "PronunciationDictionaryPhonemeRuleResponseModel": ".pronunciation_dictionary_phoneme_rule_response_model", "PronunciationDictionaryRulesResponseModel": ".pronunciation_dictionary_rules_response_model", "PronunciationDictionaryVersionLocator": ".pronunciation_dictionary_version_locator", "PronunciationDictionaryVersionResponseModel": ".pronunciation_dictionary_version_response_model", "PronunciationDictionaryVersionResponseModelPermissionOnResource": ".pronunciation_dictionary_version_response_model_permission_on_resource", "PydanticPronunciationDictionaryVersionLocator": ".pydantic_pronunciation_dictionary_version_locator", "QualityPresetType": ".quality_preset_type", "QueryParamsJsonSchema": ".query_params_json_schema", "QuoteInfo": ".quote_info", "RagChunkMetadata": ".rag_chunk_metadata", "RagConfigInput": ".rag_config_input", "RagConfigOutput": ".rag_config_output", "RagConfigWorkflowOverrideInput": ".rag_config_workflow_override_input", "RagConfigWorkflowOverrideOutput": ".rag_config_workflow_override_output", "RagDocumentIndexResponseModel": ".rag_document_index_response_model", "RagDocumentIndexUsage": ".rag_document_index_usage", "RagDocumentIndexesResponseModel": ".rag_document_indexes_response_model", "RagIndexBatchSuccessfulResponseModel": ".rag_index_batch_successful_response_model", "RagIndexOverviewEmbeddingModelResponseModel": ".rag_index_overview_embedding_model_response_model", "RagIndexOverviewResponseModel": ".rag_index_overview_response_model", "RagIndexStatus": ".rag_index_status", "RagRetrievalInfo": ".rag_retrieval_info", "ReadLegalTerms": ".read_legal_terms", "ReadMetadataChapterDbModel": ".read_metadata_chapter_db_model", "ReaderResourceResponseModel": ".reader_resource_response_model", "ReaderResourceResponseModelResourceType": ".reader_resource_response_model_resource_type", "RealtimeVoiceSettings": ".realtime_voice_settings", "RecordingResponse": ".recording_response", "ReferenceVideo": ".reference_video", "ReferencedToolCommonModel": ".referenced_tool_common_model", "ReferencedToolCommonModelType": ".referenced_tool_common_model_type", "RefreshTokenAuthResponse": ".refresh_token_auth_response", "RegexParameterEvaluationStrategy": ".regex_parameter_evaluation_strategy", "RegionConfigRequest": ".region_config_request", "RegionalProcessingSurchargeInfo": ".regional_processing_surcharge_info", "RegisterForGroupSessionParams": ".register_for_group_session_params", "RegisterMediaResponse": ".register_media_response", "RemoveMemberFromGroupRequest": ".remove_member_from_group_request", "RemoveOrderItemResponse": ".remove_order_item_response", "Render": ".render", "RenderStatus": ".render_status", "RenderType": ".render_type", "ReplicateVoiceToIsolatedEnvironmentResponseModel": ".replicate_voice_to_isolated_environment_response_model", "ReportKnowledgeGapParams": ".report_knowledge_gap_params", "RequestPvcManualVerificationResponseModel": ".request_pvc_manual_verification_response_model", "RequiredConstraint": ".required_constraint", "RequiredConstraints": ".required_constraints", "ResourceAccessInfo": ".resource_access_info", "ResourceAccessInfoAccessSource": ".resource_access_info_access_source", "ResourceAccessInfoAnonymousAccessLevelOverride": ".resource_access_info_anonymous_access_level_override", "ResourceAccessInfoRole": ".resource_access_info_role", "ResourceMetadataResponseModel": ".resource_metadata_response_model", "ResourceMetadataResponseModelAnonymousAccessLevelOverride": ".resource_metadata_response_model_anonymous_access_level_override", "ResponseFilter": ".response_filter", "ResponseFilterMode": ".response_filter_mode", "ResponseUnitTestModel": ".response_unit_test_model", "RestoreCalendarEventParams": ".restore_calendar_event_params", "RetryTriggerAction": ".retry_trigger_action", "ReviewResponseModel": ".review_response_model", "ReviewResponseModelRejectReasonsItem": ".review_response_model_reject_reasons_item", "ReviewResponseModelReviewStatus": ".review_response_model_review_status", "ReviewStatus": ".review_status", "RunSubagentToolConfigInput": ".run_subagent_tool_config_input", "RunSubagentToolConfigOutput": ".run_subagent_tool_config_output", "SafetyCommonModelInput": ".safety_common_model_input", "SafetyCommonModelOutput": ".safety_common_model_output", "SafetyEvaluation": ".safety_evaluation", "SafetyResponseModel": ".safety_response_model", "SafetyRule": ".safety_rule", "SampleConfigDbModel": ".sample_config_db_model", "SampleConfigDbModelParentType": ".sample_config_db_model_parent_type", "SaveVoicePreviewRequest": ".save_voice_preview_request", "SayNodeLiteralMessageInput": ".say_node_literal_message_input", "SayNodeLiteralMessageOutput": ".say_node_literal_message_output", "SayNodePromptMessageInput": ".say_node_prompt_message_input", "SayNodePromptMessageOutput": ".say_node_prompt_message_output", "ScheduleGroupSessionParams": ".schedule_group_session_params", "ScimGroupResponseModel": ".scim_group_response_model", "ScopedAnalysisResult": ".scoped_analysis_result", "ScribeAuthErrorPayload": ".scribe_auth_error_payload", "ScribeChunkSizeExceededErrorPayload": ".scribe_chunk_size_exceeded_error_payload", "ScribeErrorPayload": ".scribe_error_payload", "ScribeInputErrorPayload": ".scribe_input_error_payload", "ScribeInsufficientAudioActivityErrorPayload": ".scribe_insufficient_audio_activity_error_payload", "ScribeInvalidRequestError": ".scribe_invalid_request_error", "ScribeQueueOverflowErrorPayload": ".scribe_queue_overflow_error_payload", "ScribeQuotaExceededErrorPayload": ".scribe_quota_exceeded_error_payload", "ScribeRateLimitedErrorPayload": ".scribe_rate_limited_error_payload", "ScribeResourceExhaustedErrorPayload": ".scribe_resource_exhausted_error_payload", "ScribeSessionTimeLimitExceededErrorPayload": ".scribe_session_time_limit_exceeded_error_payload", "ScribeThrottledErrorPayload": ".scribe_throttled_error_payload", "ScribeTranscriberErrorPayload": ".scribe_transcriber_error_payload", "ScribeUnacceptedTermsErrorPayload": ".scribe_unaccepted_terms_error_payload", "SearchClientsParams": ".search_clients_params", "SearchHighlightSegment": ".search_highlight_segment", "SearchStrategy": ".search_strategy", "SeatType": ".seat_type", "SecretDependencyResourceType": ".secret_dependency_resource_type", "SecretDependencyType": ".secret_dependency_type", "SectionSource": ".section_source", "SegmentCreateResponse": ".segment_create_response", "SegmentDeleteResponse": ".segment_delete_response", "SegmentDubResponse": ".segment_dub_response", "SegmentMigrationResponse": ".segment_migration_response", "SegmentSubtitleFrame": ".segment_subtitle_frame", "SegmentTranscriptionResponse": ".segment_transcription_response", "SegmentTranslationResponse": ".segment_translation_response", "SegmentUpdateResponse": ".segment_update_response", "SegmentedJsonExportOptions": ".segmented_json_export_options", "SendText": ".send_text", "SendTextMulti": ".send_text_multi", "SentimentAggregate": ".sentiment_aggregate", "SentimentAnalysisSettings": ".sentiment_analysis_settings", "SessionStartedPayload": ".session_started_payload", "SessionStartedPayloadConfig": ".session_started_payload_config", "SessionStartedPayloadConfigCommitStrategy": ".session_started_payload_config_commit_strategy", "SetBookingSlugParams": ".set_booking_slug_params", "SeverityId": ".severity_id", "SfxModelId": ".sfx_model_id", "SfxSourceContext": ".sfx_source_context", "ShareOptionResponseModel": ".share_option_response_model", "ShareOptionResponseModelType": ".share_option_response_model_type", "SimilarVoice": ".similar_voice", "SimilarVoicesForSpeakerResponse": ".similar_voices_for_speaker_response", "SimulationLibrarySettings": ".simulation_library_settings", "SimulationTestModel": ".simulation_test_model", "SimulationToolMockBehaviorConfig": ".simulation_tool_mock_behavior_config", "SingleLanguagesResponse": ".single_languages_response", "SingleTestRunRequestModel": ".single_test_run_request_model", "SingleUseTokenResponseModel": ".single_use_token_response_model", "SingleUseTokenType": ".single_use_token_type", "SipLogMessage": ".sip_log_message", "SipLogMessageDirection": ".sip_log_message_direction", "SipMediaEncryptionEnum": ".sip_media_encryption_enum", "SipTrunkCredentialsRequestModel": ".sip_trunk_credentials_request_model", "SipTrunkOutboundCallResponse": ".sip_trunk_outbound_call_response", "SipTrunkTransportEnum": ".sip_trunk_transport_enum", "SipUriDynamicVariableTransferDestination": ".sip_uri_dynamic_variable_transfer_destination", "SipUriTransferDestination": ".sip_uri_transfer_destination", "SkipTurnToolConfig": ".skip_turn_tool_config", "SkipTurnToolResponseModel": ".skip_turn_tool_response_model", "SlackBotAuthResponse": ".slack_bot_auth_response", "SmbClientAccessConfig": ".smb_client_access_config", "SmsConversationInfo": ".sms_conversation_info", "SmsConversationInfoDirection": ".sms_conversation_info_direction", "SoftTimeoutConfig": ".soft_timeout_config", "SoftTimeoutConfigOverride": ".soft_timeout_config_override", "SoftTimeoutConfigOverrideConfig": ".soft_timeout_config_override_config", "SoftTimeoutConfigWorkflowOverride": ".soft_timeout_config_workflow_override", "SongMetadata": ".song_metadata", "SongSection": ".song_section", "SongSourceContext": ".song_source_context", "SortDirection": ".sort_direction", "SpeakerAudioResponseModel": ".speaker_audio_response_model", "SpeakerCreatedResponse": ".speaker_created_response", "SpeakerResponseModel": ".speaker_response_model", "SpeakerSegment": ".speaker_segment", "SpeakerSeparationResponseModel": ".speaker_separation_response_model", "SpeakerSeparationResponseModelStatus": ".speaker_separation_response_model_status", "SpeakerTrack": ".speaker_track", "SpeakerUpdatedResponse": ".speaker_updated_response", "SpeechEngineConfig": ".speech_engine_config", "SpeechEngineConfigRequestHeadersValue": ".speech_engine_config_request_headers_value", "SpeechEngineConversationInitiationClientDataConfig": ".speech_engine_conversation_initiation_client_data_config", "SpeechEngineResponse": ".speech_engine_response", "SpeechEngineSummaryResponse": ".speech_engine_summary_response", "SpeechHistoryItemResponse": ".speech_history_item_response", "SpeechHistoryItemResponseSource": ".speech_history_item_response_source", "SpeechHistoryItemResponseVoiceCategory": ".speech_history_item_response_voice_category", "SpeechToTextCharacterResponseModel": ".speech_to_text_character_response_model", "SpeechToTextChunkResponseModel": ".speech_to_text_chunk_response_model", "SpeechToTextWebhookResponseModel": ".speech_to_text_webhook_response_model", "SpeechToTextWordResponseModel": ".speech_to_text_word_response_model", "SpeechToTextWordResponseModelType": ".speech_to_text_word_response_model_type", "SpellingPatience": ".spelling_patience", "SrtExportOptions": ".srt_export_options", "StartProcedureToolConfigInput": ".start_procedure_tool_config_input", "StartProcedureToolConfigOutput": ".start_procedure_tool_config_output", "StartProcedureToolErrorStatus": ".start_procedure_tool_error_status", "StartPvcVoiceTrainingResponseModel": ".start_pvc_voice_training_response_model", "StartSpeakerSeparationResponseModel": ".start_speaker_separation_response_model", "StatusId": ".status_id", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel": ".streaming_audio_chunk_with_timestamps_and_voice_segments_response_model", "StreamingAudioChunkWithTimestampsResponse": ".streaming_audio_chunk_with_timestamps_response", "StudioAgentSettingsModel": ".studio_agent_settings_model", "StudioAgentToolSettingsModel": ".studio_agent_tool_settings_model", "StudioClipReference": ".studio_clip_reference", "StudioClipReferenceClipType": ".studio_clip_reference_clip_type", "StudioTextStyleOutlineModel": ".studio_text_style_outline_model", "StudioTextStyleShadowModel": ".studio_text_style_shadow_model", "SubAgentInput": ".sub_agent_input", "SubAgentOutput": ".sub_agent_output", "SubagentRunResultDetails": ".subagent_run_result_details", "SubmitBusinessInfoParams": ".submit_business_info_params", "SubmitOrderResponse": ".submit_order_response", "Subscription": ".subscription", "SubscriptionMaxCreditLimitExtension": ".subscription_max_credit_limit_extension", "SubscriptionPendingChange": ".subscription_pending_change", "SubscriptionResponse": ".subscription_response", "SubscriptionResponseMaxCreditLimitExtension": ".subscription_response_max_credit_limit_extension", "SubscriptionStatusType": ".subscription_status_type", "SubtitleOrderItemRequest": ".subtitle_order_item_request", "SuggestedAudioTag": ".suggested_audio_tag", "SupportedVoice": ".supported_voice", "SystemEvaluationCriteria": ".system_evaluation_criteria", "SystemToolConfigInput": ".system_tool_config_input", "SystemToolConfigInputParams": ".system_tool_config_input_params", "SystemToolConfigInputParams_EndCall": ".system_tool_config_input_params", "SystemToolConfigInputParams_EndProcedure": ".system_tool_config_input_params", "SystemToolConfigInputParams_KnowledgeBase": ".system_tool_config_input_params", "SystemToolConfigInputParams_KnowledgeBaseRag": ".system_tool_config_input_params", "SystemToolConfigInputParams_LanguageDetection": ".system_tool_config_input_params", "SystemToolConfigInputParams_PlayKeypadTouchTone": ".system_tool_config_input_params", "SystemToolConfigInputParams_RunSubagent": ".system_tool_config_input_params", "SystemToolConfigInputParams_SkipTurn": ".system_tool_config_input_params", "SystemToolConfigInputParams_StartProcedure": ".system_tool_config_input_params", "SystemToolConfigInputParams_TransferToAgent": ".system_tool_config_input_params", "SystemToolConfigInputParams_TransferToNumber": ".system_tool_config_input_params", "SystemToolConfigInputParams_VoicemailDetection": ".system_tool_config_input_params", "SystemToolConfigOutput": ".system_tool_config_output", "SystemToolConfigOutputParams": ".system_tool_config_output_params", "SystemToolConfigOutputParams_EndCall": ".system_tool_config_output_params", "SystemToolConfigOutputParams_EndProcedure": ".system_tool_config_output_params", "SystemToolConfigOutputParams_KnowledgeBase": ".system_tool_config_output_params", "SystemToolConfigOutputParams_KnowledgeBaseRag": ".system_tool_config_output_params", "SystemToolConfigOutputParams_LanguageDetection": ".system_tool_config_output_params", "SystemToolConfigOutputParams_PlayKeypadTouchTone": ".system_tool_config_output_params", "SystemToolConfigOutputParams_RunSubagent": ".system_tool_config_output_params", "SystemToolConfigOutputParams_SkipTurn": ".system_tool_config_output_params", "SystemToolConfigOutputParams_StartProcedure": ".system_tool_config_output_params", "SystemToolConfigOutputParams_TransferToAgent": ".system_tool_config_output_params", "SystemToolConfigOutputParams_TransferToNumber": ".system_tool_config_output_params", "SystemToolConfigOutputParams_VoicemailDetection": ".system_tool_config_output_params", "TelephonyCallConfig": ".telephony_call_config", "TelephonyDirection": ".telephony_direction", "TelephonyProvider": ".telephony_provider", "TestConditionRationaleCommonModel": ".test_condition_rationale_common_model", "TestConditionResultCommonModel": ".test_condition_result_common_model", "TestFromConversationMetadataInput": ".test_from_conversation_metadata_input", "TestFromConversationMetadataOutput": ".test_from_conversation_metadata_output", "TestInvocationSummaryResponseModel": ".test_invocation_summary_response_model", "TestRunMetadata": ".test_run_metadata", "TestRunMetadataTestType": ".test_run_metadata_test_type", "TestRunResultBucket": ".test_run_result_bucket", "TestRunResultSummary": ".test_run_result_summary", "TestRunStatus": ".test_run_status", "TestSharingMode": ".test_sharing_mode", "TestToolResultModel": ".test_tool_result_model", "TestType": ".test_type", "TestsFeatureUsageCommonModel": ".tests_feature_usage_common_model", "TextNormalisationType": ".text_normalisation_type", "TextToDialogueWebsocketApplyTextNormalizationEnum": ".text_to_dialogue_websocket_apply_text_normalization_enum", "TextToDialogueWebsocketAudioChunk": ".text_to_dialogue_websocket_audio_chunk", "TextToDialogueWebsocketAudioChunkMulti": ".text_to_dialogue_websocket_audio_chunk_multi", "TextToDialogueWebsocketClientMessage": ".text_to_dialogue_websocket_client_message", "TextToDialogueWebsocketClientMessageMulti": ".text_to_dialogue_websocket_client_message_multi", "TextToDialogueWebsocketError": ".text_to_dialogue_websocket_error", "TextToDialogueWebsocketFinal": ".text_to_dialogue_websocket_final", "TextToDialogueWebsocketFinalAudioForTurn": ".text_to_dialogue_websocket_final_audio_for_turn", "TextToDialogueWebsocketFinalAudioForTurnMulti": ".text_to_dialogue_websocket_final_audio_for_turn_multi", "TextToDialogueWebsocketFinalMulti": ".text_to_dialogue_websocket_final_multi", "TextToDialogueWebsocketOutputFormatEnum": ".text_to_dialogue_websocket_output_format_enum", "TextToDialogueWebsocketVoiceInput": ".text_to_dialogue_websocket_voice_input", "TextToDialogueWebsocketVoiceSettings": ".text_to_dialogue_websocket_voice_settings", "TextToSpeechApplyTextNormalizationEnum": ".text_to_speech_apply_text_normalization_enum", "TextToSpeechOutputFormatEnum": ".text_to_speech_output_format_enum", "TextToSpeechRequest": ".text_to_speech_request", "TextToSpeechStreamRequest": ".text_to_speech_stream_request", "TextToSpeechStreamWithTimestampsRequest": ".text_to_speech_stream_with_timestamps_request", "TextToSpeechWithTimestampsRequest": ".text_to_speech_with_timestamps_request", "ThresholdGuardrail": ".threshold_guardrail", "TimeRange": ".time_range", "ToDialogueSettingsResponseModel": ".to_dialogue_settings_response_model", "TokenResponseModel": ".token_response_model", "Tool": ".tool", "ToolAnnotations": ".tool_annotations", "ToolCallSoundBehavior": ".tool_call_sound_behavior", "ToolCallSoundType": ".tool_call_sound_type", "ToolCallUnitTestModel": ".tool_call_unit_test_model", "ToolErrorHandlingMode": ".tool_error_handling_mode", "ToolExecution": ".tool_execution", "ToolExecutionMode": ".tool_execution_mode", "ToolExecutionResponseModel": ".tool_execution_response_model", "ToolExecutionResponseModelToolCallDetails": ".tool_execution_response_model_tool_call_details", "ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook": ".tool_execution_response_model_tool_call_details", "ToolExecutionResponseModelToolCallDetails_Client": ".tool_execution_response_model_tool_call_details", "ToolExecutionResponseModelToolCallDetails_Mcp": ".tool_execution_response_model_tool_call_details", "ToolExecutionResponseModelToolCallDetails_Webhook": ".tool_execution_response_model_tool_call_details", "ToolExecutionTaskSupport": ".tool_execution_task_support", "ToolInterruptionMode": ".tool_interruption_mode", "ToolMockConfig": ".tool_mock_config", "ToolRequestModel": ".tool_request_model", "ToolRequestModelToolConfig": ".tool_request_model_tool_config", "ToolRequestModelToolConfig_Client": ".tool_request_model_tool_config", "ToolRequestModelToolConfig_Mcp": ".tool_request_model_tool_config", "ToolRequestModelToolConfig_System": ".tool_request_model_tool_config", "ToolRequestModelToolConfig_Webhook": ".tool_request_model_tool_config", "ToolResponseMockConfigInput": ".tool_response_mock_config_input", "ToolResponseMockConfigOutput": ".tool_response_mock_config_output", "ToolResponseModel": ".tool_response_model", "ToolResponseModelToolConfig": ".tool_response_model_tool_config", "ToolResponseModelToolConfig_Client": ".tool_response_model_tool_config", "ToolResponseModelToolConfig_Mcp": ".tool_response_model_tool_config", "ToolResponseModelToolConfig_System": ".tool_response_model_tool_config", "ToolResponseModelToolConfig_Webhook": ".tool_response_model_tool_config", "ToolSortBy": ".tool_sort_by", "ToolType": ".tool_type", "ToolTypeFilter": ".tool_type_filter", "ToolUsageStatsResponseModel": ".tool_usage_stats_response_model", "ToolsResponseModel": ".tools_response_model", "TopicDiscoverySettings": ".topic_discovery_settings", "TopicEvaluationCriteriaAggregate": ".topic_evaluation_criteria_aggregate", "TopicMetricsAggregate": ".topic_metrics_aggregate", "TopicSentimentAggregate": ".topic_sentiment_aggregate", "TranscriptMessage": ".transcript_message", "TranscriptMessageRole": ".transcript_message_role", "TranscriptionOrderItemRequest": ".transcription_order_item_request", "TranscriptionWord": ".transcription_word", "TranscriptionWordType": ".transcription_word_type", "TransferBranchInfoDefaultingToMain": ".transfer_branch_info_defaulting_to_main", "TransferBranchInfoTrafficSplit": ".transfer_branch_info_traffic_split", "TransferToAgentToolConfigInput": ".transfer_to_agent_tool_config_input", "TransferToAgentToolConfigOutput": ".transfer_to_agent_tool_config_output", "TransferToAgentToolResultErrorModel": ".transfer_to_agent_tool_result_error_model", "TransferToAgentToolResultSuccessModelInput": ".transfer_to_agent_tool_result_success_model_input", "TransferToAgentToolResultSuccessModelInputBranchInfo": ".transfer_to_agent_tool_result_success_model_input_branch_info", "TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain": ".transfer_to_agent_tool_result_success_model_input_branch_info", "TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit": ".transfer_to_agent_tool_result_success_model_input_branch_info", "TransferToAgentToolResultSuccessModelOutput": ".transfer_to_agent_tool_result_success_model_output", "TransferToAgentToolResultSuccessModelOutputBranchInfo": ".transfer_to_agent_tool_result_success_model_output_branch_info", "TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain": ".transfer_to_agent_tool_result_success_model_output_branch_info", "TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit": ".transfer_to_agent_tool_result_success_model_output_branch_info", "TransferToNumberResultErrorModel": ".transfer_to_number_result_error_model", "TransferToNumberResultExotelSuccessModel": ".transfer_to_number_result_exotel_success_model", "TransferToNumberResultSipSuccessModel": ".transfer_to_number_result_sip_success_model", "TransferToNumberResultTwilioSuccessModel": ".transfer_to_number_result_twilio_success_model", "TransferToNumberToolConfigInput": ".transfer_to_number_tool_config_input", "TransferToNumberToolConfigOutput": ".transfer_to_number_tool_config_output", "TransferTypeEnum": ".transfer_type_enum", "TranslateAudioOutputError": ".translate_audio_output_error", "TranslateAudioPayload": ".translate_audio_payload", "TranslateAuthError": ".translate_auth_error", "TranslateEndOfStreamPayload": ".translate_end_of_stream_payload", "TranslateErrorPayload": ".translate_error_payload", "TranslateFinalTranscriptPayload": ".translate_final_transcript_payload", "TranslateInputAudioChunkPayload": ".translate_input_audio_chunk_payload", "TranslateInputError": ".translate_input_error", "TranslateInputFormatEnum": ".translate_input_format_enum", "TranslateOutputFormatEnum": ".translate_output_format_enum", "TranslatePartialTranscriptPayload": ".translate_partial_transcript_payload", "TranslateQueueOverflowError": ".translate_queue_overflow_error", "TranslateRateLimitedError": ".translate_rate_limited_error", "TranslateSessionStartedPayload": ".translate_session_started_payload", "TranslateStatusPayload": ".translate_status_payload", "TranslateTranscriberError": ".translate_transcriber_error", "TranslateTranslationError": ".translate_translation_error", "TranslateTranslationPayload": ".translate_translation_payload", "TranslatedString": ".translated_string", "TriggerUserVerificationParams": ".trigger_user_verification_params", "TriggeredGuardrailCommonModel": ".triggered_guardrail_common_model", "TtsConversationalConfigInput": ".tts_conversational_config_input", "TtsConversationalConfigOutput": ".tts_conversational_config_output", "TtsConversationalConfigOverride": ".tts_conversational_config_override", "TtsConversationalConfigOverrideConfig": ".tts_conversational_config_override_config", "TtsConversationalConfigWorkflowOverrideInput": ".tts_conversational_config_workflow_override_input", "TtsConversationalConfigWorkflowOverrideOutput": ".tts_conversational_config_workflow_override_output", "TtsConversationalModel": ".tts_conversational_model", "TtsModelFamily": ".tts_model_family", "TtsOptimizeStreamingLatency": ".tts_optimize_streaming_latency", "TtsOutputFormat": ".tts_output_format", "TurnConfig": ".turn_config", "TurnConfigOverride": ".turn_config_override", "TurnConfigOverrideConfig": ".turn_config_override_config", "TurnConfigWorkflowOverride": ".turn_config_workflow_override", "TurnEagerness": ".turn_eagerness", "TurnMode": ".turn_mode", "TurnModel": ".turn_model", "TwilioEdgeLocation": ".twilio_edge_location", "TwilioOutboundCallResponse": ".twilio_outbound_call_response", "TwilioRegionId": ".twilio_region_id", "TxtExportOptions": ".txt_export_options", "UnitTestRunResponseModel": ".unit_test_run_response_model", "UnitTestRunResponseModelTestInfo": ".unit_test_run_response_model_test_info", "UnitTestRunResponseModelTestInfo_Llm": ".unit_test_run_response_model_test_info", "UnitTestRunResponseModelTestInfo_Simulation": ".unit_test_run_response_model_test_info", "UnitTestRunResponseModelTestInfo_Tool": ".unit_test_run_response_model_test_info", "UnitTestSummaryResponseModel": ".unit_test_summary_response_model", "UnitTestToolCallEvaluationModelInput": ".unit_test_tool_call_evaluation_model_input", "UnitTestToolCallEvaluationModelOutput": ".unit_test_tool_call_evaluation_model_output", "UnitTestToolCallParameter": ".unit_test_tool_call_parameter", "UnitTestToolCallParameterEval": ".unit_test_tool_call_parameter_eval", "UnitTestToolCallParameterEval_Anything": ".unit_test_tool_call_parameter_eval", "UnitTestToolCallParameterEval_Exact": ".unit_test_tool_call_parameter_eval", "UnitTestToolCallParameterEval_Llm": ".unit_test_tool_call_parameter_eval", "UnitTestToolCallParameterEval_Regex": ".unit_test_tool_call_parameter_eval", "UnitTestWorkflowNodeTransitionEvaluationNodeId": ".unit_test_workflow_node_transition_evaluation_node_id", "UpdateAgentProcedureParams": ".update_agent_procedure_params", "UpdateAgentRuleParams": ".update_agent_rule_params", "UpdateAssetParams": ".update_asset_params", "UpdateAudioNativeProjectRequest": ".update_audio_native_project_request", "UpdateBasicAuthRequest": ".update_basic_auth_request", "UpdateBearerAuthRequest": ".update_bearer_auth_request", "UpdateBookingPageAppearanceParams": ".update_booking_page_appearance_params", "UpdateBookingPageSettingsParams": ".update_booking_page_settings_params", "UpdateBusinessInfoParams": ".update_business_info_params", "UpdateCalendarEventParams": ".update_calendar_event_params", "UpdateChapterRequest": ".update_chapter_request", "UpdateClientParams": ".update_client_params", "UpdateCustomerFacingConfigParams": ".update_customer_facing_config_params", "UpdateGroupSessionSeatsParams": ".update_group_session_seats_params", "UpdateHolidayParams": ".update_holiday_params", "UpdateLocationParams": ".update_location_params", "UpdateOAuth2ClientCredsRequest": ".update_o_auth_2_client_creds_request", "UpdateOAuth2JwtRequest": ".update_o_auth_2_jwt_request", "UpdateOAuth2JwtRequestAlgorithm": ".update_o_auth_2_jwt_request_algorithm", "UpdateOAuth2JwtRequestTokenResponseField": ".update_o_auth_2_jwt_request_token_response_field", "UpdateOrderRequest": ".update_order_request", "UpdateOrderResponse": ".update_order_response", "UpdateProductParams": ".update_product_params", "UpdateProjectRequest": ".update_project_request", "UpdatePronunciationDictionariesRequest": ".update_pronunciation_dictionaries_request", "UpdateResponseUnitTestRequest": ".update_response_unit_test_request", "UpdateServiceParams": ".update_service_params", "UpdateSimulationTestRequest": ".update_simulation_test_request", "UpdateStaffParams": ".update_staff_params", "UpdateToolCallUnitTestRequest": ".update_tool_call_unit_test_request", "UpdateTransferRuleParams": ".update_transfer_rule_params", "UpdateWorkspaceMemberResponseModel": ".update_workspace_member_response_model", "UpsertOrderItemRequest": ".upsert_order_item_request", "UpsertOrderItemResponse": ".upsert_order_item_response", "UrlAvatar": ".url_avatar", "UrlModel": ".url_model", "UrlSecretAuthResponse": ".url_secret_auth_response", "UsageAggregationInterval": ".usage_aggregation_interval", "UsageCharactersResponseModel": ".usage_characters_response_model", "User": ".user", "UserAccessManagementActivityId": ".user_access_management_activity_id", "UserFeedback": ".user_feedback", "UserFeedbackScore": ".user_feedback_score", "UserModel": ".user_model", "UserTranscriptPayload": ".user_transcript_payload", "UserTypeId": ".user_type_id", "UsersSortBy": ".users_sort_by", "UtteranceResponseModel": ".utterance_response_model", "UuiTransferConfig": ".uui_transfer_config", "UuiTransferConfigProtocolDiscriminatorMode": ".uui_transfer_config_protocol_discriminator_mode", "VadConfig": ".vad_config", "VadConfigWorkflowOverride": ".vad_config_workflow_override", "ValidateUserVerificationCodeParams": ".validate_user_verification_code_params", "ValidationError": ".validation_error", "ValidationErrorLocItem": ".validation_error_loc_item", "Verbosity": ".verbosity", "VerificationAttemptResponse": ".verification_attempt_response", "VerifiedVoiceLanguageResponseModel": ".verified_voice_language_response_model", "VerifyPvcVoiceCaptchaResponseModel": ".verify_pvc_voice_captcha_response_model", "VideoAnalysis": ".video_analysis", "VideoAnalysisResult": ".video_analysis_result", "VideoAnalysisStatus": ".video_analysis_status", "VideoKeyMoment": ".video_key_moment", "VideoSegment": ".video_segment", "VideoSubject": ".video_subject", "VisitedAgentRef": ".visited_agent_ref", "Voice": ".voice", "VoiceAccentResponseModel": ".voice_accent_response_model", "VoiceCategory": ".voice_category", "VoiceDesignPreviewResponse": ".voice_design_preview_response", "VoiceGenerationParameterOptionResponse": ".voice_generation_parameter_option_response", "VoiceGenerationParameterResponse": ".voice_generation_parameter_response", "VoiceLabellingStatus": ".voice_labelling_status", "VoiceMailDetectionResultSuccessModel": ".voice_mail_detection_result_success_model", "VoicePreviewResponseModel": ".voice_preview_response_model", "VoiceRecordingQuality": ".voice_recording_quality", "VoiceSafetyControl": ".voice_safety_control", "VoiceSample": ".voice_sample", "VoiceSamplePreviewResponseModel": ".voice_sample_preview_response_model", "VoiceSampleVisualWaveformResponseModel": ".voice_sample_visual_waveform_response_model", "VoiceSegment": ".voice_segment", "VoiceSettings": ".voice_settings", "VoiceSharingModerationCheckResponseModel": ".voice_sharing_moderation_check_response_model", "VoiceSharingResponse": ".voice_sharing_response", "VoiceSharingResponseCategory": ".voice_sharing_response_category", "VoiceSharingState": ".voice_sharing_state", "VoiceStatisticsResponseModel": ".voice_statistics_response_model", "VoiceVerificationResponse": ".voice_verification_response", "VoicemailDetectionToolConfig": ".voicemail_detection_tool_config", "VoicesNotPermittedWarning": ".voices_not_permitted_warning", "WebhookAuthMethodType": ".webhook_auth_method_type", "WebhookEventType": ".webhook_event_type", "WebhookHmacSettings": ".webhook_hmac_settings", "WebhookToolApiSchemaConfigInput": ".webhook_tool_api_schema_config_input", "WebhookToolApiSchemaConfigInputAuthConnection": ".webhook_tool_api_schema_config_input_auth_connection", "WebhookToolApiSchemaConfigInputContentType": ".webhook_tool_api_schema_config_input_content_type", "WebhookToolApiSchemaConfigInputMethod": ".webhook_tool_api_schema_config_input_method", "WebhookToolApiSchemaConfigInputRequestHeadersValue": ".webhook_tool_api_schema_config_input_request_headers_value", "WebhookToolApiSchemaConfigOutput": ".webhook_tool_api_schema_config_output", "WebhookToolApiSchemaConfigOutputAuthConnection": ".webhook_tool_api_schema_config_output_auth_connection", "WebhookToolApiSchemaConfigOutputContentType": ".webhook_tool_api_schema_config_output_content_type", "WebhookToolApiSchemaConfigOutputMethod": ".webhook_tool_api_schema_config_output_method", "WebhookToolApiSchemaConfigOutputRequestHeadersValue": ".webhook_tool_api_schema_config_output_request_headers_value", "WebhookToolConfigInput": ".webhook_tool_config_input", "WebhookToolConfigOutput": ".webhook_tool_config_output", "WebhookTranscriptFormat": ".webhook_transcript_format", "WebhookUsageType": ".webhook_usage_type", "WebsocketTtsClientMessageMulti": ".websocket_tts_client_message_multi", "WebsocketTtsServerMessageMulti": ".websocket_tts_server_message_multi", "WhatsAppAuthResponse": ".whats_app_auth_response", "WhatsAppConversationInfo": ".whats_app_conversation_info", "WhatsAppConversationInfoDirection": ".whats_app_conversation_info_direction", "WhatsAppOutboundCallResponse": ".whats_app_outbound_call_response", "WhatsAppOutboundMessageResponse": ".whats_app_outbound_message_response", "WhatsAppTemplateBodyComponentParams": ".whats_app_template_body_component_params", "WhatsAppTemplateButtonComponentParams": ".whats_app_template_button_component_params", "WhatsAppTemplateDocumentParam": ".whats_app_template_document_param", "WhatsAppTemplateDocumentParamDetails": ".whats_app_template_document_param_details", "WhatsAppTemplateHeaderComponentParams": ".whats_app_template_header_component_params", "WhatsAppTemplateHeaderComponentParamsParametersItem": ".whats_app_template_header_component_params_parameters_item", "WhatsAppTemplateHeaderComponentParamsParametersItem_Document": ".whats_app_template_header_component_params_parameters_item", "WhatsAppTemplateHeaderComponentParamsParametersItem_Image": ".whats_app_template_header_component_params_parameters_item", "WhatsAppTemplateHeaderComponentParamsParametersItem_Location": ".whats_app_template_header_component_params_parameters_item", "WhatsAppTemplateHeaderComponentParamsParametersItem_Text": ".whats_app_template_header_component_params_parameters_item", "WhatsAppTemplateImageParam": ".whats_app_template_image_param", "WhatsAppTemplateImageParamDetails": ".whats_app_template_image_param_details", "WhatsAppTemplateLocationParam": ".whats_app_template_location_param", "WhatsAppTemplateLocationParamDetails": ".whats_app_template_location_param_details", "WhatsAppTemplateTextParam": ".whats_app_template_text_param", "WidgetConfig": ".widget_config", "WidgetConfigAvatar": ".widget_config_avatar", "WidgetConfigAvatar_Image": ".widget_config_avatar", "WidgetConfigAvatar_Orb": ".widget_config_avatar", "WidgetConfigAvatar_Url": ".widget_config_avatar", "WidgetConfigResponse": ".widget_config_response", "WidgetConfigResponseAvatar": ".widget_config_response_avatar", "WidgetConfigResponseAvatar_Image": ".widget_config_response_avatar", "WidgetConfigResponseAvatar_Orb": ".widget_config_response_avatar", "WidgetConfigResponseAvatar_Url": ".widget_config_response_avatar", "WidgetConfigResponseSyntaxHighlightTheme": ".widget_config_response_syntax_highlight_theme", "WidgetConfigSyntaxHighlightTheme": ".widget_config_syntax_highlight_theme", "WidgetEndFeedbackConfig": ".widget_end_feedback_config", "WidgetEndFeedbackType": ".widget_end_feedback_type", "WidgetExpandable": ".widget_expandable", "WidgetFeedbackMode": ".widget_feedback_mode", "WidgetLanguagePreset": ".widget_language_preset", "WidgetLanguagePresetResponse": ".widget_language_preset_response", "WidgetPlacement": ".widget_placement", "WidgetStyles": ".widget_styles", "WidgetTermsTranslation": ".widget_terms_translation", "WidgetTextContents": ".widget_text_contents", "WidgetTextContentsTranslation": ".widget_text_contents_translation", "WordTimestamp": ".word_timestamp", "WorkflowEdgeModelInput": ".workflow_edge_model_input", "WorkflowEdgeModelInputBackwardCondition": ".workflow_edge_model_input_backward_condition", "WorkflowEdgeModelInputBackwardCondition_Expression": ".workflow_edge_model_input_backward_condition", "WorkflowEdgeModelInputBackwardCondition_Llm": ".workflow_edge_model_input_backward_condition", "WorkflowEdgeModelInputBackwardCondition_Result": ".workflow_edge_model_input_backward_condition", "WorkflowEdgeModelInputBackwardCondition_Unconditional": ".workflow_edge_model_input_backward_condition", "WorkflowEdgeModelInputForwardCondition": ".workflow_edge_model_input_forward_condition", "WorkflowEdgeModelInputForwardCondition_Expression": ".workflow_edge_model_input_forward_condition", "WorkflowEdgeModelInputForwardCondition_Llm": ".workflow_edge_model_input_forward_condition", "WorkflowEdgeModelInputForwardCondition_Result": ".workflow_edge_model_input_forward_condition", "WorkflowEdgeModelInputForwardCondition_Unconditional": ".workflow_edge_model_input_forward_condition", "WorkflowEdgeModelOutput": ".workflow_edge_model_output", "WorkflowEdgeModelOutputBackwardCondition": ".workflow_edge_model_output_backward_condition", "WorkflowEdgeModelOutputBackwardCondition_Expression": ".workflow_edge_model_output_backward_condition", "WorkflowEdgeModelOutputBackwardCondition_Llm": ".workflow_edge_model_output_backward_condition", "WorkflowEdgeModelOutputBackwardCondition_Result": ".workflow_edge_model_output_backward_condition", "WorkflowEdgeModelOutputBackwardCondition_Unconditional": ".workflow_edge_model_output_backward_condition", "WorkflowEdgeModelOutputForwardCondition": ".workflow_edge_model_output_forward_condition", "WorkflowEdgeModelOutputForwardCondition_Expression": ".workflow_edge_model_output_forward_condition", "WorkflowEdgeModelOutputForwardCondition_Llm": ".workflow_edge_model_output_forward_condition", "WorkflowEdgeModelOutputForwardCondition_Result": ".workflow_edge_model_output_forward_condition", "WorkflowEdgeModelOutputForwardCondition_Unconditional": ".workflow_edge_model_output_forward_condition", "WorkflowEndNodeModelInput": ".workflow_end_node_model_input", "WorkflowEndNodeModelOutput": ".workflow_end_node_model_output", "WorkflowExpressionConditionModelInput": ".workflow_expression_condition_model_input", "WorkflowExpressionConditionModelOutput": ".workflow_expression_condition_model_output", "WorkflowFeaturesUsageCommonModel": ".workflow_features_usage_common_model", "WorkflowLlmConditionModelInput": ".workflow_llm_condition_model_input", "WorkflowLlmConditionModelOutput": ".workflow_llm_condition_model_output", "WorkflowOverrideAgentNodeModelInput": ".workflow_override_agent_node_model_input", "WorkflowOverrideAgentNodeModelOutput": ".workflow_override_agent_node_model_output", "WorkflowPhoneNumberNodeModelInput": ".workflow_phone_number_node_model_input", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem": ".workflow_phone_number_node_model_input_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic": ".workflow_phone_number_node_model_input_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static": ".workflow_phone_number_node_model_input_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelInputPostDialDigits": ".workflow_phone_number_node_model_input_post_dial_digits", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic": ".workflow_phone_number_node_model_input_post_dial_digits", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Static": ".workflow_phone_number_node_model_input_post_dial_digits", "WorkflowPhoneNumberNodeModelInputTransferDestination": ".workflow_phone_number_node_model_input_transfer_destination", "WorkflowPhoneNumberNodeModelInputTransferDestination_Phone": ".workflow_phone_number_node_model_input_transfer_destination", "WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable": ".workflow_phone_number_node_model_input_transfer_destination", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri": ".workflow_phone_number_node_model_input_transfer_destination", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable": ".workflow_phone_number_node_model_input_transfer_destination", "WorkflowPhoneNumberNodeModelOutput": ".workflow_phone_number_node_model_output", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem": ".workflow_phone_number_node_model_output_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic": ".workflow_phone_number_node_model_output_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static": ".workflow_phone_number_node_model_output_custom_sip_headers_item", "WorkflowPhoneNumberNodeModelOutputPostDialDigits": ".workflow_phone_number_node_model_output_post_dial_digits", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic": ".workflow_phone_number_node_model_output_post_dial_digits", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static": ".workflow_phone_number_node_model_output_post_dial_digits", "WorkflowPhoneNumberNodeModelOutputTransferDestination": ".workflow_phone_number_node_model_output_transfer_destination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone": ".workflow_phone_number_node_model_output_transfer_destination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable": ".workflow_phone_number_node_model_output_transfer_destination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri": ".workflow_phone_number_node_model_output_transfer_destination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable": ".workflow_phone_number_node_model_output_transfer_destination", "WorkflowResultConditionModelInput": ".workflow_result_condition_model_input", "WorkflowResultConditionModelOutput": ".workflow_result_condition_model_output", "WorkflowStandaloneAgentNodeModelInput": ".workflow_standalone_agent_node_model_input", "WorkflowStandaloneAgentNodeModelOutput": ".workflow_standalone_agent_node_model_output", "WorkflowStartNodeModelInput": ".workflow_start_node_model_input", "WorkflowStartNodeModelOutput": ".workflow_start_node_model_output", "WorkflowToolEdgeStepModel": ".workflow_tool_edge_step_model", "WorkflowToolLocator": ".workflow_tool_locator", "WorkflowToolLocatorSchemaOverridesValue": ".workflow_tool_locator_schema_overrides_value", "WorkflowToolLocatorSchemaOverridesValue_Constant": ".workflow_tool_locator_schema_overrides_value", "WorkflowToolLocatorSchemaOverridesValue_DynamicVariable": ".workflow_tool_locator_schema_overrides_value", "WorkflowToolLocatorSchemaOverridesValue_Llm": ".workflow_tool_locator_schema_overrides_value", "WorkflowToolLocatorSchemaOverridesValue_Omit": ".workflow_tool_locator_schema_overrides_value", "WorkflowToolMaxIterationsExceededStepModel": ".workflow_tool_max_iterations_exceeded_step_model", "WorkflowToolNestedToolsStepModelInput": ".workflow_tool_nested_tools_step_model_input", "WorkflowToolNestedToolsStepModelInputResultsItem": ".workflow_tool_nested_tools_step_model_input_results_item", "WorkflowToolNestedToolsStepModelOutput": ".workflow_tool_nested_tools_step_model_output", "WorkflowToolNestedToolsStepModelOutputResultsItem": ".workflow_tool_nested_tools_step_model_output_results_item", "WorkflowToolNodeModelInput": ".workflow_tool_node_model_input", "WorkflowToolNodeModelOutput": ".workflow_tool_node_model_output", "WorkflowToolResponseModelInput": ".workflow_tool_response_model_input", "WorkflowToolResponseModelInputStepsItem": ".workflow_tool_response_model_input_steps_item", "WorkflowToolResponseModelInputStepsItem_Edge": ".workflow_tool_response_model_input_steps_item", "WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded": ".workflow_tool_response_model_input_steps_item", "WorkflowToolResponseModelInputStepsItem_NestedTools": ".workflow_tool_response_model_input_steps_item", "WorkflowToolResponseModelOutput": ".workflow_tool_response_model_output", "WorkflowToolResponseModelOutputStepsItem": ".workflow_tool_response_model_output_steps_item", "WorkflowToolResponseModelOutputStepsItem_Edge": ".workflow_tool_response_model_output_steps_item", "WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded": ".workflow_tool_response_model_output_steps_item", "WorkflowToolResponseModelOutputStepsItem_NestedTools": ".workflow_tool_response_model_output_steps_item", "WorkflowUnconditionalModelInput": ".workflow_unconditional_model_input", "WorkflowUnconditionalModelOutput": ".workflow_unconditional_model_output", "WorkspaceAnalyticsQueryResponseModel": ".workspace_analytics_query_response_model", "WorkspaceAnalyticsQueryResponseModelColumnTypesItem": ".workspace_analytics_query_response_model_column_types_item", "WorkspaceAnalyticsQueryResponseModelRowsItemItem": ".workspace_analytics_query_response_model_rows_item_item", "WorkspaceApiKeyListResponseModel": ".workspace_api_key_list_response_model", "WorkspaceApiKeyResponseModel": ".workspace_api_key_response_model", "WorkspaceAuditLogEntryResponse": ".workspace_audit_log_entry_response", "WorkspaceAuditLogEntryResponseActivityId": ".workspace_audit_log_entry_response_activity_id", "WorkspaceAuditLogsPageResponse": ".workspace_audit_logs_page_response", "WorkspaceBatchCallsResponse": ".workspace_batch_calls_response", "WorkspaceCreateApiKeyResponseModel": ".workspace_create_api_key_response_model", "WorkspaceCreateServiceAccountResponseModel": ".workspace_create_service_account_response_model", "WorkspaceCreateWebhookResponseModel": ".workspace_create_webhook_response_model", "WorkspaceGroupByNameResponseModel": ".workspace_group_by_name_response_model", "WorkspaceGroupPermission": ".workspace_group_permission", "WorkspaceGroupResponseModel": ".workspace_group_response_model", "WorkspaceGroupResponseModelGroupPvcLimit": ".workspace_group_response_model_group_pvc_limit", "WorkspaceGroupResponseModelGroupUsageLimit": ".workspace_group_response_model_group_usage_limit", "WorkspaceMemberResponseModel": ".workspace_member_response_model", "WorkspaceResourceType": ".workspace_resource_type", "WorkspaceServiceAccountListResponseModel": ".workspace_service_account_list_response_model", "WorkspaceServiceAccountResponseModel": ".workspace_service_account_response_model", "WorkspaceWebhookEventType": ".workspace_webhook_event_type", "WorkspaceWebhookListResponseModel": ".workspace_webhook_list_response_model", "WorkspaceWebhookResponseModel": ".workspace_webhook_response_model", "WorkspaceWebhookUsageResponseModel": ".workspace_webhook_usage_response_model", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AccountChangeActivityId", "ActorModel", "AddChapterResponseModel", "AddKnowledgeBaseResponseModel", "AddProjectRequest", "AddProjectResponseModel", "AddPronunciationDictionaryResponseModel", "AddPronunciationDictionaryResponseModelPermissionOnResource", "AddSharingVoiceRequest", "AddVoiceIvcResponseModel", "AddVoiceResponseModel", "AddWorkspaceGroupMemberResponseModel", "AddWorkspaceInviteResponseModel", "AdditionalFormatResponseModel", "AdditionalFormats", "AdhocAgentConfigOverrideForTestRequestModel", "Age", "AgentAnalysisItemsInput", "AgentAnalysisItemsInputDataCollectionItem", "AgentAnalysisItemsInputDataCollectionItem_System", "AgentAnalysisItemsInputDataCollectionItem_User", "AgentAnalysisItemsInputEvaluationCriteriaItem", "AgentAnalysisItemsInputEvaluationCriteriaItem_System", "AgentAnalysisItemsInputEvaluationCriteriaItem_User", "AgentAnalysisItemsOutput", "AgentAnalysisItemsOutputDataCollectionItem", "AgentAnalysisItemsOutputDataCollectionItem_System", "AgentAnalysisItemsOutputDataCollectionItem_User", "AgentAnalysisItemsOutputEvaluationCriteriaItem", "AgentAnalysisItemsOutputEvaluationCriteriaItem_System", "AgentAnalysisItemsOutputEvaluationCriteriaItem_User", "AgentBranchBasicInfo", "AgentBranchResponse", "AgentBranchSummary", "AgentCallLimits", "AgentConfig", "AgentConfigApiModelWorkflowOverrideInput", "AgentConfigApiModelWorkflowOverrideOutput", "AgentConfigOverrideConfig", "AgentConfigOverrideInput", "AgentConfigOverrideOutput", "AgentDefinitionSource", "AgentDeploymentPercentageStrategy", "AgentDeploymentRequest", "AgentDeploymentRequestItem", "AgentDeploymentResponse", "AgentFailureResponseExample", "AgentKnowledgeBaseRagChunkResponseModel", "AgentKnowledgeBaseRagQueryRequestModel", "AgentKnowledgeBaseRagQueryResponseModel", "AgentMetadata", "AgentMetadataDbModel", "AgentMetadataResponseModel", "AgentPlatformSettingsRequestModel", "AgentPlatformSettingsResponseModel", "AgentResponsePayload", "AgentSimulatedChatTestResponseModel", "AgentSortBy", "AgentSuccessfulResponseExample", "AgentSummaryBatchSuccessfulResponseModel", "AgentSummaryResponseModel", "AgentTestEntityType", "AgentTestFolderPathSegmentResponseModel", "AgentTestingSettings", "AgentTopicResponseModel", "AgentTransferInput", "AgentTransferOp", "AgentTransferOpPop", "AgentTransferOpPush", "AgentTransferOpReplace", "AgentTransferOp_Pop", "AgentTransferOp_Push", "AgentTransferOp_Replace", "AgentTransferOutput", "AgentTrustContext", "AgentVersionMetadata", "AgentVersionParents", "AgentWorkflowRequestModel", "AgentWorkflowRequestModelNodesValue", "AgentWorkflowRequestModelNodesValue_End", "AgentWorkflowRequestModelNodesValue_OverrideAgent", "AgentWorkflowRequestModelNodesValue_PhoneNumber", "AgentWorkflowRequestModelNodesValue_StandaloneAgent", "AgentWorkflowRequestModelNodesValue_Start", "AgentWorkflowRequestModelNodesValue_Tool", "AgentWorkflowResponseModel", "AgentWorkflowResponseModelNodesValue", "AgentWorkflowResponseModelNodesValue_End", "AgentWorkflowResponseModelNodesValue_OverrideAgent", "AgentWorkflowResponseModelNodesValue_PhoneNumber", "AgentWorkflowResponseModelNodesValue_StandaloneAgent", "AgentWorkflowResponseModelNodesValue_Start", "AgentWorkflowResponseModelNodesValue_Tool", "AgentWorkspaceOverridesInput", "AgentWorkspaceOverridesOutput", "AlertingMonitorConfig", "AlertingSettings", "AlertingSettingsResponse", "AlertingWebhookHeader", "AlertingWebhookMethod", "AlertingWebhookNotifier", "AlertingWebhookNotifierResponse", "Alignment", "AllowedOutputFormats", "AllowlistItem", "AnalysisCharging", "AnalysisProperty", "AnalysisPropertyConstantValue", "AnalysisPropertyType", "AnalysisRunSnapshot", "AnalysisRunningTotal", "AnalysisScope", "AnalysisType", "ApiIntegrationOAuth2AuthCodeResponse", "ApiIntegrationOAuth2AuthCodeResponseScopeSeparator", "ApiIntegrationOAuth2CustomAppResponse", "ApiIntegrationOAuth2CustomAppResponseScopeSeparator", "ApiIntegrationWebhookOverrides", "ApiIntegrationWebhookOverridesRequestHeadersValue", "ApiIntegrationWebhookOverridesSchemaOverridesValue", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant", "ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm", "ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit", "ApiIntegrationWebhookToolConfigInput", "ApiIntegrationWebhookToolConfigOutput", "ArrayJsonSchemaPropertyInput", "ArrayJsonSchemaPropertyInputItems", "ArrayJsonSchemaPropertyInputPropertyKind", "ArrayJsonSchemaPropertyOutput", "ArrayJsonSchemaPropertyOutputItems", "AsrConversationalConfig", "AsrConversationalConfigOverride", "AsrConversationalConfigOverrideConfig", "AsrConversationalConfigWorkflowOverride", "AsrInputFormat", "AsrProvider", "AsrQuality", "AssetTranscription", "AssetTranscriptionData", "AssetTranscriptionStatus", "AstAdditionOperatorNodeInput", "AstAdditionOperatorNodeOutput", "AstAndOperatorNodeInput", "AstAndOperatorNodeOutput", "AstBooleanNodeInput", "AstBooleanNodeOutput", "AstConditionalOperatorNodeInput", "AstConditionalOperatorNodeOutput", "AstDivisionOperatorNodeInput", "AstDivisionOperatorNodeOutput", "AstDynamicVariableNodeInput", "AstDynamicVariableNodeOutput", "AstEqualsOperatorNodeInput", "AstEqualsOperatorNodeOutput", "AstGreaterThanOperatorNodeInput", "AstGreaterThanOperatorNodeOutput", "AstGreaterThanOrEqualsOperatorNodeInput", "AstGreaterThanOrEqualsOperatorNodeOutput", "AstLessThanOperatorNodeInput", "AstLessThanOperatorNodeOutput", "AstLessThanOrEqualsOperatorNodeInput", "AstLessThanOrEqualsOperatorNodeOutput", "AstMultiplicationOperatorNodeInput", "AstMultiplicationOperatorNodeOutput", "AstNodeInput", "AstNodeInputLlm", "AstNodeInput_AddOperator", "AstNodeInput_AndOperator", "AstNodeInput_BooleanLiteral", "AstNodeInput_ConditionalOperator", "AstNodeInput_DivOperator", "AstNodeInput_DynamicVariable", "AstNodeInput_EqOperator", "AstNodeInput_GtOperator", "AstNodeInput_GteOperator", "AstNodeInput_Llm", "AstNodeInput_LtOperator", "AstNodeInput_LteOperator", "AstNodeInput_MulOperator", "AstNodeInput_NeqOperator", "AstNodeInput_NullLiteral", "AstNodeInput_NumberLiteral", "AstNodeInput_OrOperator", "AstNodeInput_StringLiteral", "AstNodeInput_SubOperator", "AstNodeOutput", "AstNodeOutput_AddOperator", "AstNodeOutput_AndOperator", "AstNodeOutput_BooleanLiteral", "AstNodeOutput_ConditionalOperator", "AstNodeOutput_DivOperator", "AstNodeOutput_DynamicVariable", "AstNodeOutput_EqOperator", "AstNodeOutput_GtOperator", "AstNodeOutput_GteOperator", "AstNodeOutput_Llm", "AstNodeOutput_LtOperator", "AstNodeOutput_LteOperator", "AstNodeOutput_MulOperator", "AstNodeOutput_NeqOperator", "AstNodeOutput_NullLiteral", "AstNodeOutput_NumberLiteral", "AstNodeOutput_OrOperator", "AstNodeOutput_StringLiteral", "AstNodeOutput_SubOperator", "AstNotEqualsOperatorNodeInput", "AstNotEqualsOperatorNodeOutput", "AstNullNodeInput", "AstNullNodeOutput", "AstNumberNodeInput", "AstNumberNodeInputValue", "AstNumberNodeOutput", "AstNumberNodeOutputValue", "AstOrOperatorNodeInput", "AstOrOperatorNodeOutput", "AstStringNodeInput", "AstStringNodeOutput", "AstSubtractionOperatorNodeInput", "AstSubtractionOperatorNodeOutput", "AstllmNodeInput", "AstllmNodeInputPrompt", "AstllmNodeInputValueSchema", "AstllmNodeOutput", "AsyncConversationMetadata", "AsyncConversationMetadataDeliveryStatus", "AttachedSystemDataCollectionRef", "AttachedSystemEvaluationRef", "AttachedSystemEvaluationRefAnalysisItemId", "AttachedTestModel", "AttachedUserDataCollectionRef", "AttachedUserEvaluationRef", "AudioAnalysis", "AudioAnalysisResult", "AudioAnalysisStatus", "AudioFormatEnum", "AudioIsolationHistoryItemResponseModel", "AudioKeyMoment", "AudioNativeCreateProjectResponseModel", "AudioNativeEditContentResponseModel", "AudioNativeProjectSettingsResponseModel", "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", "AudioOutputMulti", "AudioRefChunk", "AudioSegment", "AudioWithTimestampsAndVoiceSegmentsResponseModel", "AudioWithTimestampsResponse", "AuthConnectionDependencies", "AuthConnectionDependenciesMcpServersItem", "AuthConnectionDependenciesMcpServersItem_Available", "AuthConnectionDependenciesMcpServersItem_Unknown", "AuthConnectionDependenciesToolsItem", "AuthConnectionDependenciesToolsItem_Available", "AuthConnectionDependenciesToolsItem_Unknown", "AuthConnectionLocator", "AuthConnectionStatus", "AuthSettings", "AuthenticationActivityId", "AuthorizationMethod", "AutoGenerationMetadata", "AutoSyncInfo", "BackgroundSoundConfig", "BackgroundSoundConfigWorkflowOverride", "BackgroundSoundPresetId", "BackgroundSoundSourceType", "BackupLlmDefault", "BackupLlmDisabled", "BackupLlmOverride", "BadRequestErrorBody", "BaseTurnConfig", "BasicAuthResponse", "BatchCallDetailedResponse", "BatchCallRecipientStatus", "BatchCallResponse", "BatchCallStatus", "BatchCallWhatsAppParams", "BatchFailureResponseModel", "BearerAuthResponse", "BehaviorOverride", "BillingPeriod", "BranchProtectionStatus", "BreakdownTypes", "BucketingStatus", "BuiltInToolsInput", "BuiltInToolsOutput", "BuiltInToolsWorkflowOverrideInput", "BuiltInToolsWorkflowOverrideOutput", "CancelCalendarEventParams", "CancelGroupSessionForAllParams", "CancelGroupSessionRegistrationParams", "CanvasPlacement", "CaptionStyleCharacterAnimationModel", "CaptionStyleCharacterAnimationModelEnterType", "CaptionStyleCharacterAnimationModelExitType", "CaptionStyleHorizontalPlacementModel", "CaptionStyleHorizontalPlacementModelAlign", "CaptionStyleModel", "CaptionStyleModelTextAlign", "CaptionStyleModelTextBlendMode", "CaptionStyleModelTextStyle", "CaptionStyleModelTextTransform", "CaptionStyleModelTextWeight", "CaptionStyleSectionAnimationModel", "CaptionStyleSectionAnimationModelEnterType", "CaptionStyleSectionAnimationModelExitType", "CaptionStyleTemplateModel", "CaptionStyleVerticalPlacementModel", "CaptionStyleVerticalPlacementModelAlign", "CaptionStyleWordAnimationModel", "CaptionStyleWordAnimationModelEnterType", "CaptionStyleWordAnimationModelExitType", "ChapterContentBlockExtendableNodeResponseModel", "ChapterContentBlockInputModel", "ChapterContentBlockInputModelSubType", "ChapterContentBlockResponseModel", "ChapterContentBlockResponseModelNodesItem", "ChapterContentBlockResponseModelNodesItem_Other", "ChapterContentBlockResponseModelNodesItem_TtsNode", "ChapterContentBlockTtsNodeResponseModel", "ChapterContentInputModel", "ChapterContentParagraphTtsNodeInputModel", "ChapterContentResponseModel", "ChapterResponse", "ChapterSnapshotExtendedResponseModel", "ChapterSnapshotResponse", "ChapterSnapshotsResponse", "ChapterState", "ChapterStatisticsResponse", "ChapterWithContentResponseModel", "ChapterWithContentResponseModelState", "CharacterAge", "CharacterAlignmentModel", "CharacterAlignmentResponseModel", "CharacterGender", "CharacterMetadataResponseModel", "CharacterRefreshPeriod", "CharacterResponseModel", "CharacterRole", "CharacterUsageResponse", "ChatSourceMedium", "CheckServiceAvailabilityParams", "ClientEvent", "ClientToolConfigInput", "ClientToolConfigOutput", "ClipAnimation", "ClipAnimationEnterEffect", "ClipAnimationExitEffect", "CloseConnection", "CloseContext", "ClosePayload", "CloseSocket", "ColumnFilter", "ColumnFilterOperation", "ColumnFilterValuesItem", "ColumnUnit", "CommittedTranscriptEntitiesPayload", "CommittedTranscriptPayload", "CommittedTranscriptWithTimestampsPayload", "CompileProceduresResponseModel", "CompileProceduresValidationErrorResponseModel", "CompositionPlan", "CompositionPlanChunksItem", "ConfigEntityType", "ConflictSection", "ConstantSchemaOverride", "ConstantSchemaOverrideConstantValue", "ContentConfig", "ContentFormat", "ContentGuardrailInput", "ContentGuardrailInputTriggerAction", "ContentGuardrailInputTriggerAction_EndCall", "ContentGuardrailInputTriggerAction_Retry", "ContentGuardrailOutput", "ContentGuardrailOutputTriggerAction", "ContentGuardrailOutputTriggerAction_EndCall", "ContentGuardrailOutputTriggerAction_Retry", "ContentThresholdGuardrail", "ContentThresholdGuardrailThreshold", "ContextualUpdateInfo", "Contributor", "ConvAiDynamicVariable", "ConvAiEnvVarLocator", "ConvAiFileUploadResponseModel", "ConvAiSecretLocator", "ConvAiStoredSecretDependencies", "ConvAiStoredSecretDependenciesAgentsItem", "ConvAiStoredSecretDependenciesAgentsItem_Available", "ConvAiStoredSecretDependenciesAgentsItem_Unknown", "ConvAiStoredSecretDependenciesMcpServersItem", "ConvAiStoredSecretDependenciesMcpServersItem_Available", "ConvAiStoredSecretDependenciesMcpServersItem_Unknown", "ConvAiStoredSecretDependenciesToolsItem", "ConvAiStoredSecretDependenciesToolsItem_Available", "ConvAiStoredSecretDependenciesToolsItem_Unknown", "ConvAiUserSecretDbModel", "ConvAiWebhooks", "ConvAiWorkspaceStoredSecretConfig", "ConversationAsrUsageModel", "ConversationChargingCommonModel", "ConversationConfigClientOverrideConfigInput", "ConversationConfigClientOverrideConfigOutput", "ConversationConfigClientOverrideInput", "ConversationConfigClientOverrideOutput", "ConversationConfigInput", "ConversationConfigOutput", "ConversationConfigOverride", "ConversationConfigOverrideConfig", "ConversationConfigWorkflowOverrideInput", "ConversationConfigWorkflowOverrideOutput", "ConversationDeletionSettings", "ConversationFeedbackType", "ConversationHistoryAnalysisCommonModel", "ConversationHistoryBatchCallModel", "ConversationHistoryElevenAssistantCommonModel", "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryExotelPhoneCallModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", "ConversationHistoryMetadataCommonModelPhoneCall_Exotel", "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", "ConversationHistoryMultivoiceMessageModel", "ConversationHistoryMultivoiceMessagePartModel", "ConversationHistoryRagUsageCommonModel", "ConversationHistoryRedactionConfig", "ConversationHistorySipTrunkingPhoneCallModel", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput", "ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput", "ConversationHistoryTranscriptCommonModelInput", "ConversationHistoryTranscriptCommonModelInputRole", "ConversationHistoryTranscriptCommonModelInputToolResultsItem", "ConversationHistoryTranscriptCommonModelOutput", "ConversationHistoryTranscriptCommonModelOutputRole", "ConversationHistoryTranscriptCommonModelOutputToolResultsItem", "ConversationHistoryTranscriptFileInputResponseModel", "ConversationHistoryTranscriptOtherToolsResultCommonModel", "ConversationHistoryTranscriptOtherToolsResultCommonModelType", "ConversationHistoryTranscriptResponseModel", "ConversationHistoryTranscriptResponseModelRole", "ConversationHistoryTranscriptResponseModelToolResultsItem", "ConversationHistoryTranscriptSystemToolResultCommonModelInput", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutput", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess", "ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput", "ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput", "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModelInput", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp", "ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook", "ConversationHistoryTranscriptToolCallCommonModelOutput", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp", "ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook", "ConversationHistoryTranscriptToolCallMcpDetails", "ConversationHistoryTranscriptToolCallWebhookDetails", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput", "ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput", "ConversationHistoryTwilioPhoneCallModel", "ConversationInitiationClientDataConfigInput", "ConversationInitiationClientDataConfigOutput", "ConversationInitiationClientDataInternal", "ConversationInitiationClientDataRequestInput", "ConversationInitiationClientDataRequestOutput", "ConversationInitiationClientDataWebhook", "ConversationInitiationClientDataWebhookRequestHeadersValue", "ConversationInitiationSource", "ConversationInitiationSourceInfo", "ConversationProduct", "ConversationReasoningModel", "ConversationSentimentAnalysis", "ConversationSentimentAnalysisOverallLabel", "ConversationSignedUrlResponseModel", "ConversationSimulationSpecification", "ConversationSource", "ConversationSummaryResponseModel", "ConversationSummaryResponseModelStatus", "ConversationTagResponseModel", "ConversationTokenPurpose", "ConversationTokenResponseModel", "ConversationTtsUsageModel", "ConversationTurnMetrics", "ConversationUserResponseModel", "ConversationVoiceRewardModel", "ConversationVoiceUsageModel", "ConversationalConfig", "ConversationalConfigApiModelWorkflowOverrideInput", "ConversationalConfigApiModelWorkflowOverrideOutput", "ConvertChapterResponseModel", "ConvertProjectResponseModel", "CrawlStatus", "CrawlType", "CreateAgentBranchResponseModel", "CreateAgentProcedureParams", "CreateAgentResponseModel", "CreateAgentRuleParams", "CreateAgentTestFolderResponseModel", "CreateAgentTestResponseModel", "CreateAssetParams", "CreateAudioNativeProjectRequest", "CreateAuthConnectionEnvironmentVariableRequest", "CreateBasicAuthRequest", "CreateBearerAuthRequest", "CreateClientAppointmentParams", "CreateClientInteractionParams", "CreateClientParams", "CreateCrawlJobResponseModel", "CreateCustomHeaderAuthRequest", "CreateExotelPhoneNumberRequest", "CreateHolidayParams", "CreateLocationParams", "CreateMtlsAuthRequest", "CreateOAuth2ClientCredsRequest", "CreateOAuth2JwtRequest", "CreateOAuth2JwtRequestAlgorithm", "CreateOAuth2JwtRequestTokenResponseField", "CreateOrderRequest", "CreateOrderResponse", "CreatePhoneNumberResponseModel", "CreatePreviouslyGeneratedVoiceRequest", "CreatePrivateKeyJwtRequest", "CreatePrivateKeyJwtRequestAlgorithm", "CreateProcedureRequestModel", "CreateProcedureResponseModel", "CreateProductParams", "CreatePronunciationDictionaryResponseModel", "CreateResponseUnitTestRequest", "CreateSecretEnvironmentVariableRequest", "CreateServiceParams", "CreateSimulationTestRequest", "CreateSipTrunkPhoneNumberRequest", "CreateStaffParams", "CreateStringEnvironmentVariableRequest", "CreateToolCallUnitTestRequest", "CreateTranscriptRequest", "CreateTransferRuleParams", "CreateTwilioPhoneNumberRequest", "CriteriaScoringMode", "CueOptionsRequest", "Currency", "CustomGuardrailConfig", "CustomGuardrailConfigModel", "CustomGuardrailConfigTriggerAction", "CustomGuardrailConfigTriggerAction_EndCall", "CustomGuardrailConfigTriggerAction_Retry", "CustomGuardrailInput", "CustomGuardrailOutput", "CustomGuardrailsConfigInput", "CustomGuardrailsConfigOutput", "CustomHeaderAuthResponse", "CustomLlm", "CustomLlmApiKey", "CustomLlmAuthConnection", "CustomLlmRequestHeadersValue", "CustomLlmapiType", "CustomSipHeader", "CustomSipHeaderWithDynamicVariable", "CustomToolApiSchemaConfig", "DashboardCallSuccessChartModel", "DashboardCriteriaChartModel", "DashboardDataCollectionChartModel", "DataCollectionResultCommonModel", "DefaultSharingGroupConfig", "DefaultSharingGroupConfigPermissionLevel", "DefaultSharingGroupResponseModel", "DefaultSharingGroupResponseModelPermissionLevel", "DeleteAgentProcedureParams", "DeleteAgentRuleParams", "DeleteAssetParams", "DeleteCalendarEventParams", "DeleteChapterRequest", "DeleteChapterResponseModel", "DeleteClientInteractionParams", "DeleteClientParams", "DeleteDubbingResponseModel", "DeleteGroupSessionParams", "DeleteHistoryItemResponse", "DeleteHolidayParams", "DeleteLocationParams", "DeleteProductParams", "DeleteProjectRequest", "DeleteProjectResponseModel", "DeleteSampleResponse", "DeleteServiceParams", "DeleteStaffParams", "DeleteTransferRuleParams", "DeleteVoiceResponseModel", "DeleteVoiceSampleResponseModel", "DeleteWorkspaceGroupMemberResponseModel", "DeleteWorkspaceInviteResponseModel", "DeleteWorkspaceWebhookResponseModel", "DeliverableInfo", "DependentAvailableAgentIdentifier", "DependentAvailableAgentIdentifierAccessLevel", "DependentAvailableMcpServerIdentifier", "DependentAvailableMcpServerIdentifierAccessLevel", "DependentAvailableToolIdentifier", "DependentAvailableToolIdentifierAccessLevel", "DependentBranchInfo", "DependentIntegrationConnectionIdentifier", "DependentPhoneNumberIdentifier", "DependentUnknownAgentIdentifier", "DependentUnknownMcpServerIdentifier", "DependentUnknownToolIdentifier", "DetailedMusicResponse", "DetailedMusicResponseCompositionPlan", "DetectedEntity", "DeviceModel", "DialogueInput", "DialogueInputResponseModel", "DialogueTextAlignment", "DirectPublishingReadResponseModel", "DirectPublishingReadResponseModelDisplayMode", "DirectPublishingReadResponseModelGenreItem", "DirectPublishingReadResponseModelPayoutType", "DirectPublishingReadResponseModelTargetAudience", "DiscountResponseModel", "DoDubbingResponse", "DocumentUsageModeEnum", "DocxExportOptions", "DtmfInputConfig", "DubOrderItemRequest", "DubbedSegment", "DubbingBulkSourceSegmentUpdateResponse", "DubbingBulkTargetSegmentUpdateResponse", "DubbingError", "DubbingLanguageListResponse", "DubbingLanguageOutputs", "DubbingLanguageResponse", "DubbingLanguageResponseStatus", "DubbingMediaMetadata", "DubbingMediaReference", "DubbingMetadataPageResponseModel", "DubbingMetadataResponse", "DubbingProjectListResponse", "DubbingProjectResponse", "DubbingProjectResponseStatus", "DubbingRegenerateResponse", "DubbingRenderResponseModel", "DubbingResource", "DubbingSegmentUpdateRequest", "DubbingSourceMediaInfo", "DubbingSourceSegmentUpdateResponse", "DubbingSourceTranscriptResponse", "DubbingTargetSegmentUpdateRequest", "DubbingTargetSegmentUpdateResponse", "DubbingTargetTranscriptResponse", "DubbingTargetTranscriptSegment", "DubbingTranscript", "DubbingTranscriptCharacter", "DubbingTranscriptResponseModel", "DubbingTranscriptRevisionResponse", "DubbingTranscriptSegment", "DubbingTranscriptUtterance", "DubbingTranscriptWord", "DubbingTranscriptsResponseModel", "DubbingTranscriptsResponseModelTranscriptFormat", "DummyToolResultModel", "DynamicVariableAssignment", "DynamicVariableNestedValueTypeInput", "DynamicVariableNestedValueTypeOutput", "DynamicVariableSchemaOverride", "DynamicVariableUpdateCommonModel", "DynamicVariablesConfig", "DynamicVariablesConfigWorkflowOverride", "EditChapterResponseModel", "EditProjectResponseModel", "EditVoiceResponseModel", "EditVoiceSettingsRequest", "EditVoiceSettingsResponseModel", "EmbedVariant", "EmbeddingModelEnum", "EndCallToolConfig", "EndCallToolResultModel", "EndCallTriggerAction", "EndProcedureToolConfigInput", "EndProcedureToolConfigOutput", "EndProcedureToolErrorStatus", "EntityManagementActivityId", "EntryBehavior", "EnvironmentAuthConnectionLocator", "EnvironmentVariableAuthConnectionValue", "EnvironmentVariableAuthConnectionValueRequest", "EnvironmentVariableResponse", "EnvironmentVariableResponseType", "EnvironmentVariableResponseValues", "EnvironmentVariableSecretValue", "EnvironmentVariableSecretValueRequest", "EnvironmentVariablesListResponse", "ErrorPayload", "EvaluationCriteriaSummaryResult", "EvaluationSettingsInput", "EvaluationSettingsOutput", "EvaluationSuccessResult", "ExactParameterEvaluationStrategy", "ExotelApiSubdomain", "ExotelOutboundCallResponse", "ExportOptions", "ExportOptions_Docx", "ExportOptions_Html", "ExportOptions_Pdf", "ExportOptions_SegmentedJson", "ExportOptions_Srt", "ExportOptions_Txt", "ExternalFileSyncInfo", "ExternalFolderSyncInfo", "ExternalSyncJobTrigger", "ExternalSyncJobType", "ExternalSyncProvider", "FeatureStatusCommonModel", "FeaturesUsageCommonModel", "FeedbackItem", "FieldConflict", "FileInputConfig", "FileInputConfigWorkflowOverride", "FileRefreshStatus", "FinalOutput", "FinalOutputMulti", "FinalTranscript", "FinalTranscriptWithTimestamps", "FinalTranscriptWithTimestampsWordsItem", "FinalTranscriptWithTimestampsWordsItemCharactersItem", "FinalTranscriptWithTimestampsWordsItemType", "FineTuningResponse", "FineTuningResponseStateValue", "FinetuneCreatedBy", "FinetuneVisibility", "FlushContext", "FocusGuardrail", "ForcedAlignmentCharacterResponseModel", "ForcedAlignmentResponseModel", "ForcedAlignmentWordResponseModel", "FrustratedConversationRef", "FrustratedConversationRefOverallLabel", "Gender", "GenerateVoiceRequest", "GenerationChunkInput", "GenerationChunkInputConditionStrength", "GenerationChunkInputContextAdherence", "GenerationChunkOutput", "GenerationChunkOutputConditionStrength", "GenerationChunkOutputContextAdherence", "GenerationConfig", "GenerationSourceContext", "GenesysBotOutcome", "GenesysRegion", "GetAgentEmbedResponseModel", "GetAgentKnowledgebaseSizeResponseModel", "GetAgentLinkResponseModel", "GetAgentResponseModel", "GetAgentResponseModelPhoneNumbersItem", "GetAgentResponseModelPhoneNumbersItem_Exotel", "GetAgentResponseModelPhoneNumbersItem_SipTrunk", "GetAgentResponseModelPhoneNumbersItem_Twilio", "GetAgentTestFolderResponseModel", "GetAgentTopicsResponseModel", "GetAgentsPageResponseModel", "GetAnalyticsSummaryParams", "GetAppointmentByConfirmationNumberParams", "GetAudioIsolationHistoryResponseModel", "GetAudioNativeProjectSettingsResponseModel", "GetBookingPageSettingsParams", "GetBookingSlugStatusParams", "GetChapterRequest", "GetChapterSnapshotsRequest", "GetChaptersRequest", "GetChaptersResponse", "GetClientAppointmentsParams", "GetClientByPhoneParams", "GetConvAiDashboardSettingsResponseModel", "GetConvAiDashboardSettingsResponseModelChartsItem", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria", "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection", "GetConvAiSettingsResponseModel", "GetConversationResponseModel", "GetConversationResponseModelStatus", "GetConversationTagsPageResponseModel", "GetConversationUsersPageResponseModel", "GetConversationsPageResponseModel", "GetCrawlJobResponseModel", "GetKnowledgeBaseDependentAgentsResponseModel", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available", "GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown", "GetKnowledgeBaseFileResponseModel", "GetKnowledgeBaseFolderResponseModel", "GetKnowledgeBaseListResponseModel", "GetKnowledgeBaseListResponseModelDocumentsItem", "GetKnowledgeBaseListResponseModelDocumentsItem_File", "GetKnowledgeBaseListResponseModelDocumentsItem_Folder", "GetKnowledgeBaseListResponseModelDocumentsItem_Text", "GetKnowledgeBaseListResponseModelDocumentsItem_Url", "GetKnowledgeBaseSummaryFileResponseModel", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryFolderResponseModel", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryTextResponseModel", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseSummaryUrlResponseModel", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available", "GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown", "GetKnowledgeBaseTextResponseModel", "GetKnowledgeBaseUrlResponseModel", "GetLibraryVoicesResponse", "GetLiveCountResponse", "GetOrCreateRagIndexRequestModel", "GetPhoneNumberExotelResponseModel", "GetPhoneNumberInboundSipTrunkConfigResponseModel", "GetPhoneNumberOutboundSipTrunkConfigResponseModel", "GetPhoneNumberResponse", "GetPhoneNumberSipTrunkResponseModel", "GetPhoneNumberTwilioResponseModel", "GetProjectRequest", "GetProjectsRequest", "GetProjectsResponse", "GetPronunciationDictionariesMetadataResponseModel", "GetPronunciationDictionariesResponse", "GetPronunciationDictionaryMetadataResponse", "GetPronunciationDictionaryMetadataResponsePermissionOnResource", "GetPronunciationDictionaryResponse", "GetPronunciationDictionaryWithRulesResponseModel", "GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource", "GetPronunciationDictionaryWithRulesResponseModelRulesItem", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias", "GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme", "GetResponseUnitTestResponseModel", "GetScheduleParams", "GetSecretDependenciesResponseModel", "GetSecretDependenciesResponseModelDependencies", "GetSecretDependenciesResponseModelDependenciesOneItem", "GetSecretDependenciesResponseModelDependenciesOneItem_Available", "GetSecretDependenciesResponseModelDependenciesOneItem_Unknown", "GetSecretDependenciesResponseModelDependenciesZeroItem", "GetSecretDependenciesResponseModelDependenciesZeroItem_Available", "GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown", "GetSimulationTestResponseModel", "GetSipLogMessagesResponse", "GetSpeechHistoryResponse", "GetTestInvocationsPageResponseModel", "GetTestSuiteInvocationResponseModel", "GetTestsPageResponseModel", "GetTestsSummariesByIdsResponseModel", "GetToolCallUnitTestResponseModel", "GetToolDependentAgentsResponseModel", "GetToolDependentAgentsResponseModelAgentsItem", "GetToolDependentAgentsResponseModelAgentsItem_Available", "GetToolDependentAgentsResponseModelAgentsItem_Unknown", "GetToolExecutionsPageResponseModel", "GetVoiceAccentsResponseModel", "GetVoicesResponse", "GetVoicesV2Response", "GetWhatsAppAccountResponse", "GetWorkspaceSecretsResponseModel", "GroupManagementActivityId", "GuardrailExecutionMode", "GuardrailType", "GuardrailsV1Input", "GuardrailsV1Output", "HistoryAlignmentResponseModel", "HistoryAlignmentsResponseModel", "HistoryItemResponse", "HtmlExportOptions", "HttpRequestModel", "HttpValidationError", "Icon", "ImageAnalysis", "ImageAnalysisResult", "ImageAnalysisStatus", "ImageAvatar", "ImageSubject", "InboundSipTrunkConfigRequestModel", "InitPayload", "InitialiseContext", "InitializeConnection", "InitializeConnectionMulti", "InputAudioChunkPayload", "IntegrationType", "InteractionBudget", "InternalAlertingWebhookNotifier", "InvoiceResponse", "InvoiceResponsePaymentIntentStatus", "InvoiceResponsePaymentIntentStatussesItem", "ItemId", "KbExternalSyncJob", "KeepContextAlive", "KnowledgeBaseBulkDeleteSuccessfulResponseModel", "KnowledgeBaseContentSearchResponseModel", "KnowledgeBaseContentSearchResult", "KnowledgeBaseContentSearchResultDocument", "KnowledgeBaseContentSearchResultDocument_File", "KnowledgeBaseContentSearchResultDocument_Folder", "KnowledgeBaseContentSearchResultDocument_Text", "KnowledgeBaseContentSearchResultDocument_Url", "KnowledgeBaseDeletedResponseModel", "KnowledgeBaseDependentType", "KnowledgeBaseDocumentChunkResponseModel", "KnowledgeBaseDocumentChunksResponseModel", "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", "KnowledgeBaseFolderPathSegmentResponseModel", "KnowledgeBaseFolderPathSegmentSummaryResponseModel", "KnowledgeBaseLocator", "KnowledgeBaseRagChunkModel", "KnowledgeBaseRagToolConfig", "KnowledgeBaseRagToolResultModel", "KnowledgeBaseRagToolStatus", "KnowledgeBaseSortBy", "KnowledgeBaseSourceFileUrlResponseModel", "KnowledgeBaseSummaryBatchSuccessfulResponseModel", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text", "KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url", "KnowledgeBaseToolConfig", "KnowledgeBaseToolInfo", "KnowledgeBaseToolResultModel", "KnowledgeBaseToolStatus", "LanguageAddedResponse", "LanguageDetectionToolConfig", "LanguageDetectionToolResultModel", "LanguageInfo", "LanguagePairInfo", "LanguagePresetInput", "LanguagePresetOutput", "LanguagePresetTranslation", "LanguageResponse", "LanguagesResponse", "LanguagesResponse_Pair", "LanguagesResponse_Single", "LeaveMessageParams", "LibraryVoiceResponse", "LibraryVoiceResponseCategory", "ListAgentProceduresParams", "ListAgentReferencesParams", "ListAgentRulesParams", "ListAssetsParams", "ListAuthConnectionsResponse", "ListAuthConnectionsResponseAuthConnectionsItem", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode", "ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp", "ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth", "ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth", "ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth", "ListAuthConnectionsResponseAuthConnectionsItem_Mtls", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials", "ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt", "ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt", "ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth", "ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth", "ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret", "ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth", "ListCalendarEventsParams", "ListClientInteractionsParams", "ListClientsParams", "ListCrawlJobsResponseModel", "ListCustomerFacingAgentsParams", "ListGroupSessionsParams", "ListHolidaysParams", "ListLocationsParams", "ListMcpToolsResponseModel", "ListOrdersResponse", "ListProceduresResponseModel", "ListProductsParams", "ListResponseAgentBranchSummary", "ListResponseMeta", "ListServicesParams", "ListSpeechEnginesResponse", "ListStaffParams", "ListTransferRulesParams", "ListWhatsAppAccountsResponse", "LiteralJsonSchemaProperty", "LiteralJsonSchemaPropertyConstantValue", "LiteralJsonSchemaPropertyType", "LivekitStackType", "Llm", "LlmCategoryUsage", "LlmDeprecationConfigModel", "LlmDeprecationInfoModel", "LlmInfoModelInput", "LlmInfoModelOutput", "LlmInputOutputTokensUsage", "LlmListResponseModelInput", "LlmListResponseModelOutput", "LlmLiteralJsonSchemaProperty", "LlmLiteralJsonSchemaPropertyType", "LlmParameterEvaluationStrategy", "LlmReasoningEffort", "LlmSchemaOverride", "LlmTokensCategoryUsage", "LlmUsageCalculatorLlmResponseModel", "LlmUsageCalculatorResponseModel", "LlmUsageInput", "LlmUsageOutput", "LoadMemoryEntryToolErrorStatus", "LoadableMemoryEntry", "LockReason", "ManualSource", "ManualVerificationFileResponse", "ManualVerificationResponse", "MatchAnythingParameterEvaluationStrategy", "McpApprovalPolicy", "McpServerConfigInput", "McpServerConfigInputAuthConnection", "McpServerConfigInputRequestHeadersValue", "McpServerConfigInputRequestMetaValue", "McpServerConfigInputSecretToken", "McpServerConfigInputUrl", "McpServerConfigOutput", "McpServerConfigOutputAuthConnection", "McpServerConfigOutputRequestHeadersValue", "McpServerConfigOutputRequestMetaValue", "McpServerConfigOutputSecretToken", "McpServerConfigOutputUrl", "McpServerMetadataResponseModel", "McpServerResponseModel", "McpServerResponseModelDependentAgentsItem", "McpServerResponseModelDependentAgentsItem_Available", "McpServerResponseModelDependentAgentsItem_Unknown", "McpServerTransport", "McpServersResponseModel", "McpToolApprovalHash", "McpToolApprovalPolicy", "McpToolConfigOverrideInput", "McpToolConfigOverrideInputInputOverridesValue", "McpToolConfigOverrideInputInputOverridesValue_Constant", "McpToolConfigOverrideInputInputOverridesValue_DynamicVariable", "McpToolConfigOverrideInputInputOverridesValue_Llm", "McpToolConfigOverrideInputInputOverridesValue_Omit", "McpToolConfigOverrideInputToolCallSound", "McpToolConfigOverrideOutput", "McpToolConfigOverrideOutputInputOverridesValue", "McpToolConfigOverrideOutputInputOverridesValue_Constant", "McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable", "McpToolConfigOverrideOutputInputOverridesValue_Llm", "McpToolConfigOverrideOutputInputOverridesValue_Omit", "McpToolConfigOverrideOutputToolCallSound", "MediaCodec", "MediaId", "MemoryEntrySearchResult", "MemoryEntrySearchResultSource", "MergePreviewResponseModel", "MergePreviewResponseModelPhoneNumbersItem", "MergePreviewResponseModelPhoneNumbersItem_Exotel", "MergePreviewResponseModelPhoneNumbersItem_SipTrunk", "MergePreviewResponseModelPhoneNumbersItem_Twilio", "MessageSearchSortBy", "MessagesSearchResponse", "MessagesSearchResult", "MetricRecord", "MetricType", "MockNoMatchBehavior", "MockingStrategy", "Model", "ModelRatesResponseModel", "ModelSettingsResponseModel", "ModerationConfig", "ModerationGuardrailInput", "ModerationGuardrailOutput", "MtlsAuthResponse", "MultichannelSpeechToTextResponseModel", "MultipartMusicResponse", "MusicAllowedOutputFormats", "MusicExploreSongSourceContext", "MusicFinetuneFailureReason", "MusicFinetunePageResponseModel", "MusicFinetuneResponseModel", "MusicFinetuneStatus", "MusicGenerationMode", "MusicOnlyOutputFormats", "MusicOutputFormat", "MusicPrompt", "MusicUploadResponse", "MusicUploadResponseCompositionPlan", "NonStreamingOutputFormats", "NormalizedAlignment", "NumericDistributionAggregate", "OAuth2ClientCredsResponse", "OAuth2JwtResponse", "OAuth2JwtResponseAlgorithm", "OAuth2JwtResponseTokenResponseField", "ObjectJsonSchemaPropertyInput", "ObjectJsonSchemaPropertyInputPropertiesValue", "ObjectJsonSchemaPropertyInputPropertyKind", "ObjectJsonSchemaPropertyOutput", "ObjectJsonSchemaPropertyOutputPropertiesValue", "OmitSchemaOverride", "OpenAiAudioFormat", "OpenerConfig", "OptInSmsReminderParams", "OptOutSmsReminderParams", "OrbAvatar", "OrchestratorToolMockBehaviorConfig", "OrderDeliverablesResponse", "OrderId", "OrderItemInfo", "OrderItemKind", "OrderItemRequestInput", "OrderItemRequestInput_Dub", "OrderItemRequestInput_Subtitles", "OrderItemRequestInput_Transcription", "OrderItemRequestOutput", "OrderItemRequestOutput_Dub", "OrderItemRequestOutput_Subtitles", "OrderItemRequestOutput_Transcription", "OrderMediaResponse", "OrderResponse", "OrderState", "OrderSummary", "OutboundCallRecipient", "OutboundCallRecipientResponseModel", "OutboundSipTrunkConfigRequestModel", "OutputFormat", "PairedLanguagesResponse", "PartialTranscriptPayload", "PatchWorkspaceWebhookResponseModel", "PdfExportOptions", "PendingBlocksMetadataModel", "PendingCancellationResponseModel", "PendingClipTask", "PendingClipTaskType", "PendingExternalAudiosMetadataModel", "PendingSubscriptionSwitchResponseModel", "PendingSubscriptionSwitchResponseModelNextTier", "PermissionType", "PhoneNumberAgentInfo", "PhoneNumberDynamicVariableTransferDestination", "PhoneNumberTransfer", "PhoneNumberTransferCustomSipHeadersItem", "PhoneNumberTransferCustomSipHeadersItem_Dynamic", "PhoneNumberTransferCustomSipHeadersItem_Static", "PhoneNumberTransferDestination", "PhoneNumberTransferPostDialDigits", "PhoneNumberTransferPostDialDigits_Dynamic", "PhoneNumberTransferPostDialDigits_Static", "PhoneNumberTransferTransferDestination", "PhoneNumberTransferTransferDestination_Phone", "PhoneNumberTransferTransferDestination_PhoneDynamicVariable", "PhoneNumberTransferTransferDestination_SipUri", "PhoneNumberTransferTransferDestination_SipUriDynamicVariable", "PingPayload", "PlatformCategory", "PlatformCategoryUsage", "PlatformUsage", "PlayDtmfResultErrorModel", "PlayDtmfResultSuccessModel", "PlayDtmfToolConfig", "PodcastBulletinMode", "PodcastBulletinModeData", "PodcastConversationMode", "PodcastConversationModeData", "PodcastProjectResponseModel", "PodcastTextSource", "PodcastUrlSource", "PongPayload", "PositionInput", "PositionOutput", "PostAgentAvatarResponseModel", "PostDialDigitsDynamicVariable", "PostDialDigitsStatic", "PostWorkspaceSecretResponseModel", "PreToolSpeechMode", "PreviewAudioDbModel", "Price", "PrivacyConfigInput", "PrivacyConfigOutput", "PrivateKeyJwtResponse", "PrivateKeyJwtResponseAlgorithm", "ProcedureAtVersionInput", "ProcedureAtVersionOutput", "ProcedureAtVersionResponseModel", "ProcedureDraftResponseModel", "ProcedureListItemResponseModel", "ProcedureRefResponseModel", "ProcedureType", "ProcedureValidationError", "ProjectCreationMetaResponseModel", "ProjectCreationMetaResponseModelStatus", "ProjectCreationMetaType", "ProjectExtendedResponse", "ProjectExtendedResponseAccessLevel", "ProjectExtendedResponseApplyTextNormalization", "ProjectExtendedResponseAspectRatio", "ProjectExtendedResponseAssetsItem", "ProjectExtendedResponseAssetsItem_Audio", "ProjectExtendedResponseAssetsItem_Image", "ProjectExtendedResponseAssetsItem_Video", "ProjectExtendedResponseFiction", "ProjectExtendedResponseSourceType", "ProjectExtendedResponseTargetAudience", "ProjectExternalAudioResponseModel", "ProjectExternalAudioResponseModelSourceContext", "ProjectExternalAudioResponseModelSourceContext_MusicExploreSong", "ProjectExternalAudioResponseModelSourceContext_Sfx", "ProjectExternalAudioResponseModelSourceContext_Song", "ProjectImageResponseModel", "ProjectMutedTracksResponseModel", "ProjectResponse", "ProjectResponseAccessLevel", "ProjectResponseAspectRatio", "ProjectResponseFiction", "ProjectResponseSourceType", "ProjectResponseTargetAudience", "ProjectSnapshotExtendedResponseModel", "ProjectSnapshotResponse", "ProjectSnapshotsResponse", "ProjectState", "ProjectVideoResponseModel", "ProjectVideoThumbnailSheetResponseModel", "ProjectVoiceResponseModel", "PromptAgent", "PromptAgentApiModelInput", "PromptAgentApiModelInputBackupLlmConfig", "PromptAgentApiModelInputBackupLlmConfig_Default", "PromptAgentApiModelInputBackupLlmConfig_Disabled", "PromptAgentApiModelInputBackupLlmConfig_Override", "PromptAgentApiModelInputToolsItem", "PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelInputToolsItem_Client", "PromptAgentApiModelInputToolsItem_Mcp", "PromptAgentApiModelInputToolsItem_Smb", "PromptAgentApiModelInputToolsItem_System", "PromptAgentApiModelInputToolsItem_Webhook", "PromptAgentApiModelOutput", "PromptAgentApiModelOutputBackupLlmConfig", "PromptAgentApiModelOutputBackupLlmConfig_Default", "PromptAgentApiModelOutputBackupLlmConfig_Disabled", "PromptAgentApiModelOutputBackupLlmConfig_Override", "PromptAgentApiModelOutputToolsItem", "PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelOutputToolsItem_Client", "PromptAgentApiModelOutputToolsItem_Mcp", "PromptAgentApiModelOutputToolsItem_Smb", "PromptAgentApiModelOutputToolsItem_System", "PromptAgentApiModelOutputToolsItem_Webhook", "PromptAgentApiModelOverrideConfig", "PromptAgentApiModelOverrideInput", "PromptAgentApiModelOverrideOutput", "PromptAgentApiModelWorkflowOverrideInput", "PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig", "PromptAgentApiModelWorkflowOverrideInputToolsItem", "PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Client", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb", "PromptAgentApiModelWorkflowOverrideInputToolsItem_System", "PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook", "PromptAgentApiModelWorkflowOverrideOutput", "PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig", "PromptAgentApiModelWorkflowOverrideOutputToolsItem", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_System", "PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook", "PromptAgentDbModel", "PromptEvaluationCriteria", "PromptInjectionGuardrail", "PronunciationDictionaryAliasRuleRequestModel", "PronunciationDictionaryAliasRuleResponseModel", "PronunciationDictionaryLocator", "PronunciationDictionaryLocatorResponseModel", "PronunciationDictionaryPhonemeRuleRequestModel", "PronunciationDictionaryPhonemeRuleResponseModel", "PronunciationDictionaryRulesResponseModel", "PronunciationDictionaryVersionLocator", "PronunciationDictionaryVersionResponseModel", "PronunciationDictionaryVersionResponseModelPermissionOnResource", "PydanticPronunciationDictionaryVersionLocator", "QualityPresetType", "QueryParamsJsonSchema", "QuoteInfo", "RagChunkMetadata", "RagConfigInput", "RagConfigOutput", "RagConfigWorkflowOverrideInput", "RagConfigWorkflowOverrideOutput", "RagDocumentIndexResponseModel", "RagDocumentIndexUsage", "RagDocumentIndexesResponseModel", "RagIndexBatchSuccessfulResponseModel", "RagIndexOverviewEmbeddingModelResponseModel", "RagIndexOverviewResponseModel", "RagIndexStatus", "RagRetrievalInfo", "ReadLegalTerms", "ReadMetadataChapterDbModel", "ReaderResourceResponseModel", "ReaderResourceResponseModelResourceType", "RealtimeVoiceSettings", "RecordingResponse", "ReferenceVideo", "ReferencedToolCommonModel", "ReferencedToolCommonModelType", "RefreshTokenAuthResponse", "RegexParameterEvaluationStrategy", "RegionConfigRequest", "RegionalProcessingSurchargeInfo", "RegisterForGroupSessionParams", "RegisterMediaResponse", "RemoveMemberFromGroupRequest", "RemoveOrderItemResponse", "Render", "RenderStatus", "RenderType", "ReplicateVoiceToIsolatedEnvironmentResponseModel", "ReportKnowledgeGapParams", "RequestPvcManualVerificationResponseModel", "RequiredConstraint", "RequiredConstraints", "ResourceAccessInfo", "ResourceAccessInfoAccessSource", "ResourceAccessInfoAnonymousAccessLevelOverride", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", "ResourceMetadataResponseModelAnonymousAccessLevelOverride", "ResponseFilter", "ResponseFilterMode", "ResponseUnitTestModel", "RestoreCalendarEventParams", "RetryTriggerAction", "ReviewResponseModel", "ReviewResponseModelRejectReasonsItem", "ReviewResponseModelReviewStatus", "ReviewStatus", "RunSubagentToolConfigInput", "RunSubagentToolConfigOutput", "SafetyCommonModelInput", "SafetyCommonModelOutput", "SafetyEvaluation", "SafetyResponseModel", "SafetyRule", "SampleConfigDbModel", "SampleConfigDbModelParentType", "SaveVoicePreviewRequest", "SayNodeLiteralMessageInput", "SayNodeLiteralMessageOutput", "SayNodePromptMessageInput", "SayNodePromptMessageOutput", "ScheduleGroupSessionParams", "ScimGroupResponseModel", "ScopedAnalysisResult", "ScribeAuthErrorPayload", "ScribeChunkSizeExceededErrorPayload", "ScribeErrorPayload", "ScribeInputErrorPayload", "ScribeInsufficientAudioActivityErrorPayload", "ScribeInvalidRequestError", "ScribeQueueOverflowErrorPayload", "ScribeQuotaExceededErrorPayload", "ScribeRateLimitedErrorPayload", "ScribeResourceExhaustedErrorPayload", "ScribeSessionTimeLimitExceededErrorPayload", "ScribeThrottledErrorPayload", "ScribeTranscriberErrorPayload", "ScribeUnacceptedTermsErrorPayload", "SearchClientsParams", "SearchHighlightSegment", "SearchStrategy", "SeatType", "SecretDependencyResourceType", "SecretDependencyType", "SectionSource", "SegmentCreateResponse", "SegmentDeleteResponse", "SegmentDubResponse", "SegmentMigrationResponse", "SegmentSubtitleFrame", "SegmentTranscriptionResponse", "SegmentTranslationResponse", "SegmentUpdateResponse", "SegmentedJsonExportOptions", "SendText", "SendTextMulti", "SentimentAggregate", "SentimentAnalysisSettings", "SessionStartedPayload", "SessionStartedPayloadConfig", "SessionStartedPayloadConfigCommitStrategy", "SetBookingSlugParams", "SeverityId", "SfxModelId", "SfxSourceContext", "ShareOptionResponseModel", "ShareOptionResponseModelType", "SimilarVoice", "SimilarVoicesForSpeakerResponse", "SimulationLibrarySettings", "SimulationTestModel", "SimulationToolMockBehaviorConfig", "SingleLanguagesResponse", "SingleTestRunRequestModel", "SingleUseTokenResponseModel", "SingleUseTokenType", "SipLogMessage", "SipLogMessageDirection", "SipMediaEncryptionEnum", "SipTrunkCredentialsRequestModel", "SipTrunkOutboundCallResponse", "SipTrunkTransportEnum", "SipUriDynamicVariableTransferDestination", "SipUriTransferDestination", "SkipTurnToolConfig", "SkipTurnToolResponseModel", "SlackBotAuthResponse", "SmbClientAccessConfig", "SmsConversationInfo", "SmsConversationInfoDirection", "SoftTimeoutConfig", "SoftTimeoutConfigOverride", "SoftTimeoutConfigOverrideConfig", "SoftTimeoutConfigWorkflowOverride", "SongMetadata", "SongSection", "SongSourceContext", "SortDirection", "SpeakerAudioResponseModel", "SpeakerCreatedResponse", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", "SpeakerSeparationResponseModelStatus", "SpeakerTrack", "SpeakerUpdatedResponse", "SpeechEngineConfig", "SpeechEngineConfigRequestHeadersValue", "SpeechEngineConversationInitiationClientDataConfig", "SpeechEngineResponse", "SpeechEngineSummaryResponse", "SpeechHistoryItemResponse", "SpeechHistoryItemResponseSource", "SpeechHistoryItemResponseVoiceCategory", "SpeechToTextCharacterResponseModel", "SpeechToTextChunkResponseModel", "SpeechToTextWebhookResponseModel", "SpeechToTextWordResponseModel", "SpeechToTextWordResponseModelType", "SpellingPatience", "SrtExportOptions", "StartProcedureToolConfigInput", "StartProcedureToolConfigOutput", "StartProcedureToolErrorStatus", "StartPvcVoiceTrainingResponseModel", "StartSpeakerSeparationResponseModel", "StatusId", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel", "StreamingAudioChunkWithTimestampsResponse", "StudioAgentSettingsModel", "StudioAgentToolSettingsModel", "StudioClipReference", "StudioClipReferenceClipType", "StudioTextStyleOutlineModel", "StudioTextStyleShadowModel", "SubAgentInput", "SubAgentOutput", "SubagentRunResultDetails", "SubmitBusinessInfoParams", "SubmitOrderResponse", "Subscription", "SubscriptionMaxCreditLimitExtension", "SubscriptionPendingChange", "SubscriptionResponse", "SubscriptionResponseMaxCreditLimitExtension", "SubscriptionStatusType", "SubtitleOrderItemRequest", "SuggestedAudioTag", "SupportedVoice", "SystemEvaluationCriteria", "SystemToolConfigInput", "SystemToolConfigInputParams", "SystemToolConfigInputParams_EndCall", "SystemToolConfigInputParams_EndProcedure", "SystemToolConfigInputParams_KnowledgeBase", "SystemToolConfigInputParams_KnowledgeBaseRag", "SystemToolConfigInputParams_LanguageDetection", "SystemToolConfigInputParams_PlayKeypadTouchTone", "SystemToolConfigInputParams_RunSubagent", "SystemToolConfigInputParams_SkipTurn", "SystemToolConfigInputParams_StartProcedure", "SystemToolConfigInputParams_TransferToAgent", "SystemToolConfigInputParams_TransferToNumber", "SystemToolConfigInputParams_VoicemailDetection", "SystemToolConfigOutput", "SystemToolConfigOutputParams", "SystemToolConfigOutputParams_EndCall", "SystemToolConfigOutputParams_EndProcedure", "SystemToolConfigOutputParams_KnowledgeBase", "SystemToolConfigOutputParams_KnowledgeBaseRag", "SystemToolConfigOutputParams_LanguageDetection", "SystemToolConfigOutputParams_PlayKeypadTouchTone", "SystemToolConfigOutputParams_RunSubagent", "SystemToolConfigOutputParams_SkipTurn", "SystemToolConfigOutputParams_StartProcedure", "SystemToolConfigOutputParams_TransferToAgent", "SystemToolConfigOutputParams_TransferToNumber", "SystemToolConfigOutputParams_VoicemailDetection", "TelephonyCallConfig", "TelephonyDirection", "TelephonyProvider", "TestConditionRationaleCommonModel", "TestConditionResultCommonModel", "TestFromConversationMetadataInput", "TestFromConversationMetadataOutput", "TestInvocationSummaryResponseModel", "TestRunMetadata", "TestRunMetadataTestType", "TestRunResultBucket", "TestRunResultSummary", "TestRunStatus", "TestSharingMode", "TestToolResultModel", "TestType", "TestsFeatureUsageCommonModel", "TextNormalisationType", "TextToDialogueWebsocketApplyTextNormalizationEnum", "TextToDialogueWebsocketAudioChunk", "TextToDialogueWebsocketAudioChunkMulti", "TextToDialogueWebsocketClientMessage", "TextToDialogueWebsocketClientMessageMulti", "TextToDialogueWebsocketError", "TextToDialogueWebsocketFinal", "TextToDialogueWebsocketFinalAudioForTurn", "TextToDialogueWebsocketFinalAudioForTurnMulti", "TextToDialogueWebsocketFinalMulti", "TextToDialogueWebsocketOutputFormatEnum", "TextToDialogueWebsocketVoiceInput", "TextToDialogueWebsocketVoiceSettings", "TextToSpeechApplyTextNormalizationEnum", "TextToSpeechOutputFormatEnum", "TextToSpeechRequest", "TextToSpeechStreamRequest", "TextToSpeechStreamWithTimestampsRequest", "TextToSpeechWithTimestampsRequest", "ThresholdGuardrail", "TimeRange", "ToDialogueSettingsResponseModel", "TokenResponseModel", "Tool", "ToolAnnotations", "ToolCallSoundBehavior", "ToolCallSoundType", "ToolCallUnitTestModel", "ToolErrorHandlingMode", "ToolExecution", "ToolExecutionMode", "ToolExecutionResponseModel", "ToolExecutionResponseModelToolCallDetails", "ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook", "ToolExecutionResponseModelToolCallDetails_Client", "ToolExecutionResponseModelToolCallDetails_Mcp", "ToolExecutionResponseModelToolCallDetails_Webhook", "ToolExecutionTaskSupport", "ToolInterruptionMode", "ToolMockConfig", "ToolRequestModel", "ToolRequestModelToolConfig", "ToolRequestModelToolConfig_Client", "ToolRequestModelToolConfig_Mcp", "ToolRequestModelToolConfig_System", "ToolRequestModelToolConfig_Webhook", "ToolResponseMockConfigInput", "ToolResponseMockConfigOutput", "ToolResponseModel", "ToolResponseModelToolConfig", "ToolResponseModelToolConfig_Client", "ToolResponseModelToolConfig_Mcp", "ToolResponseModelToolConfig_System", "ToolResponseModelToolConfig_Webhook", "ToolSortBy", "ToolType", "ToolTypeFilter", "ToolUsageStatsResponseModel", "ToolsResponseModel", "TopicDiscoverySettings", "TopicEvaluationCriteriaAggregate", "TopicMetricsAggregate", "TopicSentimentAggregate", "TranscriptMessage", "TranscriptMessageRole", "TranscriptionOrderItemRequest", "TranscriptionWord", "TranscriptionWordType", "TransferBranchInfoDefaultingToMain", "TransferBranchInfoTrafficSplit", "TransferToAgentToolConfigInput", "TransferToAgentToolConfigOutput", "TransferToAgentToolResultErrorModel", "TransferToAgentToolResultSuccessModelInput", "TransferToAgentToolResultSuccessModelInputBranchInfo", "TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain", "TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit", "TransferToAgentToolResultSuccessModelOutput", "TransferToAgentToolResultSuccessModelOutputBranchInfo", "TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain", "TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit", "TransferToNumberResultErrorModel", "TransferToNumberResultExotelSuccessModel", "TransferToNumberResultSipSuccessModel", "TransferToNumberResultTwilioSuccessModel", "TransferToNumberToolConfigInput", "TransferToNumberToolConfigOutput", "TransferTypeEnum", "TranslateAudioOutputError", "TranslateAudioPayload", "TranslateAuthError", "TranslateEndOfStreamPayload", "TranslateErrorPayload", "TranslateFinalTranscriptPayload", "TranslateInputAudioChunkPayload", "TranslateInputError", "TranslateInputFormatEnum", "TranslateOutputFormatEnum", "TranslatePartialTranscriptPayload", "TranslateQueueOverflowError", "TranslateRateLimitedError", "TranslateSessionStartedPayload", "TranslateStatusPayload", "TranslateTranscriberError", "TranslateTranslationError", "TranslateTranslationPayload", "TranslatedString", "TriggerUserVerificationParams", "TriggeredGuardrailCommonModel", "TtsConversationalConfigInput", "TtsConversationalConfigOutput", "TtsConversationalConfigOverride", "TtsConversationalConfigOverrideConfig", "TtsConversationalConfigWorkflowOverrideInput", "TtsConversationalConfigWorkflowOverrideOutput", "TtsConversationalModel", "TtsModelFamily", "TtsOptimizeStreamingLatency", "TtsOutputFormat", "TurnConfig", "TurnConfigOverride", "TurnConfigOverrideConfig", "TurnConfigWorkflowOverride", "TurnEagerness", "TurnMode", "TurnModel", "TwilioEdgeLocation", "TwilioOutboundCallResponse", "TwilioRegionId", "TxtExportOptions", "UnitTestRunResponseModel", "UnitTestRunResponseModelTestInfo", "UnitTestRunResponseModelTestInfo_Llm", "UnitTestRunResponseModelTestInfo_Simulation", "UnitTestRunResponseModelTestInfo_Tool", "UnitTestSummaryResponseModel", "UnitTestToolCallEvaluationModelInput", "UnitTestToolCallEvaluationModelOutput", "UnitTestToolCallParameter", "UnitTestToolCallParameterEval", "UnitTestToolCallParameterEval_Anything", "UnitTestToolCallParameterEval_Exact", "UnitTestToolCallParameterEval_Llm", "UnitTestToolCallParameterEval_Regex", "UnitTestWorkflowNodeTransitionEvaluationNodeId", "UpdateAgentProcedureParams", "UpdateAgentRuleParams", "UpdateAssetParams", "UpdateAudioNativeProjectRequest", "UpdateBasicAuthRequest", "UpdateBearerAuthRequest", "UpdateBookingPageAppearanceParams", "UpdateBookingPageSettingsParams", "UpdateBusinessInfoParams", "UpdateCalendarEventParams", "UpdateChapterRequest", "UpdateClientParams", "UpdateCustomerFacingConfigParams", "UpdateGroupSessionSeatsParams", "UpdateHolidayParams", "UpdateLocationParams", "UpdateOAuth2ClientCredsRequest", "UpdateOAuth2JwtRequest", "UpdateOAuth2JwtRequestAlgorithm", "UpdateOAuth2JwtRequestTokenResponseField", "UpdateOrderRequest", "UpdateOrderResponse", "UpdateProductParams", "UpdateProjectRequest", "UpdatePronunciationDictionariesRequest", "UpdateResponseUnitTestRequest", "UpdateServiceParams", "UpdateSimulationTestRequest", "UpdateStaffParams", "UpdateToolCallUnitTestRequest", "UpdateTransferRuleParams", "UpdateWorkspaceMemberResponseModel", "UpsertOrderItemRequest", "UpsertOrderItemResponse", "UrlAvatar", "UrlModel", "UrlSecretAuthResponse", "UsageAggregationInterval", "UsageCharactersResponseModel", "User", "UserAccessManagementActivityId", "UserFeedback", "UserFeedbackScore", "UserModel", "UserTranscriptPayload", "UserTypeId", "UsersSortBy", "UtteranceResponseModel", "UuiTransferConfig", "UuiTransferConfigProtocolDiscriminatorMode", "VadConfig", "VadConfigWorkflowOverride", "ValidateUserVerificationCodeParams", "ValidationError", "ValidationErrorLocItem", "Verbosity", "VerificationAttemptResponse", "VerifiedVoiceLanguageResponseModel", "VerifyPvcVoiceCaptchaResponseModel", "VideoAnalysis", "VideoAnalysisResult", "VideoAnalysisStatus", "VideoKeyMoment", "VideoSegment", "VideoSubject", "VisitedAgentRef", "Voice", "VoiceAccentResponseModel", "VoiceCategory", "VoiceDesignPreviewResponse", "VoiceGenerationParameterOptionResponse", "VoiceGenerationParameterResponse", "VoiceLabellingStatus", "VoiceMailDetectionResultSuccessModel", "VoicePreviewResponseModel", "VoiceRecordingQuality", "VoiceSafetyControl", "VoiceSample", "VoiceSamplePreviewResponseModel", "VoiceSampleVisualWaveformResponseModel", "VoiceSegment", "VoiceSettings", "VoiceSharingModerationCheckResponseModel", "VoiceSharingResponse", "VoiceSharingResponseCategory", "VoiceSharingState", "VoiceStatisticsResponseModel", "VoiceVerificationResponse", "VoicemailDetectionToolConfig", "VoicesNotPermittedWarning", "WebhookAuthMethodType", "WebhookEventType", "WebhookHmacSettings", "WebhookToolApiSchemaConfigInput", "WebhookToolApiSchemaConfigInputAuthConnection", "WebhookToolApiSchemaConfigInputContentType", "WebhookToolApiSchemaConfigInputMethod", "WebhookToolApiSchemaConfigInputRequestHeadersValue", "WebhookToolApiSchemaConfigOutput", "WebhookToolApiSchemaConfigOutputAuthConnection", "WebhookToolApiSchemaConfigOutputContentType", "WebhookToolApiSchemaConfigOutputMethod", "WebhookToolApiSchemaConfigOutputRequestHeadersValue", "WebhookToolConfigInput", "WebhookToolConfigOutput", "WebhookTranscriptFormat", "WebhookUsageType", "WebsocketTtsClientMessageMulti", "WebsocketTtsServerMessageMulti", "WhatsAppAuthResponse", "WhatsAppConversationInfo", "WhatsAppConversationInfoDirection", "WhatsAppOutboundCallResponse", "WhatsAppOutboundMessageResponse", "WhatsAppTemplateBodyComponentParams", "WhatsAppTemplateButtonComponentParams", "WhatsAppTemplateDocumentParam", "WhatsAppTemplateDocumentParamDetails", "WhatsAppTemplateHeaderComponentParams", "WhatsAppTemplateHeaderComponentParamsParametersItem", "WhatsAppTemplateHeaderComponentParamsParametersItem_Document", "WhatsAppTemplateHeaderComponentParamsParametersItem_Image", "WhatsAppTemplateHeaderComponentParamsParametersItem_Location", "WhatsAppTemplateHeaderComponentParamsParametersItem_Text", "WhatsAppTemplateImageParam", "WhatsAppTemplateImageParamDetails", "WhatsAppTemplateLocationParam", "WhatsAppTemplateLocationParamDetails", "WhatsAppTemplateTextParam", "WidgetConfig", "WidgetConfigAvatar", "WidgetConfigAvatar_Image", "WidgetConfigAvatar_Orb", "WidgetConfigAvatar_Url", "WidgetConfigResponse", "WidgetConfigResponseAvatar", "WidgetConfigResponseAvatar_Image", "WidgetConfigResponseAvatar_Orb", "WidgetConfigResponseAvatar_Url", "WidgetConfigResponseSyntaxHighlightTheme", "WidgetConfigSyntaxHighlightTheme", "WidgetEndFeedbackConfig", "WidgetEndFeedbackType", "WidgetExpandable", "WidgetFeedbackMode", "WidgetLanguagePreset", "WidgetLanguagePresetResponse", "WidgetPlacement", "WidgetStyles", "WidgetTermsTranslation", "WidgetTextContents", "WidgetTextContentsTranslation", "WordTimestamp", "WorkflowEdgeModelInput", "WorkflowEdgeModelInputBackwardCondition", "WorkflowEdgeModelInputBackwardCondition_Expression", "WorkflowEdgeModelInputBackwardCondition_Llm", "WorkflowEdgeModelInputBackwardCondition_Result", "WorkflowEdgeModelInputBackwardCondition_Unconditional", "WorkflowEdgeModelInputForwardCondition", "WorkflowEdgeModelInputForwardCondition_Expression", "WorkflowEdgeModelInputForwardCondition_Llm", "WorkflowEdgeModelInputForwardCondition_Result", "WorkflowEdgeModelInputForwardCondition_Unconditional", "WorkflowEdgeModelOutput", "WorkflowEdgeModelOutputBackwardCondition", "WorkflowEdgeModelOutputBackwardCondition_Expression", "WorkflowEdgeModelOutputBackwardCondition_Llm", "WorkflowEdgeModelOutputBackwardCondition_Result", "WorkflowEdgeModelOutputBackwardCondition_Unconditional", "WorkflowEdgeModelOutputForwardCondition", "WorkflowEdgeModelOutputForwardCondition_Expression", "WorkflowEdgeModelOutputForwardCondition_Llm", "WorkflowEdgeModelOutputForwardCondition_Result", "WorkflowEdgeModelOutputForwardCondition_Unconditional", "WorkflowEndNodeModelInput", "WorkflowEndNodeModelOutput", "WorkflowExpressionConditionModelInput", "WorkflowExpressionConditionModelOutput", "WorkflowFeaturesUsageCommonModel", "WorkflowLlmConditionModelInput", "WorkflowLlmConditionModelOutput", "WorkflowOverrideAgentNodeModelInput", "WorkflowOverrideAgentNodeModelOutput", "WorkflowPhoneNumberNodeModelInput", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic", "WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static", "WorkflowPhoneNumberNodeModelInputPostDialDigits", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic", "WorkflowPhoneNumberNodeModelInputPostDialDigits_Static", "WorkflowPhoneNumberNodeModelInputTransferDestination", "WorkflowPhoneNumberNodeModelInputTransferDestination_Phone", "WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri", "WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable", "WorkflowPhoneNumberNodeModelOutput", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic", "WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static", "WorkflowPhoneNumberNodeModelOutputPostDialDigits", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic", "WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static", "WorkflowPhoneNumberNodeModelOutputTransferDestination", "WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone", "WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri", "WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable", "WorkflowResultConditionModelInput", "WorkflowResultConditionModelOutput", "WorkflowStandaloneAgentNodeModelInput", "WorkflowStandaloneAgentNodeModelOutput", "WorkflowStartNodeModelInput", "WorkflowStartNodeModelOutput", "WorkflowToolEdgeStepModel", "WorkflowToolLocator", "WorkflowToolLocatorSchemaOverridesValue", "WorkflowToolLocatorSchemaOverridesValue_Constant", "WorkflowToolLocatorSchemaOverridesValue_DynamicVariable", "WorkflowToolLocatorSchemaOverridesValue_Llm", "WorkflowToolLocatorSchemaOverridesValue_Omit", "WorkflowToolMaxIterationsExceededStepModel", "WorkflowToolNestedToolsStepModelInput", "WorkflowToolNestedToolsStepModelInputResultsItem", "WorkflowToolNestedToolsStepModelOutput", "WorkflowToolNestedToolsStepModelOutputResultsItem", "WorkflowToolNodeModelInput", "WorkflowToolNodeModelOutput", "WorkflowToolResponseModelInput", "WorkflowToolResponseModelInputStepsItem", "WorkflowToolResponseModelInputStepsItem_Edge", "WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded", "WorkflowToolResponseModelInputStepsItem_NestedTools", "WorkflowToolResponseModelOutput", "WorkflowToolResponseModelOutputStepsItem", "WorkflowToolResponseModelOutputStepsItem_Edge", "WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded", "WorkflowToolResponseModelOutputStepsItem_NestedTools", "WorkflowUnconditionalModelInput", "WorkflowUnconditionalModelOutput", "WorkspaceAnalyticsQueryResponseModel", "WorkspaceAnalyticsQueryResponseModelColumnTypesItem", "WorkspaceAnalyticsQueryResponseModelRowsItemItem", "WorkspaceApiKeyListResponseModel", "WorkspaceApiKeyResponseModel", "WorkspaceAuditLogEntryResponse", "WorkspaceAuditLogEntryResponseActivityId", "WorkspaceAuditLogsPageResponse", "WorkspaceBatchCallsResponse", "WorkspaceCreateApiKeyResponseModel", "WorkspaceCreateServiceAccountResponseModel", "WorkspaceCreateWebhookResponseModel", "WorkspaceGroupByNameResponseModel", "WorkspaceGroupPermission", "WorkspaceGroupResponseModel", "WorkspaceGroupResponseModelGroupPvcLimit", "WorkspaceGroupResponseModelGroupUsageLimit", "WorkspaceMemberResponseModel", "WorkspaceResourceType", "WorkspaceServiceAccountListResponseModel", "WorkspaceServiceAccountResponseModel", "WorkspaceWebhookEventType", "WorkspaceWebhookListResponseModel", "WorkspaceWebhookResponseModel", "WorkspaceWebhookUsageResponseModel", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/account_change_activity_id.py000066400000000000000000000001371523660243400316110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. AccountChangeActivityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/actor_model.py000066400000000000000000000022401523660243400265450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .user_model import UserModel class ActorModel(UncheckedBaseModel): """ OCSF Actor object - describes the entity that performed the action. Spec: https://schema.ocsf.io/1.6.0/objects/actor """ user: UserModel = pydantic.Field() """ User who performed the action """ app_name: typing.Optional[str] = pydantic.Field(default=None) """ Client application or service name """ app_uid: typing.Optional[str] = pydantic.Field(default=None) """ Client application unique identifier """ session: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Session information """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_chapter_response_model.py000066400000000000000000000012511523660243400316120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_with_content_response_model import ChapterWithContentResponseModel class AddChapterResponseModel(UncheckedBaseModel): chapter: ChapterWithContentResponseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_knowledge_base_response_model.py000066400000000000000000000016761523660243400331500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) class AddKnowledgeBaseResponseModel(UncheckedBaseModel): id: str name: str folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_project_request.py000066400000000000000000000001571523660243400303100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AddProjectRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_project_response_model.py000066400000000000000000000011661523660243400316370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_response import ProjectResponse class AddProjectResponseModel(UncheckedBaseModel): project: ProjectResponse 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 add_pronunciation_dictionary_response_model.py000066400000000000000000000034171523660243400352300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .add_pronunciation_dictionary_response_model_permission_on_resource import ( AddPronunciationDictionaryResponseModelPermissionOnResource, ) class AddPronunciationDictionaryResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the created pronunciation dictionary. """ name: str = pydantic.Field() """ The name of the created pronunciation dictionary. """ created_by: str = pydantic.Field() """ The user ID of the creator of the pronunciation dictionary. """ creation_time_unix: int = pydantic.Field() """ The creation time of the pronunciation dictionary in Unix timestamp. """ version_id: str = pydantic.Field() """ The ID of the created pronunciation dictionary version. """ version_rules_num: int = pydantic.Field() """ The number of rules in the version of the pronunciation dictionary. """ description: typing.Optional[str] = pydantic.Field(default=None) """ 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow add_pronunciation_dictionary_response_model_permission_on_resource.py000066400000000000000000000003471523660243400421020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing AddPronunciationDictionaryResponseModelPermissionOnResource = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_sharing_voice_request.py000066400000000000000000000001641523660243400314600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AddSharingVoiceRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_voice_ivc_response_model.py000066400000000000000000000013701523660243400321340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AddVoiceIvcResponseModel(UncheckedBaseModel): voice_id: str = pydantic.Field() """ The ID of the newly created voice. """ requires_verification: bool = pydantic.Field() """ Whether the voice requires verification """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_voice_response_model.py000066400000000000000000000011671523660243400312770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AddVoiceResponseModel(UncheckedBaseModel): voice_id: str = pydantic.Field() """ The ID of the voice. """ 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 add_workspace_group_member_response_model.py000066400000000000000000000014371523660243400346540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AddWorkspaceGroupMemberResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace group member addition 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/add_workspace_invite_response_model.py000066400000000000000000000014131523660243400335400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AddWorkspaceInviteResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace invite 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/additional_format_response_model.py000066400000000000000000000023511523660243400330360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class AdditionalFormatResponseModel(UncheckedBaseModel): requested_format: str = pydantic.Field() """ The requested format. """ file_extension: str = pydantic.Field() """ The file extension of the additional format. """ content_type: str = pydantic.Field() """ The content type of the additional format. """ is_base_64_encoded: typing_extensions.Annotated[ bool, FieldMetadata(alias="is_base64_encoded"), pydantic.Field(alias="is_base64_encoded", description="Whether the content is base64 encoded."), ] content: str = pydantic.Field() """ The content of the additional format. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/additional_formats.py000066400000000000000000000002521523660243400301210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .export_options import ExportOptions AdditionalFormats = typing.List[ExportOptions] adhoc_agent_config_override_for_test_request_model.py000066400000000000000000000020631523660243400365160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_platform_settings_request_model import AgentPlatformSettingsRequestModel from .agent_workflow_request_model import AgentWorkflowRequestModel from .conversational_config import ConversationalConfig class AdhocAgentConfigOverrideForTestRequestModel(UncheckedBaseModel): conversation_config: ConversationalConfig platform_settings: AgentPlatformSettingsRequestModel workflow: typing.Optional[AgentWorkflowRequestModel] = 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 update_forward_refs(AdhocAgentConfigOverrideForTestRequestModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/age.py000066400000000000000000000001411523660243400250070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing Age = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_analysis_items_input.py000066400000000000000000000017211523660243400317010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_analysis_items_input_data_collection_item import AgentAnalysisItemsInputDataCollectionItem from .agent_analysis_items_input_evaluation_criteria_item import AgentAnalysisItemsInputEvaluationCriteriaItem class AgentAnalysisItemsInput(UncheckedBaseModel): evaluation_criteria: typing.Optional[typing.List[AgentAnalysisItemsInputEvaluationCriteriaItem]] = None data_collection: typing.Optional[typing.List[AgentAnalysisItemsInputDataCollectionItem]] = 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 agent_analysis_items_input_data_collection_item.py000066400000000000000000000032051523660243400360430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .analysis_scope import AnalysisScope class AgentAnalysisItemsInputDataCollectionItem_System(UncheckedBaseModel): source: typing.Literal["system"] = "system" analysis_item_id: typing.Literal["__system_data_collection_topic"] = "__system_data_collection_topic" scope: typing.Optional[AnalysisScope] = 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 class AgentAnalysisItemsInputDataCollectionItem_User(UncheckedBaseModel): source: typing.Literal["user"] = "user" analysis_item_id: str version_id: typing.Optional[str] = None scope: typing.Optional[AnalysisScope] = 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 AgentAnalysisItemsInputDataCollectionItem = typing_extensions.Annotated[ typing.Union[AgentAnalysisItemsInputDataCollectionItem_System, AgentAnalysisItemsInputDataCollectionItem_User], UnionMetadata(discriminant="source"), ] agent_analysis_items_input_evaluation_criteria_item.py000066400000000000000000000035751523660243400367620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .analysis_scope import AnalysisScope from .attached_system_evaluation_ref_analysis_item_id import AttachedSystemEvaluationRefAnalysisItemId class AgentAnalysisItemsInputEvaluationCriteriaItem_System(UncheckedBaseModel): source: typing.Literal["system"] = "system" analysis_item_id: AttachedSystemEvaluationRefAnalysisItemId scope: typing.Optional[AnalysisScope] = None weight: typing.Optional[float] = 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 class AgentAnalysisItemsInputEvaluationCriteriaItem_User(UncheckedBaseModel): source: typing.Literal["user"] = "user" analysis_item_id: str version_id: typing.Optional[str] = None additional_version_ids: typing.Optional[typing.List[str]] = None scope: typing.Optional[AnalysisScope] = None weight: typing.Optional[float] = 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 AgentAnalysisItemsInputEvaluationCriteriaItem = typing_extensions.Annotated[ typing.Union[ AgentAnalysisItemsInputEvaluationCriteriaItem_System, AgentAnalysisItemsInputEvaluationCriteriaItem_User ], UnionMetadata(discriminant="source"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_analysis_items_output.py000066400000000000000000000017301523660243400321020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_analysis_items_output_data_collection_item import AgentAnalysisItemsOutputDataCollectionItem from .agent_analysis_items_output_evaluation_criteria_item import AgentAnalysisItemsOutputEvaluationCriteriaItem class AgentAnalysisItemsOutput(UncheckedBaseModel): evaluation_criteria: typing.Optional[typing.List[AgentAnalysisItemsOutputEvaluationCriteriaItem]] = None data_collection: typing.Optional[typing.List[AgentAnalysisItemsOutputDataCollectionItem]] = 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 agent_analysis_items_output_data_collection_item.py000066400000000000000000000032121523660243400362420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .analysis_scope import AnalysisScope class AgentAnalysisItemsOutputDataCollectionItem_System(UncheckedBaseModel): source: typing.Literal["system"] = "system" analysis_item_id: typing.Literal["__system_data_collection_topic"] = "__system_data_collection_topic" scope: typing.Optional[AnalysisScope] = 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 class AgentAnalysisItemsOutputDataCollectionItem_User(UncheckedBaseModel): source: typing.Literal["user"] = "user" analysis_item_id: str version_id: typing.Optional[str] = None scope: typing.Optional[AnalysisScope] = 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 AgentAnalysisItemsOutputDataCollectionItem = typing_extensions.Annotated[ typing.Union[AgentAnalysisItemsOutputDataCollectionItem_System, AgentAnalysisItemsOutputDataCollectionItem_User], UnionMetadata(discriminant="source"), ] agent_analysis_items_output_evaluation_criteria_item.py000066400000000000000000000036021523660243400371520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .analysis_scope import AnalysisScope from .attached_system_evaluation_ref_analysis_item_id import AttachedSystemEvaluationRefAnalysisItemId class AgentAnalysisItemsOutputEvaluationCriteriaItem_System(UncheckedBaseModel): source: typing.Literal["system"] = "system" analysis_item_id: AttachedSystemEvaluationRefAnalysisItemId scope: typing.Optional[AnalysisScope] = None weight: typing.Optional[float] = 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 class AgentAnalysisItemsOutputEvaluationCriteriaItem_User(UncheckedBaseModel): source: typing.Literal["user"] = "user" analysis_item_id: str version_id: typing.Optional[str] = None additional_version_ids: typing.Optional[typing.List[str]] = None scope: typing.Optional[AnalysisScope] = None weight: typing.Optional[float] = 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 AgentAnalysisItemsOutputEvaluationCriteriaItem = typing_extensions.Annotated[ typing.Union[ AgentAnalysisItemsOutputEvaluationCriteriaItem_System, AgentAnalysisItemsOutputEvaluationCriteriaItem_User ], UnionMetadata(discriminant="source"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_branch_basic_info.py000066400000000000000000000011021523660243400310400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentBranchBasicInfo(UncheckedBaseModel): id: str name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_branch_response.py000066400000000000000000000030401523660243400306050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_branch_basic_info import AgentBranchBasicInfo from .agent_version_metadata import AgentVersionMetadata from .branch_protection_status import BranchProtectionStatus from .resource_access_info import ResourceAccessInfo class AgentBranchResponse(UncheckedBaseModel): id: str name: str agent_id: str description: str created_at: int last_committed_at: int is_archived: bool protection_status: typing.Optional[BranchProtectionStatus] = None access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ Access information for the branch """ current_live_percentage: typing.Optional[float] = pydantic.Field(default=None) """ Percentage of traffic live on the branch """ parent_branch: typing.Optional[AgentBranchBasicInfo] = pydantic.Field(default=None) """ Parent branch of the branch """ most_recent_versions: typing.Optional[typing.List[AgentVersionMetadata]] = pydantic.Field(default=None) """ Most recent versions on the branch """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_branch_summary.py000066400000000000000000000046271523660243400304600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .branch_protection_status import BranchProtectionStatus from .resource_access_info import ResourceAccessInfo class AgentBranchSummary(UncheckedBaseModel): id: str name: str agent_id: str description: str created_at: int last_committed_at: int is_archived: bool protection_status: typing.Optional[BranchProtectionStatus] = None access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ Access information for the branch """ current_live_percentage: typing.Optional[float] = pydantic.Field(default=None) """ Percentage of traffic live on the branch """ parent_branch_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the parent branch """ draft_exists: typing.Optional[bool] = pydantic.Field(default=None) """ Whether a draft exists for the branch """ calls_7_d: typing_extensions.Annotated[ typing.Optional[int], FieldMetadata(alias="calls_7d"), pydantic.Field(alias="calls_7d", description="Number of calls in the last 7 days"), ] = None commits_ahead: typing.Optional[int] = pydantic.Field(default=None) """ Number of commits on this branch not yet on main, relative to their common ancestor. Null if it could not be computed (e.g. no common ancestor, or the branch history exceeds the comparison budget). """ commits_behind: typing.Optional[int] = pydantic.Field(default=None) """ Number of commits on main not yet incorporated into this branch, relative to their common ancestor. Null if it could not be computed (e.g. no common ancestor, or the branch history exceeds the comparison budget). """ merged_into_branch_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the branch this branch's tip version was merged into, if any """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_call_limits.py000066400000000000000000000021671523660243400277370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentCallLimits(UncheckedBaseModel): agent_concurrency_limit: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of concurrent conversations. -1 indicates that there is no maximum """ daily_limit: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of conversations per day """ bursting_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable bursting. If true, exceeding workspace concurrency limit will be allowed up to 3 times the limit. Calls will be charged at double rate when exceeding the limit. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_config.py000066400000000000000000000041271523660243400267060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .behavior_override import BehaviorOverride from .prompt_agent_api_model_output import PromptAgentApiModelOutput class AgentConfig(UncheckedBaseModel): first_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Language of the agent - used for ASR and TTS """ hinglish_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and language is Hindi, the agent will respond in Hinglish """ dynamic_variables: typing.Optional[typing.Any] = None disable_first_message_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the user will not be able to interrupt the agent while the first message is being delivered. """ max_conversation_duration_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the message the agent will send when max conversation duration is reached. """ text_behavior_overrides: typing.Optional[typing.Dict[str, typing.Optional[BehaviorOverride]]] = pydantic.Field( default=None ) """ Per-channel response behavior overrides for text conversations. Built-in channel defaults apply when unset. """ prompt: typing.Optional[PromptAgentApiModelOutput] = pydantic.Field(default=None) """ The prompt for the agent """ 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 update_forward_refs(AgentConfig) agent_config_api_model_workflow_override_input.py000066400000000000000000000046141523660243400357110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .behavior_override import BehaviorOverride from .dynamic_variables_config_workflow_override import DynamicVariablesConfigWorkflowOverride from .prompt_agent_api_model_workflow_override_input import PromptAgentApiModelWorkflowOverrideInput class AgentConfigApiModelWorkflowOverrideInput(UncheckedBaseModel): first_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Language of the agent - used for ASR and TTS """ hinglish_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and language is Hindi, the agent will respond in Hinglish """ dynamic_variables: typing.Optional[DynamicVariablesConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for dynamic variables """ disable_first_message_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the user will not be able to interrupt the agent while the first message is being delivered. """ max_conversation_duration_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the message the agent will send when max conversation duration is reached. """ text_behavior_overrides: typing.Optional[typing.Dict[str, typing.Optional[BehaviorOverride]]] = pydantic.Field( default=None ) """ Per-channel response behavior overrides for text conversations. Built-in channel defaults apply when unset. """ prompt: typing.Optional[PromptAgentApiModelWorkflowOverrideInput] = pydantic.Field(default=None) """ The prompt for the agent """ 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 update_forward_refs(AgentConfigApiModelWorkflowOverrideInput) agent_config_api_model_workflow_override_output.py000066400000000000000000000046211523660243400361100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .behavior_override import BehaviorOverride from .dynamic_variables_config_workflow_override import DynamicVariablesConfigWorkflowOverride from .prompt_agent_api_model_workflow_override_output import PromptAgentApiModelWorkflowOverrideOutput class AgentConfigApiModelWorkflowOverrideOutput(UncheckedBaseModel): first_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Language of the agent - used for ASR and TTS """ hinglish_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and language is Hindi, the agent will respond in Hinglish """ dynamic_variables: typing.Optional[DynamicVariablesConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for dynamic variables """ disable_first_message_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the user will not be able to interrupt the agent while the first message is being delivered. """ max_conversation_duration_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the message the agent will send when max conversation duration is reached. """ text_behavior_overrides: typing.Optional[typing.Dict[str, typing.Optional[BehaviorOverride]]] = pydantic.Field( default=None ) """ Per-channel response behavior overrides for text conversations. Built-in channel defaults apply when unset. """ prompt: typing.Optional[PromptAgentApiModelWorkflowOverrideOutput] = pydantic.Field(default=None) """ The prompt for the agent """ 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 update_forward_refs(AgentConfigApiModelWorkflowOverrideOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_config_override_config.py000066400000000000000000000023611523660243400321300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .prompt_agent_api_model_override_config import PromptAgentApiModelOverrideConfig class AgentConfigOverrideConfig(UncheckedBaseModel): first_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the first_message field. """ language: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the language field. """ max_conversation_duration_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the max_conversation_duration_message field. """ prompt: typing.Optional[PromptAgentApiModelOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_config_override_input.py000066400000000000000000000024471523660243400320270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .prompt_agent_api_model_override_input import PromptAgentApiModelOverrideInput class AgentConfigOverrideInput(UncheckedBaseModel): first_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Language of the agent - used for ASR and TTS """ max_conversation_duration_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the message the agent will send when max conversation duration is reached. """ prompt: typing.Optional[PromptAgentApiModelOverrideInput] = pydantic.Field(default=None) """ The prompt for the agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_config_override_output.py000066400000000000000000000024531523660243400322250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .prompt_agent_api_model_override_output import PromptAgentApiModelOverrideOutput class AgentConfigOverrideOutput(UncheckedBaseModel): first_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Language of the agent - used for ASR and TTS """ max_conversation_duration_message: typing.Optional[str] = pydantic.Field(default=None) """ If non-empty, the message the agent will send when max conversation duration is reached. """ prompt: typing.Optional[PromptAgentApiModelOverrideOutput] = pydantic.Field(default=None) """ The prompt for the agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_definition_source.py000066400000000000000000000002741523660243400311500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AgentDefinitionSource = typing.Union[typing.Literal["cli", "ui", "api", "template", "unknown"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_deployment_percentage_strategy.py000066400000000000000000000013261523660243400337360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentDeploymentPercentageStrategy(UncheckedBaseModel): type: typing.Optional[typing.Literal["percentage"]] = None traffic_percentage: float = pydantic.Field() """ Traffic percentage to deploy """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_deployment_request.py000066400000000000000000000013511523660243400313650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_deployment_request_item import AgentDeploymentRequestItem class AgentDeploymentRequest(UncheckedBaseModel): requests: typing.List[AgentDeploymentRequestItem] = pydantic.Field() """ List of deployment requests """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_deployment_request_item.py000066400000000000000000000014231523660243400324030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_deployment_percentage_strategy import AgentDeploymentPercentageStrategy class AgentDeploymentRequestItem(UncheckedBaseModel): branch_id: str = pydantic.Field() """ ID of the branch to deploy """ deployment_strategy: AgentDeploymentPercentageStrategy 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_deployment_response.py000066400000000000000000000013261523660243400315350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentDeploymentResponse(UncheckedBaseModel): traffic_percentage_branch_id_map: typing.Optional[typing.Dict[str, float]] = pydantic.Field(default=None) """ Map of branch IDs to traffic percentages """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_failure_response_example.py000066400000000000000000000011611523660243400325140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentFailureResponseExample(UncheckedBaseModel): response: str type: typing.Literal["failure"] = "failure" 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 agent_knowledge_base_rag_chunk_response_model.py000066400000000000000000000027531523660243400354550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_format import ContentFormat from .knowledge_base_document_type import KnowledgeBaseDocumentType class AgentKnowledgeBaseRagChunkResponseModel(UncheckedBaseModel): document_id: str = pydantic.Field() """ ID of the source knowledge base document. """ document_name: str = pydantic.Field() """ Name of the source knowledge base document. """ chunk_id: str = pydantic.Field() """ ID of the retrieved chunk. """ text: str = pydantic.Field() """ Text content of the retrieved chunk. """ vector_distance: typing.Optional[float] = pydantic.Field(default=None) """ Similarity distance when exposed by the retrieval strategy. """ content_format: ContentFormat = pydantic.Field() """ Format of the chunk text. Markdown chunks contain raw markdown; HTML chunks contain HTML. """ document_type: KnowledgeBaseDocumentType = pydantic.Field() """ Type of the source knowledge base document. """ 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 agent_knowledge_base_rag_query_request_model.py000066400000000000000000000021771523660243400353440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentKnowledgeBaseRagQueryRequestModel(UncheckedBaseModel): query: str = pydantic.Field() """ Query to run against the agent's knowledge base RAG index. """ use_agent_defaults: typing.Optional[bool] = pydantic.Field(default=None) """ When true (the default), retrieval uses the agent's own RAG settings, reproducing exactly what the agent would retrieve. Set to false to retrieve with neutral default RAG settings instead (the agent's embedding model is always kept, since it determines which vector index exists). Useful for auditing the knowledge base independently of how a particular agent is tuned. """ 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 agent_knowledge_base_rag_query_response_model.py000066400000000000000000000017151523660243400355070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_knowledge_base_rag_chunk_response_model import AgentKnowledgeBaseRagChunkResponseModel class AgentKnowledgeBaseRagQueryResponseModel(UncheckedBaseModel): retrieval_query: str = pydantic.Field() """ Raw query used for retrieval (echoes the request query). """ chunks: typing.List[AgentKnowledgeBaseRagChunkResponseModel] = pydantic.Field() """ Ranked chunks the agent would retrieve, after distance and length filtering. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_metadata.py000066400000000000000000000012741523660243400272210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentMetadata(UncheckedBaseModel): agent_id: str branch_id: typing.Optional[str] = None workflow_node_id: typing.Optional[str] = None version_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_metadata_db_model.py000066400000000000000000000014441523660243400310450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_definition_source import AgentDefinitionSource class AgentMetadataDbModel(UncheckedBaseModel): created_at_unix_secs: int updated_at_unix_secs: int created_from: typing.Optional[AgentDefinitionSource] = None last_updated_from: typing.Optional[AgentDefinitionSource] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_metadata_response_model.py000066400000000000000000000014321523660243400323130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentMetadataResponseModel(UncheckedBaseModel): created_at_unix_secs: int = pydantic.Field() """ The creation time of the agent in unix seconds """ updated_at_unix_secs: int = pydantic.Field() """ The last update time of the agent in unix 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_platform_settings_request_model.py000066400000000000000000000120011523660243400341230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_analysis_items_input import AgentAnalysisItemsInput from .agent_call_limits import AgentCallLimits from .agent_testing_settings import AgentTestingSettings from .agent_trust_context import AgentTrustContext from .agent_workspace_overrides_input import AgentWorkspaceOverridesInput from .alerting_settings import AlertingSettings from .analysis_property import AnalysisProperty from .analysis_scope import AnalysisScope from .auth_settings import AuthSettings from .conversation_initiation_client_data_config_input import ConversationInitiationClientDataConfigInput from .evaluation_settings_input import EvaluationSettingsInput from .guardrails_v_1_input import GuardrailsV1Input from .llm import Llm from .privacy_config_input import PrivacyConfigInput from .sentiment_analysis_settings import SentimentAnalysisSettings from .topic_discovery_settings import TopicDiscoverySettings from .widget_config import WidgetConfig class AgentPlatformSettingsRequestModel(UncheckedBaseModel): evaluation: typing.Optional[EvaluationSettingsInput] = pydantic.Field(default=None) """ Settings for evaluation """ widget: typing.Optional[WidgetConfig] = pydantic.Field(default=None) """ Configuration for the widget """ data_collection: typing.Optional[typing.Dict[str, AnalysisProperty]] = pydantic.Field(default=None) """ Data collection settings """ data_collection_scopes: typing.Optional[typing.Dict[str, AnalysisScope]] = pydantic.Field(default=None) """ Scope per data collection item ID. Missing keys default to conversation scope. """ analysis_items: typing.Optional[AgentAnalysisItemsInput] = pydantic.Field(default=None) """ Evaluation + data-collection items attached by reference. None means the agent has not been migrated onto analysis items yet (distinct from an empty, migrated set); reads fall back to the legacy evaluation/data_collection fields in that case. """ overrides: typing.Optional[ConversationInitiationClientDataConfigInput] = pydantic.Field(default=None) """ Additional overrides for the agent during conversation initiation """ workspace_overrides: typing.Optional[AgentWorkspaceOverridesInput] = pydantic.Field(default=None) """ Workspace overrides for the agent """ testing: typing.Optional[AgentTestingSettings] = pydantic.Field(default=None) """ Testing configuration for the agent """ archived: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the agent is archived """ guardrails: typing.Optional[GuardrailsV1Input] = pydantic.Field(default=None) """ Guardrails configuration for the agent """ summary_language: typing.Optional[str] = pydantic.Field(default=None) """ Language for all conversation analysis outputs (summaries, titles, evaluation rationales, data collection rationales). If not set, the language will be inferred from the conversation. Must be one of the supported conversation languages. """ auto_translate_transcript_to_app_language: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, a conversation transcript is automatically translated to the viewer's application language when they open the transcript page. If not set or false, transcripts are shown in their original language unless the viewer manually selects a translation. """ auth: typing.Optional[AuthSettings] = pydantic.Field(default=None) """ Settings for authentication """ call_limits: typing.Optional[AgentCallLimits] = pydantic.Field(default=None) """ Call limits for the agent """ privacy: typing.Optional[PrivacyConfigInput] = pydantic.Field(default=None) """ Privacy settings for the agent """ trust_context: typing.Optional[AgentTrustContext] = pydantic.Field(default=None) """ The trust context in which the agent operates. """ analysis_llm: typing.Optional[Llm] = pydantic.Field(default=None) """ Default LLM model for post-call analysis (evaluation and data collection) """ topic_discovery: typing.Optional[TopicDiscoverySettings] = pydantic.Field(default=None) """ Per-agent topic discovery configuration """ sentiment_analysis: typing.Optional[SentimentAnalysisSettings] = pydantic.Field(default=None) """ Per-agent post-call sentiment analysis configuration """ alerting: typing.Optional[AlertingSettings] = pydantic.Field(default=None) """ Agent-level alerting configuration overriding workspace settings. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_platform_settings_response_model.py000066400000000000000000000122351523660243400343020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_analysis_items_output import AgentAnalysisItemsOutput from .agent_call_limits import AgentCallLimits from .agent_testing_settings import AgentTestingSettings from .agent_trust_context import AgentTrustContext from .agent_workspace_overrides_output import AgentWorkspaceOverridesOutput from .alerting_settings_response import AlertingSettingsResponse from .analysis_property import AnalysisProperty from .analysis_scope import AnalysisScope from .auth_settings import AuthSettings from .conversation_initiation_client_data_config_output import ConversationInitiationClientDataConfigOutput from .evaluation_settings_output import EvaluationSettingsOutput from .guardrails_v_1_output import GuardrailsV1Output from .llm import Llm from .privacy_config_output import PrivacyConfigOutput from .safety_response_model import SafetyResponseModel from .sentiment_analysis_settings import SentimentAnalysisSettings from .topic_discovery_settings import TopicDiscoverySettings from .widget_config import WidgetConfig class AgentPlatformSettingsResponseModel(UncheckedBaseModel): evaluation: typing.Optional[EvaluationSettingsOutput] = pydantic.Field(default=None) """ Settings for evaluation """ widget: typing.Optional[WidgetConfig] = pydantic.Field(default=None) """ Configuration for the widget """ data_collection: typing.Optional[typing.Dict[str, AnalysisProperty]] = pydantic.Field(default=None) """ Data collection settings """ data_collection_scopes: typing.Optional[typing.Dict[str, AnalysisScope]] = pydantic.Field(default=None) """ Scope per data collection item ID. Missing keys default to conversation scope. """ analysis_items: typing.Optional[AgentAnalysisItemsOutput] = pydantic.Field(default=None) """ Evaluation + data-collection items attached by reference. None means the agent has not been migrated onto analysis items yet (distinct from an empty, migrated set); reads fall back to the legacy evaluation/data_collection fields in that case. """ overrides: typing.Optional[ConversationInitiationClientDataConfigOutput] = pydantic.Field(default=None) """ Additional overrides for the agent during conversation initiation """ workspace_overrides: typing.Optional[AgentWorkspaceOverridesOutput] = pydantic.Field(default=None) """ Workspace overrides for the agent """ testing: typing.Optional[AgentTestingSettings] = pydantic.Field(default=None) """ Testing configuration for the agent """ archived: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the agent is archived """ guardrails: typing.Optional[GuardrailsV1Output] = pydantic.Field(default=None) """ Guardrails configuration for the agent """ summary_language: typing.Optional[str] = pydantic.Field(default=None) """ Language for all conversation analysis outputs (summaries, titles, evaluation rationales, data collection rationales). If not set, the language will be inferred from the conversation. Must be one of the supported conversation languages. """ auto_translate_transcript_to_app_language: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, a conversation transcript is automatically translated to the viewer's application language when they open the transcript page. If not set or false, transcripts are shown in their original language unless the viewer manually selects a translation. """ auth: typing.Optional[AuthSettings] = pydantic.Field(default=None) """ Settings for authentication """ call_limits: typing.Optional[AgentCallLimits] = pydantic.Field(default=None) """ Call limits for the agent """ privacy: typing.Optional[PrivacyConfigOutput] = pydantic.Field(default=None) """ Privacy settings for the agent """ trust_context: typing.Optional[AgentTrustContext] = pydantic.Field(default=None) """ The trust context in which the agent operates. """ analysis_llm: typing.Optional[Llm] = pydantic.Field(default=None) """ Default LLM model for post-call analysis (evaluation and data collection) """ topic_discovery: typing.Optional[TopicDiscoverySettings] = pydantic.Field(default=None) """ Per-agent topic discovery configuration """ sentiment_analysis: typing.Optional[SentimentAnalysisSettings] = pydantic.Field(default=None) """ Per-agent post-call sentiment analysis configuration """ alerting: typing.Optional[AlertingSettingsResponse] = pydantic.Field(default=None) """ Agent-level alerting configuration overriding workspace settings. """ safety: typing.Optional[SafetyResponseModel] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_response_payload.py000066400000000000000000000030541523660243400310060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentResponsePayload(UncheckedBaseModel): """ Text chunk sent from your server to ElevenLabs for speech synthesis. Stream LLM output by sending multiple messages with `is_final: false`, then terminate the response with a message where `is_final: true` and `content` is an empty string. """ type: typing.Literal["agent_response"] = pydantic.Field(default="agent_response") """ The message type identifier. """ content: str = pydantic.Field() """ The text to synthesize. For streaming responses, send incremental chunks here. The final message in a response must have an empty string (`""`). """ event_id: typing.Optional[int] = pydantic.Field(default=None) """ The `event_id` from the `user_transcript` this response addresses. ElevenLabs uses this to discard responses that belong to an interrupted turn. """ is_final: bool = pydantic.Field() """ Set to `true` on the last message of a response (with an empty `content`). Set to `false` on all preceding chunks. """ 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 agent_simulated_chat_test_response_model.py000066400000000000000000000017721523660243400345100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_analysis_common_model import ConversationHistoryAnalysisCommonModel from .conversation_history_transcript_response_model import ConversationHistoryTranscriptResponseModel class AgentSimulatedChatTestResponseModel(UncheckedBaseModel): simulated_conversation: typing.List[ConversationHistoryTranscriptResponseModel] analysis: ConversationHistoryAnalysisCommonModel 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 update_forward_refs(AgentSimulatedChatTestResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_sort_by.py000066400000000000000000000002561523660243400271210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AgentSortBy = typing.Union[typing.Literal["name", "created_at", "call_count_7d"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_successful_response_example.py000066400000000000000000000011641523660243400332470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentSuccessfulResponseExample(UncheckedBaseModel): response: str type: typing.Literal["success"] = "success" 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 agent_summary_batch_successful_response_model.py000066400000000000000000000012441523660243400355520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_summary_response_model import AgentSummaryResponseModel class AgentSummaryBatchSuccessfulResponseModel(UncheckedBaseModel): data: AgentSummaryResponseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_summary_response_model.py000066400000000000000000000025721523660243400322360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .resource_access_info import ResourceAccessInfo class AgentSummaryResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ name: str = pydantic.Field() """ The name of the agent """ tags: typing.List[str] = pydantic.Field() """ Agent tags used to categorize the agent """ created_at_unix_secs: int = pydantic.Field() """ The creation time of the agent in unix seconds """ access_info: ResourceAccessInfo = pydantic.Field() """ The access information of the agent """ last_call_time_unix_secs: typing.Optional[int] = pydantic.Field(default=None) """ The time of the most recent call in unix seconds, null if no calls have been made """ archived: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the agent is archived """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_test_entity_type.py000066400000000000000000000002411523660243400310460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AgentTestEntityType = typing.Union[typing.Literal["test", "folder"], typing.Any] agent_test_folder_path_segment_response_model.py000066400000000000000000000011551523660243400355260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTestFolderPathSegmentResponseModel(UncheckedBaseModel): id: str name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_testing_settings.py000066400000000000000000000015041523660243400310320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .attached_test_model import AttachedTestModel class AgentTestingSettings(UncheckedBaseModel): """ Settings for agent testing configuration. """ attached_tests: typing.Optional[typing.List[AttachedTestModel]] = pydantic.Field(default=None) """ List of test IDs that should be run for this agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_topic_response_model.py000066400000000000000000000022121523660243400316460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .topic_metrics_aggregate import TopicMetricsAggregate class AgentTopicResponseModel(UncheckedBaseModel): topic_id: str label: str description: str conversation_count: int parent_topic_id: typing.Optional[str] = None x_2_d: typing_extensions.Annotated[ typing.Optional[float], FieldMetadata(alias="x_2d"), pydantic.Field(alias="x_2d") ] = None y_2_d: typing_extensions.Annotated[ typing.Optional[float], FieldMetadata(alias="y_2d"), pydantic.Field(alias="y_2d") ] = None metrics: typing.Optional[TopicMetricsAggregate] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_input.py000066400000000000000000000020571523660243400305040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTransferInput(UncheckedBaseModel): agent_id: typing.Optional[str] = None node_id: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None is_workflow_node_transfer: typing.Optional[bool] = None preserve_client_tts_overrides: typing.Optional[bool] = pydantic.Field(default=None) """ Defines whether TTS client overrides should be carried over to the transferred agent. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_op.py000066400000000000000000000032041523660243400277560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class AgentTransferOp_Pop(UncheckedBaseModel): type: typing.Literal["pop"] = "pop" 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 AgentTransferOp_Push(UncheckedBaseModel): type: typing.Literal["push"] = "push" return_node_id: 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 class AgentTransferOp_Replace(UncheckedBaseModel): type: typing.Literal["replace"] = "replace" 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 AgentTransferOp = typing_extensions.Annotated[ typing.Union[AgentTransferOp_Pop, AgentTransferOp_Push, AgentTransferOp_Replace], UnionMetadata(discriminant="type") ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_op_pop.py000066400000000000000000000010451523660243400306350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTransferOpPop(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_op_push.py000066400000000000000000000011271523660243400310170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTransferOpPush(UncheckedBaseModel): return_node_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_op_replace.py000066400000000000000000000010511523660243400314470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTransferOpReplace(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_transfer_output.py000066400000000000000000000020601523660243400306770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentTransferOutput(UncheckedBaseModel): agent_id: typing.Optional[str] = None node_id: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None is_workflow_node_transfer: typing.Optional[bool] = None preserve_client_tts_overrides: typing.Optional[bool] = pydantic.Field(default=None) """ Defines whether TTS client overrides should be carried over to the transferred agent. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_trust_context.py000066400000000000000000000002471523660243400303650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AgentTrustContext = typing.Union[typing.Literal["unknown", "low", "high"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_version_metadata.py000066400000000000000000000015661523660243400307720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_version_parents import AgentVersionParents from .resource_access_info import ResourceAccessInfo class AgentVersionMetadata(UncheckedBaseModel): id: str agent_id: str branch_id: str version_description: str seq_no_in_branch: int time_committed_secs: int parents: AgentVersionParents access_info: typing.Optional[ResourceAccessInfo] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_version_parents.py000066400000000000000000000015641523660243400306640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AgentVersionParents(UncheckedBaseModel): in_branch_parent_id: typing.Optional[str] = None out_of_branch_parent_id: typing.Optional[str] = None merged_into_branch_id: typing.Optional[str] = None merged_from_branch_id: typing.Optional[str] = None merged_from_version_id: typing.Optional[str] = None rebased_from_version_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_workflow_request_model.py000066400000000000000000000021551523660243400322420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_workflow_request_model_nodes_value import AgentWorkflowRequestModelNodesValue from .workflow_edge_model_input import WorkflowEdgeModelInput class AgentWorkflowRequestModel(UncheckedBaseModel): edges: typing.Optional[typing.Dict[str, WorkflowEdgeModelInput]] = None nodes: typing.Optional[typing.Dict[str, AgentWorkflowRequestModelNodesValue]] = None prevent_subagent_loops: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to prevent loops in the workflow execution. """ 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 update_forward_refs(AgentWorkflowRequestModel) agent_workflow_request_model_nodes_value.py000066400000000000000000000135331523660243400345510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversational_config_api_model_workflow_override_input import ConversationalConfigApiModelWorkflowOverrideInput from .entry_behavior import EntryBehavior from .knowledge_base_locator import KnowledgeBaseLocator from .position_input import PositionInput from .transfer_type_enum import TransferTypeEnum from .uui_transfer_config import UuiTransferConfig from .workflow_phone_number_node_model_input_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem, ) from .workflow_phone_number_node_model_input_post_dial_digits import WorkflowPhoneNumberNodeModelInputPostDialDigits from .workflow_phone_number_node_model_input_transfer_destination import ( WorkflowPhoneNumberNodeModelInputTransferDestination, ) from .workflow_tool_locator import WorkflowToolLocator class AgentWorkflowRequestModelNodesValue_End(UncheckedBaseModel): type: typing.Literal["end"] = "end" position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[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 class AgentWorkflowRequestModelNodesValue_OverrideAgent(UncheckedBaseModel): type: typing.Literal["override_agent"] = "override_agent" position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[str]] = None conversation_config: typing.Optional[ConversationalConfigApiModelWorkflowOverrideInput] = None additional_prompt: typing.Optional[str] = None additional_knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = None additional_tool_ids: typing.Optional[typing.List[str]] = None label: str entry_behavior: typing.Optional[EntryBehavior] = 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 class AgentWorkflowRequestModelNodesValue_PhoneNumber(UncheckedBaseModel): type: typing.Literal["phone_number"] = "phone_number" custom_sip_headers: typing.Optional[typing.List[WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem]] = None transfer_destination: WorkflowPhoneNumberNodeModelInputTransferDestination transfer_type: typing.Optional[TransferTypeEnum] = None uui: typing.Optional[UuiTransferConfig] = None post_dial_digits: typing.Optional[WorkflowPhoneNumberNodeModelInputPostDialDigits] = None position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[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 class AgentWorkflowRequestModelNodesValue_StandaloneAgent(UncheckedBaseModel): type: typing.Literal["standalone_agent"] = "standalone_agent" position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[str]] = None agent_id: typing.Optional[str] = None node_id: typing.Optional[str] = None delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None preserve_client_tts_overrides: typing.Optional[bool] = 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 class AgentWorkflowRequestModelNodesValue_Start(UncheckedBaseModel): type: typing.Literal["start"] = "start" position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[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 class AgentWorkflowRequestModelNodesValue_Tool(UncheckedBaseModel): type: typing.Literal["tool"] = "tool" position: typing.Optional[PositionInput] = None edge_order: typing.Optional[typing.List[str]] = None tools: typing.Optional[typing.List[WorkflowToolLocator]] = 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 AgentWorkflowRequestModelNodesValue = typing_extensions.Annotated[ typing.Union[ AgentWorkflowRequestModelNodesValue_End, AgentWorkflowRequestModelNodesValue_OverrideAgent, AgentWorkflowRequestModelNodesValue_PhoneNumber, AgentWorkflowRequestModelNodesValue_StandaloneAgent, AgentWorkflowRequestModelNodesValue_Start, AgentWorkflowRequestModelNodesValue_Tool, ], UnionMetadata(discriminant="type"), ] update_forward_refs(AgentWorkflowRequestModelNodesValue_OverrideAgent) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_workflow_response_model.py000066400000000000000000000020501523660243400324020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_workflow_response_model_nodes_value import AgentWorkflowResponseModelNodesValue from .workflow_edge_model_output import WorkflowEdgeModelOutput class AgentWorkflowResponseModel(UncheckedBaseModel): edges: typing.Dict[str, WorkflowEdgeModelOutput] nodes: typing.Dict[str, AgentWorkflowResponseModelNodesValue] prevent_subagent_loops: bool = pydantic.Field() """ Whether to prevent loops in the workflow execution. """ 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 update_forward_refs(AgentWorkflowResponseModel) agent_workflow_response_model_nodes_value.py000066400000000000000000000125251523660243400347170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversational_config_api_model_workflow_override_output import ConversationalConfigApiModelWorkflowOverrideOutput from .entry_behavior import EntryBehavior from .knowledge_base_locator import KnowledgeBaseLocator from .position_output import PositionOutput from .transfer_type_enum import TransferTypeEnum from .uui_transfer_config import UuiTransferConfig from .workflow_phone_number_node_model_output_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem, ) from .workflow_phone_number_node_model_output_post_dial_digits import WorkflowPhoneNumberNodeModelOutputPostDialDigits from .workflow_phone_number_node_model_output_transfer_destination import ( WorkflowPhoneNumberNodeModelOutputTransferDestination, ) from .workflow_tool_locator import WorkflowToolLocator class AgentWorkflowResponseModelNodesValue_End(UncheckedBaseModel): type: typing.Literal["end"] = "end" position: PositionOutput edge_order: typing.List[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 AgentWorkflowResponseModelNodesValue_OverrideAgent(UncheckedBaseModel): type: typing.Literal["override_agent"] = "override_agent" position: PositionOutput edge_order: typing.List[str] conversation_config: ConversationalConfigApiModelWorkflowOverrideOutput additional_prompt: str additional_knowledge_base: typing.List[KnowledgeBaseLocator] additional_tool_ids: typing.List[str] label: str entry_behavior: EntryBehavior 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 AgentWorkflowResponseModelNodesValue_PhoneNumber(UncheckedBaseModel): type: typing.Literal["phone_number"] = "phone_number" custom_sip_headers: typing.List[WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem] transfer_destination: WorkflowPhoneNumberNodeModelOutputTransferDestination transfer_type: TransferTypeEnum uui: typing.Optional[UuiTransferConfig] = None post_dial_digits: typing.Optional[WorkflowPhoneNumberNodeModelOutputPostDialDigits] = None position: PositionOutput edge_order: typing.List[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 AgentWorkflowResponseModelNodesValue_StandaloneAgent(UncheckedBaseModel): type: typing.Literal["standalone_agent"] = "standalone_agent" position: PositionOutput edge_order: typing.List[str] agent_id: typing.Optional[str] = None node_id: typing.Optional[str] = None delay_ms: int transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: bool preserve_client_tts_overrides: bool 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 AgentWorkflowResponseModelNodesValue_Start(UncheckedBaseModel): type: typing.Literal["start"] = "start" position: PositionOutput edge_order: typing.List[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 AgentWorkflowResponseModelNodesValue_Tool(UncheckedBaseModel): type: typing.Literal["tool"] = "tool" position: PositionOutput edge_order: typing.List[str] tools: typing.List[WorkflowToolLocator] 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 AgentWorkflowResponseModelNodesValue = typing_extensions.Annotated[ typing.Union[ AgentWorkflowResponseModelNodesValue_End, AgentWorkflowResponseModelNodesValue_OverrideAgent, AgentWorkflowResponseModelNodesValue_PhoneNumber, AgentWorkflowResponseModelNodesValue_StandaloneAgent, AgentWorkflowResponseModelNodesValue_Start, AgentWorkflowResponseModelNodesValue_Tool, ], UnionMetadata(discriminant="type"), ] update_forward_refs(AgentWorkflowResponseModelNodesValue_OverrideAgent) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_workspace_overrides_input.py000066400000000000000000000017341523660243400327410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_webhooks import ConvAiWebhooks from .conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook class AgentWorkspaceOverridesInput(UncheckedBaseModel): conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = ( pydantic.Field(default=None) ) """ The webhook to send conversation initiation client data to """ webhooks: typing.Optional[ConvAiWebhooks] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/agent_workspace_overrides_output.py000066400000000000000000000017351523660243400331430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_webhooks import ConvAiWebhooks from .conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook class AgentWorkspaceOverridesOutput(UncheckedBaseModel): conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = ( pydantic.Field(default=None) ) """ The webhook to send conversation initiation client data to """ webhooks: typing.Optional[ConvAiWebhooks] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_monitor_config.py000066400000000000000000000015651523660243400311670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AlertingMonitorConfig(UncheckedBaseModel): threshold: typing.Optional[float] = pydantic.Field(default=None) """ Failure rate threshold at which this monitor can notify. """ auto_resolve_after_inactive_minutes: typing.Optional[int] = pydantic.Field(default=None) """ How many minutes an alert can stay inactive before it is auto-resolved. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_settings.py000066400000000000000000000032761523660243400300140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .alerting_monitor_config import AlertingMonitorConfig from .alerting_webhook_notifier import AlertingWebhookNotifier class AlertingSettings(UncheckedBaseModel): """ Alerting configuration used at both per-agent and per-workspace level. All fields are optional overrides; the cascade resolver fills in defaults when they are unset. Notifiers stack and dedupe (by webhook_id) across the workspace and agent layers rather than overriding each other. Cascade order for per-monitor threshold and auto-resolve: agent → workspace → system default. """ monitor_configs: typing.Optional[typing.Dict[str, AlertingMonitorConfig]] = pydantic.Field(default=None) """ Alerting configuration keyed by monitor name. """ auto_resolve_after_inactive_minutes: typing.Optional[int] = pydantic.Field(default=None) """ How many minutes an alert can stay inactive before it is auto-resolved. Unset values fall through to the next layer. """ notifiers: typing.Optional[typing.List[AlertingWebhookNotifier]] = pydantic.Field(default=None) """ Delivery channels for alert lifecycle notifications. Stacked and deduped by webhook_id with other layers. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_settings_response.py000066400000000000000000000022401523660243400317200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .alerting_monitor_config import AlertingMonitorConfig from .alerting_webhook_notifier_response import AlertingWebhookNotifierResponse class AlertingSettingsResponse(UncheckedBaseModel): """ Customer-facing view of alerting settings. Unlike AdminAlertingSettingsResponse, it has no internal_notifiers field: those are ElevenLabs-internal delivery channels whose URLs must never be returned outside the admin API. """ monitor_configs: typing.Optional[typing.Dict[str, AlertingMonitorConfig]] = None auto_resolve_after_inactive_minutes: typing.Optional[int] = None notifiers: typing.Optional[typing.List[AlertingWebhookNotifierResponse]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_webhook_header.py000066400000000000000000000013641523660243400311160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AlertingWebhookHeader(UncheckedBaseModel): name: str is_secret: typing.Optional[bool] = None value: typing.Optional[str] = pydantic.Field(default=None) """ Header value. May be null only for a secret header on update. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_webhook_method.py000066400000000000000000000002401523660243400311360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AlertingWebhookMethod = typing.Union[typing.Literal["POST", "PUT"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_webhook_notifier.py000066400000000000000000000013531523660243400315030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AlertingWebhookNotifier(UncheckedBaseModel): type: typing.Optional[typing.Literal["webhook"]] = None webhook_id: str = pydantic.Field() """ ID of the workspace webhook to deliver alert lifecycle notifications to. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alerting_webhook_notifier_response.py000066400000000000000000000012031523660243400334130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AlertingWebhookNotifierResponse(UncheckedBaseModel): type: typing.Optional[typing.Literal["webhook"]] = None webhook_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/alignment.py000066400000000000000000000041361523660243400262410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class Alignment(UncheckedBaseModel): """ Alignment information for the generated audio given the input text sequence. """ char_start_times_ms: typing_extensions.Annotated[ typing.Optional[typing.List[int]], FieldMetadata(alias="charStartTimesMs"), pydantic.Field( alias="charStartTimesMs", description="A list of starting times (in milliseconds) for each character in the text as it\ncorresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio.\nNote these times are relative to the returned chunk from the model, and not the\nfull audio response.", ), ] = None char_durations_ms: typing_extensions.Annotated[ typing.Optional[typing.List[int]], FieldMetadata(alias="charDurationsMs"), pydantic.Field( alias="charDurationsMs", description="A list of durations (in milliseconds) for each character in the text as it\ncorresponds to the audio. For instance, the character 'H' lasts for 3 ms in the audio.\nNote these times are relative to the returned chunk from the model, and not the\nfull audio response.", ), ] = None chars: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of characters in the text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. The length of this list should be the same as the lengths of `charStartTimesMs` and `charDurationsMs`. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/allowed_output_formats.py000066400000000000000000000012071523660243400310610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AllowedOutputFormats = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/allowlist_item.py000066400000000000000000000011751523660243400273130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AllowlistItem(UncheckedBaseModel): hostname: str = pydantic.Field() """ The hostname of the allowed origin """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_charging.py000066400000000000000000000015361523660243400277510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_run_snapshot import AnalysisRunSnapshot from .analysis_running_total import AnalysisRunningTotal class AnalysisCharging(UncheckedBaseModel): """ Cost of running post-call analysis on this conversation. Present once an analysis pass has run, billed or not. """ total: AnalysisRunningTotal last_run: AnalysisRunSnapshot 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_property.py000066400000000000000000000061501523660243400300500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_property_constant_value import AnalysisPropertyConstantValue from .analysis_property_type import AnalysisPropertyType from .llm import Llm class AnalysisProperty(UncheckedBaseModel): """ Data collection property with optional per-item LLM override for post-call analysis. TODO: migrate to composition (value_schema: LiteralJsonSchemaProperty + llm) instead of inheritance, so this generalizes cleanly to object/array schemas in the future. """ type: AnalysisPropertyType description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the property. When set, the LLM will provide the value based on this description. Mutually exclusive with dynamic_variable, is_system_provided, constant_value, and is_omitted. """ enum: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of allowed string values for string type parameters """ is_system_provided: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the value will be populated by the system at runtime. Used by API Integration Webhook tools for templating. Mutually exclusive with description, dynamic_variable, constant_value, and is_omitted. """ dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ The name of the dynamic variable to use for this property's value. Mutually exclusive with description, is_system_provided, constant_value, and is_omitted. """ allowed_values_dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the LLM provides the value but the runtime rejects any value not present in the list held by this dynamic variable. Use to let the LLM pick from a server-verified set (e.g. the IDs the current user is allowed to access). Requires description; mutually exclusive with dynamic_variable, is_system_provided, constant_value, and is_omitted. """ constant_value: typing.Optional[AnalysisPropertyConstantValue] = pydantic.Field(default=None) """ A constant value to use for this property. Mutually exclusive with description, dynamic_variable, is_system_provided, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, is_system_provided, and constant_value. """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for this analysis item. If not set, uses agent's analysis_llm default. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_property_constant_value.py000066400000000000000000000002241523660243400331510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AnalysisPropertyConstantValue = typing.Union[str, int, float, bool] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_property_type.py000066400000000000000000000002721523660243400311100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AnalysisPropertyType = typing.Union[typing.Literal["boolean", "string", "integer", "number"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_run_snapshot.py000066400000000000000000000015441523660243400307110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AnalysisRunSnapshot(UncheckedBaseModel): """ LLM cost of the most recent post-call analysis pass on this conversation. """ price: typing.Optional[float] = None charge: typing.Optional[int] = None price_per_feature: typing.Optional[typing.Dict[str, float]] = None charge_per_feature: typing.Optional[typing.Dict[str, int]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_running_total.py000066400000000000000000000016111523660243400310440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AnalysisRunningTotal(UncheckedBaseModel): """ Cumulative LLM cost of running post-call analysis on this conversation. """ price: typing.Optional[float] = None charge: typing.Optional[int] = None runs: typing.Optional[int] = None price_per_feature: typing.Optional[typing.Dict[str, float]] = None charge_per_feature: typing.Optional[typing.Dict[str, int]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_scope.py000066400000000000000000000002421523660243400272710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AnalysisScope = typing.Union[typing.Literal["conversation", "agent"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/analysis_type.py000066400000000000000000000002621523660243400271430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AnalysisType = typing.Union[typing.Literal["evaluation_criteria", "data_collection"], typing.Any] api_integration_o_auth_2_auth_code_response.py000066400000000000000000000030511523660243400350640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .api_integration_o_auth_2_auth_code_response_scope_separator import ( ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ) from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class ApiIntegrationOAuth2AuthCodeResponse(UncheckedBaseModel): """ Response model for integration-managed OAuth2 Auth Code auth connections """ name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2AuthCodeResponseScopeSeparator] = pydantic.Field(default=None) """ Separator for scopes """ expires_at: str = pydantic.Field() """ ISO 8601 timestamp of when the access token expires """ integration_id: str credential_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 api_integration_o_auth_2_auth_code_response_scope_separator.py000066400000000000000000000002701523660243400403350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ApiIntegrationOAuth2AuthCodeResponseScopeSeparator = typing.Union[typing.Literal[" ", ","], typing.Any] api_integration_o_auth_2_custom_app_response.py000066400000000000000000000033171523660243400353100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .api_integration_o_auth_2_custom_app_response_scope_separator import ( ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ) from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class ApiIntegrationOAuth2CustomAppResponse(UncheckedBaseModel): """ Response model for user-owned OAuth2 Custom App auth connections """ name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2CustomAppResponseScopeSeparator] = pydantic.Field(default=None) """ Separator for scopes """ expires_at: str = pydantic.Field() """ ISO 8601 timestamp of when the access token expires """ integration_id: str credential_id: str client_id: str = pydantic.Field() """ OAuth client ID (rendered from template if credential uses templated credentials, None for legacy connections) """ id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 api_integration_o_auth_2_custom_app_response_scope_separator.py000066400000000000000000000002711523660243400405550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ApiIntegrationOAuth2CustomAppResponseScopeSeparator = typing.Union[typing.Literal[" ", ","], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/api_integration_webhook_overrides.py000066400000000000000000000025761523660243400332450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .api_integration_webhook_overrides_request_headers_value import ApiIntegrationWebhookOverridesRequestHeadersValue from .api_integration_webhook_overrides_schema_overrides_value import ApiIntegrationWebhookOverridesSchemaOverridesValue from .response_filter_mode import ResponseFilterMode class ApiIntegrationWebhookOverrides(UncheckedBaseModel): """ A whitelist of fields that can be overridden by users when configuring an API Integration Webhook Tool. """ schema_overrides: typing.Optional[ typing.Dict[str, typing.Optional[ApiIntegrationWebhookOverridesSchemaOverridesValue]] ] = None request_headers: typing.Optional[ typing.Dict[str, typing.Optional[ApiIntegrationWebhookOverridesRequestHeadersValue]] ] = None response_filter_mode: typing.Optional[ResponseFilterMode] = None response_filters: typing.Optional[typing.List[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 api_integration_webhook_overrides_request_headers_value.py000066400000000000000000000003521523660243400376130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable ApiIntegrationWebhookOverridesRequestHeadersValue = typing.Union[str, ConvAiDynamicVariable] api_integration_webhook_overrides_schema_overrides_value.py000066400000000000000000000051421523660243400377540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 ApiIntegrationWebhookOverridesSchemaOverridesValue = typing_extensions.Annotated[ typing.Union[ ApiIntegrationWebhookOverridesSchemaOverridesValue_Constant, ApiIntegrationWebhookOverridesSchemaOverridesValue_DynamicVariable, ApiIntegrationWebhookOverridesSchemaOverridesValue_Llm, ApiIntegrationWebhookOverridesSchemaOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] api_integration_webhook_tool_config_input.py000066400000000000000000000111001523660243400346640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class ApiIntegrationWebhookToolConfigInput(UncheckedBaseModel): name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 300 seconds (inclusive). """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ tool_version: typing.Optional[str] = pydantic.Field(default=None) """ The version of the API integration tool """ api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = pydantic.Field(default=None) """ User overrides applied on top of the base api_schema """ 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 api_integration_webhook_tool_config_output.py000066400000000000000000000104021523660243400350710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class ApiIntegrationWebhookToolConfigOutput(UncheckedBaseModel): name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: int = pydantic.Field() """ The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 300 seconds (inclusive). """ disable_interruptions: bool = pydantic.Field() """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: ToolInterruptionMode = pydantic.Field() """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: bool = pydantic.Field() """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: PreToolSpeechMode = pydantic.Field() """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.List[DynamicVariableAssignment] = pydantic.Field() """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: ToolCallSoundBehavior = pydantic.Field() """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: ToolErrorHandlingMode = pydantic.Field() """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ dynamic_variables: DynamicVariablesConfig = pydantic.Field() """ Configuration for dynamic variables """ execution_mode: ToolExecutionMode = pydantic.Field() """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ tool_version: str = pydantic.Field() """ The version of the API integration tool """ api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = pydantic.Field(default=None) """ User overrides applied on top of the base api_schema """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/array_json_schema_property_input.py000066400000000000000000000046571523660243400331450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .array_json_schema_property_input_property_kind import ArrayJsonSchemaPropertyInputPropertyKind class ArrayJsonSchemaPropertyInput(UncheckedBaseModel): property_kind: typing.Optional[ArrayJsonSchemaPropertyInputPropertyKind] = None description: typing.Optional[str] = None dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the entire parameter is populated from this dynamic variable at runtime. Mutually exclusive with description (LLM-provided value), constant_value, and is_omitted. """ constant_value: typing.Optional[typing.List[typing.Any]] = pydantic.Field(default=None) """ When set, the entire array uses this constant value at runtime. Mutually exclusive with description (LLM-provided array), dynamic_variable, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, and constant_value. """ type: typing.Optional[typing.Literal["array"]] = None items: typing.Optional["ArrayJsonSchemaPropertyInputItems"] = pydantic.Field(default=None) """ Schema for array elements. """ 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 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/array_json_schema_property_input_items.py000066400000000000000000000010051523660243400343260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .literal_json_schema_property import LiteralJsonSchemaProperty if typing.TYPE_CHECKING: from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput ArrayJsonSchemaPropertyInputItems = typing.Union[ LiteralJsonSchemaProperty, "ObjectJsonSchemaPropertyInput", "ArrayJsonSchemaPropertyInput" ] array_json_schema_property_input_property_kind.py000066400000000000000000000002671523660243400360300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ArrayJsonSchemaPropertyInputPropertyKind = typing.Union[typing.Literal["array", "object"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/array_json_schema_property_output.py000066400000000000000000000044051523660243400333350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class ArrayJsonSchemaPropertyOutput(UncheckedBaseModel): description: typing.Optional[str] = None dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the entire parameter is populated from this dynamic variable at runtime. Mutually exclusive with description (LLM-provided value), constant_value, and is_omitted. """ constant_value: typing.Optional[typing.List[typing.Any]] = pydantic.Field(default=None) """ When set, the entire array uses this constant value at runtime. Mutually exclusive with description (LLM-provided array), dynamic_variable, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, and constant_value. """ type: typing.Optional[typing.Literal["array"]] = None items: typing.Optional["ArrayJsonSchemaPropertyOutputItems"] = pydantic.Field(default=None) """ Schema for array elements. """ 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 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/array_json_schema_property_output_items.py000066400000000000000000000010141523660243400345270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .literal_json_schema_property import LiteralJsonSchemaProperty if typing.TYPE_CHECKING: from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput ArrayJsonSchemaPropertyOutputItems = typing.Union[ LiteralJsonSchemaProperty, "ObjectJsonSchemaPropertyOutput", "ArrayJsonSchemaPropertyOutput" ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asr_conversational_config.py000066400000000000000000000023241523660243400315010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .asr_input_format import AsrInputFormat from .asr_provider import AsrProvider from .asr_quality import AsrQuality class AsrConversationalConfig(UncheckedBaseModel): quality: typing.Optional[AsrQuality] = pydantic.Field(default=None) """ The quality of the transcription """ provider: typing.Optional[AsrProvider] = pydantic.Field(default=None) """ The provider of the transcription service """ user_input_audio_format: typing.Optional[AsrInputFormat] = pydantic.Field(default=None) """ The format of the audio to be transcribed """ keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Keywords to boost prediction probability for """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asr_conversational_config_override.py000066400000000000000000000013031523660243400333740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AsrConversationalConfigOverride(UncheckedBaseModel): keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Keywords to boost prediction probability for """ 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 asr_conversational_config_override_config.py000066400000000000000000000013001523660243400346370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AsrConversationalConfigOverrideConfig(UncheckedBaseModel): keywords: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the keywords field. """ 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 asr_conversational_config_workflow_override.py000066400000000000000000000023441523660243400352550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .asr_input_format import AsrInputFormat from .asr_provider import AsrProvider from .asr_quality import AsrQuality class AsrConversationalConfigWorkflowOverride(UncheckedBaseModel): quality: typing.Optional[AsrQuality] = pydantic.Field(default=None) """ The quality of the transcription """ provider: typing.Optional[AsrProvider] = pydantic.Field(default=None) """ The provider of the transcription service """ user_input_audio_format: typing.Optional[AsrInputFormat] = pydantic.Field(default=None) """ The format of the audio to be transcribed """ keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Keywords to boost prediction probability for """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asr_input_format.py000066400000000000000000000003521523660243400276330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AsrInputFormat = typing.Union[ typing.Literal["pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "pcm_48000", "ulaw_8000"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asr_provider.py000066400000000000000000000002501523660243400267530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AsrProvider = typing.Union[typing.Literal["elevenlabs", "scribe_realtime"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asr_quality.py000066400000000000000000000001641523660243400266150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AsrQuality = typing.Literal["high"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asset_transcription.py000066400000000000000000000014611523660243400303570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .asset_transcription_data import AssetTranscriptionData from .asset_transcription_status import AssetTranscriptionStatus class AssetTranscription(UncheckedBaseModel): status: AssetTranscriptionStatus data: typing.Optional[AssetTranscriptionData] = None updated_at_ms: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asset_transcription_data.py000066400000000000000000000013651523660243400313530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AssetTranscriptionData(UncheckedBaseModel): language_code: str text: str words: typing.List[str] word_start_times_ms: typing.List[int] word_end_times_ms: typing.List[int] word_speaker_ids: typing.List[typing.Optional[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/asset_transcription_status.py000066400000000000000000000002711523660243400317600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AssetTranscriptionStatus = typing.Union[typing.Literal["processing", "completed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_addition_operator_node_input.py000066400000000000000000000056271523660243400330720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstAdditionOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_addition_operator_node_output.py000066400000000000000000000057171523660243400332730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstAdditionOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_and_operator_node_input.py000066400000000000000000000055121523660243400320320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstAndOperatorNodeInput(UncheckedBaseModel): children: typing.List["AstNodeInput"] = pydantic.Field() """ Child nodes of the logical operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstAndOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_and_operator_node_output.py000066400000000000000000000056011523660243400322320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstAndOperatorNodeOutput(UncheckedBaseModel): children: typing.List["AstNodeOutput"] = pydantic.Field() """ Child nodes of the logical operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstAndOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_boolean_node_input.py000066400000000000000000000011651523660243400307740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstBooleanNodeInput(UncheckedBaseModel): value: bool = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_boolean_node_output.py000066400000000000000000000011661523660243400311760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstBooleanNodeOutput(UncheckedBaseModel): value: bool = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_conditional_operator_node_input.py000066400000000000000000000065461523660243400336030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class AstConditionalOperatorNodeInput(UncheckedBaseModel): condition: "AstNodeInput" = pydantic.Field() """ Condition deciding which expression should be selected. """ true_expression: typing_extensions.Annotated[ "AstNodeInput", FieldMetadata(alias="trueExpression"), pydantic.Field(alias="trueExpression", description="Expression selected if the condition is true."), ] false_expression: typing_extensions.Annotated[ "AstNodeInput", FieldMetadata(alias="falseExpression"), pydantic.Field(alias="falseExpression", description="Expression selected if the condition is false."), ] 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstConditionalOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_conditional_operator_node_output.py000066400000000000000000000066371523660243400340050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class AstConditionalOperatorNodeOutput(UncheckedBaseModel): condition: "AstNodeOutput" = pydantic.Field() """ Condition deciding which expression should be selected. """ true_expression: typing_extensions.Annotated[ "AstNodeOutput", FieldMetadata(alias="trueExpression"), pydantic.Field(alias="trueExpression", description="Expression selected if the condition is true."), ] false_expression: typing_extensions.Annotated[ "AstNodeOutput", FieldMetadata(alias="falseExpression"), pydantic.Field(alias="falseExpression", description="Expression selected if the condition is false."), ] 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstConditionalOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_division_operator_node_input.py000066400000000000000000000056271523660243400331230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstDivisionOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstDivisionOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_division_operator_node_output.py000066400000000000000000000057171523660243400333240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstDivisionOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstDivisionOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_dynamic_variable_node_input.py000066400000000000000000000012061523660243400326420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstDynamicVariableNodeInput(UncheckedBaseModel): name: str = pydantic.Field() """ The name of the dynamic variable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_dynamic_variable_node_output.py000066400000000000000000000012071523660243400330440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstDynamicVariableNodeOutput(UncheckedBaseModel): name: str = pydantic.Field() """ The name of the dynamic variable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_equals_operator_node_input.py000066400000000000000000000056331523660243400325660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstEqualsOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstEqualsOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_equals_operator_node_output.py000066400000000000000000000057231523660243400327670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstEqualsOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstEqualsOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_greater_than_operator_node_input.py000066400000000000000000000056201523660243400337330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstGreaterThanOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstGreaterThanOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_greater_than_operator_node_output.py000066400000000000000000000057101523660243400341340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstGreaterThanOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstGreaterThanOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) ast_greater_than_or_equals_operator_node_input.py000066400000000000000000000055761523660243400357400ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstGreaterThanOrEqualsOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstGreaterThanOrEqualsOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) ast_greater_than_or_equals_operator_node_output.py000066400000000000000000000056661523660243400361410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstGreaterThanOrEqualsOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstGreaterThanOrEqualsOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_less_than_operator_node_input.py000066400000000000000000000056261523660243400332560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstLessThanOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstLessThanOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_less_than_operator_node_output.py000066400000000000000000000057161523660243400334570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstLessThanOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstLessThanOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) ast_less_than_or_equals_operator_node_input.py000066400000000000000000000056041523660243400352450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstLessThanOrEqualsOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstLessThanOrEqualsOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) ast_less_than_or_equals_operator_node_output.py000066400000000000000000000056741523660243400354550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstLessThanOrEqualsOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstLessThanOrEqualsOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_multiplication_operator_node_input.py000066400000000000000000000056131523660243400343270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstMultiplicationOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstMultiplicationOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_multiplication_operator_node_output.py000066400000000000000000000057031523660243400345300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstMultiplicationOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstMultiplicationOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_node_input.py000066400000000000000000000545221523660243400273020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .ast_number_node_input_value import AstNumberNodeInputValue from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty class AstNodeInput_AddOperator(UncheckedBaseModel): type: typing.Literal["add_operator"] = "add_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_AndOperator(UncheckedBaseModel): type: typing.Literal["and_operator"] = "and_operator" children: typing.List["AstNodeInput"] 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 AstNodeInput_BooleanLiteral(UncheckedBaseModel): type: typing.Literal["boolean_literal"] = "boolean_literal" value: bool 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 AstNodeInput_ConditionalOperator(UncheckedBaseModel): type: typing.Literal["conditional_operator"] = "conditional_operator" condition: "AstNodeInput" true_expression: typing_extensions.Annotated[ "AstNodeInput", FieldMetadata(alias="trueExpression"), pydantic.Field(alias="trueExpression") ] false_expression: typing_extensions.Annotated[ "AstNodeInput", FieldMetadata(alias="falseExpression"), pydantic.Field(alias="falseExpression") ] 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 AstNodeInput_DivOperator(UncheckedBaseModel): type: typing.Literal["div_operator"] = "div_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_DynamicVariable(UncheckedBaseModel): type: typing.Literal["dynamic_variable"] = "dynamic_variable" name: 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 AstNodeInput_EqOperator(UncheckedBaseModel): type: typing.Literal["eq_operator"] = "eq_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_GtOperator(UncheckedBaseModel): type: typing.Literal["gt_operator"] = "gt_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_GteOperator(UncheckedBaseModel): type: typing.Literal["gte_operator"] = "gte_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" value_schema: typing.Optional[LlmLiteralJsonSchemaProperty] = None prompt: 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 class AstNodeInput_LtOperator(UncheckedBaseModel): type: typing.Literal["lt_operator"] = "lt_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_LteOperator(UncheckedBaseModel): type: typing.Literal["lte_operator"] = "lte_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_MulOperator(UncheckedBaseModel): type: typing.Literal["mul_operator"] = "mul_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_NeqOperator(UncheckedBaseModel): type: typing.Literal["neq_operator"] = "neq_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput_NullLiteral(UncheckedBaseModel): type: typing.Literal["null_literal"] = "null_literal" 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 AstNodeInput_NumberLiteral(UncheckedBaseModel): type: typing.Literal["number_literal"] = "number_literal" value: AstNumberNodeInputValue 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 AstNodeInput_OrOperator(UncheckedBaseModel): type: typing.Literal["or_operator"] = "or_operator" children: typing.List["AstNodeInput"] 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 AstNodeInput_StringLiteral(UncheckedBaseModel): type: typing.Literal["string_literal"] = "string_literal" value: 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 AstNodeInput_SubOperator(UncheckedBaseModel): type: typing.Literal["sub_operator"] = "sub_operator" left: "AstNodeInput" right: "AstNodeInput" 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 AstNodeInput = typing_extensions.Annotated[ typing.Union[ AstNodeInput_AddOperator, AstNodeInput_AndOperator, AstNodeInput_BooleanLiteral, AstNodeInput_ConditionalOperator, AstNodeInput_DivOperator, AstNodeInput_DynamicVariable, AstNodeInput_EqOperator, AstNodeInput_GtOperator, AstNodeInput_GteOperator, AstNodeInput_Llm, AstNodeInput_LtOperator, AstNodeInput_LteOperator, AstNodeInput_MulOperator, AstNodeInput_NeqOperator, AstNodeInput_NullLiteral, AstNodeInput_NumberLiteral, AstNodeInput_OrOperator, AstNodeInput_StringLiteral, AstNodeInput_SubOperator, ], UnionMetadata(discriminant="type"), ] from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstNodeInput_AddOperator, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_AndOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_ConditionalOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_DivOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_EqOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_GtOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_GteOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_LtOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_LteOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_MulOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_NeqOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_OrOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) update_forward_refs( AstNodeInput_SubOperator, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_node_input_llm.py000066400000000000000000000017111523660243400301360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty class AstNodeInputLlm(UncheckedBaseModel): value_schema: typing.Optional[LlmLiteralJsonSchemaProperty] = pydantic.Field(default=None) """ JSON schema describing the value that the LLM should extract. """ prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt to evaluate to a boolean value. Deprecated. Use a boolean schema instead. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_node_output.py000066400000000000000000000553361523660243400275070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .ast_number_node_output_value import AstNumberNodeOutputValue from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty class AstNodeOutput_AddOperator(UncheckedBaseModel): type: typing.Literal["add_operator"] = "add_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_AndOperator(UncheckedBaseModel): type: typing.Literal["and_operator"] = "and_operator" children: typing.List["AstNodeOutput"] 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 AstNodeOutput_BooleanLiteral(UncheckedBaseModel): type: typing.Literal["boolean_literal"] = "boolean_literal" value: bool 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 AstNodeOutput_ConditionalOperator(UncheckedBaseModel): type: typing.Literal["conditional_operator"] = "conditional_operator" condition: "AstNodeOutput" true_expression: typing_extensions.Annotated[ "AstNodeOutput", FieldMetadata(alias="trueExpression"), pydantic.Field(alias="trueExpression") ] false_expression: typing_extensions.Annotated[ "AstNodeOutput", FieldMetadata(alias="falseExpression"), pydantic.Field(alias="falseExpression") ] 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 AstNodeOutput_DivOperator(UncheckedBaseModel): type: typing.Literal["div_operator"] = "div_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_DynamicVariable(UncheckedBaseModel): type: typing.Literal["dynamic_variable"] = "dynamic_variable" name: 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 AstNodeOutput_EqOperator(UncheckedBaseModel): type: typing.Literal["eq_operator"] = "eq_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_GtOperator(UncheckedBaseModel): type: typing.Literal["gt_operator"] = "gt_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_GteOperator(UncheckedBaseModel): type: typing.Literal["gte_operator"] = "gte_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" value_schema: LlmLiteralJsonSchemaProperty prompt: 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 AstNodeOutput_LtOperator(UncheckedBaseModel): type: typing.Literal["lt_operator"] = "lt_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_LteOperator(UncheckedBaseModel): type: typing.Literal["lte_operator"] = "lte_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_MulOperator(UncheckedBaseModel): type: typing.Literal["mul_operator"] = "mul_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_NeqOperator(UncheckedBaseModel): type: typing.Literal["neq_operator"] = "neq_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput_NullLiteral(UncheckedBaseModel): type: typing.Literal["null_literal"] = "null_literal" 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 AstNodeOutput_NumberLiteral(UncheckedBaseModel): type: typing.Literal["number_literal"] = "number_literal" value: AstNumberNodeOutputValue 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 AstNodeOutput_OrOperator(UncheckedBaseModel): type: typing.Literal["or_operator"] = "or_operator" children: typing.List["AstNodeOutput"] 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 AstNodeOutput_StringLiteral(UncheckedBaseModel): type: typing.Literal["string_literal"] = "string_literal" value: 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 AstNodeOutput_SubOperator(UncheckedBaseModel): type: typing.Literal["sub_operator"] = "sub_operator" left: "AstNodeOutput" right: "AstNodeOutput" 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 AstNodeOutput = typing_extensions.Annotated[ typing.Union[ AstNodeOutput_AddOperator, AstNodeOutput_AndOperator, AstNodeOutput_BooleanLiteral, AstNodeOutput_ConditionalOperator, AstNodeOutput_DivOperator, AstNodeOutput_DynamicVariable, AstNodeOutput_EqOperator, AstNodeOutput_GtOperator, AstNodeOutput_GteOperator, AstNodeOutput_Llm, AstNodeOutput_LtOperator, AstNodeOutput_LteOperator, AstNodeOutput_MulOperator, AstNodeOutput_NeqOperator, AstNodeOutput_NullLiteral, AstNodeOutput_NumberLiteral, AstNodeOutput_OrOperator, AstNodeOutput_StringLiteral, AstNodeOutput_SubOperator, ], UnionMetadata(discriminant="type"), ] from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstNodeOutput_AddOperator, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_AndOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_ConditionalOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_DivOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_EqOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_GtOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_GteOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_LtOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_LteOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_MulOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_NeqOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_OrOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) update_forward_refs( AstNodeOutput_SubOperator, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_not_equals_operator_node_input.py000066400000000000000000000056241523660243400334460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstNotEqualsOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstNotEqualsOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_not_equals_operator_node_output.py000066400000000000000000000057141523660243400336470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstNotEqualsOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstNotEqualsOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_null_node_input.py000066400000000000000000000010431523660243400303220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstNullNodeInput(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_null_node_output.py000066400000000000000000000010441523660243400305240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstNullNodeOutput(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_number_node_input.py000066400000000000000000000013101523660243400306350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .ast_number_node_input_value import AstNumberNodeInputValue class AstNumberNodeInput(UncheckedBaseModel): value: AstNumberNodeInputValue = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_number_node_input_value.py000066400000000000000000000002031523660243400320310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AstNumberNodeInputValue = typing.Union[float, int] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_number_node_output.py000066400000000000000000000013141523660243400310420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .ast_number_node_output_value import AstNumberNodeOutputValue class AstNumberNodeOutput(UncheckedBaseModel): value: AstNumberNodeOutputValue = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_number_node_output_value.py000066400000000000000000000002041523660243400322330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AstNumberNodeOutputValue = typing.Union[float, int] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_or_operator_node_input.py000066400000000000000000000055141523660243400317120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstOrOperatorNodeInput(UncheckedBaseModel): children: typing.List["AstNodeInput"] = pydantic.Field() """ Child nodes of the logical operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstOrOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_or_operator_node_output.py000066400000000000000000000056031523660243400321120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstOrOperatorNodeOutput(UncheckedBaseModel): children: typing.List["AstNodeOutput"] = pydantic.Field() """ Child nodes of the logical operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstOrOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_string_node_input.py000066400000000000000000000011631523660243400306610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstStringNodeInput(UncheckedBaseModel): value: str = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_string_node_output.py000066400000000000000000000011641523660243400310630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstStringNodeOutput(UncheckedBaseModel): value: str = pydantic.Field() """ Value of this literal. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_subtraction_operator_node_input.py000066400000000000000000000056211523660243400336260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstSubtractionOperatorNodeInput(UncheckedBaseModel): left: "AstNodeInput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeInput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 update_forward_refs( AstSubtractionOperatorNodeInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ast_subtraction_operator_node_output.py000066400000000000000000000057111523660243400340270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class AstSubtractionOperatorNodeOutput(UncheckedBaseModel): left: "AstNodeOutput" = pydantic.Field() """ Left operand of the binary operator. """ right: "AstNodeOutput" = pydantic.Field() """ Right operand of the binary operator. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 update_forward_refs( AstSubtractionOperatorNodeOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/astllm_node_input.py000066400000000000000000000004461523660243400300030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .astllm_node_input_prompt import AstllmNodeInputPrompt from .astllm_node_input_value_schema import AstllmNodeInputValueSchema AstllmNodeInput = typing.Union[AstllmNodeInputValueSchema, AstllmNodeInputPrompt] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/astllm_node_input_prompt.py000066400000000000000000000013551523660243400314040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AstllmNodeInputPrompt(UncheckedBaseModel): type: typing.Optional[typing.Literal["llm"]] = None prompt: str = pydantic.Field() """ The prompt to evaluate to a boolean value. Deprecated. Use a boolean schema instead. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/astllm_node_input_value_schema.py000066400000000000000000000015051523660243400325140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty class AstllmNodeInputValueSchema(UncheckedBaseModel): type: typing.Optional[typing.Literal["llm"]] = None value_schema: LlmLiteralJsonSchemaProperty = pydantic.Field() """ JSON schema describing the value that the LLM should extract. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/astllm_node_output.py000066400000000000000000000016201523660243400301770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_literal_json_schema_property import LlmLiteralJsonSchemaProperty class AstllmNodeOutput(UncheckedBaseModel): value_schema: LlmLiteralJsonSchemaProperty = pydantic.Field() """ JSON schema describing the value that the LLM should extract. """ prompt: str = pydantic.Field() """ The prompt to evaluate to a boolean value. Deprecated. Use a boolean schema instead. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/async_conversation_metadata.py000066400000000000000000000021611523660243400320260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .async_conversation_metadata_delivery_status import AsyncConversationMetadataDeliveryStatus class AsyncConversationMetadata(UncheckedBaseModel): """ Metadata for async conversation delivery (Zendesk, Slack, etc.). """ delivery_status: AsyncConversationMetadataDeliveryStatus delivery_timestamp: int delivery_error: typing.Optional[str] = None external_system: str external_id: str external_link: typing.Optional[str] = None retry_count: typing.Optional[int] = None last_retry_timestamp: typing.Optional[int] = None last_processed_external_message_id: 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 async_conversation_metadata_delivery_status.py000066400000000000000000000003031523660243400352510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing AsyncConversationMetadataDeliveryStatus = typing.Union[typing.Literal["pending", "success", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/attached_system_data_collection_ref.py000066400000000000000000000017461523660243400335100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope class AttachedSystemDataCollectionRef(UncheckedBaseModel): analysis_item_id: typing.Literal["__system_data_collection_topic"] = pydantic.Field( default="__system_data_collection_topic" ) """ Id of the referenced built-in system data-collection item. """ scope: typing.Optional[AnalysisScope] = pydantic.Field(default=None) """ Transcript context ('conversation' or 'agent') used when running this item. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/attached_system_evaluation_ref.py000066400000000000000000000022111523660243400325170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope from .attached_system_evaluation_ref_analysis_item_id import AttachedSystemEvaluationRefAnalysisItemId class AttachedSystemEvaluationRef(UncheckedBaseModel): analysis_item_id: AttachedSystemEvaluationRefAnalysisItemId = pydantic.Field() """ Id of the referenced built-in system evaluation. """ scope: typing.Optional[AnalysisScope] = pydantic.Field(default=None) """ Transcript context ('conversation' or 'agent') used when running this item. """ weight: typing.Optional[float] = pydantic.Field(default=None) """ Optional relative weight for aggregate scoring. """ 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 attached_system_evaluation_ref_analysis_item_id.py000066400000000000000000000003651523660243400360450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing AttachedSystemEvaluationRefAnalysisItemId = typing.Union[ typing.Literal["__system_eval_criteria_sentiment", "__system_eval_criteria_frustration"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/attached_test_model.py000066400000000000000000000011501523660243400302500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AttachedTestModel(UncheckedBaseModel): test_id: str workflow_node_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/attached_user_data_collection_ref.py000066400000000000000000000020251523660243400331310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope class AttachedUserDataCollectionRef(UncheckedBaseModel): analysis_item_id: str = pydantic.Field() """ Id of the referenced user data-collection item. """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Pinned item version. None tracks the item's latest published version. """ scope: typing.Optional[AnalysisScope] = pydantic.Field(default=None) """ Transcript context ('conversation' or 'agent') used when running this item. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/attached_user_evaluation_ref.py000066400000000000000000000026771523660243400321710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope class AttachedUserEvaluationRef(UncheckedBaseModel): analysis_item_id: str = pydantic.Field() """ Id of the referenced user evaluation item. """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Primary item version whose result feeds scoring. None tracks the item's latest published version. """ additional_version_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Extra item versions to also run for comparison (A/B). These are executed and stored but excluded from scoring; the primary version_id is the one that scores. """ scope: typing.Optional[AnalysisScope] = pydantic.Field(default=None) """ Transcript context ('conversation' or 'agent') used when running this item. """ weight: typing.Optional[float] = pydantic.Field(default=None) """ Optional relative weight for aggregate scoring. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_analysis.py000066400000000000000000000014241523660243400272640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_analysis_result import AudioAnalysisResult from .audio_analysis_status import AudioAnalysisStatus class AudioAnalysis(UncheckedBaseModel): status: AudioAnalysisStatus data: typing.Optional[AudioAnalysisResult] = None updated_at_ms: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_analysis_result.py000066400000000000000000000016031523660243400306610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_key_moment import AudioKeyMoment from .audio_segment import AudioSegment class AudioAnalysisResult(UncheckedBaseModel): title: str description: str content_type: typing.Optional[str] = None overall_pacing: typing.Optional[str] = None segments: typing.Optional[typing.List[AudioSegment]] = None key_moments: typing.Optional[typing.List[AudioKeyMoment]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_analysis_status.py000066400000000000000000000002641523660243400306700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AudioAnalysisStatus = typing.Union[typing.Literal["processing", "completed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_format_enum.py000066400000000000000000000003531523660243400277550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AudioFormatEnum = typing.Union[ typing.Literal["pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "pcm_48000", "ulaw_8000"], typing.Any ] audio_isolation_history_item_response_model.py000066400000000000000000000022161523660243400352600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class AudioIsolationHistoryItemResponseModel(UncheckedBaseModel): id: str title: typing.Optional[str] = None created_at_unix: int format: str duration_seconds: typing.Optional[float] = None download_url: typing.Optional[str] = None icon_url: typing.Optional[str] = None source_video_url: typing.Optional[str] = None supports_video: bool processing: bool video_processing_failed: bool preview_b_64: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="preview_b64"), pydantic.Field(alias="preview_b64") ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_key_moment.py000066400000000000000000000011331523660243400276050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AudioKeyMoment(UncheckedBaseModel): timestamp_ms: int type: str description: 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 audio_native_create_project_response_model.py000066400000000000000000000016001523660243400350130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AudioNativeCreateProjectResponseModel(UncheckedBaseModel): project_id: str = pydantic.Field() """ The ID of the created Audio Native project. """ converting: bool = pydantic.Field() """ Whether the project is currently being converted. """ html_snippet: str = pydantic.Field() """ The HTML snippet to embed the Audio Native player. """ 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 audio_native_edit_content_response_model.py000066400000000000000000000017301523660243400345050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AudioNativeEditContentResponseModel(UncheckedBaseModel): project_id: str = pydantic.Field() """ The ID of the project. """ converting: bool = pydantic.Field() """ Whether the project is currently being converted. """ publishing: bool = pydantic.Field() """ Whether the project is currently being published. """ html_snippet: str = pydantic.Field() """ The HTML snippet to embed the Audio Native player. """ 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 audio_native_project_settings_response_model.py000066400000000000000000000033501523660243400354140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_native_project_settings_response_model_status import AudioNativeProjectSettingsResponseModelStatus class AudioNativeProjectSettingsResponseModel(UncheckedBaseModel): title: str = pydantic.Field() """ The title of the project. """ image: str = pydantic.Field() """ The image of the project. """ author: str = pydantic.Field() """ The author of the project. """ small: bool = pydantic.Field() """ Whether the project is small. """ text_color: str = pydantic.Field() """ The text color of the project. """ background_color: str = pydantic.Field() """ The background color of the project. """ sessionization: int = pydantic.Field() """ The sessionization of the project. Specifies for how many minutes to persist the session across page reloads. """ audio_path: typing.Optional[str] = pydantic.Field(default=None) """ The path of the audio file. """ audio_url: typing.Optional[str] = pydantic.Field(default=None) """ 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow audio_native_project_settings_response_model_status.py000066400000000000000000000003001523660243400370070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing AudioNativeProjectSettingsResponseModelStatus = typing.Union[typing.Literal["processing", "ready"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_output.py000066400000000000000000000022031523660243400267750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .alignment import Alignment from .normalized_alignment import NormalizedAlignment class AudioOutput(UncheckedBaseModel): audio: str = pydantic.Field() """ A generated partial audio chunk, encoded using the selected output_format, by default this is MP3 encoded as a base64 string. """ normalized_alignment: typing_extensions.Annotated[ typing.Optional[NormalizedAlignment], FieldMetadata(alias="normalizedAlignment"), pydantic.Field(alias="normalizedAlignment"), ] = None alignment: typing.Optional[Alignment] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_output_multi.py000066400000000000000000000025331523660243400302150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .alignment import Alignment from .normalized_alignment import NormalizedAlignment class AudioOutputMulti(UncheckedBaseModel): """ Server payload containing an audio chunk for a specific context. """ audio: str = pydantic.Field() """ Base64 encoded audio chunk. """ normalized_alignment: typing_extensions.Annotated[ typing.Optional[NormalizedAlignment], FieldMetadata(alias="normalizedAlignment"), pydantic.Field(alias="normalizedAlignment"), ] = None alignment: typing.Optional[Alignment] = None context_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="contextId"), pydantic.Field(alias="contextId", description="The contextId for which this audio is."), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_ref_chunk.py000066400000000000000000000015311523660243400274040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange class AudioRefChunk(UncheckedBaseModel): song_id: str = pydantic.Field() """ The ID of the song to source the chunk from. You can find the song ID in the response headers when you generate a song. """ range: TimeRange = pydantic.Field() """ The time range to extract from the song. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_segment.py000066400000000000000000000014061523660243400271030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AudioSegment(UncheckedBaseModel): start_ms: int end_ms: int description: str segment_type: typing.Optional[str] = None has_speech: typing.Optional[bool] = None has_music: typing.Optional[bool] = None pacing: 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 audio_with_timestamps_and_voice_segments_response_model.py000066400000000000000000000026561523660243400376250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_response_model import CharacterAlignmentResponseModel from .voice_segment import VoiceSegment class AudioWithTimestampsAndVoiceSegmentsResponseModel(UncheckedBaseModel): audio_base_64: typing_extensions.Annotated[ str, FieldMetadata(alias="audio_base64"), pydantic.Field(alias="audio_base64", description="Base64 encoded audio data"), ] alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the original text """ normalized_alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the normalized text """ voice_segments: typing.List[VoiceSegment] = pydantic.Field() """ Voice segments for the audio """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/audio_with_timestamps_response.py000066400000000000000000000023761523660243400326070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_response_model import CharacterAlignmentResponseModel class AudioWithTimestampsResponse(UncheckedBaseModel): audio_base_64: typing_extensions.Annotated[ str, FieldMetadata(alias="audio_base64"), pydantic.Field(alias="audio_base64", description="Base64 encoded audio data"), ] alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the original text """ normalized_alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the normalized text """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auth_connection_dependencies.py000066400000000000000000000022511523660243400321450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies_mcp_servers_item import AuthConnectionDependenciesMcpServersItem from .auth_connection_dependencies_tools_item import AuthConnectionDependenciesToolsItem from .dependent_integration_connection_identifier import DependentIntegrationConnectionIdentifier class AuthConnectionDependencies(UncheckedBaseModel): """ Dependencies that use an auth connection """ tools: typing.Optional[typing.List[AuthConnectionDependenciesToolsItem]] = None mcp_servers: typing.Optional[typing.List[AuthConnectionDependenciesMcpServersItem]] = None integration_connections: typing.Optional[typing.List[DependentIntegrationConnectionIdentifier]] = 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 auth_connection_dependencies_mcp_servers_item.py000066400000000000000000000031221523660243400355120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_mcp_server_identifier_access_level import DependentAvailableMcpServerIdentifierAccessLevel class AuthConnectionDependenciesMcpServersItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" id: str name: str created_at_unix_secs: int access_level: DependentAvailableMcpServerIdentifierAccessLevel 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 AuthConnectionDependenciesMcpServersItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" 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 AuthConnectionDependenciesMcpServersItem = typing_extensions.Annotated[ typing.Union[AuthConnectionDependenciesMcpServersItem_Available, AuthConnectionDependenciesMcpServersItem_Unknown], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auth_connection_dependencies_tools_item.py000066400000000000000000000030511523660243400344020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel class AuthConnectionDependenciesToolsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" id: str name: str created_at_unix_secs: int access_level: DependentAvailableToolIdentifierAccessLevel 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 AuthConnectionDependenciesToolsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" 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 AuthConnectionDependenciesToolsItem = typing_extensions.Annotated[ typing.Union[AuthConnectionDependenciesToolsItem_Available, AuthConnectionDependenciesToolsItem_Unknown], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auth_connection_locator.py000066400000000000000000000012531523660243400311630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AuthConnectionLocator(UncheckedBaseModel): """ Used to reference an auth connection from the workspace's auth connection store. """ auth_connection_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auth_connection_status.py000066400000000000000000000003231523660243400310400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AuthConnectionStatus = typing.Union[ typing.Literal["active", "refresh_failed", "revoked", "credential_invalid"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auth_settings.py000066400000000000000000000024611523660243400271430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .allowlist_item import AllowlistItem class AuthSettings(UncheckedBaseModel): enable_auth: typing.Optional[bool] = pydantic.Field(default=None) """ If set to true, starting a conversation with an agent will require a signed token """ allowlist: typing.Optional[typing.List[AllowlistItem]] = pydantic.Field(default=None) """ A list of hosts that are allowed to start conversations with the agent """ require_origin_header: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, connections with no origin header will be rejected. If the allowlist is empty, this option has no effect. """ shareable_token: typing.Optional[str] = pydantic.Field(default=None) """ A shareable token that can be used to start a conversation with the agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/authentication_activity_id.py000066400000000000000000000001401523660243400316610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. AuthenticationActivityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/authorization_method.py000066400000000000000000000007051523660243400305210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AuthorizationMethod = typing.Union[ typing.Literal[ "invalid", "public", "authorization_header", "signed_url", "shareable_link", "livekit_token", "livekit_token_website", "genesys_api_key", "avaya_api_key", "audiocodes_api_key", "whatsapp", "sms", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auto_generation_metadata.py000066400000000000000000000027231523660243400313060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AutoGenerationMetadata(UncheckedBaseModel): """ Metadata for an automatically generated simulation test. Tracks the origin and context of tests that were auto-generated from conversations, including the source conversation, topic, and evaluation criteria the test covers. """ agent_id: str = pydantic.Field() """ Agent whose simulation library this test belongs to. """ stable_topic_id: str = pydantic.Field() """ Stable topic id (from topic discovery) this test covers. """ criteria_id: str = pydantic.Field() """ Evaluation criterion id this test targets. """ topic_label: str = pydantic.Field() """ Human-readable topic label at generation time. """ source_conversation_id: str = pydantic.Field() """ Conversation the test was generated from. """ generated_at_unix: int = pydantic.Field() """ Unix timestamp (seconds) when the test was generated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/auto_sync_info.py000066400000000000000000000021641523660243400273010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class AutoSyncInfo(UncheckedBaseModel): minimum_frequency_days: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of days between automatic syncs """ auto_remove: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to remove the document if the URL becomes unavailable """ consec_failures: typing.Optional[int] = pydantic.Field(default=None) """ Number of consecutive sync failures """ next_refresh_by: typing.Optional[int] = pydantic.Field(default=None) """ Unix timestamp for the next scheduled sync or None (in case of folders) """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/background_sound_config.py000066400000000000000000000024071523660243400311360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_preset_id import BackgroundSoundPresetId from .background_sound_source_type import BackgroundSoundSourceType class BackgroundSoundConfig(UncheckedBaseModel): source_type: typing.Optional[BackgroundSoundSourceType] = pydantic.Field(default=None) """ The type of background sound source. """ source_id: typing.Optional[BackgroundSoundPresetId] = pydantic.Field(default=None) """ Identifier for the sound source. """ volume: typing.Optional[float] = pydantic.Field(default=None) """ Volume level for background sound (0.01 to 1.0). """ crossfade_loop: typing.Optional[bool] = pydantic.Field(default=None) """ Apply a crossfade at the loop boundary to avoid audible pops when the sound loops. """ 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 background_sound_config_workflow_override.py000066400000000000000000000024271523660243400347120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_preset_id import BackgroundSoundPresetId from .background_sound_source_type import BackgroundSoundSourceType class BackgroundSoundConfigWorkflowOverride(UncheckedBaseModel): source_type: typing.Optional[BackgroundSoundSourceType] = pydantic.Field(default=None) """ The type of background sound source. """ source_id: typing.Optional[BackgroundSoundPresetId] = pydantic.Field(default=None) """ Identifier for the sound source. """ volume: typing.Optional[float] = pydantic.Field(default=None) """ Volume level for background sound (0.01 to 1.0). """ crossfade_loop: typing.Optional[bool] = pydantic.Field(default=None) """ Apply a crossfade at the loop boundary to avoid audible pops when the sound loops. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/background_sound_preset_id.py000066400000000000000000000004261523660243400316460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BackgroundSoundPresetId = typing.Union[ typing.Literal[ "office2", "office1", "restaurant", "city", "typing", "elevator1", "elevator2", "elevator3", "elevator4" ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/background_sound_source_type.py000066400000000000000000000002051523660243400322240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BackgroundSoundSourceType = typing.Literal["preset"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/backup_llm_default.py000066400000000000000000000011461523660243400300760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class BackupLlmDefault(UncheckedBaseModel): preference: typing.Optional[typing.Literal["default"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/backup_llm_disabled.py000066400000000000000000000011501523660243400302140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class BackupLlmDisabled(UncheckedBaseModel): preference: typing.Optional[typing.Literal["disabled"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/backup_llm_override.py000066400000000000000000000012311523660243400302640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm class BackupLlmOverride(UncheckedBaseModel): preference: typing.Optional[typing.Literal["override"]] = None order: typing.List[Llm] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/bad_request_error_body.py000066400000000000000000000011671523660243400310100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class BadRequestErrorBody(UncheckedBaseModel): error: typing.Optional[str] = None message: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/base_turn_config.py000066400000000000000000000061071523660243400275720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .spelling_patience import SpellingPatience from .turn_eagerness import TurnEagerness from .turn_model import TurnModel class BaseTurnConfig(UncheckedBaseModel): turn_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Maximum wait time for the user's reply before re-engaging the user """ initial_wait_time: typing.Optional[float] = pydantic.Field(default=None) """ How long the agent will wait for the user to start the conversation if the first message is empty. If not set, uses the regular turn_timeout. """ silence_end_call_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Maximum wait time since the user last spoke before terminating the call """ turn_eagerness: typing.Optional[TurnEagerness] = pydantic.Field(default=None) """ Controls how eager the agent is to respond. Low = less eager (waits longer), Standard = default eagerness, High = more eager (responds sooner) """ spelling_patience: typing.Optional[SpellingPatience] = pydantic.Field(default=None) """ Controls if the agent should be more patient when user is spelling numbers and named entities. Auto = model based, Off = never wait extra """ speculative_turn: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, starts generating LLM responses during silence before full turn confidence is reached, reducing perceived latency. May increase LLM costs. """ retranscribe_on_turn_timeout: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, if VAD detects no speech, attempts to re-transcribe accumulated audio at turn timeout. Disables silence discount billing for affected turns. """ turn_model: typing.Optional[TurnModel] = None interruption_ignore_terms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of terms that should not trigger an interruption when spoken by the user (e.g. 'gotcha', 'understood'). Uses case-insensitive exact matching. """ interruption_ignore_term_languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Language codes for which preset ignore-term categories have been activated. Stored explicitly so display is not inferred from term overlap. """ transcribe_on_disabled_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ When interruptions are disabled, still transcribe what the user says so it can carry into the next turn. When off, user speech during a non-interruptible turn is ignored and won't trigger a turn. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/basic_auth_response.py000066400000000000000000000017571523660243400303110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class BasicAuthResponse(UncheckedBaseModel): """ Response model for basic auth """ name: str provider: str username: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_call_detailed_response.py000066400000000000000000000036441523660243400321130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .batch_call_status import BatchCallStatus from .batch_call_whats_app_params import BatchCallWhatsAppParams from .outbound_call_recipient_response_model import OutboundCallRecipientResponseModel from .telephony_call_config import TelephonyCallConfig from .telephony_provider import TelephonyProvider class BatchCallDetailedResponse(UncheckedBaseModel): """ Detailed response model for a batch call including all recipients. """ id: str phone_number_id: typing.Optional[str] = None phone_provider: typing.Optional[TelephonyProvider] = None whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = None name: str agent_id: str branch_id: typing.Optional[str] = None environment: typing.Optional[str] = None created_at_unix: int scheduled_time_unix: int timezone: typing.Optional[str] = None total_calls_dispatched: int total_calls_scheduled: int total_calls_finished: int last_updated_at_unix: int status: BatchCallStatus retry_count: int telephony_call_config: TelephonyCallConfig target_concurrency_limit: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. """ agent_name: str branch_name: typing.Optional[str] = None recipients: typing.List[OutboundCallRecipientResponseModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_call_recipient_status.py000066400000000000000000000004231523660243400317770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BatchCallRecipientStatus = typing.Union[ typing.Literal[ "pending", "dispatched", "initiated", "in_progress", "completed", "failed", "cancelled", "voicemail" ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_call_response.py000066400000000000000000000032551523660243400302560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .batch_call_status import BatchCallStatus from .batch_call_whats_app_params import BatchCallWhatsAppParams from .telephony_call_config import TelephonyCallConfig from .telephony_provider import TelephonyProvider class BatchCallResponse(UncheckedBaseModel): id: str phone_number_id: typing.Optional[str] = None phone_provider: typing.Optional[TelephonyProvider] = None whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = None name: str agent_id: str branch_id: typing.Optional[str] = None environment: typing.Optional[str] = None created_at_unix: int scheduled_time_unix: int timezone: typing.Optional[str] = None total_calls_dispatched: int total_calls_scheduled: int total_calls_finished: int last_updated_at_unix: int status: BatchCallStatus retry_count: int telephony_call_config: TelephonyCallConfig target_concurrency_limit: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of simultaneous calls for this batch. When set, dispatch is governed by this limit rather than workspace/agent capacity percentages. """ agent_name: str branch_name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_call_status.py000066400000000000000000000003111523660243400277310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BatchCallStatus = typing.Union[typing.Literal["pending", "in_progress", "completed", "failed", "cancelled"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_call_whats_app_params.py000066400000000000000000000013361523660243400317470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class BatchCallWhatsAppParams(UncheckedBaseModel): whatsapp_phone_number_id: typing.Optional[str] = None whatsapp_call_permission_request_template_name: str whatsapp_call_permission_request_template_language_code: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/batch_failure_response_model.py000066400000000000000000000011561523660243400321500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class BatchFailureResponseModel(UncheckedBaseModel): error_code: int error_status: str error_message: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/bearer_auth_response.py000066400000000000000000000017371523660243400304660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class BearerAuthResponse(UncheckedBaseModel): """ Response model for bearer auth """ name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/behavior_override.py000066400000000000000000000022161523660243400277560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .interaction_budget import InteractionBudget from .output_format import OutputFormat from .verbosity import Verbosity class BehaviorOverride(UncheckedBaseModel): verbosity: typing.Optional[Verbosity] = pydantic.Field(default=None) """ Verbosity override. Underlying default applies when unset. """ output_format: typing.Optional[OutputFormat] = pydantic.Field(default=None) """ Output format override. Underlying default applies when unset. """ interaction_budget: typing.Optional[InteractionBudget] = pydantic.Field(default=None) """ Interaction budget override. Underlying default applies when unset. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/billing_period.py000066400000000000000000000003261523660243400272420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BillingPeriod = typing.Union[ typing.Literal["monthly_period", "3_month_period", "6_month_period", "annual_period"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/branch_protection_status.py000066400000000000000000000003031523660243400313610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BranchProtectionStatus = typing.Union[typing.Literal["writer_perms_required", "admin_perms_required"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/breakdown_types.py000066400000000000000000000007741523660243400274670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BreakdownTypes = typing.Union[ typing.Literal[ "none", "voice", "voice_multiplier", "user", "groups", "api_keys", "all_api_keys", "product_type", "model", "resource", "request_queue", "region", "subresource_id", "reporting_workspace_id", "has_api_key", "request_source", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/bucketing_status.py000066400000000000000000000002551523660243400276370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BucketingStatus = typing.Union[typing.Literal["pending", "completed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/built_in_tools_input.py000066400000000000000000000032001523660243400305160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .system_tool_config_input import SystemToolConfigInput class BuiltInToolsInput(UncheckedBaseModel): end_call: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The end call tool """ language_detection: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The language detection tool """ transfer_to_agent: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The transfer to agent tool """ transfer_to_number: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The transfer to number tool """ skip_turn: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The skip turn tool """ play_keypad_touch_tone: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The play DTMF tool """ voicemail_detection: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The voicemail detection tool """ 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 update_forward_refs(BuiltInToolsInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/built_in_tools_output.py000066400000000000000000000032131523660243400307230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .system_tool_config_output import SystemToolConfigOutput class BuiltInToolsOutput(UncheckedBaseModel): end_call: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The end call tool """ language_detection: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The language detection tool """ transfer_to_agent: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The transfer to agent tool """ transfer_to_number: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The transfer to number tool """ skip_turn: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The skip turn tool """ play_keypad_touch_tone: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The play DTMF tool """ voicemail_detection: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The voicemail detection tool """ 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 update_forward_refs(BuiltInToolsOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/built_in_tools_workflow_override_input.py000066400000000000000000000032401523660243400343530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .system_tool_config_input import SystemToolConfigInput class BuiltInToolsWorkflowOverrideInput(UncheckedBaseModel): end_call: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The end call tool """ language_detection: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The language detection tool """ transfer_to_agent: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The transfer to agent tool """ transfer_to_number: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The transfer to number tool """ skip_turn: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The skip turn tool """ play_keypad_touch_tone: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The play DTMF tool """ voicemail_detection: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) """ The voicemail detection tool """ 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 update_forward_refs(BuiltInToolsWorkflowOverrideInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/built_in_tools_workflow_override_output.py000066400000000000000000000032531523660243400345600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .system_tool_config_output import SystemToolConfigOutput class BuiltInToolsWorkflowOverrideOutput(UncheckedBaseModel): end_call: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The end call tool """ language_detection: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The language detection tool """ transfer_to_agent: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The transfer to agent tool """ transfer_to_number: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The transfer to number tool """ skip_turn: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The skip turn tool """ play_keypad_touch_tone: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The play DTMF tool """ voicemail_detection: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None) """ The voicemail detection tool """ 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 update_forward_refs(BuiltInToolsWorkflowOverrideOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/cancel_calendar_event_params.py000066400000000000000000000012001523660243400320720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CancelCalendarEventParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["cancel_calendar_event"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/cancel_group_session_for_all_params.py000066400000000000000000000015171523660243400335300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CancelGroupSessionForAllParams(UncheckedBaseModel): """ Cancel an entire group session and notify every registered participant. Destructive -- prefer ``cancel_group_session_registration`` for cancelling a single attendee. """ smb_tool_type: typing.Optional[typing.Literal["cancel_group_session_for_all"]] = 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 cancel_group_session_registration_params.py000066400000000000000000000013471523660243400345460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CancelGroupSessionRegistrationParams(UncheckedBaseModel): """ Cancel a single client's registration for a group session. """ smb_tool_type: typing.Optional[typing.Literal["cancel_group_session_registration"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/canvas_placement.py000066400000000000000000000023241523660243400275630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CanvasPlacement(UncheckedBaseModel): """ Defines asset positioning and transformation on canvas. """ x_relative: typing.Optional[float] = None y_relative: typing.Optional[float] = None scale_x: typing.Optional[float] = None scale_y: typing.Optional[float] = None pivot_x: typing.Optional[float] = None pivot_y: typing.Optional[float] = None skew_x: typing.Optional[float] = None skew_y: typing.Optional[float] = None crop_top: typing.Optional[float] = None crop_right: typing.Optional[float] = None crop_bottom: typing.Optional[float] = None crop_left: typing.Optional[float] = None flip_x: typing.Optional[bool] = None flip_y: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_character_animation_model.py000066400000000000000000000016071523660243400343730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_character_animation_model_enter_type import CaptionStyleCharacterAnimationModelEnterType from .caption_style_character_animation_model_exit_type import CaptionStyleCharacterAnimationModelExitType class CaptionStyleCharacterAnimationModel(UncheckedBaseModel): enter_type: CaptionStyleCharacterAnimationModelEnterType exit_type: CaptionStyleCharacterAnimationModelExitType 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 caption_style_character_animation_model_enter_type.py000066400000000000000000000003061523660243400365450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleCharacterAnimationModelEnterType = typing.Union[typing.Literal["none", "fade", "typewriter"], typing.Any] caption_style_character_animation_model_exit_type.py000066400000000000000000000002671523660243400364070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleCharacterAnimationModelExitType = typing.Union[typing.Literal["none", "fade"], typing.Any] caption_style_horizontal_placement_model.py000066400000000000000000000013541523660243400345410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_horizontal_placement_model_align import CaptionStyleHorizontalPlacementModelAlign class CaptionStyleHorizontalPlacementModel(UncheckedBaseModel): align: CaptionStyleHorizontalPlacementModelAlign translate_pct: float 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 caption_style_horizontal_placement_model_align.py000066400000000000000000000003001523660243400357010ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleHorizontalPlacementModelAlign = typing.Union[typing.Literal["left", "center", "right"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model.py000066400000000000000000000067331523660243400303250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_character_animation_model import CaptionStyleCharacterAnimationModel from .caption_style_horizontal_placement_model import CaptionStyleHorizontalPlacementModel from .caption_style_model_text_align import CaptionStyleModelTextAlign from .caption_style_model_text_blend_mode import CaptionStyleModelTextBlendMode from .caption_style_model_text_style import CaptionStyleModelTextStyle from .caption_style_model_text_transform import CaptionStyleModelTextTransform from .caption_style_model_text_weight import CaptionStyleModelTextWeight from .caption_style_section_animation_model import CaptionStyleSectionAnimationModel from .caption_style_template_model import CaptionStyleTemplateModel from .caption_style_vertical_placement_model import CaptionStyleVerticalPlacementModel from .caption_style_word_animation_model import CaptionStyleWordAnimationModel from .studio_text_style_outline_model import StudioTextStyleOutlineModel from .studio_text_style_shadow_model import StudioTextStyleShadowModel class CaptionStyleModel(UncheckedBaseModel): template: typing.Optional[CaptionStyleTemplateModel] = None text_font: typing.Optional[str] = None text_scale: typing.Optional[float] = None text_color: typing.Optional[str] = None text_align: typing.Optional[CaptionStyleModelTextAlign] = None text_style: typing.Optional[CaptionStyleModelTextStyle] = None text_weight: typing.Optional[CaptionStyleModelTextWeight] = None text_transform: typing.Optional[CaptionStyleModelTextTransform] = None text_blend_mode: typing.Optional[CaptionStyleModelTextBlendMode] = None text_shadow: typing.Optional[StudioTextStyleShadowModel] = None text_outline: typing.Optional[StudioTextStyleOutlineModel] = None background_enabled: typing.Optional[bool] = None background_color: typing.Optional[str] = None background_opacity: typing.Optional[float] = None background_blur: typing.Optional[float] = None background_border_radius: typing.Optional[float] = None word_highlights_enabled: typing.Optional[bool] = None word_highlights_color: typing.Optional[str] = None word_highlights_background_color: typing.Optional[str] = None word_highlights_opacity: typing.Optional[float] = None word_highlights_border_radius: typing.Optional[float] = None word_highlights_blur: typing.Optional[float] = None section_animation: typing.Optional[CaptionStyleSectionAnimationModel] = None word_animation: typing.Optional[CaptionStyleWordAnimationModel] = None character_animation: typing.Optional[CaptionStyleCharacterAnimationModel] = None cursor_enabled: typing.Optional[bool] = None width_pct: typing.Optional[float] = None horizontal_placement: typing.Optional[CaptionStyleHorizontalPlacementModel] = None vertical_placement: typing.Optional[CaptionStyleVerticalPlacementModel] = None auto_break_enabled: typing.Optional[bool] = None max_lines_per_section: typing.Optional[int] = None max_words_per_line: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model_text_align.py000066400000000000000000000002601523660243400325300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleModelTextAlign = typing.Union[typing.Literal["start", "center", "end"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model_text_blend_mode.py000066400000000000000000000002761523660243400335350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleModelTextBlendMode = typing.Union[typing.Literal["normal", "difference", "multiply"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model_text_style.py000066400000000000000000000002521523660243400325770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleModelTextStyle = typing.Union[typing.Literal["normal", "italic"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model_text_transform.py000066400000000000000000000002571523660243400334570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleModelTextTransform = typing.Union[typing.Literal["none", "uppercase"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_model_text_weight.py000066400000000000000000000002601523660243400327250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleModelTextWeight = typing.Union[typing.Literal["normal", "bold", "900"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_section_animation_model.py000066400000000000000000000015711523660243400341030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_section_animation_model_enter_type import CaptionStyleSectionAnimationModelEnterType from .caption_style_section_animation_model_exit_type import CaptionStyleSectionAnimationModelExitType class CaptionStyleSectionAnimationModel(UncheckedBaseModel): enter_type: CaptionStyleSectionAnimationModelEnterType exit_type: CaptionStyleSectionAnimationModelExitType 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 caption_style_section_animation_model_enter_type.py000066400000000000000000000004151523660243400362560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleSectionAnimationModelEnterType = typing.Union[ typing.Literal["none", "fade", "scale", "pop", "slide_up", "slide_down", "slam", "scale_down", "slide_in"], typing.Any, ] caption_style_section_animation_model_exit_type.py000066400000000000000000000004141523660243400361110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleSectionAnimationModelExitType = typing.Union[ typing.Literal["none", "fade", "scale", "pop", "slide_up", "slide_down", "slam", "scale_down", "slide_in"], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_template_model.py000066400000000000000000000011751523660243400322130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CaptionStyleTemplateModel(UncheckedBaseModel): key: str label: str requires_high_fps: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_vertical_placement_model.py000066400000000000000000000013441523660243400342370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_vertical_placement_model_align import CaptionStyleVerticalPlacementModelAlign class CaptionStyleVerticalPlacementModel(UncheckedBaseModel): align: CaptionStyleVerticalPlacementModelAlign translate_pct: float 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 caption_style_vertical_placement_model_align.py000066400000000000000000000002761523660243400353350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleVerticalPlacementModelAlign = typing.Union[typing.Literal["top", "center", "bottom"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/caption_style_word_animation_model.py000066400000000000000000000015441523660243400334120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_word_animation_model_enter_type import CaptionStyleWordAnimationModelEnterType from .caption_style_word_animation_model_exit_type import CaptionStyleWordAnimationModelExitType class CaptionStyleWordAnimationModel(UncheckedBaseModel): enter_type: CaptionStyleWordAnimationModelEnterType exit_type: CaptionStyleWordAnimationModelExitType 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 caption_style_word_animation_model_enter_type.py000066400000000000000000000004121523660243400355620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleWordAnimationModelEnterType = typing.Union[ typing.Literal["none", "fade", "scale", "pop", "slide_up", "slide_down", "slam", "scale_down", "slide_in"], typing.Any, ] caption_style_word_animation_model_exit_type.py000066400000000000000000000004111523660243400354150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CaptionStyleWordAnimationModelExitType = typing.Union[ typing.Literal["none", "fade", "scale", "pop", "slide_up", "slide_down", "slam", "scale_down", "slide_in"], typing.Any, ] chapter_content_block_extendable_node_response_model.py000066400000000000000000000012221523660243400370250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ChapterContentBlockExtendableNodeResponseModel(UncheckedBaseModel): """ Not used. Make sure you anticipate new types in the future. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_content_block_input_model.py000066400000000000000000000016511523660243400332130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_content_block_input_model_sub_type import ChapterContentBlockInputModelSubType from .chapter_content_paragraph_tts_node_input_model import ChapterContentParagraphTtsNodeInputModel class ChapterContentBlockInputModel(UncheckedBaseModel): sub_type: typing.Optional[ChapterContentBlockInputModelSubType] = None nodes: typing.List[ChapterContentParagraphTtsNodeInputModel] block_id: 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 chapter_content_block_input_model_sub_type.py000066400000000000000000000002671523660243400350500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ChapterContentBlockInputModelSubType = typing.Union[typing.Literal["p", "h1", "h2", "h3"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_content_block_response_model.py000066400000000000000000000013571523660243400337150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_content_block_response_model_nodes_item import ChapterContentBlockResponseModelNodesItem class ChapterContentBlockResponseModel(UncheckedBaseModel): block_id: str nodes: typing.List[ChapterContentBlockResponseModelNodesItem] 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 chapter_content_block_response_model_nodes_item.py000066400000000000000000000026451523660243400360450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class ChapterContentBlockResponseModelNodesItem_TtsNode(UncheckedBaseModel): type: typing.Literal["tts_node"] = "tts_node" project_voice_ref_id: str text: str voice_id: 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 class ChapterContentBlockResponseModelNodesItem_Other(UncheckedBaseModel): type: typing.Literal["_other"] = "_other" 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 ChapterContentBlockResponseModelNodesItem = typing_extensions.Annotated[ typing.Union[ChapterContentBlockResponseModelNodesItem_TtsNode, ChapterContentBlockResponseModelNodesItem_Other], UnionMetadata(discriminant="type"), ] chapter_content_block_tts_node_response_model.py000066400000000000000000000012211523660243400355230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ChapterContentBlockTtsNodeResponseModel(UncheckedBaseModel): project_voice_ref_id: str text: str voice_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_content_input_model.py000066400000000000000000000012601523660243400320350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_content_block_input_model import ChapterContentBlockInputModel class ChapterContentInputModel(UncheckedBaseModel): blocks: typing.List[ChapterContentBlockInputModel] 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 chapter_content_paragraph_tts_node_input_model.py000066400000000000000000000012161523660243400357030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ChapterContentParagraphTtsNodeInputModel(UncheckedBaseModel): type: typing.Literal["tts_node"] = "tts_node" text: str voice_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_content_response_model.py000066400000000000000000000012741523660243400325410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_content_block_response_model import ChapterContentBlockResponseModel class ChapterContentResponseModel(UncheckedBaseModel): blocks: typing.List[ChapterContentBlockResponseModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_response.py000066400000000000000000000037361523660243400276340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_state import ChapterState from .chapter_statistics_response import ChapterStatisticsResponse class ChapterResponse(UncheckedBaseModel): chapter_id: str = pydantic.Field() """ The ID of the chapter. """ name: str = pydantic.Field() """ The name of the chapter. """ last_conversion_date_unix: typing.Optional[int] = pydantic.Field(default=None) """ The last conversion date of the chapter. """ conversion_progress: typing.Optional[float] = pydantic.Field(default=None) """ The conversion progress of the chapter. """ can_be_downloaded: bool = pydantic.Field() """ Whether the chapter can be downloaded. """ state: ChapterState = pydantic.Field() """ The state of the chapter. """ has_video: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the chapter has a video. """ has_visual_content: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the chapter has any visual content (video, image, or text clips). """ voice_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of voice ids used by the chapter """ statistics: typing.Optional[ChapterStatisticsResponse] = pydantic.Field(default=None) """ The statistics of the chapter. """ last_conversion_error: typing.Optional[str] = pydantic.Field(default=None) """ The last conversion error of the chapter. """ 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 chapter_snapshot_extended_response_model.py000066400000000000000000000022051523660243400345220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_model import CharacterAlignmentModel class ChapterSnapshotExtendedResponseModel(UncheckedBaseModel): chapter_snapshot_id: str = pydantic.Field() """ The ID of the chapter snapshot. """ project_id: str = pydantic.Field() """ The ID of the project. """ chapter_id: str = pydantic.Field() """ The ID of the chapter. """ created_at_unix: int = pydantic.Field() """ The creation date of the chapter snapshot. """ name: str = pydantic.Field() """ The name of the chapter snapshot. """ character_alignments: typing.List[CharacterAlignmentModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_snapshot_response.py000066400000000000000000000017711523660243400315500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ChapterSnapshotResponse(UncheckedBaseModel): chapter_snapshot_id: str = pydantic.Field() """ The ID of the chapter snapshot. """ project_id: str = pydantic.Field() """ The ID of the project. """ chapter_id: str = pydantic.Field() """ The ID of the chapter. """ created_at_unix: int = pydantic.Field() """ The creation date of the chapter snapshot. """ name: str = pydantic.Field() """ The name of the chapter snapshot. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_snapshots_response.py000066400000000000000000000013411523660243400317240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_snapshot_response import ChapterSnapshotResponse class ChapterSnapshotsResponse(UncheckedBaseModel): snapshots: typing.List[ChapterSnapshotResponse] = pydantic.Field() """ List of chapter snapshots. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_state.py000066400000000000000000000002411523660243400271020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ChapterState = typing.Union[typing.Literal["default", "converting"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_statistics_response.py000066400000000000000000000025761523660243400321070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice_statistics_response_model import VoiceStatisticsResponseModel class ChapterStatisticsResponse(UncheckedBaseModel): characters_unconverted: int = pydantic.Field() """ The number of unconverted characters. """ characters_converted: int = pydantic.Field() """ The number of converted characters. """ paragraphs_converted: int = pydantic.Field() """ The number of converted paragraphs. """ paragraphs_unconverted: int = pydantic.Field() """ The number of unconverted paragraphs. """ credits_needed_to_convert: typing.Optional[int] = pydantic.Field(default=None) """ The number of credits needed to convert the remaining paragraphs. """ voice_statistics: typing.Optional[typing.List[VoiceStatisticsResponseModel]] = pydantic.Field(default=None) """ Per-voice breakdown of character counts. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chapter_with_content_response_model.py000066400000000000000000000042541523660243400335750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_content_response_model import ChapterContentResponseModel from .chapter_statistics_response import ChapterStatisticsResponse from .chapter_with_content_response_model_state import ChapterWithContentResponseModelState class ChapterWithContentResponseModel(UncheckedBaseModel): chapter_id: str = pydantic.Field() """ The ID of the chapter. """ name: str = pydantic.Field() """ The name of the chapter. """ last_conversion_date_unix: typing.Optional[int] = pydantic.Field(default=None) """ The last conversion date of the chapter. """ conversion_progress: typing.Optional[float] = pydantic.Field(default=None) """ The conversion progress of the chapter. """ can_be_downloaded: bool = pydantic.Field() """ Whether the chapter can be downloaded. """ state: ChapterWithContentResponseModelState = pydantic.Field() """ The state of the chapter. """ has_video: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the chapter has a video. """ has_visual_content: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the chapter has any visual content (video, image, or text clips). """ voice_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of voice ids used by the chapter """ statistics: typing.Optional[ChapterStatisticsResponse] = pydantic.Field(default=None) """ The statistics of the chapter. """ last_conversion_error: typing.Optional[str] = pydantic.Field(default=None) """ The last conversion error of the chapter. """ content: ChapterContentResponseModel 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 chapter_with_content_response_model_state.py000066400000000000000000000002711523660243400347110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ChapterWithContentResponseModelState = typing.Union[typing.Literal["default", "converting"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_age.py000066400000000000000000000002471523660243400270320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CharacterAge = typing.Union[typing.Literal["young", "middle_aged", "old"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_alignment_model.py000066400000000000000000000012661523660243400314360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CharacterAlignmentModel(UncheckedBaseModel): characters: typing.List[str] character_start_times_seconds: typing.List[float] character_end_times_seconds: typing.List[float] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_alignment_response_model.py000066400000000000000000000012761523660243400333550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CharacterAlignmentResponseModel(UncheckedBaseModel): characters: typing.List[str] character_start_times_seconds: typing.List[float] character_end_times_seconds: typing.List[float] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_gender.py000066400000000000000000000002501523660243400275340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CharacterGender = typing.Union[typing.Literal["male", "female", "neutral"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_metadata_response_model.py000066400000000000000000000020131523660243400331450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .character_age import CharacterAge from .character_gender import CharacterGender from .character_role import CharacterRole class CharacterMetadataResponseModel(UncheckedBaseModel): description: typing.Optional[str] = None sample_message: typing.Optional[str] = None voice_creation_prompt_suggestion: typing.Optional[str] = None gender: typing.Optional[CharacterGender] = None age: typing.Optional[CharacterAge] = None accent: typing.Optional[str] = None role: typing.Optional[CharacterRole] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_refresh_period.py000066400000000000000000000003371523660243400312760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CharacterRefreshPeriod = typing.Union[ typing.Literal["monthly_period", "3_month_period", "6_month_period", "annual_period"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_response_model.py000066400000000000000000000014451523660243400313150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .character_metadata_response_model import CharacterMetadataResponseModel class CharacterResponseModel(UncheckedBaseModel): character_id: str name: str metadata: typing.Optional[CharacterMetadataResponseModel] = None recommended_voice_ids: typing.Optional[typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_role.py000066400000000000000000000002641523660243400272360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CharacterRole = typing.Union[typing.Literal["narrator", "main", "supporting", "minor"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/character_usage_response.py000066400000000000000000000001641523660243400313160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CharacterUsageResponse = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/chat_source_medium.py000066400000000000000000000002561523660243400301210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ChatSourceMedium = typing.Union[typing.Literal["audio", "text", "image", "file"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/check_service_availability_params.py000066400000000000000000000012121523660243400331450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CheckServiceAvailabilityParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["check_service_availability"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/client_event.py000066400000000000000000000015771523660243400267500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ClientEvent = typing.Union[ typing.Literal[ "conversation_initiation_metadata", "asr_initiation_metadata", "ping", "audio", "interruption", "user_transcript", "tentative_user_transcript", "agent_response", "agent_response_correction", "client_tool_call", "mcp_tool_call", "mcp_connection_status", "agent_tool_request", "agent_tool_response", "agent_tool_response_full_payload", "agent_response_metadata", "vad_score", "agent_chat_response_part", "client_error", "guardrail_triggered", "dtmf_request", "agent_response_complete", "internal_turn_probability", "internal_tentative_agent_response", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/client_tool_config_input.py000066400000000000000000000131111523660243400313330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class ClientToolConfigInput(UncheckedBaseModel): """ A client tool is one that sends an event to the user's client to trigger something client side """ name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 120 seconds (inclusive). """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = pydantic.Field(default=None) """ Schema for any parameters to pass to the client """ expects_response: typing.Optional[bool] = pydantic.Field(default=None) """ If true, calling this tool should block the conversation until the client responds with some response which is passed to the llm. If false then we will continue the conversation without waiting for the client to respond, this is useful to show content to a user but not block the conversation """ dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ 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 from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( ClientToolConfigInput, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/client_tool_config_output.py000066400000000000000000000131341523660243400315410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class ClientToolConfigOutput(UncheckedBaseModel): """ A client tool is one that sends an event to the user's client to trigger something client side """ name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 120 seconds (inclusive). """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = pydantic.Field(default=None) """ Schema for any parameters to pass to the client """ expects_response: typing.Optional[bool] = pydantic.Field(default=None) """ If true, calling this tool should block the conversation until the client responds with some response which is passed to the llm. If false then we will continue the conversation without waiting for the client to respond, this is useful to show content to a user but not block the conversation """ dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ 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 from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( ClientToolConfigOutput, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/clip_animation.py000066400000000000000000000016141523660243400272470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .clip_animation_enter_effect import ClipAnimationEnterEffect from .clip_animation_exit_effect import ClipAnimationExitEffect class ClipAnimation(UncheckedBaseModel): enter_effect: typing.Optional[ClipAnimationEnterEffect] = None enter_duration_ms: typing.Optional[int] = None exit_effect: typing.Optional[ClipAnimationExitEffect] = None exit_duration_ms: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/clip_animation_enter_effect.py000066400000000000000000000006621523660243400317620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ClipAnimationEnterEffect = typing.Union[ typing.Literal[ "none", "fade", "float", "gentle_float", "zoom_in", "drop", "slide_left", "slide_right", "slide_up", "slide_down", "pop", "bounce", "spin", "slide_bounce", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/clip_animation_exit_effect.py000066400000000000000000000006611523660243400316150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ClipAnimationExitEffect = typing.Union[ typing.Literal[ "none", "fade", "float", "gentle_float", "zoom_in", "drop", "slide_left", "slide_right", "slide_up", "slide_down", "pop", "bounce", "spin", "slide_bounce", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/close_connection.py000066400000000000000000000012251523660243400276030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CloseConnection(UncheckedBaseModel): text: typing.Literal[""] = pydantic.Field(default="") """ End the stream with an empty string """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/close_context.py000066400000000000000000000021131523660243400271250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CloseContext(UncheckedBaseModel): """ Payload to close a specific TTS context. """ context_id: str = pydantic.Field() """ The context_id to close. """ close_context: bool = pydantic.Field() """ Must set the close_context to true, to close the specified context. If false, the context will remain open and the text will be ignored. If set to true, the context will close. If it has already been set to flush it will continue flushing. The same context id can be used again but will not be linked to the previous context with the same name. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/close_payload.py000066400000000000000000000013611523660243400270760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ClosePayload(UncheckedBaseModel): """ Payload indicating a clean end-of-conversation signal from ElevenLabs. """ type: typing.Literal["close"] = pydantic.Field(default="close") """ The message type identifier. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/close_socket.py000066400000000000000000000015431523660243400267370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CloseSocket(UncheckedBaseModel): """ Payload to signal closing the entire WebSocket connection. """ close_socket: typing.Optional[bool] = pydantic.Field(default=None) """ If true, closes all contexts and closes the entire WebSocket connection. Any context that was previously set to flush will wait to flush before closing. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/column_filter.py000066400000000000000000000014171523660243400271240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .column_filter_operation import ColumnFilterOperation from .column_filter_values_item import ColumnFilterValuesItem class ColumnFilter(UncheckedBaseModel): column: str operation: ColumnFilterOperation values: typing.List[typing.Optional[ColumnFilterValuesItem]] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/column_filter_operation.py000066400000000000000000000003061523660243400312000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ColumnFilterOperation = typing.Union[typing.Literal["in", "not_in", "le", "ge", "lt", "gt", "eq", "neq"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/column_filter_values_item.py000066400000000000000000000002601523660243400315140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing ColumnFilterValuesItem = typing.Union[str, int, float, dt.datetime, bool] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/column_unit.py000066400000000000000000000003441523660243400266140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ColumnUnit = typing.Union[ typing.Literal["ms", "s", "min", "duration", "credits", "usd", "eur", "inr", "pln", "ratio", "rating"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/committed_transcript_entities_payload.py000066400000000000000000000021351523660243400341330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .detected_entity import DetectedEntity class CommittedTranscriptEntitiesPayload(UncheckedBaseModel): """ Payload for detected entities on a committed transcript. """ message_type: typing.Literal["committed_transcript_entities"] = pydantic.Field( default="committed_transcript_entities" ) """ The message type identifier. """ text: str = pydantic.Field() """ The committed transcript text the entities were detected in. """ entities: typing.List[DetectedEntity] = pydantic.Field() """ Detected entities. Empty if none were found. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/committed_transcript_payload.py000066400000000000000000000015371523660243400322340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CommittedTranscriptPayload(UncheckedBaseModel): """ Payload for committed transcription results. """ message_type: typing.Literal["committed_transcript"] = pydantic.Field(default="committed_transcript") """ The message type identifier. """ text: str = pydantic.Field() """ Committed transcription text. """ 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 committed_transcript_with_timestamps_payload.py000066400000000000000000000024001523660243400354440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transcription_word import TranscriptionWord class CommittedTranscriptWithTimestampsPayload(UncheckedBaseModel): """ Payload for committed transcription results with word-level timestamps. """ message_type: typing.Literal["committed_transcript_with_timestamps"] = pydantic.Field( default="committed_transcript_with_timestamps" ) """ The message type identifier. """ text: str = pydantic.Field() """ Committed transcription text. """ language_code: typing.Optional[str] = pydantic.Field(default=None) """ Detected or specified language code. """ words: typing.Optional[typing.List[TranscriptionWord]] = pydantic.Field(default=None) """ Word-level information with timestamps. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/compile_procedures_response_model.py000066400000000000000000000015331523660243400332420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_workflow_response_model import AgentWorkflowResponseModel class CompileProceduresResponseModel(UncheckedBaseModel): workflow: AgentWorkflowResponseModel = pydantic.Field() """ Generated workflow from compilation """ 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 update_forward_refs(CompileProceduresResponseModel) compile_procedures_validation_error_response_model.py000066400000000000000000000014261523660243400366070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_validation_error import ProcedureValidationError class CompileProceduresValidationErrorResponseModel(UncheckedBaseModel): errors: typing.Dict[str, typing.List[ProcedureValidationError]] = pydantic.Field() """ Validation errors keyed by procedure ID. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/composition_plan.py000066400000000000000000000015501523660243400276350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .composition_plan_chunks_item import CompositionPlanChunksItem class CompositionPlan(UncheckedBaseModel): """ Composition plan for the `music_v2` model. Using this field with any other model will result in an error. """ chunks: typing.List[CompositionPlanChunksItem] = pydantic.Field() """ The chunks that make up the generation. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/composition_plan_chunks_item.py000066400000000000000000000004031523660243400322220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .audio_ref_chunk import AudioRefChunk from .generation_chunk_input import GenerationChunkInput CompositionPlanChunksItem = typing.Union[GenerationChunkInput, AudioRefChunk] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/config_entity_type.py000066400000000000000000000037131523660243400301650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConfigEntityType = typing.Union[ typing.Literal[ "name", "name.name_given", "name.name_family", "name.name_other", "email_address", "contact_number", "dob", "age", "religious_belief", "political_opinion", "sexual_orientation", "ethnicity_race", "marital_status", "occupation", "physical_attribute", "language", "username", "password", "url", "organization", "financial_id", "financial_id.payment_card", "financial_id.payment_card.payment_card_number", "financial_id.payment_card.payment_card_expiration_date", "financial_id.payment_card.payment_card_cvv", "financial_id.bank_account", "financial_id.bank_account.bank_account_number", "financial_id.bank_account.bank_routing_number", "financial_id.bank_account.swift_bic_code", "financial_id.financial_id_other", "location", "location.location_address", "location.location_city", "location.location_postal_code", "location.location_coordinate", "location.location_state", "location.location_country", "location.location_other", "date", "date_interval", "unique_id", "unique_id.government_issued_id", "unique_id.account_number", "unique_id.vehicle_id", "unique_id.healthcare_number", "unique_id.healthcare_number.medical_record_number", "unique_id.healthcare_number.health_plan_beneficiary_number", "unique_id.device_id", "unique_id.unique_id_other", "medical", "medical.medical_condition", "medical.medication", "medical.medical_procedure", "medical.medical_measurement", "medical.medical_other", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conflict_section.py000066400000000000000000000003271523660243400276060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConflictSection = typing.Union[ typing.Literal["conversation_config", "platform_settings", "procedures", "workflow"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/constant_schema_override.py000066400000000000000000000013741523660243400313340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class ConstantSchemaOverride(UncheckedBaseModel): constant_value: ConstantSchemaOverrideConstantValue = pydantic.Field() """ The constant value to use """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/constant_schema_override_constant_value.py000066400000000000000000000003271523660243400344360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConstantSchemaOverrideConstantValue = typing.Union[ str, int, float, bool, typing.List[typing.Any], typing.Dict[str, typing.Any] ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_config.py000066400000000000000000000021071523660243400272560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_threshold_guardrail import ContentThresholdGuardrail class ContentConfig(UncheckedBaseModel): sexual: typing.Optional[ContentThresholdGuardrail] = None violence: typing.Optional[ContentThresholdGuardrail] = None harassment: typing.Optional[ContentThresholdGuardrail] = None self_harm: typing.Optional[ContentThresholdGuardrail] = None profanity: typing.Optional[ContentThresholdGuardrail] = None religion_or_politics: typing.Optional[ContentThresholdGuardrail] = None medical_and_legal_information: typing.Optional[ContentThresholdGuardrail] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_format.py000066400000000000000000000002351523660243400273010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ContentFormat = typing.Union[typing.Literal["html", "markdown"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_guardrail_input.py000066400000000000000000000016531523660243400312070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_config import ContentConfig from .content_guardrail_input_trigger_action import ContentGuardrailInputTriggerAction from .guardrail_execution_mode import GuardrailExecutionMode class ContentGuardrailInput(UncheckedBaseModel): execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ContentConfig] = None trigger_action: typing.Optional[ContentGuardrailInputTriggerAction] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_guardrail_input_trigger_action.py000066400000000000000000000025241523660243400342650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class ContentGuardrailInputTriggerAction_EndCall(UncheckedBaseModel): 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 ContentGuardrailInputTriggerAction_Retry(UncheckedBaseModel): type: typing.Literal["retry"] = "retry" feedback: 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 ContentGuardrailInputTriggerAction = typing_extensions.Annotated[ typing.Union[ContentGuardrailInputTriggerAction_EndCall, ContentGuardrailInputTriggerAction_Retry], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_guardrail_output.py000066400000000000000000000016571523660243400314140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_config import ContentConfig from .content_guardrail_output_trigger_action import ContentGuardrailOutputTriggerAction from .guardrail_execution_mode import GuardrailExecutionMode class ContentGuardrailOutput(UncheckedBaseModel): execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ContentConfig] = None trigger_action: typing.Optional[ContentGuardrailOutputTriggerAction] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_guardrail_output_trigger_action.py000066400000000000000000000025311523660243400344640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class ContentGuardrailOutputTriggerAction_EndCall(UncheckedBaseModel): 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 ContentGuardrailOutputTriggerAction_Retry(UncheckedBaseModel): type: typing.Literal["retry"] = "retry" feedback: 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 ContentGuardrailOutputTriggerAction = typing_extensions.Annotated[ typing.Union[ContentGuardrailOutputTriggerAction_EndCall, ContentGuardrailOutputTriggerAction_Retry], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_threshold_guardrail.py000066400000000000000000000013721523660243400320420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_threshold_guardrail_threshold import ContentThresholdGuardrailThreshold class ContentThresholdGuardrail(UncheckedBaseModel): is_enabled: typing.Optional[bool] = None threshold: typing.Optional[ContentThresholdGuardrailThreshold] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/content_threshold_guardrail_threshold.py000066400000000000000000000003301523660243400341070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ContentThresholdGuardrailThreshold = typing.Union[ float, typing.Literal["low"], typing.Literal["medium"], typing.Literal["high"] ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/contextual_update_info.py000066400000000000000000000015371523660243400310300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ContextualUpdateInfo(UncheckedBaseModel): context_id: str = pydantic.Field() """ Client-supplied identifier grouping related contextual updates. """ is_superseded: typing.Optional[bool] = pydantic.Field(default=None) """ True when this contextual update has been replaced by a newer update with the same context_id. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/contributor.py000066400000000000000000000012141523660243400266270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class Contributor(UncheckedBaseModel): name: str role: str bio: typing.Optional[str] = None profile_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_dynamic_variable.py000066400000000000000000000011731523660243400312500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvAiDynamicVariable(UncheckedBaseModel): """ Used to reference a dynamic variable. """ variable_name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_env_var_locator.py000066400000000000000000000012071523660243400311400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvAiEnvVarLocator(UncheckedBaseModel): """ Used to reference an environment variable by label. """ env_var_label: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_file_upload_response_model.py000066400000000000000000000011021523660243400333300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvAiFileUploadResponseModel(UncheckedBaseModel): file_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_secret_locator.py000066400000000000000000000012111523660243400307600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvAiSecretLocator(UncheckedBaseModel): """ Used to reference a secret from the agent's secret store. """ secret_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_stored_secret_dependencies.py000066400000000000000000000035161523660243400333350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_stored_secret_dependencies_agents_item import ConvAiStoredSecretDependenciesAgentsItem from .conv_ai_stored_secret_dependencies_mcp_servers_item import ConvAiStoredSecretDependenciesMcpServersItem from .conv_ai_stored_secret_dependencies_tools_item import ConvAiStoredSecretDependenciesToolsItem from .dependent_phone_number_identifier import DependentPhoneNumberIdentifier from .secret_dependency_type import SecretDependencyType class ConvAiStoredSecretDependencies(UncheckedBaseModel): tools: typing.List[ConvAiStoredSecretDependenciesToolsItem] tools_has_more: typing.Optional[bool] = pydantic.Field(default=None) """ Whether there are more tool dependents beyond the returned preview """ agents: typing.List[ConvAiStoredSecretDependenciesAgentsItem] agents_has_more: typing.Optional[bool] = pydantic.Field(default=None) """ Whether there are more agent dependents beyond the returned preview """ phone_numbers: typing.Optional[typing.List[DependentPhoneNumberIdentifier]] = None phone_numbers_has_more: typing.Optional[bool] = pydantic.Field(default=None) """ Whether there are more phone number dependents beyond the returned preview """ mcp_servers: typing.Optional[typing.List[ConvAiStoredSecretDependenciesMcpServersItem]] = None others: typing.List[SecretDependencyType] 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 conv_ai_stored_secret_dependencies_agents_item.py000066400000000000000000000033211523660243400356270ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class ConvAiStoredSecretDependenciesAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 ConvAiStoredSecretDependenciesAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 ConvAiStoredSecretDependenciesAgentsItem = typing_extensions.Annotated[ typing.Union[ConvAiStoredSecretDependenciesAgentsItem_Available, ConvAiStoredSecretDependenciesAgentsItem_Unknown], UnionMetadata(discriminant="type"), ] conv_ai_stored_secret_dependencies_mcp_servers_item.py000066400000000000000000000031641523660243400367030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_mcp_server_identifier_access_level import DependentAvailableMcpServerIdentifierAccessLevel class ConvAiStoredSecretDependenciesMcpServersItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" id: str name: str created_at_unix_secs: int access_level: DependentAvailableMcpServerIdentifierAccessLevel 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 ConvAiStoredSecretDependenciesMcpServersItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" 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 ConvAiStoredSecretDependenciesMcpServersItem = typing_extensions.Annotated[ typing.Union[ ConvAiStoredSecretDependenciesMcpServersItem_Available, ConvAiStoredSecretDependenciesMcpServersItem_Unknown ], UnionMetadata(discriminant="type"), ] conv_ai_stored_secret_dependencies_tools_item.py000066400000000000000000000030751523660243400355140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel class ConvAiStoredSecretDependenciesToolsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" id: str name: str created_at_unix_secs: int access_level: DependentAvailableToolIdentifierAccessLevel 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 ConvAiStoredSecretDependenciesToolsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" 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 ConvAiStoredSecretDependenciesToolsItem = typing_extensions.Annotated[ typing.Union[ConvAiStoredSecretDependenciesToolsItem_Available, ConvAiStoredSecretDependenciesToolsItem_Unknown], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_user_secret_db_model.py000066400000000000000000000013221523660243400321230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvAiUserSecretDbModel(UncheckedBaseModel): """ User-specific secret model that are not shared with other users in a workspace. """ name: str encrypted_value: str nonce: str 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_webhooks.py000066400000000000000000000024371523660243400276040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .webhook_event_type import WebhookEventType from .webhook_transcript_format import WebhookTranscriptFormat class ConvAiWebhooks(UncheckedBaseModel): post_call_webhook_id: typing.Optional[str] = None events: typing.Optional[typing.List[WebhookEventType]] = pydantic.Field(default=None) """ List of event types to send via webhook. Options: transcript, audio, call_initiation_failure, unredacted_transcript, unredacted_audio. """ transcript_format: typing.Optional[WebhookTranscriptFormat] = pydantic.Field(default=None) """ Format for transcript webhooks. """ send_audio: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: Use 'events' field instead. Whether to send audio data with post-call webhooks for ConvAI conversations """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conv_ai_workspace_stored_secret_config.py000066400000000000000000000013771523660243400342350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_stored_secret_dependencies import ConvAiStoredSecretDependencies class ConvAiWorkspaceStoredSecretConfig(UncheckedBaseModel): type: typing.Literal["stored"] = "stored" secret_id: str name: str used_by: ConvAiStoredSecretDependencies 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_asr_usage_model.py000066400000000000000000000014541523660243400322060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationAsrUsageModel(UncheckedBaseModel): """ Aggregated ASR usage for a conversation (analytics-only, not billing). """ asr_model: typing.Optional[str] = None total_transcription_calls: typing.Optional[int] = None total_audio_input_seconds: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_charging_common_model.py000066400000000000000000000031201523660243400333570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_charging import AnalysisCharging from .conversation_asr_usage_model import ConversationAsrUsageModel from .conversation_tts_usage_model import ConversationTtsUsageModel from .llm_category_usage import LlmCategoryUsage from .platform_usage import PlatformUsage class ConversationChargingCommonModel(UncheckedBaseModel): dev_discount: typing.Optional[bool] = None is_burst: typing.Optional[bool] = None tier: typing.Optional[str] = None llm_usage: typing.Optional[LlmCategoryUsage] = None llm_price: typing.Optional[float] = None llm_charge: typing.Optional[int] = None call_charge: typing.Optional[int] = None platform_charge: typing.Optional[int] = None platform_usage: typing.Optional[PlatformUsage] = None platform_price: typing.Optional[float] = None free_minutes_consumed: typing.Optional[float] = None free_llm_dollars_consumed: typing.Optional[float] = None tts_usage: typing.Optional[ConversationTtsUsageModel] = None asr_usage: typing.Optional[ConversationAsrUsageModel] = None analysis: typing.Optional[AnalysisCharging] = 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 conversation_config_client_override_config_input.py000066400000000000000000000033121523660243400362370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_override_config import AgentConfigOverrideConfig from .asr_conversational_config_override_config import AsrConversationalConfigOverrideConfig from .conversation_config_override_config import ConversationConfigOverrideConfig from .tts_conversational_config_override_config import TtsConversationalConfigOverrideConfig from .turn_config_override_config import TurnConfigOverrideConfig class ConversationConfigClientOverrideConfigInput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ turn: typing.Optional[TurnConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ tts: typing.Optional[TtsConversationalConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ conversation: typing.Optional[ConversationConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ agent: typing.Optional[AgentConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ 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 conversation_config_client_override_config_output.py000066400000000000000000000033131523660243400364410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_override_config import AgentConfigOverrideConfig from .asr_conversational_config_override_config import AsrConversationalConfigOverrideConfig from .conversation_config_override_config import ConversationConfigOverrideConfig from .tts_conversational_config_override_config import TtsConversationalConfigOverrideConfig from .turn_config_override_config import TurnConfigOverrideConfig class ConversationConfigClientOverrideConfigOutput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ turn: typing.Optional[TurnConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ tts: typing.Optional[TtsConversationalConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ conversation: typing.Optional[ConversationConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ agent: typing.Optional[AgentConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ 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 conversation_config_client_override_input.py000066400000000000000000000031621523660243400347150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_override_input import AgentConfigOverrideInput from .asr_conversational_config_override import AsrConversationalConfigOverride from .conversation_config_override import ConversationConfigOverride from .tts_conversational_config_override import TtsConversationalConfigOverride from .turn_config_override import TurnConfigOverride class ConversationConfigClientOverrideInput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational transcription """ turn: typing.Optional[TurnConfigOverride] = pydantic.Field(default=None) """ Configuration for turn detection """ tts: typing.Optional[TtsConversationalConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational text to speech """ conversation: typing.Optional[ConversationConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational events """ agent: typing.Optional[AgentConfigOverrideInput] = pydantic.Field(default=None) """ Agent specific configuration """ 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 conversation_config_client_override_output.py000066400000000000000000000031661523660243400351220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_override_output import AgentConfigOverrideOutput from .asr_conversational_config_override import AsrConversationalConfigOverride from .conversation_config_override import ConversationConfigOverride from .tts_conversational_config_override import TtsConversationalConfigOverride from .turn_config_override import TurnConfigOverride class ConversationConfigClientOverrideOutput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational transcription """ turn: typing.Optional[TurnConfigOverride] = pydantic.Field(default=None) """ Configuration for turn detection """ tts: typing.Optional[TtsConversationalConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational text to speech """ conversation: typing.Optional[ConversationConfigOverride] = pydantic.Field(default=None) """ Configuration for conversational events """ agent: typing.Optional[AgentConfigOverrideOutput] = pydantic.Field(default=None) """ Agent specific configuration """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_config_input.py000066400000000000000000000040201523660243400315310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_config import BackgroundSoundConfig from .client_event import ClientEvent from .file_input_config import FileInputConfig class ConversationConfigInput(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled audio will not be processed and only text will be used, use to avoid audio pricing. """ max_duration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ The maximum duration of a conversation in seconds """ client_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to the client """ file_input: typing.Optional[FileInputConfig] = pydantic.Field(default=None) """ Configuration for file input (image/PDF uploads) during conversations. """ monitoring_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Enable real-time monitoring of conversations via WebSocket """ monitoring_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to monitoring connections. """ background_sound: typing.Optional[BackgroundSoundConfig] = pydantic.Field(default=None) """ Configuration for background sound during conversations. """ source_attribution: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and knowledge base content is present, the LLM is instructed to report which sources it used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_config_output.py000066400000000000000000000040211523660243400317330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_config import BackgroundSoundConfig from .client_event import ClientEvent from .file_input_config import FileInputConfig class ConversationConfigOutput(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled audio will not be processed and only text will be used, use to avoid audio pricing. """ max_duration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ The maximum duration of a conversation in seconds """ client_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to the client """ file_input: typing.Optional[FileInputConfig] = pydantic.Field(default=None) """ Configuration for file input (image/PDF uploads) during conversations. """ monitoring_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Enable real-time monitoring of conversations via WebSocket """ monitoring_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to monitoring connections. """ background_sound: typing.Optional[BackgroundSoundConfig] = pydantic.Field(default=None) """ Configuration for background sound during conversations. """ source_attribution: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and knowledge base content is present, the LLM is instructed to report which sources it used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_config_override.py000066400000000000000000000015721523660243400322220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationConfigOverride(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled audio will not be processed and only text will be used, use to avoid audio pricing. """ max_duration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ The maximum duration of a conversation 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_config_override_config.py000066400000000000000000000015351523660243400335460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationConfigOverrideConfig(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the text_only field. """ max_duration_seconds: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the max_duration_seconds field. """ 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 conversation_config_workflow_override_input.py000066400000000000000000000042041523660243400353070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_config_workflow_override import BackgroundSoundConfigWorkflowOverride from .client_event import ClientEvent from .file_input_config_workflow_override import FileInputConfigWorkflowOverride class ConversationConfigWorkflowOverrideInput(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled audio will not be processed and only text will be used, use to avoid audio pricing. """ max_duration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ The maximum duration of a conversation in seconds """ client_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to the client """ file_input: typing.Optional[FileInputConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for file input (image/PDF uploads) during conversations. """ monitoring_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Enable real-time monitoring of conversations via WebSocket """ monitoring_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to monitoring connections. """ background_sound: typing.Optional[BackgroundSoundConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for background sound during conversations. """ source_attribution: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and knowledge base content is present, the LLM is instructed to report which sources it used. """ 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 conversation_config_workflow_override_output.py000066400000000000000000000042051523660243400355110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .background_sound_config_workflow_override import BackgroundSoundConfigWorkflowOverride from .client_event import ClientEvent from .file_input_config_workflow_override import FileInputConfigWorkflowOverride class ConversationConfigWorkflowOverrideOutput(UncheckedBaseModel): text_only: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled audio will not be processed and only text will be used, use to avoid audio pricing. """ max_duration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ The maximum duration of a conversation in seconds """ client_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to the client """ file_input: typing.Optional[FileInputConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for file input (image/PDF uploads) during conversations. """ monitoring_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Enable real-time monitoring of conversations via WebSocket """ monitoring_events: typing.Optional[typing.List[ClientEvent]] = pydantic.Field(default=None) """ The events that will be sent to monitoring connections. """ background_sound: typing.Optional[BackgroundSoundConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for background sound during conversations. """ source_attribution: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled and knowledge base content is present, the LLM is instructed to report which sources it used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_deletion_settings.py000066400000000000000000000016331523660243400325770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationDeletionSettings(UncheckedBaseModel): deletion_time_unix_secs: typing.Optional[int] = None deleted_logs_at_time_unix_secs: typing.Optional[int] = None deleted_audio_at_time_unix_secs: typing.Optional[int] = None deleted_transcript_at_time_unix_secs: typing.Optional[int] = None delete_transcript_and_pii: typing.Optional[bool] = None delete_audio: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_feedback_type.py000066400000000000000000000002501523660243400316330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConversationFeedbackType = typing.Union[typing.Literal["thumbs", "rating"], typing.Any] conversation_history_analysis_common_model.py000066400000000000000000000031641523660243400351320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_evaluation_criteria_result_common_model import ( ConversationHistoryEvaluationCriteriaResultCommonModel, ) from .data_collection_result_common_model import DataCollectionResultCommonModel from .evaluation_success_result import EvaluationSuccessResult from .scoped_analysis_result import ScopedAnalysisResult class ConversationHistoryAnalysisCommonModel(UncheckedBaseModel): evaluation_criteria_results: typing.Optional[ typing.Dict[str, ConversationHistoryEvaluationCriteriaResultCommonModel] ] = None data_collection_results: typing.Optional[typing.Dict[str, DataCollectionResultCommonModel]] = None evaluation_criteria_results_list: typing.Optional[ typing.List[ConversationHistoryEvaluationCriteriaResultCommonModel] ] = None data_collection_results_list: typing.Optional[typing.List[DataCollectionResultCommonModel]] = None call_successful: EvaluationSuccessResult call_success_score: typing.Optional[float] = None transcript_summary: str call_summary_title: typing.Optional[str] = None scoped: typing.Optional[typing.List[ScopedAnalysisResult]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_history_batch_call_model.py000066400000000000000000000011551523660243400340700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryBatchCallModel(UncheckedBaseModel): batch_call_id: str batch_call_recipient_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 conversation_history_eleven_assistant_common_model.py000066400000000000000000000011671523660243400366570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryElevenAssistantCommonModel(UncheckedBaseModel): is_eleven_assistant: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_history_error_common_model.py000066400000000000000000000011551523660243400345150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 conversation_history_evaluation_criteria_result_common_model.py000066400000000000000000000016341523660243400407360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .criteria_scoring_mode import CriteriaScoringMode from .evaluation_success_result import EvaluationSuccessResult class ConversationHistoryEvaluationCriteriaResultCommonModel(UncheckedBaseModel): criteria_id: str result: EvaluationSuccessResult rationale: str scoring_mode: typing.Optional[CriteriaScoringMode] = None score: typing.Optional[int] = None max_score: typing.Optional[int] = 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 conversation_history_exotel_phone_call_model.py000066400000000000000000000013771523660243400354270ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .telephony_direction import TelephonyDirection class ConversationHistoryExotelPhoneCallModel(UncheckedBaseModel): direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str stream_sid: str call_sid: 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 conversation_history_feedback_common_model.py000066400000000000000000000017101523660243400350260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_feedback_type import ConversationFeedbackType from .user_feedback_score import UserFeedbackScore class ConversationHistoryFeedbackCommonModel(UncheckedBaseModel): type: typing.Optional[ConversationFeedbackType] = None overall_score: typing.Optional[UserFeedbackScore] = None likes: typing.Optional[int] = None dislikes: typing.Optional[int] = None rating: typing.Optional[int] = None comment: 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 conversation_history_metadata_common_model.py000066400000000000000000000075161523660243400350740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_definition_source import AgentDefinitionSource from .async_conversation_metadata import AsyncConversationMetadata from .authorization_method import AuthorizationMethod from .conversation_charging_common_model import ConversationChargingCommonModel from .conversation_deletion_settings import ConversationDeletionSettings from .conversation_history_batch_call_model import ConversationHistoryBatchCallModel from .conversation_history_eleven_assistant_common_model import ConversationHistoryElevenAssistantCommonModel from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel from .conversation_history_feedback_common_model import ConversationHistoryFeedbackCommonModel from .conversation_history_metadata_common_model_phone_call import ConversationHistoryMetadataCommonModelPhoneCall from .conversation_history_rag_usage_common_model import ConversationHistoryRagUsageCommonModel from .conversation_initiation_source import ConversationInitiationSource from .conversation_voice_reward_model import ConversationVoiceRewardModel from .features_usage_common_model import FeaturesUsageCommonModel from .sms_conversation_info import SmsConversationInfo from .whats_app_conversation_info import WhatsAppConversationInfo 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 feedback: typing.Optional[ConversationHistoryFeedbackCommonModel] = None authorization_method: typing.Optional[AuthorizationMethod] = None charging: typing.Optional[ConversationChargingCommonModel] = None phone_call: typing.Optional[ConversationHistoryMetadataCommonModelPhoneCall] = None batch_call: typing.Optional[ConversationHistoryBatchCallModel] = None termination_reason: typing.Optional[str] = None error: typing.Optional[ConversationHistoryErrorCommonModel] = None warnings: typing.Optional[typing.List[str]] = None main_language: typing.Optional[str] = None rag_usage: typing.Optional[ConversationHistoryRagUsageCommonModel] = None text_only: typing.Optional[bool] = None features_usage: typing.Optional[FeaturesUsageCommonModel] = None eleven_assistant: typing.Optional[ConversationHistoryElevenAssistantCommonModel] = None initiator_id: typing.Optional[str] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None conversation_initiation_source_version: typing.Optional[str] = None timezone: typing.Optional[str] = None async_metadata: typing.Optional[AsyncConversationMetadata] = None whatsapp: typing.Optional[WhatsAppConversationInfo] = None sms: typing.Optional[SmsConversationInfo] = None agent_created_from: typing.Optional[AgentDefinitionSource] = None agent_last_updated_from: typing.Optional[AgentDefinitionSource] = None voice_rewards: typing.Optional[typing.List[ConversationVoiceRewardModel]] = None cost_fiat: typing.Optional[float] = pydantic.Field(default=None) """ Total fiat cost of the conversation in USD, i.e. the sum of the LLM price and the non-LLM platform price (the fiat analogue of ``cost``). ``None`` when neither is set (e.g. conversations that predate fiat cost tracking). """ 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 conversation_history_metadata_common_model_phone_call.py000066400000000000000000000047071523660243400372570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .telephony_direction import TelephonyDirection class ConversationHistoryMetadataCommonModelPhoneCall_Exotel(UncheckedBaseModel): type: typing.Literal["exotel"] = "exotel" direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str stream_sid: str call_sid: 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 ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking(UncheckedBaseModel): type: typing.Literal["sip_trunking"] = "sip_trunking" direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str call_id: typing.Optional[str] = None call_sid: str sip_header_dynamic_variables: typing.Optional[typing.Dict[str, 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 class ConversationHistoryMetadataCommonModelPhoneCall_Twilio(UncheckedBaseModel): type: typing.Literal["twilio"] = "twilio" direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str stream_sid: str call_sid: 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 ConversationHistoryMetadataCommonModelPhoneCall = typing_extensions.Annotated[ typing.Union[ ConversationHistoryMetadataCommonModelPhoneCall_Exotel, ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ], UnionMetadata(discriminant="type"), ] conversation_history_multivoice_message_model.py000066400000000000000000000014651523660243400356250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_multivoice_message_part_model import ConversationHistoryMultivoiceMessagePartModel class ConversationHistoryMultivoiceMessageModel(UncheckedBaseModel): """ Represents a message from a multi-voice agent. """ parts: typing.List[ConversationHistoryMultivoiceMessagePartModel] 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 conversation_history_multivoice_message_part_model.py000066400000000000000000000013751523660243400366530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryMultivoiceMessagePartModel(UncheckedBaseModel): """ Represents a single voice part of a multi-voice message. """ text: str voice_label: typing.Optional[str] = None time_in_call_secs: typing.Optional[int] = 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 conversation_history_rag_usage_common_model.py000066400000000000000000000011501523660243400352350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_history_redaction_config.py000066400000000000000000000020341523660243400341260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .config_entity_type import ConfigEntityType class ConversationHistoryRedactionConfig(UncheckedBaseModel): enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether conversation history redaction is enabled """ entities: typing.Optional[typing.List[ConfigEntityType]] = pydantic.Field(default=None) """ The entities to redact from the conversation transcript, audio and analysis. Use top-level types like 'name', 'email_address', or dot notation for specific subtypes like 'name.full_name'. """ 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 conversation_history_sip_trunking_phone_call_model.py000066400000000000000000000015511523660243400366350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .telephony_direction import TelephonyDirection class ConversationHistorySipTrunkingPhoneCallModel(UncheckedBaseModel): direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str call_id: typing.Optional[str] = None call_sid: str sip_header_dynamic_variables: typing.Optional[typing.Dict[str, 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 conversation_history_transcript_api_integration_webhook_tools_result_common_model_input.py000066400000000000000000000024621523660243400465070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" integration_id: typing.Optional[str] = None credential_id: typing.Optional[str] = None integration_connection_id: 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 conversation_history_transcript_api_integration_webhook_tools_result_common_model_output.py000066400000000000000000000021631523660243400467060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: bool tool_has_been_called: bool tool_latency_secs: float error_type: str raw_error_message: str dynamic_variable_updates: typing.List[DynamicVariableUpdateCommonModel] type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" integration_id: str credential_id: str integration_connection_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 conversation_history_transcript_common_model_input.py000066400000000000000000000060041523660243400367130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata import AgentMetadata from .chat_source_medium import ChatSourceMedium from .conversation_history_multivoice_message_model import ConversationHistoryMultivoiceMessageModel from .conversation_history_transcript_common_model_input_role import ConversationHistoryTranscriptCommonModelInputRole from .conversation_history_transcript_common_model_input_tool_results_item import ( ConversationHistoryTranscriptCommonModelInputToolResultsItem, ) from .conversation_history_transcript_tool_call_common_model_input import ( ConversationHistoryTranscriptToolCallCommonModelInput, ) from .conversation_reasoning_model import ConversationReasoningModel from .conversation_turn_metrics import ConversationTurnMetrics from .llm_usage_input import LlmUsageInput from .rag_retrieval_info import RagRetrievalInfo from .triggered_guardrail_common_model import TriggeredGuardrailCommonModel from .user_feedback import UserFeedback class ConversationHistoryTranscriptCommonModelInput(UncheckedBaseModel): role: ConversationHistoryTranscriptCommonModelInputRole agent_metadata: typing.Optional[AgentMetadata] = None message: typing.Optional[str] = None multivoice_message: typing.Optional[ConversationHistoryMultivoiceMessageModel] = None tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModelInput]] = None tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInputToolResultsItem]] = None feedback: typing.Optional[UserFeedback] = None llm_override: typing.Optional[str] = None producing_llm: typing.Optional[str] = None time_in_call_secs: int conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None llm_usage: typing.Optional[LlmUsageInput] = None interrupted: typing.Optional[bool] = None ignored_as_backchannel: typing.Optional[bool] = None original_message: typing.Optional[str] = None reasoning: typing.Optional[typing.List[ConversationReasoningModel]] = None source_medium: typing.Optional[ChatSourceMedium] = None source_event_id: typing.Optional[int] = None used_static_kb_document_ids: typing.Optional[typing.List[str]] = None user_identifier: typing.Optional[str] = None id: typing.Optional[str] = None triggered_guardrails: typing.Optional[typing.List[TriggeredGuardrailCommonModel]] = 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 update_forward_refs(ConversationHistoryTranscriptCommonModelInput) conversation_history_transcript_common_model_input_role.py000066400000000000000000000002761523660243400377410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationHistoryTranscriptCommonModelInputRole = typing.Union[typing.Literal["user", "agent"], typing.Any] conversation_history_transcript_common_model_input_tool_results_item.py000066400000000000000000000020771523660243400425550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_input import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_system_tool_result_common_model_input import ( ConversationHistoryTranscriptSystemToolResultCommonModelInput, ) from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) ConversationHistoryTranscriptCommonModelInputToolResultsItem = typing.Union[ ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptSystemToolResultCommonModelInput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ] conversation_history_transcript_common_model_output.py000066400000000000000000000060221523660243400371140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata import AgentMetadata from .chat_source_medium import ChatSourceMedium from .conversation_history_multivoice_message_model import ConversationHistoryMultivoiceMessageModel from .conversation_history_transcript_common_model_output_role import ConversationHistoryTranscriptCommonModelOutputRole from .conversation_history_transcript_common_model_output_tool_results_item import ( ConversationHistoryTranscriptCommonModelOutputToolResultsItem, ) from .conversation_history_transcript_tool_call_common_model_output import ( ConversationHistoryTranscriptToolCallCommonModelOutput, ) from .conversation_reasoning_model import ConversationReasoningModel from .conversation_turn_metrics import ConversationTurnMetrics from .llm_usage_output import LlmUsageOutput from .rag_retrieval_info import RagRetrievalInfo from .triggered_guardrail_common_model import TriggeredGuardrailCommonModel from .user_feedback import UserFeedback class ConversationHistoryTranscriptCommonModelOutput(UncheckedBaseModel): role: ConversationHistoryTranscriptCommonModelOutputRole agent_metadata: typing.Optional[AgentMetadata] = None message: typing.Optional[str] = None multivoice_message: typing.Optional[ConversationHistoryMultivoiceMessageModel] = None tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModelOutput]] = None tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutputToolResultsItem]] = None feedback: typing.Optional[UserFeedback] = None llm_override: typing.Optional[str] = None producing_llm: typing.Optional[str] = None time_in_call_secs: int conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None llm_usage: typing.Optional[LlmUsageOutput] = None interrupted: typing.Optional[bool] = None ignored_as_backchannel: typing.Optional[bool] = None original_message: typing.Optional[str] = None reasoning: typing.Optional[typing.List[ConversationReasoningModel]] = None source_medium: typing.Optional[ChatSourceMedium] = None source_event_id: typing.Optional[int] = None used_static_kb_document_ids: typing.Optional[typing.List[str]] = None user_identifier: typing.Optional[str] = None id: typing.Optional[str] = None triggered_guardrails: typing.Optional[typing.List[TriggeredGuardrailCommonModel]] = 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 update_forward_refs(ConversationHistoryTranscriptCommonModelOutput) conversation_history_transcript_common_model_output_role.py000066400000000000000000000002771523660243400401430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationHistoryTranscriptCommonModelOutputRole = typing.Union[typing.Literal["user", "agent"], typing.Any] conversation_history_transcript_common_model_output_tool_results_item.py000066400000000000000000000021111523660243400427430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_output import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_system_tool_result_common_model_output import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ) from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) ConversationHistoryTranscriptCommonModelOutputToolResultsItem = typing.Union[ ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ] conversation_history_transcript_file_input_response_model.py000066400000000000000000000012301523660243400402540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryTranscriptFileInputResponseModel(UncheckedBaseModel): file_id: str original_filename: str mime_type: str file_url: 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 conversation_history_transcript_other_tools_result_common_model.py000066400000000000000000000024521523660243400415160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_other_tools_result_common_model_type import ( ConversationHistoryTranscriptOtherToolsResultCommonModelType, ) from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptOtherToolsResultCommonModel(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Optional[ConversationHistoryTranscriptOtherToolsResultCommonModelType] = 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 conversation_history_transcript_other_tools_result_common_model_type.py000066400000000000000000000003421523660243400425530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationHistoryTranscriptOtherToolsResultCommonModelType = typing.Union[ typing.Literal["client", "webhook", "mcp", "code"], typing.Any ] conversation_history_transcript_response_model.py000066400000000000000000000065751523660243400360570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata import AgentMetadata from .chat_source_medium import ChatSourceMedium from .contextual_update_info import ContextualUpdateInfo from .conversation_history_multivoice_message_model import ConversationHistoryMultivoiceMessageModel from .conversation_history_transcript_file_input_response_model import ( ConversationHistoryTranscriptFileInputResponseModel, ) from .conversation_history_transcript_response_model_role import ConversationHistoryTranscriptResponseModelRole from .conversation_history_transcript_response_model_tool_results_item import ( ConversationHistoryTranscriptResponseModelToolResultsItem, ) from .conversation_history_transcript_tool_call_common_model_output import ( ConversationHistoryTranscriptToolCallCommonModelOutput, ) from .conversation_reasoning_model import ConversationReasoningModel from .conversation_turn_metrics import ConversationTurnMetrics from .llm_usage_output import LlmUsageOutput from .rag_retrieval_info import RagRetrievalInfo from .triggered_guardrail_common_model import TriggeredGuardrailCommonModel from .user_feedback import UserFeedback class ConversationHistoryTranscriptResponseModel(UncheckedBaseModel): role: ConversationHistoryTranscriptResponseModelRole agent_metadata: typing.Optional[AgentMetadata] = None message: typing.Optional[str] = None multivoice_message: typing.Optional[ConversationHistoryMultivoiceMessageModel] = None tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModelOutput]] = None tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptResponseModelToolResultsItem]] = None feedback: typing.Optional[UserFeedback] = None llm_override: typing.Optional[str] = None producing_llm: typing.Optional[str] = None time_in_call_secs: int conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None llm_usage: typing.Optional[LlmUsageOutput] = None interrupted: typing.Optional[bool] = None ignored_as_backchannel: typing.Optional[bool] = None original_message: typing.Optional[str] = None reasoning: typing.Optional[typing.List[ConversationReasoningModel]] = None source_medium: typing.Optional[ChatSourceMedium] = None source_event_id: typing.Optional[int] = None used_static_kb_document_ids: typing.Optional[typing.List[str]] = None user_identifier: typing.Optional[str] = None id: typing.Optional[str] = None triggered_guardrails: typing.Optional[typing.List[TriggeredGuardrailCommonModel]] = None file_input: typing.Optional[ConversationHistoryTranscriptFileInputResponseModel] = None contextual_update_info: typing.Optional[ContextualUpdateInfo] = None reasoned: typing.Optional[bool] = 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 update_forward_refs(ConversationHistoryTranscriptResponseModel) conversation_history_transcript_response_model_role.py000066400000000000000000000002731523660243400370650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationHistoryTranscriptResponseModelRole = typing.Union[typing.Literal["user", "agent"], typing.Any] conversation_history_transcript_response_model_tool_results_item.py000066400000000000000000000021051523660243400416740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_output import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_system_tool_result_common_model_output import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ) from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) ConversationHistoryTranscriptResponseModelToolResultsItem = typing.Union[ ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ] conversation_history_transcript_system_tool_result_common_model_input.py000066400000000000000000000025651523660243400427620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_system_tool_result_common_model_input_result import ( ConversationHistoryTranscriptSystemToolResultCommonModelInputResult, ) from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptSystemToolResultCommonModelInput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Literal["system"] = "system" result: typing.Optional[ConversationHistoryTranscriptSystemToolResultCommonModelInputResult] = 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 conversation_history_transcript_system_tool_result_common_model_input_result.py000066400000000000000000000312671523660243400443610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .knowledge_base_rag_chunk_model import KnowledgeBaseRagChunkModel from .knowledge_base_rag_tool_status import KnowledgeBaseRagToolStatus from .knowledge_base_tool_status import KnowledgeBaseToolStatus from .transfer_to_agent_tool_result_success_model_input_branch_info import ( TransferToAgentToolResultSuccessModelInputBranchInfo, ) class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy(UncheckedBaseModel): result_type: typing.Literal["dummy"] = "dummy" 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 ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess(UncheckedBaseModel): result_type: typing.Literal["end_call_success"] = "end_call_success" status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None message: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess(UncheckedBaseModel): result_type: typing.Literal["knowledge_base_rag_success"] = "knowledge_base_rag_success" status: typing.Optional[KnowledgeBaseRagToolStatus] = None chunk_count: typing.Optional[int] = None message: typing.Optional[str] = None chunks: typing.Optional[typing.List[KnowledgeBaseRagChunkModel]] = 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess(UncheckedBaseModel): result_type: typing.Literal["knowledge_base_success"] = "knowledge_base_success" status: typing.Optional[KnowledgeBaseToolStatus] = None chunk_count: typing.Optional[int] = None message: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess(UncheckedBaseModel): result_type: typing.Literal["language_detection_success"] = "language_detection_success" status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None language: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError(UncheckedBaseModel): result_type: typing.Literal["play_dtmf_error"] = "play_dtmf_error" status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess(UncheckedBaseModel): result_type: typing.Literal["play_dtmf_success"] = "play_dtmf_success" status: typing.Optional[typing.Literal["success"]] = None dtmf_tones: str 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess(UncheckedBaseModel): result_type: typing.Literal["skip_turn_success"] = "skip_turn_success" status: typing.Optional[typing.Literal["success"]] = None 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult(UncheckedBaseModel): result_type: typing.Literal["testing_tool_result"] = "testing_tool_result" status: typing.Optional[typing.Literal["success"]] = None 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError(UncheckedBaseModel): result_type: typing.Literal["transfer_to_agent_error"] = "transfer_to_agent_error" status: typing.Optional[typing.Literal["error"]] = None from_agent: str error: 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 ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess(UncheckedBaseModel): result_type: typing.Literal["transfer_to_agent_success"] = "transfer_to_agent_success" status: typing.Optional[typing.Literal["success"]] = None from_agent: str to_agent: str to_node: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None branch_info: typing.Optional[TransferToAgentToolResultSuccessModelInputBranchInfo] = None preserve_client_tts_overrides: typing.Optional[bool] = 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError(UncheckedBaseModel): result_type: typing.Literal["transfer_to_number_error"] = "transfer_to_number_error" status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_exotel_success"] = "transfer_to_number_exotel_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None agent_message: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_sip_success"] = "transfer_to_number_sip_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_twilio_success"] = "transfer_to_number_twilio_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None client_message: typing.Optional[str] = None agent_message: str conference_name: str post_dial_digits: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess(UncheckedBaseModel): result_type: typing.Literal["voicemail_detection_success"] = "voicemail_detection_success" status: typing.Optional[typing.Literal["success"]] = None voicemail_message: typing.Optional[str] = None 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 ConversationHistoryTranscriptSystemToolResultCommonModelInputResult = typing_extensions.Annotated[ typing.Union[ ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelInputResult_VoicemailDetectionSuccess, ], UnionMetadata(discriminant="result_type"), ] conversation_history_transcript_system_tool_result_common_model_output.py000066400000000000000000000025711523660243400431600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_system_tool_result_common_model_output_result import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult, ) from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptSystemToolResultCommonModelOutput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Literal["system"] = "system" result: typing.Optional[ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult] = 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 conversation_history_transcript_system_tool_result_common_model_output_result.py000066400000000000000000000313411523660243400445530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .knowledge_base_rag_chunk_model import KnowledgeBaseRagChunkModel from .knowledge_base_rag_tool_status import KnowledgeBaseRagToolStatus from .knowledge_base_tool_status import KnowledgeBaseToolStatus from .transfer_to_agent_tool_result_success_model_output_branch_info import ( TransferToAgentToolResultSuccessModelOutputBranchInfo, ) class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy(UncheckedBaseModel): result_type: typing.Literal["dummy"] = "dummy" 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 ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess(UncheckedBaseModel): result_type: typing.Literal["end_call_success"] = "end_call_success" status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None message: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess(UncheckedBaseModel): result_type: typing.Literal["knowledge_base_rag_success"] = "knowledge_base_rag_success" status: typing.Optional[KnowledgeBaseRagToolStatus] = None chunk_count: typing.Optional[int] = None message: typing.Optional[str] = None chunks: typing.Optional[typing.List[KnowledgeBaseRagChunkModel]] = 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess(UncheckedBaseModel): result_type: typing.Literal["knowledge_base_success"] = "knowledge_base_success" status: typing.Optional[KnowledgeBaseToolStatus] = None chunk_count: typing.Optional[int] = None message: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess(UncheckedBaseModel): result_type: typing.Literal["language_detection_success"] = "language_detection_success" status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None language: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError(UncheckedBaseModel): result_type: typing.Literal["play_dtmf_error"] = "play_dtmf_error" status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess(UncheckedBaseModel): result_type: typing.Literal["play_dtmf_success"] = "play_dtmf_success" status: typing.Optional[typing.Literal["success"]] = None dtmf_tones: str 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess(UncheckedBaseModel): result_type: typing.Literal["skip_turn_success"] = "skip_turn_success" status: typing.Optional[typing.Literal["success"]] = None 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult(UncheckedBaseModel): result_type: typing.Literal["testing_tool_result"] = "testing_tool_result" status: typing.Optional[typing.Literal["success"]] = None 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError(UncheckedBaseModel): result_type: typing.Literal["transfer_to_agent_error"] = "transfer_to_agent_error" status: typing.Optional[typing.Literal["error"]] = None from_agent: str error: 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 ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess(UncheckedBaseModel): result_type: typing.Literal["transfer_to_agent_success"] = "transfer_to_agent_success" status: typing.Optional[typing.Literal["success"]] = None from_agent: str to_agent: str to_node: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None branch_info: typing.Optional[TransferToAgentToolResultSuccessModelOutputBranchInfo] = None preserve_client_tts_overrides: typing.Optional[bool] = 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError(UncheckedBaseModel): result_type: typing.Literal["transfer_to_number_error"] = "transfer_to_number_error" status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_exotel_success"] = "transfer_to_number_exotel_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None agent_message: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_sip_success"] = "transfer_to_number_sip_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess( UncheckedBaseModel ): result_type: typing.Literal["transfer_to_number_twilio_success"] = "transfer_to_number_twilio_success" status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None client_message: typing.Optional[str] = None agent_message: str conference_name: str post_dial_digits: typing.Optional[str] = None note: 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 class ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess( UncheckedBaseModel ): result_type: typing.Literal["voicemail_detection_success"] = "voicemail_detection_success" status: typing.Optional[typing.Literal["success"]] = None voicemail_message: typing.Optional[str] = None 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 ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult = typing_extensions.Annotated[ typing.Union[ ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_Dummy, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_EndCallSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseRagSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_KnowledgeBaseSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_LanguageDetectionSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_PlayDtmfSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_SkipTurnSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TestingToolResult, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToAgentSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberError, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberExotelSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberSipSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_TransferToNumberTwilioSuccess, ConversationHistoryTranscriptSystemToolResultCommonModelOutputResult_VoicemailDetectionSuccess, ], UnionMetadata(discriminant="result_type"), ] conversation_history_transcript_tool_call_api_integration_webhook_details_input.py000066400000000000000000000017011523660243400446710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) class ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsInput(UncheckedBaseModel): integration_id: typing.Optional[str] = None credential_id: typing.Optional[str] = None integration_connection_id: typing.Optional[str] = None webhook_details: ConversationHistoryTranscriptToolCallWebhookDetails 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 conversation_history_transcript_tool_call_api_integration_webhook_details_output.py000066400000000000000000000015721523660243400451000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) class ConversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput(UncheckedBaseModel): integration_id: str credential_id: str integration_connection_id: str webhook_details: ConversationHistoryTranscriptToolCallWebhookDetails 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 conversation_history_transcript_tool_call_client_details.py000066400000000000000000000011321523660243400400340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 conversation_history_transcript_tool_call_common_model_input.py000066400000000000000000000017761523660243400407560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_common_model_input_tool_details import ( ConversationHistoryTranscriptToolCallCommonModelInputToolDetails, ) from .tool_type import ToolType class ConversationHistoryTranscriptToolCallCommonModelInput(UncheckedBaseModel): type: typing.Optional[ToolType] = None request_id: str tool_name: str params_as_json: str tool_has_been_called: bool tool_details: typing.Optional[ConversationHistoryTranscriptToolCallCommonModelInputToolDetails] = 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 conversation_history_transcript_tool_call_common_model_input_tool_details.py000066400000000000000000000067231523660243400435150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) class ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook(UncheckedBaseModel): type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" integration_id: typing.Optional[str] = None credential_id: typing.Optional[str] = None integration_connection_id: typing.Optional[str] = None webhook_details: ConversationHistoryTranscriptToolCallWebhookDetails 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 ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_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 ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp(UncheckedBaseModel): type: typing.Literal["mcp"] = "mcp" mcp_server_id: str mcp_server_name: str integration_type: str parameters: typing.Optional[typing.Dict[str, str]] = None approval_policy: str requires_approval: typing.Optional[bool] = None mcp_tool_name: typing.Optional[str] = None mcp_tool_description: 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 class ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_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 ConversationHistoryTranscriptToolCallCommonModelInputToolDetails = typing_extensions.Annotated[ typing.Union[ ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelInputToolDetails_Webhook, ], UnionMetadata(discriminant="type"), ] conversation_history_transcript_tool_call_common_model_output.py000066400000000000000000000020021523660243400411360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_common_model_output_tool_details import ( ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails, ) from .tool_type import ToolType class ConversationHistoryTranscriptToolCallCommonModelOutput(UncheckedBaseModel): type: typing.Optional[ToolType] = None request_id: str tool_name: str params_as_json: str tool_has_been_called: bool tool_details: typing.Optional[ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails] = 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 conversation_history_transcript_tool_call_common_model_output_tool_details.py000066400000000000000000000066241523660243400437160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) class ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook(UncheckedBaseModel): type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" integration_id: str credential_id: str integration_connection_id: str webhook_details: ConversationHistoryTranscriptToolCallWebhookDetails 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 ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_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 ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp(UncheckedBaseModel): type: typing.Literal["mcp"] = "mcp" mcp_server_id: str mcp_server_name: str integration_type: str parameters: typing.Optional[typing.Dict[str, str]] = None approval_policy: str requires_approval: typing.Optional[bool] = None mcp_tool_name: typing.Optional[str] = None mcp_tool_description: 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 class ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_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 ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails = typing_extensions.Annotated[ typing.Union[ ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_ApiIntegrationWebhook, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Client, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Mcp, ConversationHistoryTranscriptToolCallCommonModelOutputToolDetails_Webhook, ], UnionMetadata(discriminant="type"), ] conversation_history_transcript_tool_call_mcp_details.py000066400000000000000000000015751523660243400373500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryTranscriptToolCallMcpDetails(UncheckedBaseModel): mcp_server_id: str mcp_server_name: str integration_type: str parameters: typing.Optional[typing.Dict[str, str]] = None approval_policy: str requires_approval: typing.Optional[bool] = None mcp_tool_name: typing.Optional[str] = None mcp_tool_description: 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 conversation_history_transcript_tool_call_webhook_details.py000066400000000000000000000016001523660243400402140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationHistoryTranscriptToolCallWebhookDetails(UncheckedBaseModel): type: typing.Optional[typing.Literal["webhook"]] = None 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 conversation_history_transcript_workflow_tools_result_common_model_input.py000066400000000000000000000041631523660243400434670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Literal["workflow"] = "workflow" result: typing.Optional["WorkflowToolResponseModelInput"] = 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 from .workflow_tool_nested_tools_step_model_input import WorkflowToolNestedToolsStepModelInput # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_input_results_item import WorkflowToolNestedToolsStepModelInputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_input import WorkflowToolResponseModelInput # noqa: E402, I001 from .workflow_tool_response_model_input_steps_item import WorkflowToolResponseModelInputStepsItem # noqa: E402, I001 update_forward_refs( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, WorkflowToolNestedToolsStepModelInput=WorkflowToolNestedToolsStepModelInput, WorkflowToolNestedToolsStepModelInputResultsItem=WorkflowToolNestedToolsStepModelInputResultsItem, WorkflowToolResponseModelInput=WorkflowToolResponseModelInput, WorkflowToolResponseModelInputStepsItem=WorkflowToolResponseModelInputStepsItem, ) conversation_history_transcript_workflow_tools_result_common_model_output.py000066400000000000000000000042061523660243400436660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel class ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput(UncheckedBaseModel): request_id: str tool_name: str result_value: str is_error: bool is_blocked: typing.Optional[bool] = None tool_has_been_called: bool tool_latency_secs: typing.Optional[float] = None error_type: typing.Optional[str] = None raw_error_message: typing.Optional[str] = None dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None type: typing.Literal["workflow"] = "workflow" result: typing.Optional["WorkflowToolResponseModelOutput"] = 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 from .workflow_tool_nested_tools_step_model_output import WorkflowToolNestedToolsStepModelOutput # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_output_results_item import WorkflowToolNestedToolsStepModelOutputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_output import WorkflowToolResponseModelOutput # noqa: E402, I001 from .workflow_tool_response_model_output_steps_item import WorkflowToolResponseModelOutputStepsItem # noqa: E402, I001 update_forward_refs( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, WorkflowToolNestedToolsStepModelOutput=WorkflowToolNestedToolsStepModelOutput, WorkflowToolNestedToolsStepModelOutputResultsItem=WorkflowToolNestedToolsStepModelOutputResultsItem, WorkflowToolResponseModelOutput=WorkflowToolResponseModelOutput, WorkflowToolResponseModelOutputStepsItem=WorkflowToolResponseModelOutputStepsItem, ) conversation_history_twilio_phone_call_model.py000066400000000000000000000013771523660243400354360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .telephony_direction import TelephonyDirection class ConversationHistoryTwilioPhoneCallModel(UncheckedBaseModel): direction: TelephonyDirection phone_number_id: str agent_number: str external_number: str stream_sid: str call_sid: 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 conversation_initiation_client_data_config_input.py000066400000000000000000000027101523660243400362340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_config_input import ConversationConfigClientOverrideConfigInput class ConversationInitiationClientDataConfigInput(UncheckedBaseModel): conversation_config_override: typing.Optional[ConversationConfigClientOverrideConfigInput] = pydantic.Field( default=None ) """ Overrides for the conversation configuration """ custom_llm_extra_body: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to include custom LLM extra body """ enable_conversation_initiation_client_data_from_webhook: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable conversation initiation client data from webhooks """ enable_starting_workflow_node_id_from_client: typing.Optional[bool] = pydantic.Field(default=None) """ Whether clients may pass starting_workflow_node_id in initiation client data; if false, sending it fails conversation start. """ 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 conversation_initiation_client_data_config_output.py000066400000000000000000000027141523660243400364410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_config_output import ConversationConfigClientOverrideConfigOutput class ConversationInitiationClientDataConfigOutput(UncheckedBaseModel): conversation_config_override: typing.Optional[ConversationConfigClientOverrideConfigOutput] = pydantic.Field( default=None ) """ Overrides for the conversation configuration """ custom_llm_extra_body: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to include custom LLM extra body """ enable_conversation_initiation_client_data_from_webhook: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable conversation initiation client data from webhooks """ enable_starting_workflow_node_id_from_client: typing.Optional[bool] = pydantic.Field(default=None) """ Whether clients may pass starting_workflow_node_id in initiation client data; if false, sending it fails conversation start. """ 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 conversation_initiation_client_data_internal.py000066400000000000000000000044761523660243400353770ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .conversation_initiation_source_info import ConversationInitiationSourceInfo from .orchestrator_tool_mock_behavior_config import OrchestratorToolMockBehaviorConfig from .tool_response_mock_config_output import ToolResponseMockConfigOutput class ConversationInitiationClientDataInternal(UncheckedBaseModel): conversation_config_override: typing.Optional[ConversationConfigClientOverrideOutput] = None custom_llm_extra_body: typing.Optional[typing.Dict[str, typing.Any]] = None user_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the end user participating in this conversation (for agent owner's user identification) """ source_info: typing.Optional[ConversationInitiationSourceInfo] = None branch_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the agent branch to use for this conversation """ environment: typing.Optional[str] = pydantic.Field(default=None) """ Environment to use for resolving environment variables """ starting_workflow_node_id: typing.Optional[str] = pydantic.Field(default=None) """ If set, start the workflow at this node id instead of the default entry """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None tool_mock_config: typing.Optional[OrchestratorToolMockBehaviorConfig] = pydantic.Field(default=None) """ Configuration for which tools to mock and fallback behavior """ tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = pydantic.Field( default=None ) """ Per-tool response mock overrides keyed by resolved tool name, applied ahead of the tool's shared mocks. Used for test-specific mocks. """ 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 conversation_initiation_client_data_request_input.py000066400000000000000000000032661523660243400364660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_input import ConversationConfigClientOverrideInput from .conversation_initiation_source_info import ConversationInitiationSourceInfo class ConversationInitiationClientDataRequestInput(UncheckedBaseModel): conversation_config_override: typing.Optional[ConversationConfigClientOverrideInput] = None custom_llm_extra_body: typing.Optional[typing.Dict[str, typing.Any]] = None user_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the end user participating in this conversation (for agent owner's user identification) """ source_info: typing.Optional[ConversationInitiationSourceInfo] = None branch_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the agent branch to use for this conversation """ environment: typing.Optional[str] = pydantic.Field(default=None) """ Environment to use for resolving environment variables """ starting_workflow_node_id: typing.Optional[str] = pydantic.Field(default=None) """ If set, start the workflow at this node id instead of the default entry """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = 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 conversation_initiation_client_data_request_output.py000066400000000000000000000032721523660243400366640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .conversation_initiation_source_info import ConversationInitiationSourceInfo class ConversationInitiationClientDataRequestOutput(UncheckedBaseModel): conversation_config_override: typing.Optional[ConversationConfigClientOverrideOutput] = None custom_llm_extra_body: typing.Optional[typing.Dict[str, typing.Any]] = None user_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the end user participating in this conversation (for agent owner's user identification) """ source_info: typing.Optional[ConversationInitiationSourceInfo] = None branch_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the agent branch to use for this conversation """ environment: typing.Optional[str] = pydantic.Field(default=None) """ Environment to use for resolving environment variables """ starting_workflow_node_id: typing.Optional[str] = pydantic.Field(default=None) """ If set, start the workflow at this node id instead of the default entry """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = 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 conversation_initiation_client_data_webhook.py000066400000000000000000000017301523660243400352070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_initiation_client_data_webhook_request_headers_value import ( ConversationInitiationClientDataWebhookRequestHeadersValue, ) class ConversationInitiationClientDataWebhook(UncheckedBaseModel): url: str = pydantic.Field() """ The URL to send the webhook to """ request_headers: typing.Dict[str, ConversationInitiationClientDataWebhookRequestHeadersValue] = pydantic.Field() """ The headers to send with the webhook request """ 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 conversation_initiation_client_data_webhook_request_headers_value.py000066400000000000000000000003551523660243400416500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_secret_locator import ConvAiSecretLocator ConversationInitiationClientDataWebhookRequestHeadersValue = typing.Union[str, ConvAiSecretLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_initiation_source.py000066400000000000000000000014641523660243400326050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConversationInitiationSource = typing.Union[ typing.Literal[ "unknown", "android_sdk", "node_js_sdk", "react_native_sdk", "react_sdk", "js_sdk", "python_sdk", "widget", "sip_trunk", "twilio", "exotel", "genesys", "avaya", "audiocodes", "swift_sdk", "whatsapp", "twilio_sms", "flutter_sdk", "zendesk_integration", "slack_integration", "telegram_integration", "intercom_integration", "freshdesk_integration", "salesforce_integration", "template_preview", "genesys_bot_connector", "subagent_tool", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_initiation_source_info.py000066400000000000000000000017121523660243400336140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_initiation_source import ConversationInitiationSource class ConversationInitiationSourceInfo(UncheckedBaseModel): """ Information about the source of conversation initiation """ source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Source of the conversation initiation """ version: typing.Optional[str] = pydantic.Field(default=None) """ The SDK version number """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_product.py000066400000000000000000000002521523660243400305300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConversationProduct = typing.Union[typing.Literal["agents", "speech_engine"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_reasoning_model.py000066400000000000000000000012111523660243400322110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationReasoningModel(UncheckedBaseModel): summary: typing.Optional[str] = None provider_redact: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_sentiment_analysis.py000066400000000000000000000016041523660243400327630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_sentiment_analysis_overall_label import ConversationSentimentAnalysisOverallLabel class ConversationSentimentAnalysis(UncheckedBaseModel): overall_label: ConversationSentimentAnalysisOverallLabel overall_sentiment_score: float overall_frustration_score: float min_user_sentiment_score: float max_user_frustration_score: float num_scored_user_turns: int 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 conversation_sentiment_analysis_overall_label.py000066400000000000000000000003101523660243400355600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationSentimentAnalysisOverallLabel = typing.Union[typing.Literal["positive", "neutral", "negative"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_signed_url_response_model.py000066400000000000000000000011121523660243400342750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationSignedUrlResponseModel(UncheckedBaseModel): signed_url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_simulation_specification.py000066400000000000000000000026631523660243400341440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config import AgentConfig from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .tool_mock_config import ToolMockConfig class ConversationSimulationSpecification(UncheckedBaseModel): """ A specification that will be used to simulate a conversation between an agent and an AI user. """ simulated_user_config: AgentConfig tool_mock_config: typing.Optional[typing.Dict[str, ToolMockConfig]] = None partial_conversation_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = ( pydantic.Field(default=None) ) """ A partial conversation history to start the simulation from. If empty, simulation starts fresh. """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = 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 update_forward_refs(ConversationSimulationSpecification) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_source.py000066400000000000000000000012001523660243400303420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationSource(UncheckedBaseModel): type: typing.Optional[typing.Literal["conversation"]] = None conversation_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_summary_response_model.py000066400000000000000000000044021523660243400336440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_initiation_source import ConversationInitiationSource from .conversation_sentiment_analysis import ConversationSentimentAnalysis from .conversation_summary_response_model_status import ConversationSummaryResponseModelStatus from .evaluation_criteria_summary_result import EvaluationCriteriaSummaryResult from .evaluation_success_result import EvaluationSuccessResult from .telephony_direction import TelephonyDirection class ConversationSummaryResponseModel(UncheckedBaseModel): agent_id: str branch_id: typing.Optional[str] = None version_id: typing.Optional[str] = None agent_name: typing.Optional[str] = None conversation_id: str start_time_unix_secs: int call_duration_secs: int message_count: int status: ConversationSummaryResponseModelStatus termination_reason: typing.Optional[str] = None call_successful: EvaluationSuccessResult call_success_score: typing.Optional[float] = None transcript_summary: typing.Optional[str] = None call_summary_title: typing.Optional[str] = None main_language: typing.Optional[str] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_names: typing.Optional[typing.List[str]] = None direction: typing.Optional[TelephonyDirection] = None rating: typing.Optional[float] = None sentiment_analysis: typing.Optional[ConversationSentimentAnalysis] = None data_collection_results: typing.Optional[typing.Dict[str, typing.Any]] = None evaluation_criteria_results: typing.Optional[typing.Dict[str, typing.Optional[EvaluationCriteriaSummaryResult]]] = ( None ) tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Conversation tag ids assigned to this conversation. """ 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 conversation_summary_response_model_status.py000066400000000000000000000003441523660243400351710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ConversationSummaryResponseModelStatus = typing.Union[ typing.Literal["initiated", "in-progress", "processing", "done", "failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_tag_response_model.py000066400000000000000000000013071523660243400327230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationTagResponseModel(UncheckedBaseModel): tag_id: str workspace_id: str owner_user_id: str title: str description: typing.Optional[str] = None created_at_unix_secs: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_token_purpose.py000066400000000000000000000002641523660243400317500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ConversationTokenPurpose = typing.Union[typing.Literal["signed_url", "shareable_link"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_token_response_model.py000066400000000000000000000024551523660243400332750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_token_purpose import ConversationTokenPurpose class ConversationTokenResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ conversation_token: str = pydantic.Field() """ The token for the agent """ expiration_time_unix_secs: typing.Optional[int] = pydantic.Field(default=None) """ The expiration time of the token in unix seconds """ conversation_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the conversation """ purpose: ConversationTokenPurpose = pydantic.Field() """ The purpose of the token """ token_requester_user_id: typing.Optional[str] = pydantic.Field(default=None) """ The user ID of the entity who requested the token """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_tts_usage_model.py000066400000000000000000000017121523660243400322300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_voice_usage_model import ConversationVoiceUsageModel class ConversationTtsUsageModel(UncheckedBaseModel): """ Aggregated TTS usage for a conversation (analytics-only, not billing). """ primary_tts_model: typing.Optional[str] = None total_audio_output_seconds: typing.Optional[float] = None total_characters: typing.Optional[int] = None per_voice_usage: typing.Optional[typing.List[ConversationVoiceUsageModel]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_turn_metrics.py000066400000000000000000000014621523660243400315720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .metric_record import MetricRecord class ConversationTurnMetrics(UncheckedBaseModel): metrics: typing.Optional[typing.Dict[str, MetricRecord]] = None convai_asr_provider: typing.Optional[str] = None convai_tts_model: typing.Optional[str] = None convai_tts_cascade: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_user_response_model.py000066400000000000000000000020601523660243400331230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .frustrated_conversation_ref import FrustratedConversationRef from .sentiment_aggregate import SentimentAggregate class ConversationUserResponseModel(UncheckedBaseModel): user_id: str last_contact_unix_secs: int first_contact_unix_secs: int conversation_count: int last_contact_agent_id: typing.Optional[str] = None last_contact_conversation_id: str last_contact_agent_name: typing.Optional[str] = None sentiment: SentimentAggregate most_frustrated_conversations: typing.Optional[typing.List[FrustratedConversationRef]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_voice_reward_model.py000066400000000000000000000011361523660243400327030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationVoiceRewardModel(UncheckedBaseModel): voice_id: str reward_usd_cents: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversation_voice_usage_model.py000066400000000000000000000011711523660243400325220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConversationVoiceUsageModel(UncheckedBaseModel): voice_id: str audio_output_seconds: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/conversational_config.py000066400000000000000000000037421523660243400306410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config import AgentConfig from .asr_conversational_config import AsrConversationalConfig from .conversation_config_output import ConversationConfigOutput from .language_preset_output import LanguagePresetOutput from .tts_conversational_config_output import TtsConversationalConfigOutput from .turn_config import TurnConfig from .vad_config import VadConfig class ConversationalConfig(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfig] = pydantic.Field(default=None) """ Configuration for conversational transcription """ turn: typing.Optional[TurnConfig] = pydantic.Field(default=None) """ Configuration for turn detection """ tts: typing.Optional[TtsConversationalConfigOutput] = pydantic.Field(default=None) """ Configuration for conversational text to speech """ conversation: typing.Optional[ConversationConfigOutput] = pydantic.Field(default=None) """ Configuration for conversational events """ language_presets: typing.Optional[typing.Dict[str, LanguagePresetOutput]] = pydantic.Field(default=None) """ Language presets for conversations """ vad: typing.Optional[VadConfig] = pydantic.Field(default=None) """ Configuration for voice activity detection """ agent: typing.Optional[AgentConfig] = pydantic.Field(default=None) """ Agent specific configuration """ 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 update_forward_refs(ConversationalConfig) conversational_config_api_model_workflow_override_input.py000066400000000000000000000046101523660243400376360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_api_model_workflow_override_input import AgentConfigApiModelWorkflowOverrideInput from .asr_conversational_config_workflow_override import AsrConversationalConfigWorkflowOverride from .conversation_config_workflow_override_input import ConversationConfigWorkflowOverrideInput from .language_preset_input import LanguagePresetInput from .tts_conversational_config_workflow_override_input import TtsConversationalConfigWorkflowOverrideInput from .turn_config_workflow_override import TurnConfigWorkflowOverride from .vad_config_workflow_override import VadConfigWorkflowOverride class ConversationalConfigApiModelWorkflowOverrideInput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for conversational transcription """ turn: typing.Optional[TurnConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for turn detection """ tts: typing.Optional[TtsConversationalConfigWorkflowOverrideInput] = pydantic.Field(default=None) """ Configuration for conversational text to speech """ conversation: typing.Optional[ConversationConfigWorkflowOverrideInput] = pydantic.Field(default=None) """ Configuration for conversational events """ language_presets: typing.Optional[typing.Dict[str, typing.Optional[LanguagePresetInput]]] = pydantic.Field( default=None ) """ Language presets for conversations """ vad: typing.Optional[VadConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for voice activity detection """ agent: typing.Optional[AgentConfigApiModelWorkflowOverrideInput] = pydantic.Field(default=None) """ Agent specific configuration """ 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 update_forward_refs(ConversationalConfigApiModelWorkflowOverrideInput) conversational_config_api_model_workflow_override_output.py000066400000000000000000000046261523660243400400460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config_api_model_workflow_override_output import AgentConfigApiModelWorkflowOverrideOutput from .asr_conversational_config_workflow_override import AsrConversationalConfigWorkflowOverride from .conversation_config_workflow_override_output import ConversationConfigWorkflowOverrideOutput from .language_preset_output import LanguagePresetOutput from .tts_conversational_config_workflow_override_output import TtsConversationalConfigWorkflowOverrideOutput from .turn_config_workflow_override import TurnConfigWorkflowOverride from .vad_config_workflow_override import VadConfigWorkflowOverride class ConversationalConfigApiModelWorkflowOverrideOutput(UncheckedBaseModel): asr: typing.Optional[AsrConversationalConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for conversational transcription """ turn: typing.Optional[TurnConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for turn detection """ tts: typing.Optional[TtsConversationalConfigWorkflowOverrideOutput] = pydantic.Field(default=None) """ Configuration for conversational text to speech """ conversation: typing.Optional[ConversationConfigWorkflowOverrideOutput] = pydantic.Field(default=None) """ Configuration for conversational events """ language_presets: typing.Optional[typing.Dict[str, typing.Optional[LanguagePresetOutput]]] = pydantic.Field( default=None ) """ Language presets for conversations """ vad: typing.Optional[VadConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for voice activity detection """ agent: typing.Optional[AgentConfigApiModelWorkflowOverrideOutput] = pydantic.Field(default=None) """ Agent specific configuration """ 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 update_forward_refs(ConversationalConfigApiModelWorkflowOverrideOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/convert_chapter_response_model.py000066400000000000000000000014201523660243400325400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvertChapterResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the studio chapter conversion 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/convert_project_response_model.py000066400000000000000000000014201523660243400325600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ConvertProjectResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the studio project conversion 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/crawl_status.py000066400000000000000000000003241523660243400267710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CrawlStatus = typing.Union[ typing.Literal["queued", "processing", "succeeded", "failed", "skipped", "cancelled"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/crawl_type.py000066400000000000000000000002351523660243400264300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CrawlType = typing.Union[typing.Literal["discovery", "sitemap"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_branch_response_model.py000066400000000000000000000013771523660243400333230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentBranchResponseModel(UncheckedBaseModel): created_branch_id: str = pydantic.Field() """ ID of the created branch """ created_version_id: str = pydantic.Field() """ ID of the first version on the created branch """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_procedure_params.py000066400000000000000000000012021523660243400323060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentProcedureParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_agent_procedure"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_response_model.py000066400000000000000000000011751523660243400320020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ ID of the created agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_rule_params.py000066400000000000000000000011701523660243400312710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_agent_rule"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_test_folder_response_model.py000066400000000000000000000011201523660243400343620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentTestFolderResponseModel(UncheckedBaseModel): id: str name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_agent_test_response_model.py000066400000000000000000000010741523660243400330370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAgentTestResponseModel(UncheckedBaseModel): 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_asset_params.py000066400000000000000000000011571523660243400302700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateAssetParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_asset"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_audio_native_project_request.py000066400000000000000000000001751523660243400335520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CreateAudioNativeProjectRequest = typing.Any create_auth_connection_environment_variable_request.py000066400000000000000000000017251523660243400367510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .environment_variable_auth_connection_value_request import EnvironmentVariableAuthConnectionValueRequest class CreateAuthConnectionEnvironmentVariableRequest(UncheckedBaseModel): label: str = pydantic.Field() """ Unique label for the environment variable. """ values: typing.Dict[str, EnvironmentVariableAuthConnectionValueRequest] = pydantic.Field() """ Environment-specific auth connection references. Must include 'production' key. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_basic_auth_request.py000066400000000000000000000013561523660243400314610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateBasicAuthRequest(UncheckedBaseModel): """ Request model for creating Basic Auth connections - inherits common settings and includes sensitive fields """ name: str provider: str username: str password: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_bearer_auth_request.py000066400000000000000000000013331523660243400316330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateBearerAuthRequest(UncheckedBaseModel): """ Request model for creating Bearer Auth connections - inherits common settings and includes sensitive fields """ name: str provider: str token: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_client_appointment_params.py000066400000000000000000000012101523660243400330330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateClientAppointmentParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_client_appointment"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_client_interaction_params.py000066400000000000000000000012101523660243400330140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateClientInteractionParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_client_interaction"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_client_params.py000066400000000000000000000012511523660243400304220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateClientParams(UncheckedBaseModel): """ Create a new client in the system. """ smb_tool_type: typing.Optional[typing.Literal["create_client"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_crawl_job_response_model.py000066400000000000000000000020441523660243400326420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .crawl_type import CrawlType from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) class CreateCrawlJobResponseModel(UncheckedBaseModel): id: str type: CrawlType root_folder_id: str status: str created_at: int folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to the root folder, from root to parent folder. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_custom_header_auth_request.py000066400000000000000000000013421523660243400332150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateCustomHeaderAuthRequest(UncheckedBaseModel): name: str provider: str header_name: str = pydantic.Field() """ The name of the header to use for authentication (e.g., 'x-api-key') """ token: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_exotel_phone_number_request.py000066400000000000000000000036321523660243400334170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .exotel_api_subdomain import ExotelApiSubdomain class CreateExotelPhoneNumberRequest(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ Agent ID to assign the phone number to """ account_sid: str = pydantic.Field() """ Exotel Account SID """ api_key: str = pydantic.Field() """ Exotel API Key """ api_token: str = pydantic.Field() """ Exotel API Token """ api_subdomain: ExotelApiSubdomain = pydantic.Field() """ Exotel region-specific API host """ app_id: str = pydantic.Field() """ Exotel applet identifier used in Calls/connect """ applet_url: typing.Optional[str] = pydantic.Field(default=None) """ Optional full applet URL override. Defaults to Exotel start_voice URL derived from account SID and app ID. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_holiday_params.py000066400000000000000000000011631523660243400305770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateHolidayParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_holiday"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_location_params.py000066400000000000000000000011651523660243400307600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateLocationParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_location"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_mtls_auth_request.py000066400000000000000000000014401523660243400313510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateMtlsAuthRequest(UncheckedBaseModel): """ Request model for creating mTLS auth connections. """ name: str provider: str client_certificate: str client_key: str ca_certificate: typing.Optional[str] = None key_passphrase: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_o_auth_2_client_creds_request.py000066400000000000000000000022031523660243400335650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateOAuth2ClientCredsRequest(UncheckedBaseModel): """ Request model for creating auth connections - inherits common settings and includes sensitive fields """ name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = pydantic.Field(default=None) """ If True, send client credentials in Authorization header as Basic Auth instead of request body """ client_secret: str custom_headers: typing.Optional[typing.Dict[str, 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_o_auth_2_jwt_request.py000066400000000000000000000042261523660243400317420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .create_o_auth_2_jwt_request_algorithm import CreateOAuth2JwtRequestAlgorithm from .create_o_auth_2_jwt_request_token_response_field import CreateOAuth2JwtRequestTokenResponseField class CreateOAuth2JwtRequest(UncheckedBaseModel): """ Request model for creating OAuth2 JWT auth connections - inherits common settings and includes sensitive fields """ name: str provider: str algorithm: typing.Optional[CreateOAuth2JwtRequestAlgorithm] = pydantic.Field(default=None) """ JWT signing algorithm """ key_id: typing.Optional[str] = pydantic.Field(default=None) """ Key ID (kid) for JWT header - useful for key rotation """ issuer: str = pydantic.Field() """ JWT issuer (iss claim) """ audience: str = pydantic.Field() """ JWT audience (aud claim) """ subject: str = pydantic.Field() """ JWT subject (sub claim) """ expiration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ Token expiration time in seconds """ extra_params: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Additional custom claims to include in the JWT """ token_url: str = pydantic.Field() """ Token endpoint URL for exchanging JWT for access token """ scopes: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ OAuth2 scopes to request when exchanging JWT for access token """ token_response_field: typing.Optional[CreateOAuth2JwtRequestTokenResponseField] = pydantic.Field(default=None) """ Token field to extract from the token endpoint response. """ secret_key: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_o_auth_2_jwt_request_algorithm.py000066400000000000000000000003271523660243400340060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CreateOAuth2JwtRequestAlgorithm = typing.Union[ typing.Literal["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"], typing.Any ] create_o_auth_2_jwt_request_token_response_field.py000066400000000000000000000003001523660243400361310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CreateOAuth2JwtRequestTokenResponseField = typing.Union[typing.Literal["access_token", "id_token"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_order_request.py000066400000000000000000000013231523660243400304640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateOrderRequest(UncheckedBaseModel): sandbox: typing.Optional[bool] = pydantic.Field(default=None) """ When true, creates a sandbox order that auto-progresses without producer intervention. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_order_response.py000066400000000000000000000014351523660243400306360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .order_id import OrderId class CreateOrderResponse(UncheckedBaseModel): order_id: OrderId = pydantic.Field() """ The ID of the newly created order. """ sandbox: typing.Optional[bool] = pydantic.Field(default=None) """ Whether this is a sandbox order. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_phone_number_response_model.py000066400000000000000000000012021523660243400333540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreatePhoneNumberResponseModel(UncheckedBaseModel): phone_number_id: str = pydantic.Field() """ Phone entity ID """ 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 create_previously_generated_voice_request.py000066400000000000000000000002031523660243400347120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CreatePreviouslyGeneratedVoiceRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_private_key_jwt_request.py000066400000000000000000000031601523660243400325600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .create_private_key_jwt_request_algorithm import CreatePrivateKeyJwtRequestAlgorithm class CreatePrivateKeyJwtRequest(UncheckedBaseModel): """ Request model for creating Private Key JWT auth connections - inherits common settings and includes sensitive fields """ name: str provider: str algorithm: typing.Optional[CreatePrivateKeyJwtRequestAlgorithm] = pydantic.Field(default=None) """ JWT signing algorithm """ key_id: typing.Optional[str] = pydantic.Field(default=None) """ Key ID (kid) for JWT header - useful for key rotation """ issuer: str = pydantic.Field() """ JWT issuer (iss claim) """ audience: str = pydantic.Field() """ JWT audience (aud claim) """ subject: str = pydantic.Field() """ JWT subject (sub claim) """ expiration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ Token expiration time in seconds """ extra_params: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Additional custom claims to include in the JWT """ secret_key: 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 create_private_key_jwt_request_algorithm.py000066400000000000000000000003331523660243400345460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing CreatePrivateKeyJwtRequestAlgorithm = typing.Union[ typing.Literal["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_procedure_request_model.py000066400000000000000000000023531523660243400325250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_type import ProcedureType class CreateProcedureRequestModel(UncheckedBaseModel): name: typing.Optional[str] = pydantic.Field(default=None) """ Procedure name """ content: typing.Optional[str] = pydantic.Field(default=None) """ Initial procedure content """ type: typing.Optional[ProcedureType] = pydantic.Field(default=None) """ Procedure type """ trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. If omitted or null, the trigger is derived from the content instead. Also accepts `description` as an alias. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_procedure_response_model.py000066400000000000000000000012111523660243400326630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateProcedureResponseModel(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ ID of the created procedure """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_product_params.py000066400000000000000000000011631523660243400306260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateProductParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_product"]] = 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 create_pronunciation_dictionary_response_model.py000066400000000000000000000014451523660243400357420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreatePronunciationDictionaryResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the create pronunciation dictionary 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_response_unit_test_request.py000066400000000000000000000050341523660243400333100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_failure_response_example import AgentFailureResponseExample from .agent_successful_response_example import AgentSuccessfulResponseExample from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_input import TestFromConversationMetadataInput class CreateResponseUnitTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ A prompt that evaluates whether the agent's response is successful. Should return True or False. """ success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered successful """ failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered failures """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be created at the root level. """ 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 update_forward_refs(CreateResponseUnitTestRequest) create_secret_environment_variable_request.py000066400000000000000000000016531523660243400350560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .environment_variable_secret_value_request import EnvironmentVariableSecretValueRequest class CreateSecretEnvironmentVariableRequest(UncheckedBaseModel): label: str = pydantic.Field() """ Unique label for the environment variable. """ values: typing.Dict[str, EnvironmentVariableSecretValueRequest] = pydantic.Field() """ Environment-specific secret references. Must include 'production' key. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_service_params.py000066400000000000000000000013101523660243400306000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateServiceParams(UncheckedBaseModel): """ Create a new service (classic, rental, or group) in the system. """ smb_tool_type: typing.Optional[typing.Literal["create_service"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_simulation_test_request.py000066400000000000000000000074771523660243400326140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .llm import Llm from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .test_from_conversation_metadata_input import TestFromConversationMetadataInput from .tool_response_mock_config_input import ToolResponseMockConfigInput class CreateSimulationTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ Deprecated legacy single success criterion. Use success_conditions instead. At least one of success_condition or success_conditions is required. """ success_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of prompts that evaluate whether the simulation was successful. If provided, all criteria are evaluated and merged into a final result. Capped at the maximum number of evaluation criteria. """ simulation_scenario: typing.Optional[str] = pydantic.Field(default=None) """ Description of the simulation scenario and user persona for simulation tests. """ simulation_max_turns: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of conversation turns for simulation tests. """ simulation_environment: typing.Optional[str] = pydantic.Field(default=None) """ The environment to use when running this simulation test. If not provided, defaults to 'production'. """ tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = pydantic.Field(default=None) """ Configuration for which tools to mock and fallback behavior. """ tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigInput]]] = pydantic.Field( default=None ) """ Test-specific response mocks, keyed by tool ID. Applied ahead of the tool's shared mocks and only within this test. Only take effect for tools that are mocked (see tool_mock_config). """ evaluation_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for evaluating simulation results. """ simulated_user_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model for the simulated user. """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be created at the root level. """ 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 update_forward_refs(CreateSimulationTestRequest) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_sip_trunk_phone_number_request.py000066400000000000000000000031031523660243400341260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .inbound_sip_trunk_config_request_model import InboundSipTrunkConfigRequestModel from .outbound_sip_trunk_config_request_model import OutboundSipTrunkConfigRequestModel class CreateSipTrunkPhoneNumberRequest(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ Agent ID to assign the phone number to """ inbound_trunk_config: typing.Optional[InboundSipTrunkConfigRequestModel] = None outbound_trunk_config: typing.Optional[OutboundSipTrunkConfigRequestModel] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_staff_params.py000066400000000000000000000012551523660243400302530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateStaffParams(UncheckedBaseModel): """ Create a new staff member in the system. """ smb_tool_type: typing.Optional[typing.Literal["create_staff"]] = 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 create_string_environment_variable_request.py000066400000000000000000000014411523660243400350720ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateStringEnvironmentVariableRequest(UncheckedBaseModel): label: str = pydantic.Field() """ Unique label for the environment variable. """ values: typing.Dict[str, str] = pydantic.Field() """ Environment-specific values. Must include 'production' key. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_tool_call_unit_test_request.py000066400000000000000000000045601523660243400334250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_input import TestFromConversationMetadataInput from .unit_test_tool_call_evaluation_model_input import UnitTestToolCallEvaluationModelInput class CreateToolCallUnitTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelInput] = pydantic.Field(default=None) """ How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. """ check_any_tool_matches: typing.Optional[bool] = pydantic.Field(default=None) """ If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be created at the root level. """ 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 update_forward_refs(CreateToolCallUnitTestRequest) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_transcript_request.py000066400000000000000000000001651523660243400315450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CreateTranscriptRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_transfer_rule_params.py000066400000000000000000000017451523660243400320270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CreateTransferRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["create_transfer_rule"]] = None post_dial_digits_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to offer the post_dial_digits parameter, set from the receptionists' enable_play_keypad_touch_tone_tool config. Digits saved while that is off are dropped when the receptionist is built, so the parameter is hidden rather than accepted and ignored. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/create_twilio_phone_number_request.py000066400000000000000000000034271523660243400334300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .region_config_request import RegionConfigRequest class CreateTwilioPhoneNumberRequest(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ Agent ID to assign the phone number to """ sid: str = pydantic.Field() """ Twilio Account SID """ token: str = pydantic.Field() """ Twilio Auth Token """ region_config: typing.Optional[RegionConfigRequest] = pydantic.Field(default=None) """ Twilio Additional Region Configuration """ enable_sms: typing.Optional[bool] = pydantic.Field(default=None) """ Route inbound SMS to ElevenLabs. On by default; set to false to skip SMS configuration for numbers that don't support it. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/criteria_scoring_mode.py000066400000000000000000000002541523660243400306120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CriteriaScoringMode = typing.Union[typing.Literal["binary", "numeric_uniform"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/cue_options_request.py000066400000000000000000000027121523660243400303600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CueOptionsRequest(UncheckedBaseModel): min_duration_ms: typing.Optional[int] = pydantic.Field(default=None) """ Minimum duration of each cue in milliseconds. """ max_duration_ms: typing.Optional[int] = pydantic.Field(default=None) """ Maximum duration of each cue in milliseconds. """ max_lines_per_cue: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of lines per cue. """ max_chars_per_line: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of characters per line in a cue. """ max_chars_per_s: typing.Optional[int] = pydantic.Field(default=None) """ Maximum characters per second reading speed. If not set, no reading speed limit is applied. """ min_gap_between_cues_frames: typing.Optional[int] = pydantic.Field(default=None) """ Minimum gap between consecutive cues in frames. If not set, no minimum gap is enforced. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/currency.py000066400000000000000000000002401523660243400261050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing Currency = typing.Union[typing.Literal["usd", "eur", "inr", "pln"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrail_config.py000066400000000000000000000040421523660243400311500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrail_config_model import CustomGuardrailConfigModel from .custom_guardrail_config_trigger_action import CustomGuardrailConfigTriggerAction from .guardrail_execution_mode import GuardrailExecutionMode class CustomGuardrailConfig(UncheckedBaseModel): """ Single custom guardrail configuration """ is_enabled: typing.Optional[bool] = None name: str = pydantic.Field() """ User-facing name for this guardrail """ prompt: str = pydantic.Field() """ Instruction describing what to block, e.g. 'don't talk about politics' """ execution_mode: typing.Optional[GuardrailExecutionMode] = None model: typing.Optional[CustomGuardrailConfigModel] = pydantic.Field(default=None) """ LLM model to use for custom guardrail evaluation """ history_message_count: typing.Optional[int] = pydantic.Field(default=None) """ How much recent history the guardrail sees before the reply it evaluates, counted in user messages (the agent replies between them are included too). The guardrail always gets a single transcript ending in the evaluated reply, marked 'AGENT [current reply]:'. 0 (default) adds no prior history (just that line); 1 adds the latest user message onward. """ trigger_action: typing.Optional[CustomGuardrailConfigTriggerAction] = None evaluate_full_response_only: typing.Optional[bool] = pydantic.Field(default=None) """ Evaluate once against the complete non-TTS response instead of cumulative partials. Requires blocking mode. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrail_config_model.py000066400000000000000000000006131523660243400323300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CustomGuardrailConfigModel = typing.Union[ typing.Literal[ "gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-3.1-flash-lite", "gemini-3.5-flash", "claude-haiku-4-5", "claude-sonnet-4-6", "gpt-5.4-nano", "gpt-5.4-mini", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrail_config_trigger_action.py000066400000000000000000000025241523660243400342330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class CustomGuardrailConfigTriggerAction_EndCall(UncheckedBaseModel): 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 CustomGuardrailConfigTriggerAction_Retry(UncheckedBaseModel): type: typing.Literal["retry"] = "retry" feedback: 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 CustomGuardrailConfigTriggerAction = typing_extensions.Annotated[ typing.Union[CustomGuardrailConfigTriggerAction_EndCall, CustomGuardrailConfigTriggerAction_Retry], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrail_input.py000066400000000000000000000014131523660243400310410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrails_config_input import CustomGuardrailsConfigInput class CustomGuardrailInput(UncheckedBaseModel): """ Container for custom guardrails, matching ModerationGuardrail pattern """ config: typing.Optional[CustomGuardrailsConfigInput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrail_output.py000066400000000000000000000014171523660243400312460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrails_config_output import CustomGuardrailsConfigOutput class CustomGuardrailOutput(UncheckedBaseModel): """ Container for custom guardrails, matching ModerationGuardrail pattern """ config: typing.Optional[CustomGuardrailsConfigOutput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrails_config_input.py000066400000000000000000000013631523660243400325550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrail_config import CustomGuardrailConfig class CustomGuardrailsConfigInput(UncheckedBaseModel): """ Config container for custom guardrails list """ configs: typing.Optional[typing.List[CustomGuardrailConfig]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_guardrails_config_output.py000066400000000000000000000013641523660243400327570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrail_config import CustomGuardrailConfig class CustomGuardrailsConfigOutput(UncheckedBaseModel): """ Config container for custom guardrails list """ configs: typing.Optional[typing.List[CustomGuardrailConfig]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_header_auth_response.py000066400000000000000000000021771523660243400320470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class CustomHeaderAuthResponse(UncheckedBaseModel): """ Response model for Custom Header Auth auth connections """ name: str provider: str header_name: str = pydantic.Field() """ The name of the header to use for authentication (e.g., 'x-api-key') """ id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_llm.py000066400000000000000000000040411523660243400264340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_llm_api_key import CustomLlmApiKey from .custom_llm_auth_connection import CustomLlmAuthConnection from .custom_llm_request_headers_value import CustomLlmRequestHeadersValue from .custom_llmapi_type import CustomLlmapiType class CustomLlm(UncheckedBaseModel): url: str = pydantic.Field() """ The URL of the Chat Completions compatible endpoint """ model_id: typing.Optional[str] = pydantic.Field(default=None) """ The model ID to be used if URL serves multiple models """ api_key: typing.Optional[CustomLlmApiKey] = pydantic.Field(default=None) """ The API key for authentication. Either a workspace secret reference {'secret_id': '...'} or an environment variable reference {'env_var_label': '...'}. """ auth_connection: typing.Optional[CustomLlmAuthConnection] = pydantic.Field(default=None) """ Optional workspace auth connection for authentication. Only auth connections that produce an Authorization Bearer token are supported; Basic auth, mTLS, custom header, and URL secret auth connections are not supported. """ request_headers: typing.Optional[typing.Dict[str, CustomLlmRequestHeadersValue]] = pydantic.Field(default=None) """ Headers that should be included in the request """ api_version: typing.Optional[str] = pydantic.Field(default=None) """ The API version to use for the request """ api_type: typing.Optional[CustomLlmapiType] = pydantic.Field(default=None) """ The API type to use (chat_completions, responses or websocket) """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_llm_api_key.py000066400000000000000000000004131523660243400301340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator CustomLlmApiKey = typing.Union[ConvAiSecretLocator, ConvAiEnvVarLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_llm_auth_connection.py000066400000000000000000000004761523660243400317040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .auth_connection_locator import AuthConnectionLocator from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator CustomLlmAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_llm_request_headers_value.py000066400000000000000000000005601523660243400330750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator CustomLlmRequestHeadersValue = typing.Union[str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_llmapi_type.py000066400000000000000000000002721523660243400301710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing CustomLlmapiType = typing.Union[typing.Literal["chat_completions", "responses", "websocket"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_sip_header.py000066400000000000000000000014471523660243400277620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CustomSipHeader(UncheckedBaseModel): """ Custom SIP header for phone transfers with a static (validated) value. """ key: str = pydantic.Field() """ The SIP header name (e.g., 'X-Customer-ID') """ value: str = pydantic.Field() """ The header value """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_sip_header_with_dynamic_variable.py000066400000000000000000000017511523660243400343640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class CustomSipHeaderWithDynamicVariable(UncheckedBaseModel): """ Custom SIP header for phone transfers with a dynamic variable reference. The value is a variable name that will be resolved at runtime. Value is not validated here since it will be substituted with actual value later. """ key: str = pydantic.Field() """ The SIP header name (e.g., 'X-Customer-ID') """ value: str = pydantic.Field() """ The dynamic variable name to resolve """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/custom_tool_api_schema_config.py000066400000000000000000000034141523660243400323260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class CustomToolApiSchemaConfig(UncheckedBaseModel): """ Parameter schema for an integration tool the brain answers itself. Unlike ``WebhookToolApiSchemaConfig`` there is no HTTP transport: ``handler`` receives the LLM's parameters and produces the tool result. """ request_body_schema: "ObjectJsonSchemaPropertyOutput" = pydantic.Field() """ JSON schema for the parameters the LLM provides to this tool. """ 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 from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( CustomToolApiSchemaConfig, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dashboard_call_success_chart_model.py000066400000000000000000000011001523660243400332620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DashboardCallSuccessChartModel(UncheckedBaseModel): name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dashboard_criteria_chart_model.py000066400000000000000000000011221523660243400324250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DashboardCriteriaChartModel(UncheckedBaseModel): name: str criteria_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dashboard_data_collection_chart_model.py000066400000000000000000000011371523660243400337550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DashboardDataCollectionChartModel(UncheckedBaseModel): name: str data_collection_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/data_collection_result_common_model.py000066400000000000000000000014271523660243400335350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .literal_json_schema_property import LiteralJsonSchemaProperty class DataCollectionResultCommonModel(UncheckedBaseModel): data_collection_id: str value: typing.Optional[typing.Any] = None json_schema: typing.Optional[LiteralJsonSchemaProperty] = None rationale: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/default_sharing_group_config.py000066400000000000000000000015761523660243400321700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .default_sharing_group_config_permission_level import DefaultSharingGroupConfigPermissionLevel class DefaultSharingGroupConfig(UncheckedBaseModel): group_id: str = pydantic.Field() """ The ID of the group to share with """ permission_level: DefaultSharingGroupConfigPermissionLevel = pydantic.Field() """ The permission level to grant to the group """ 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 default_sharing_group_config_permission_level.py000066400000000000000000000003011523660243400355310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DefaultSharingGroupConfigPermissionLevel = typing.Union[typing.Literal["admin", "editor", "viewer"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/default_sharing_group_response_model.py000066400000000000000000000017711523660243400337360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .default_sharing_group_response_model_permission_level import DefaultSharingGroupResponseModelPermissionLevel from .workspace_group_response_model import WorkspaceGroupResponseModel class DefaultSharingGroupResponseModel(UncheckedBaseModel): group: WorkspaceGroupResponseModel = pydantic.Field() """ The group to share with by default """ permission_level: DefaultSharingGroupResponseModelPermissionLevel = pydantic.Field() """ The permission level to grant to the group """ 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 default_sharing_group_response_model_permission_level.py000066400000000000000000000003101523660243400373020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DefaultSharingGroupResponseModelPermissionLevel = typing.Union[typing.Literal["admin", "editor", "viewer"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_agent_procedure_params.py000066400000000000000000000012021523660243400323050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteAgentProcedureParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_agent_procedure"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_agent_rule_params.py000066400000000000000000000011701523660243400312700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteAgentRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_agent_rule"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_asset_params.py000066400000000000000000000011571523660243400302670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteAssetParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_asset"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_calendar_event_params.py000066400000000000000000000016351523660243400321230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteCalendarEventParams(UncheckedBaseModel): """ Permanently remove a previously-cancelled calendar event. This delete tool is the irreversible follow-up to cancel_calendar_event. The backend rejects the call (422) if the event hasn't been cancelled yet, so the only safe path is cancel-then-delete. """ smb_tool_type: typing.Optional[typing.Literal["delete_calendar_event"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_chapter_request.py000066400000000000000000000001621523660243400307760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DeleteChapterRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_chapter_response_model.py000066400000000000000000000014151523660243400323260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteChapterResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the studio chapter 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_client_interaction_params.py000066400000000000000000000012101523660243400330130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteClientInteractionParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_client_interaction"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_client_params.py000066400000000000000000000013131523660243400304200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteClientParams(UncheckedBaseModel): """ Delete a client, cascading deletion of all their appointments first. """ smb_tool_type: typing.Optional[typing.Literal["delete_client"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_dubbing_response_model.py000066400000000000000000000013751523660243400323170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteDubbingResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the dubbing project. 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_group_session_params.py000066400000000000000000000021121523660243400320370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteGroupSessionParams(UncheckedBaseModel): """ Permanently remove a previously-cancelled group session. Group analogue of ``delete_calendar_event``: cancel (``cancel_group_session_for_all``) is the soft, history-preserving step; this tool is the irreversible follow-up that drops the row from Mongo and the staff Google Calendar entirely. The backend rejects the call (422) if the session hasn't been cancelled yet, so the only safe path is cancel-then-delete. """ smb_tool_type: typing.Optional[typing.Literal["delete_group_session"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_history_item_response.py000066400000000000000000000014001523660243400322310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteHistoryItemResponse(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the deletion request. If the request was successful, the status will be 'ok'. Otherwise an error message with http code 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_holiday_params.py000066400000000000000000000011631523660243400305760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteHolidayParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_holiday"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_location_params.py000066400000000000000000000011651523660243400307570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteLocationParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_location"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_product_params.py000066400000000000000000000011631523660243400306250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteProductParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_product"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_project_request.py000066400000000000000000000001621523660243400310160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DeleteProjectRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_project_response_model.py000066400000000000000000000014151523660243400323460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteProjectResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the studio project 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_sample_response.py000066400000000000000000000013771523660243400310100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteSampleResponse(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_service_params.py000066400000000000000000000012641523660243400306070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteServiceParams(UncheckedBaseModel): """ Delete an existing service from the system. """ smb_tool_type: typing.Optional[typing.Literal["delete_service"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_staff_params.py000066400000000000000000000012651523660243400302530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteStaffParams(UncheckedBaseModel): """ Delete an existing staff member from the system. """ smb_tool_type: typing.Optional[typing.Literal["delete_staff"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_transfer_rule_params.py000066400000000000000000000011761523660243400320240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteTransferRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["delete_transfer_rule"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_voice_response_model.py000066400000000000000000000014021523660243400320010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteVoiceResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ 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: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_voice_sample_response_model.py000066400000000000000000000014171523660243400333500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 delete_workspace_group_member_response_model.py000066400000000000000000000014421523660243400353620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteWorkspaceGroupMemberResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace group 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_workspace_invite_response_model.py000066400000000000000000000014271523660243400342570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteWorkspaceInviteResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace invite 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/delete_workspace_webhook_response_model.py000066400000000000000000000014311523660243400344120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeleteWorkspaceWebhookResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace webhook 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/deliverable_info.py000066400000000000000000000017321523660243400275530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeliverableInfo(UncheckedBaseModel): signed_url: str = pydantic.Field() """ A time-limited URL to download the delivered file. """ content_type: str = pydantic.Field() """ The MIME type of the delivered file (e.g. 'video/mp4'). """ name: str = pydantic.Field() """ The name of the delivered file. """ version: typing.Optional[int] = pydantic.Field(default=None) """ The version number of the deliverable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_available_agent_identifier.py000066400000000000000000000017651523660243400336160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class DependentAvailableAgentIdentifier(UncheckedBaseModel): referenced_resource_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ If the agent is a transitive dependent, contains IDs of the resources that the agent depends on directly. """ id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 dependent_available_agent_identifier_access_level.py000066400000000000000000000003301523660243400362320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DependentAvailableAgentIdentifierAccessLevel = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] dependent_available_mcp_server_identifier.py000066400000000000000000000014511523660243400345760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dependent_available_mcp_server_identifier_access_level import DependentAvailableMcpServerIdentifierAccessLevel class DependentAvailableMcpServerIdentifier(UncheckedBaseModel): id: str name: str created_at_unix_secs: int access_level: DependentAvailableMcpServerIdentifierAccessLevel 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 dependent_available_mcp_server_identifier_access_level.py000066400000000000000000000003341523660243400373050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DependentAvailableMcpServerIdentifierAccessLevel = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_available_tool_identifier.py000066400000000000000000000014241523660243400334650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel class DependentAvailableToolIdentifier(UncheckedBaseModel): id: str name: str created_at_unix_secs: int access_level: DependentAvailableToolIdentifierAccessLevel 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 dependent_available_tool_identifier_access_level.py000066400000000000000000000003271523660243400361170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DependentAvailableToolIdentifierAccessLevel = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_branch_info.py000066400000000000000000000012071523660243400305550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DependentBranchInfo(UncheckedBaseModel): agent_id: str agent_name: str branch_id: str branch_name: str is_main: bool 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 dependent_integration_connection_identifier.py000066400000000000000000000012671523660243400352000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DependentIntegrationConnectionIdentifier(UncheckedBaseModel): """ Identifier for an integration connection that depends on an auth connection """ id: str name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_phone_number_identifier.py000066400000000000000000000013021523660243400331640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .telephony_provider import TelephonyProvider class DependentPhoneNumberIdentifier(UncheckedBaseModel): phone_number_id: str phone_number: str label: str provider: TelephonyProvider 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_unknown_agent_identifier.py000066400000000000000000000016421523660243400333670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DependentUnknownAgentIdentifier(UncheckedBaseModel): """ A model that represents an agent dependent on a knowledge base/tools to which the user has no direct access. """ referenced_resource_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ If the agent is a transitive dependent, contains IDs of the resources that the agent depends on directly. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_unknown_mcp_server_identifier.py000066400000000000000000000011031523660243400344260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DependentUnknownMcpServerIdentifier(UncheckedBaseModel): 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dependent_unknown_tool_identifier.py000066400000000000000000000013031523660243400332400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DependentUnknownToolIdentifier(UncheckedBaseModel): """ A model that represents an tool dependent on a knowledge base/tools to which the user has no direct access. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/detailed_music_response.py000066400000000000000000000023071523660243400311520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .detailed_music_response_composition_plan import DetailedMusicResponseCompositionPlan from .song_metadata import SongMetadata from .word_timestamp import WordTimestamp class DetailedMusicResponse(UncheckedBaseModel): """ Response model for structured music generation endpoint """ composition_plan: DetailedMusicResponseCompositionPlan = pydantic.Field() """ The composition plan used to generate the song """ song_metadata: SongMetadata = pydantic.Field() """ The metadata of the generated song """ words_timestamps: typing.Optional[typing.List[WordTimestamp]] = pydantic.Field(default=None) """ The timestamps of the words in the generated song """ 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 detailed_music_response_composition_plan.py000066400000000000000000000003671523660243400345340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .composition_plan import CompositionPlan from .music_prompt import MusicPrompt DetailedMusicResponseCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/detected_entity.py000066400000000000000000000020511523660243400274320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DetectedEntity(UncheckedBaseModel): """ An entity detected within transcribed text. """ text: str = pydantic.Field() """ The text that was identified as an entity. """ entity_type: str = pydantic.Field() """ The type of entity detected (e.g., 'credit_card', 'email_address', 'person_name'). """ start_char: int = pydantic.Field() """ Start character position in the transcript text. """ end_char: int = pydantic.Field() """ End character position in the transcript text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/device_model.py000066400000000000000000000016651523660243400267060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DeviceModel(UncheckedBaseModel): """ Device information. Spec: https://schema.ocsf.io/1.6.0/objects/device """ ip: typing.Optional[str] = pydantic.Field(default=None) """ IP address """ hostname: typing.Optional[str] = pydantic.Field(default=None) """ Device hostname """ type_id: typing.Optional[int] = pydantic.Field(default=None) """ Device type ID (99 = Unknown) """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dialogue_input.py000066400000000000000000000013511523660243400272670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DialogueInput(UncheckedBaseModel): text: str = pydantic.Field() """ The text to be converted into speech. """ voice_id: str = pydantic.Field() """ The ID of the voice to be used for the generation. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dialogue_input_response_model.py000066400000000000000000000015561523660243400323740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DialogueInputResponseModel(UncheckedBaseModel): text: str = pydantic.Field() """ The text of the dialogue input line. """ voice_id: str = pydantic.Field() """ The ID of the voice used for this dialogue input line. """ voice_name: str = pydantic.Field() """ The name of the voice used for this dialogue input line. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dialogue_text_alignment.py000066400000000000000000000014711523660243400311550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DialogueTextAlignment(UncheckedBaseModel): """ Character-level alignment data (field names use snake_case in JSON). """ chars: typing.Optional[typing.List[str]] = None char_start_times_ms: typing.Optional[typing.List[int]] = None char_durations_ms: typing.Optional[typing.List[int]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/direct_publishing_read_response_model.py000066400000000000000000000075531523660243400340600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .contributor import Contributor from .direct_publishing_read_response_model_display_mode import DirectPublishingReadResponseModelDisplayMode from .direct_publishing_read_response_model_genre_item import DirectPublishingReadResponseModelGenreItem from .direct_publishing_read_response_model_payout_type import DirectPublishingReadResponseModelPayoutType from .direct_publishing_read_response_model_target_audience import DirectPublishingReadResponseModelTargetAudience from .preview_audio_db_model import PreviewAudioDbModel from .read_legal_terms import ReadLegalTerms from .read_metadata_chapter_db_model import ReadMetadataChapterDbModel from .review_response_model import ReviewResponseModel from .sample_config_db_model import SampleConfigDbModel class DirectPublishingReadResponseModel(UncheckedBaseModel): read_id: str created_at_unix: int updated_at_unix: int word_count: int char_count: int chapters: typing.List[ReadMetadataChapterDbModel] title: typing.Optional[str] = None author: typing.Optional[str] = None description: typing.Optional[str] = None article_image_url: typing.Optional[str] = None language: typing.Optional[str] = None locale: typing.Optional[str] = None display_mode: typing.Optional[DirectPublishingReadResponseModelDisplayMode] = None genre: typing.Optional[typing.List[DirectPublishingReadResponseModelGenreItem]] = None fiction: typing.Optional[str] = None content_type: typing.Optional[str] = None original_file_type: typing.Optional[str] = None target_audience: typing.Optional[DirectPublishingReadResponseModelTargetAudience] = None mature_content: typing.Optional[bool] = None safesearch_adult: typing.Optional[bool] = None origin: typing.Optional[str] = None publication_date: typing.Optional[str] = None isbn: typing.Optional[str] = None ean: typing.Optional[str] = None legal_terms: typing.Optional[ReadLegalTerms] = None content_guidelines_terms: typing.Optional[ReadLegalTerms] = None last_updated_from_project_unix: typing.Optional[int] = None publishing_project_id: typing.Optional[str] = None publishing_state: typing.Optional[str] = None publisher_profile_id: typing.Optional[str] = None quality_score: typing.Optional[int] = None publisher: typing.Optional[str] = None copyright: typing.Optional[str] = None subtitle: typing.Optional[str] = None distribution_territories: typing.Optional[typing.List[str]] = None edition: typing.Optional[str] = None contributors: typing.Optional[typing.List[Contributor]] = None payout_type: typing.Optional[DirectPublishingReadResponseModelPayoutType] = None list_price: typing.Optional[float] = None currency: typing.Optional[typing.Literal["usd"]] = None original_audio_project_export_id: typing.Optional[str] = None original_audio_document_id: typing.Optional[str] = None series_id: typing.Optional[str] = None volume: typing.Optional[int] = None published_at_unix: typing.Optional[int] = None read_slug: typing.Optional[str] = None preview_audio_object: typing.Optional[PreviewAudioDbModel] = None sample_config: typing.Optional[SampleConfigDbModel] = None review: typing.Optional[ReviewResponseModel] = None voice_id: typing.Optional[str] = None can_use_assistant: typing.Optional[bool] = None is_voice_changer_on: typing.Optional[bool] = 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 direct_publishing_read_response_model_display_mode.py000066400000000000000000000003271523660243400365220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DirectPublishingReadResponseModelDisplayMode = typing.Union[ typing.Literal["text", "audio-only", "text-with-audio"], typing.Any ] direct_publishing_read_response_model_genre_item.py000066400000000000000000000017741523660243400361760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DirectPublishingReadResponseModelGenreItem = typing.Union[ typing.Literal[ "Fantasy", "Romance", "Science Fiction", "Mystery and Thriller", "Action and Adventure", "Dystopia", "Business and Economics", "Technology", "Christian & Inspirational", "Horror", "Biography and Memoir", "Education and Learning", "History", "Children's Literature", "Young Adult", "Fairy Tales and Folklore", "Fan Fiction", "General Fiction", "Health and Wellness", "Historical Fiction", "Humor", "Literary Classics", "Philosophy", "Poetry", "Politics and Government", "Psychology", "Science and Nature", "Self-Help", "Spirituality and Religion", "Travel", "True Crime", "Other", ], typing.Any, ] direct_publishing_read_response_model_payout_type.py000066400000000000000000000003311523660243400364260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DirectPublishingReadResponseModelPayoutType = typing.Union[ typing.Literal["none", "engagement_based", "fixed_payout"], typing.Any ] direct_publishing_read_response_model_target_audience.py000066400000000000000000000003411523660243400371700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DirectPublishingReadResponseModelTargetAudience = typing.Union[ typing.Literal["children", "young adult", "adult", "all ages"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/discount_response_model.py000066400000000000000000000015641523660243400312130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DiscountResponseModel(UncheckedBaseModel): discount_percent_off: typing.Optional[float] = pydantic.Field(default=None) """ The discount applied to the invoice. E.g. [20.0f] for 20% off. """ discount_amount_off: typing.Optional[float] = pydantic.Field(default=None) """ The discount applied to the invoice. E.g. [20.0f] for 20 cents off. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/do_dubbing_response.py000066400000000000000000000014011523660243400302650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DoDubbingResponse(UncheckedBaseModel): dubbing_id: str = pydantic.Field() """ The ID of the dubbing project. """ expected_duration_sec: float = pydantic.Field() """ The expected duration of the dubbing project 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/document_usage_mode_enum.py000066400000000000000000000002431523660243400313100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DocumentUsageModeEnum = typing.Union[typing.Literal["prompt", "auto"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/docx_export_options.py000066400000000000000000000014761523660243400304000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DocxExportOptions(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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dtmf_input_config.py000066400000000000000000000023071523660243400277570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DtmfInputConfig(UncheckedBaseModel): """ Configuration for DTMF (keypad) input collection during phone calls. """ dtmf_input_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Timeout in seconds to wait for additional DTMF digits """ hash_terminator: typing.Optional[bool] = pydantic.Field(default=None) """ If true, pressing # immediately completes DTMF input """ redact_input: typing.Optional[bool] = pydantic.Field(default=None) """ If true, replace the caller's DTMF (keypad) entries with a redaction marker in the transcript, conversation log and analysis. Digits the agent repeats back or passes to a tool are not affected. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dub_order_item_request.py000066400000000000000000000027761523660243400310260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_id import MediaId class DubOrderItemRequest(UncheckedBaseModel): media_id: MediaId = pydantic.Field() """ The ID of the uploaded media file to dub. """ source_language: str = pydantic.Field() """ The language code of the source media (e.g. 'en', 'es'). """ destination_languages: typing.List[str] = pydantic.Field() """ List of target language codes to dub the media into. """ include_captions: bool = pydantic.Field() """ Whether to generate captions for the dubbed outputs. """ include_source_captions: bool = pydantic.Field() """ Whether to generate captions for the source language. """ instructions: typing.Optional[str] = pydantic.Field(default=None) """ Optional free-text instructions for the dubbing team. """ captions_sdh: typing.Optional[bool] = pydantic.Field(default=None) """ Whether captions should use SDH format, which includes descriptions for deaf and hard-of-hearing viewers. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbed_segment.py000066400000000000000000000015511523660243400272300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_media_reference import DubbingMediaReference from .segment_subtitle_frame import SegmentSubtitleFrame class DubbedSegment(UncheckedBaseModel): start_time: float end_time: float text: typing.Optional[str] = None subtitles: typing.List[SegmentSubtitleFrame] audio_stale: bool media_ref: typing.Optional[DubbingMediaReference] = 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 dubbing_bulk_source_segment_update_response.py000066400000000000000000000017301523660243400352120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_segment import DubbingTranscriptSegment class DubbingBulkSourceSegmentUpdateResponse(UncheckedBaseModel): """ The result of a bulk source edit: the updated segments and the new revision. """ segments: typing.List[DubbingTranscriptSegment] = pydantic.Field() """ The edited segments in their updated state. """ revision: int = pydantic.Field() """ The project's source-transcript revision after the edits. """ 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 dubbing_bulk_target_segment_update_response.py000066400000000000000000000017371523660243400352070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_target_transcript_segment import DubbingTargetTranscriptSegment class DubbingBulkTargetSegmentUpdateResponse(UncheckedBaseModel): """ The result of a bulk target edit: the updated segments and the new revision. """ segments: typing.List[DubbingTargetTranscriptSegment] = pydantic.Field() """ The edited target segments in their updated state. """ revision: int = pydantic.Field() """ The target's revision after the edits. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_error.py000066400000000000000000000021461523660243400271050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingError(UncheckedBaseModel): code: str = pydantic.Field() """ Stable identifier for the failure, safe to branch on. New codes are added over time, so treat an unrecognized value as 'internal_error'. """ message: str = pydantic.Field() """ Human-readable description of the failure, for display. The wording may change at any time; branch on `code` instead. """ retryable: bool = pydantic.Field() """ Whether resubmitting the same input could succeed. False means the failure describes the input or the account, so an identical retry will fail the same way. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_language_list_response.py000066400000000000000000000016231523660243400325070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_language_response import DubbingLanguageResponse class DubbingLanguageListResponse(UncheckedBaseModel): languages: typing.List[DubbingLanguageResponse] = pydantic.Field() """ The page of language targets for the project. """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for the next page, or null when there are no more results. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_language_outputs.py000066400000000000000000000014161523660243400313410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingLanguageOutputs(UncheckedBaseModel): """ Signed, time-limited download URLs for a language target's outputs. """ lossless_audio: typing.Optional[str] = pydantic.Field(default=None) """ Signed URL of the dubbed lossless audio track. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_language_response.py000066400000000000000000000064351523660243400314620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_error import DubbingError from .dubbing_language_outputs import DubbingLanguageOutputs from .dubbing_language_response_status import DubbingLanguageResponseStatus from .voice_settings import VoiceSettings from .voices_not_permitted_warning import VoicesNotPermittedWarning class DubbingLanguageResponse(UncheckedBaseModel): language_id: str = pydantic.Field() """ Unique identifier of the language target. """ project_id: str = pydantic.Field() """ Identifier of the parent dubbing project. """ target_language: str = pydantic.Field() """ BCP-47 language tag this target is dubbed into. """ status: DubbingLanguageResponseStatus = pydantic.Field() """ Lifecycle status: 'queued' (waiting on the project), 'processing', 'completed', 'stale' (source/transcript changed), or 'failed'. """ model_id: typing.Optional[str] = pydantic.Field(default=None) """ Effective dubbing model id (target override or project default). """ voice_settings: typing.Optional[VoiceSettings] = pydantic.Field(default=None) """ Voice settings applied to the whole language, or null if unset. """ outputs: typing.Optional[DubbingLanguageOutputs] = pydantic.Field(default=None) """ Signed output URLs; null until the target has produced an output (present once 'completed', and kept while 'stale' -- compare `output_revision` against `revision` to tell whether the output is up to date). """ revision: int = pydantic.Field() """ Monotonic counter incremented whenever this target's transcript changes (a source edit affecting it, or an edit to its translation). """ output_revision: typing.Optional[int] = pydantic.Field(default=None) """ The `revision` the current dubbed output was generated from; equal to `revision` when up to date, less than it when 'stale'. Null until a generation has completed. """ error: typing.Optional[DubbingError] = pydantic.Field(default=None) """ Why this language failed; null unless `status` is 'failed', and also null for the few languages that failed before failure reporting was introduced. A code of 'project_failed' means the parent project failed, so read the project for the underlying cause. """ warnings: typing.Optional[typing.List[VoicesNotPermittedWarning]] = pydantic.Field(default=None) """ Non-fatal conditions raised while dubbing this language, empty when there are none. Reflects the latest generation. Conditions raised while preparing the source are reported on the project instead. """ created_at: dt.datetime = pydantic.Field() """ When the language target was created. """ updated_at: dt.datetime = pydantic.Field() """ When the language target was last updated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_language_response_status.py000066400000000000000000000003271523660243400330570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DubbingLanguageResponseStatus = typing.Union[ typing.Literal["queued", "processing", "completed", "stale", "failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_media_metadata.py000066400000000000000000000013461523660243400306740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingMediaMetadata(UncheckedBaseModel): content_type: str = pydantic.Field() """ The content type of the media. """ duration: float = pydantic.Field() """ The duration of the media 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_media_reference.py000066400000000000000000000012641523660243400310510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingMediaReference(UncheckedBaseModel): src: str content_type: str bucket_name: str random_path_slug: str duration_secs: float is_audio: bool url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_metadata_page_response_model.py000066400000000000000000000013421523660243400336230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_metadata_response import DubbingMetadataResponse class DubbingMetadataPageResponseModel(UncheckedBaseModel): dubs: typing.List[DubbingMetadataResponse] next_cursor: typing.Optional[str] = None has_more: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_metadata_response.py000066400000000000000000000034211523660243400314470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_media_metadata import DubbingMediaMetadata class DubbingMetadataResponse(UncheckedBaseModel): dubbing_id: str = pydantic.Field() """ The ID of the dubbing project. """ name: str = pydantic.Field() """ The name of the dubbing project. """ status: str = pydantic.Field() """ The state this dub is in. """ source_language: typing.Optional[str] = pydantic.Field(default=None) """ Once dubbing has completed, the ISO-639-1 code of the original media's source language. """ target_languages: typing.List[str] = pydantic.Field() """ The ISO-639-1 code of the languages this media has been dubbed into. """ editable: typing.Optional[bool] = pydantic.Field(default=None) """ Whether this dubbing project is editable in Dubbing Studio. """ created_at: dt.datetime = pydantic.Field() """ Timestamp this dub was created. """ media_metadata: typing.Optional[DubbingMediaMetadata] = pydantic.Field(default=None) """ Metadata, such as the length in seconds and content type, of the dubbed content. """ error: typing.Optional[str] = pydantic.Field(default=None) """ Error message indicate, if this dub has failed, what happened. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_project_list_response.py000066400000000000000000000016241523660243400323730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_project_response import DubbingProjectResponse class DubbingProjectListResponse(UncheckedBaseModel): projects: typing.List[DubbingProjectResponse] = pydantic.Field() """ The page of dubbing projects the caller can access. """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for the next page, or null when there are no more results. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_project_response.py000066400000000000000000000060301523660243400313340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_error import DubbingError from .dubbing_project_response_status import DubbingProjectResponseStatus from .dubbing_source_media_info import DubbingSourceMediaInfo from .voices_not_permitted_warning import VoicesNotPermittedWarning class DubbingProjectResponse(UncheckedBaseModel): project_id: str = pydantic.Field() """ Unique identifier of the dubbing project. """ status: DubbingProjectResponseStatus = pydantic.Field() """ Lifecycle status of the project: 'preparing'/'processing' while it transcribes, 'ready' once transcription is done, or 'failed'. """ reference: typing.Optional[str] = pydantic.Field(default=None) """ Optional free-form string the customer can provide to identify the project on their end. """ source_language: typing.Optional[str] = pydantic.Field(default=None) """ BCP-47 language tag of the source media (null if auto-detected). """ model_id: typing.Optional[str] = pydantic.Field(default=None) """ Default dubbing model id applied to this project's language targets. """ media: typing.Optional[DubbingSourceMediaInfo] = pydantic.Field(default=None) """ Source media metadata; null until the project is ready. """ language_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Identifiers of the language targets created under this project. """ webhook_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Workspace webhooks notified when this project becomes ready or fails, and when any of its languages completes or fails. """ revision: int = pydantic.Field() """ Monotonic counter incremented whenever the source transcript is edited (segment add/edit/delete). """ error: typing.Optional[DubbingError] = pydantic.Field(default=None) """ Why the project failed; null unless `status` is 'failed'. Also null for the few projects that failed before failure reporting was introduced. """ warnings: typing.Optional[typing.List[VoicesNotPermittedWarning]] = pydantic.Field(default=None) """ Non-fatal conditions raised while preparing the source, empty when there are none. Reflects the latest preparation. Conditions raised while dubbing a particular language are reported on that language instead. """ created_at: dt.datetime = pydantic.Field() """ When the project was created. """ updated_at: dt.datetime = pydantic.Field() """ When the project was last updated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_project_response_status.py000066400000000000000000000003261523660243400327410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing DubbingProjectResponseStatus = typing.Union[ typing.Literal["queued", "preparing", "processing", "ready", "failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_regenerate_response.py000066400000000000000000000026461523660243400320200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingRegenerateResponse(UncheckedBaseModel): """ The accepted re-dub: what it covers and what it cost. """ regenerated_segment_ids: typing.List[str] = pydantic.Field() """ The segments this re-dub re-synthesizes: those with edits to apply. """ regenerated_seconds: float = pydantic.Field() """ Seconds of audio this re-dub covers -- the edited regions only, never the whole target. `charged_seconds` is the part of it that was billed. """ charged_seconds: float = pydantic.Field() """ Seconds actually billed, after the free-regeneration allowance. Zero when the re-dub cost nothing -- the allowance covered all of it, or the project's included generation did. """ free_regeneration_seconds_remaining: float = pydantic.Field() """ Free-regeneration seconds left for this language target after this re-dub. The allowance is the source's own duration. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_render_response_model.py000066400000000000000000000011221523660243400323220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_resource.py000066400000000000000000000021271523660243400276020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_media_reference import DubbingMediaReference from .render import Render from .speaker_segment import SpeakerSegment from .speaker_track import SpeakerTrack class DubbingResource(UncheckedBaseModel): id: str version: int source_language: str target_languages: typing.List[str] input: DubbingMediaReference background: typing.Optional[DubbingMediaReference] = None foreground: typing.Optional[DubbingMediaReference] = None 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_segment_update_request.py000066400000000000000000000021261523660243400325260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingSegmentUpdateRequest(UncheckedBaseModel): """ A partial update to a source segment; omitted fields are left unchanged. """ text: typing.Optional[str] = pydantic.Field(default=None) """ New text for the segment. """ speaker_id: typing.Optional[str] = pydantic.Field(default=None) """ New speaker id for the segment. """ start_s: typing.Optional[float] = pydantic.Field(default=None) """ New start time, in seconds. """ end_s: typing.Optional[float] = pydantic.Field(default=None) """ New end time, 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_source_media_info.py000066400000000000000000000022261523660243400314250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingSourceMediaInfo(UncheckedBaseModel): """ Metadata about the project's source media. """ filename: typing.Optional[str] = pydantic.Field(default=None) """ Original filename of the uploaded source media (null for URL sources). """ duration_s: typing.Optional[float] = pydantic.Field(default=None) """ Duration of the source media in seconds. """ has_video: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the source media contains a video stream. """ mime_type: typing.Optional[str] = pydantic.Field(default=None) """ MIME type of the uploaded source media. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_source_segment_update_response.py000066400000000000000000000016751523660243400342640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_segment import DubbingTranscriptSegment class DubbingSourceSegmentUpdateResponse(UncheckedBaseModel): """ The result of a source-segment add or edit: the segment and the new revision. """ segment: DubbingTranscriptSegment = pydantic.Field() """ The segment in its updated state. """ revision: int = pydantic.Field() """ The project's source-transcript revision after this edit. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_source_transcript_response.py000066400000000000000000000017771523660243400334540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_segment import DubbingTranscriptSegment class DubbingSourceTranscriptResponse(UncheckedBaseModel): language: typing.Optional[str] = pydantic.Field(default=None) """ BCP-47 language tag of the source transcript (null if unknown). """ segments: typing.List[DubbingTranscriptSegment] = pydantic.Field() """ The source segments, in playback order. """ revision: int = pydantic.Field() """ The project's source-transcript revision at read time. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_target_segment_update_request.py000066400000000000000000000015741523660243400341020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingTargetSegmentUpdateRequest(UncheckedBaseModel): """ A partial edit to a target segment. An omitted field is left unchanged; a provided ``null`` clears it (see each field for what clearing means). """ translation: typing.Optional[str] = pydantic.Field(default=None) """ New translated text, or null to mark the segment for re-translation. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_target_segment_update_response.py000066400000000000000000000017111523660243400342410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_target_transcript_segment import DubbingTargetTranscriptSegment class DubbingTargetSegmentUpdateResponse(UncheckedBaseModel): """ The result of a target-translation edit: the updated segment and the new revision. """ segment: DubbingTargetTranscriptSegment = pydantic.Field() """ The target segment in its updated state. """ revision: int = pydantic.Field() """ The target's revision after this edit. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_target_transcript_response.py000066400000000000000000000021511523660243400334250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_target_transcript_segment import DubbingTargetTranscriptSegment class DubbingTargetTranscriptResponse(UncheckedBaseModel): source_language: typing.Optional[str] = pydantic.Field(default=None) """ BCP-47 language tag of the source transcript. """ target_language: str = pydantic.Field() """ BCP-47 language tag this target is translated into. """ segments: typing.List[DubbingTargetTranscriptSegment] = pydantic.Field() """ The target segments, in playback order. """ revision: int = pydantic.Field() """ The target's revision at read time. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_target_transcript_segment.py000066400000000000000000000024421523660243400332340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingTargetTranscriptSegment(UncheckedBaseModel): """ One segment of a target transcript: a source segment plus its translation. """ id: str = pydantic.Field() """ Stable identifier of the segment (from the source). """ speaker_id: str = pydantic.Field() """ Identifier of the segment's speaker. """ start_s: float = pydantic.Field() """ Start time of the segment, in seconds. """ end_s: float = pydantic.Field() """ End time of the segment, in seconds. """ source_text: str = pydantic.Field() """ The source-language text of the segment. """ translation: typing.Optional[str] = pydantic.Field(default=None) """ The translated text, or null if not translated yet (needs translation). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript.py000066400000000000000000000012641523660243400301450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_utterance import DubbingTranscriptUtterance class DubbingTranscript(UncheckedBaseModel): language: str utterances: typing.List[DubbingTranscriptUtterance] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_character.py000066400000000000000000000012501523660243400321540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingTranscriptCharacter(UncheckedBaseModel): text: typing.Optional[str] = None start_s: typing.Optional[float] = None end_s: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_response_model.py000066400000000000000000000013011523660243400332330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_utterance import DubbingTranscriptUtterance class DubbingTranscriptResponseModel(UncheckedBaseModel): language: str utterances: typing.List[DubbingTranscriptUtterance] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_revision_response.py000066400000000000000000000014131523660243400337750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingTranscriptRevisionResponse(UncheckedBaseModel): """ The new revision after a source edit that returns no segment (e.g. a delete). """ revision: int = pydantic.Field() """ The project's source-transcript revision after this edit. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_segment.py000066400000000000000000000023271523660243400316700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DubbingTranscriptSegment(UncheckedBaseModel): """ One segment of a source transcript. """ id: str = pydantic.Field() """ Stable identifier of the segment. """ text: str = pydantic.Field() """ The transcribed text of the segment. """ speaker_id: str = pydantic.Field() """ Identifier of the segment's speaker. """ start_s: float = pydantic.Field() """ Start time of the segment, in seconds. """ end_s: float = pydantic.Field() """ End time of the segment, in seconds. """ external_id: typing.Optional[str] = pydantic.Field(default=None) """ The caller-supplied external id for this segment, if one was provided. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_utterance.py000066400000000000000000000015251523660243400322170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_word import DubbingTranscriptWord class DubbingTranscriptUtterance(UncheckedBaseModel): text: typing.Optional[str] = None speaker_id: typing.Optional[str] = None start_s: typing.Optional[float] = None end_s: typing.Optional[float] = None words: typing.Optional[typing.List[DubbingTranscriptWord]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcript_word.py000066400000000000000000000015431523660243400312000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript_character import DubbingTranscriptCharacter class DubbingTranscriptWord(UncheckedBaseModel): text: typing.Optional[str] = None word_type: typing.Optional[str] = None start_s: typing.Optional[float] = None end_s: typing.Optional[float] = None characters: typing.Optional[typing.List[DubbingTranscriptCharacter]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dubbing_transcripts_response_model.py000066400000000000000000000021161523660243400334230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_transcript import DubbingTranscript from .dubbing_transcripts_response_model_transcript_format import DubbingTranscriptsResponseModelTranscriptFormat class DubbingTranscriptsResponseModel(UncheckedBaseModel): transcript_format: DubbingTranscriptsResponseModelTranscriptFormat srt: typing.Optional[str] = None webvtt: typing.Optional[str] = None json_: typing_extensions.Annotated[ typing.Optional[DubbingTranscript], FieldMetadata(alias="json"), pydantic.Field(alias="json") ] = 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 dubbing_transcripts_response_model_transcript_format.py000066400000000000000000000003041523660243400371620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DubbingTranscriptsResponseModelTranscriptFormat = typing.Union[typing.Literal["srt", "webvtt", "json"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dummy_tool_result_model.py000066400000000000000000000010471523660243400312270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DummyToolResultModel(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dynamic_variable_assignment.py000066400000000000000000000032541523660243400320040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DynamicVariableAssignment(UncheckedBaseModel): """ Configuration for extracting values from tool responses and assigning them to dynamic variables. """ source: typing.Optional[typing.Literal["response"]] = pydantic.Field(default=None) """ The source to extract the value from. Currently only 'response' is supported. """ dynamic_variable: str = pydantic.Field() """ The name of the dynamic variable to assign the extracted value to """ value_path: str = pydantic.Field() """ Dot notation path to extract the value from the source (e.g., 'user.name' or 'data.0.id') """ sanitize: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this assignment's value will be removed from the tool response before sending to the LLM and transcript, but still processed for variable assignment. """ preserve_native_type: typing.Optional[bool] = pydantic.Field(default=None) """ If true, non-scalar values (lists, objects) extracted from the tool response are stored as their native type instead of being stringified to JSON. Enable this to use extracted arrays directly as list dynamic variables. """ 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 dynamic_variable_nested_value_type_input.py000066400000000000000000000002011523660243400345000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DynamicVariableNestedValueTypeInput = typing.Any dynamic_variable_nested_value_type_output.py000066400000000000000000000002021523660243400347020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing DynamicVariableNestedValueTypeOutput = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dynamic_variable_schema_override.py000066400000000000000000000012321523660243400327650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DynamicVariableSchemaOverride(UncheckedBaseModel): dynamic_variable: str = pydantic.Field() """ The name of the dynamic variable to use """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dynamic_variable_update_common_model.py000066400000000000000000000014461523660243400336470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DynamicVariableUpdateCommonModel(UncheckedBaseModel): """ Tracks a dynamic variable update that occurred during tool execution. """ variable_name: str old_value: typing.Optional[str] = None new_value: str updated_at: float tool_name: str tool_request_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/dynamic_variables_config.py000066400000000000000000000013551523660243400312640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DynamicVariablesConfig(UncheckedBaseModel): dynamic_variable_placeholders: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ A dictionary of dynamic variable placeholders and their values """ 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 dynamic_variables_config_workflow_override.py000066400000000000000000000013751523660243400350400ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class DynamicVariablesConfigWorkflowOverride(UncheckedBaseModel): dynamic_variable_placeholders: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ A dictionary of dynamic variable placeholders and their values """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/edit_chapter_response_model.py000066400000000000000000000012521523660243400320100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_with_content_response_model import ChapterWithContentResponseModel class EditChapterResponseModel(UncheckedBaseModel): chapter: ChapterWithContentResponseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/edit_project_response_model.py000066400000000000000000000011671523660243400320350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_response import ProjectResponse class EditProjectResponseModel(UncheckedBaseModel): project: ProjectResponse 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/edit_voice_response_model.py000066400000000000000000000013741523660243400314740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EditVoiceResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the voice edit 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/edit_voice_settings_request.py000066400000000000000000000001661523660243400320640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EditVoiceSettingsRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/edit_voice_settings_response_model.py000066400000000000000000000014151523660243400334100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EditVoiceSettingsResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the voice settings edit 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/embed_variant.py000066400000000000000000000002611523660243400270560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EmbedVariant = typing.Union[typing.Literal["tiny", "compact", "full", "expandable"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/embedding_model_enum.py000066400000000000000000000003201523660243400303740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EmbeddingModelEnum = typing.Union[ typing.Literal["e5_mistral_7b_instruct", "multilingual_e5_large_instruct"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_call_tool_config.py000066400000000000000000000010441523660243400304010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_call_tool_result_model.py000066400000000000000000000012711523660243400316340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EndCallToolResultModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None message: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_call_trigger_action.py000066400000000000000000000010471523660243400311020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EndCallTriggerAction(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_procedure_tool_config_input.py000066400000000000000000000013011523660243400326710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_at_version_input import ProcedureAtVersionInput class EndProcedureToolConfigInput(UncheckedBaseModel): procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionInput]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_procedure_tool_config_output.py000066400000000000000000000013051523660243400330760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_at_version_output import ProcedureAtVersionOutput class EndProcedureToolConfigOutput(UncheckedBaseModel): procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionOutput]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/end_procedure_tool_error_status.py000066400000000000000000000002621523660243400327460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EndProcedureToolErrorStatus = typing.Union[typing.Literal["not_found", "invalid_id"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/entity_management_activity_id.py000066400000000000000000000001421523660243400323540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. EntityManagementActivityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/entry_behavior.py000066400000000000000000000002721523660243400273000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EntryBehavior = typing.Union[typing.Literal["generate_immediately", "wait_for_user", "auto"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_auth_connection_locator.py000066400000000000000000000014411523660243400336060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EnvironmentAuthConnectionLocator(UncheckedBaseModel): """ References an environment variable of type 'auth_connection' by label. At runtime, resolves to the auth connection for the current environment, falling back to the default environment. """ env_var_label: 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 environment_variable_auth_connection_value.py000066400000000000000000000011261523660243400350450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EnvironmentVariableAuthConnectionValue(UncheckedBaseModel): auth_connection_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 environment_variable_auth_connection_value_request.py000066400000000000000000000011351523660243400366150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EnvironmentVariableAuthConnectionValueRequest(UncheckedBaseModel): auth_connection_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_variable_response.py000066400000000000000000000017141523660243400324110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .environment_variable_response_type import EnvironmentVariableResponseType from .environment_variable_response_values import EnvironmentVariableResponseValues class EnvironmentVariableResponse(UncheckedBaseModel): label: str created_at_unix_secs: int updated_at_unix_secs: int created_by_user_id: typing.Optional[str] = None type: EnvironmentVariableResponseType id: str workspace_id: str values: EnvironmentVariableResponseValues 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_variable_response_type.py000066400000000000000000000003021523660243400334420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EnvironmentVariableResponseType = typing.Union[typing.Literal["string", "secret", "auth_connection"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_variable_response_values.py000066400000000000000000000007011523660243400337630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .environment_variable_auth_connection_value import EnvironmentVariableAuthConnectionValue from .environment_variable_secret_value import EnvironmentVariableSecretValue EnvironmentVariableResponseValues = typing.Union[ typing.Dict[str, str], typing.Dict[str, EnvironmentVariableSecretValue], typing.Dict[str, EnvironmentVariableAuthConnectionValue], ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_variable_secret_value.py000066400000000000000000000011051523660243400332260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EnvironmentVariableSecretValue(UncheckedBaseModel): secret_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 environment_variable_secret_value_request.py000066400000000000000000000011141523660243400347170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class EnvironmentVariableSecretValueRequest(UncheckedBaseModel): secret_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/environment_variables_list_response.py000066400000000000000000000013771523660243400336340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .environment_variable_response import EnvironmentVariableResponse class EnvironmentVariablesListResponse(UncheckedBaseModel): environment_variables: typing.List[EnvironmentVariableResponse] next_cursor: typing.Optional[str] = None has_more: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/error_payload.py000066400000000000000000000015401523660243400271210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ErrorPayload(UncheckedBaseModel): """ Payload for protocol-level errors sent by ElevenLabs before closing the connection. """ type: typing.Literal["error"] = pydantic.Field(default="error") """ The message type identifier. """ message: str = pydantic.Field() """ Human-readable description of the error. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/evaluation_criteria_summary_result.py000066400000000000000000000013501523660243400334620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .evaluation_success_result import EvaluationSuccessResult class EvaluationCriteriaSummaryResult(UncheckedBaseModel): result: EvaluationSuccessResult score: typing.Optional[int] = None max_score: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/evaluation_settings_input.py000066400000000000000000000017431523660243400315720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .prompt_evaluation_criteria import PromptEvaluationCriteria class EvaluationSettingsInput(UncheckedBaseModel): """ Settings to evaluate an agent's performance. Agents are evaluated against a set of criteria, with success being defined as meeting some combination of those criteria. """ criteria: typing.Optional[typing.List[PromptEvaluationCriteria]] = pydantic.Field(default=None) """ Individual criteria that the agent should be evaluated against """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/evaluation_settings_output.py000066400000000000000000000017441523660243400317740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .prompt_evaluation_criteria import PromptEvaluationCriteria class EvaluationSettingsOutput(UncheckedBaseModel): """ Settings to evaluate an agent's performance. Agents are evaluated against a set of criteria, with success being defined as meeting some combination of those criteria. """ criteria: typing.Optional[typing.List[PromptEvaluationCriteria]] = pydantic.Field(default=None) """ Individual criteria that the agent should be evaluated against """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/evaluation_success_result.py000066400000000000000000000002641523660243400315560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EvaluationSuccessResult = typing.Union[typing.Literal["success", "failure", "unknown"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/exact_parameter_evaluation_strategy.py000066400000000000000000000012511523660243400335730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ExactParameterEvaluationStrategy(UncheckedBaseModel): expected_value: str = pydantic.Field() """ The exact string value that the parameter must match. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/exotel_api_subdomain.py000066400000000000000000000002651523660243400304540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ExotelApiSubdomain = typing.Union[typing.Literal["api.in.exotel.com", "api.exotel.com"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/exotel_outbound_call_response.py000066400000000000000000000016471523660243400324170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class ExotelOutboundCallResponse(UncheckedBaseModel): success: bool message: str conversation_id: typing.Optional[str] = None call_sid: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="callSid"), pydantic.Field(alias="callSid", description="Exotel CallSid for the originated call"), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/export_options.py000066400000000000000000000111461523660243400273560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class ExportOptions_Docx(UncheckedBaseModel): format: typing.Literal["docx"] = "docx" 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 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 ExportOptions_Html(UncheckedBaseModel): format: typing.Literal["html"] = "html" 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 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 ExportOptions_Pdf(UncheckedBaseModel): format: typing.Literal["pdf"] = "pdf" 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 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 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 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 ExportOptions_Srt(UncheckedBaseModel): format: typing.Literal["srt"] = "srt" max_characters_per_line: typing.Optional[int] = None 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 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 ExportOptions_Txt(UncheckedBaseModel): format: typing.Literal["txt"] = "txt" max_characters_per_line: typing.Optional[int] = None 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 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 ExportOptions = typing_extensions.Annotated[ typing.Union[ ExportOptions_Docx, ExportOptions_Html, ExportOptions_Pdf, ExportOptions_SegmentedJson, ExportOptions_Srt, ExportOptions_Txt, ], UnionMetadata(discriminant="format"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/external_file_sync_info.py000066400000000000000000000030411523660243400311450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .external_sync_provider import ExternalSyncProvider class ExternalFileSyncInfo(UncheckedBaseModel): """ Tracks the link back to the original file in an external source. """ type: ExternalSyncProvider = pydantic.Field(default="google_drive") """ Provider identifier """ source_entity_id: str = pydantic.Field() """ Entity ID in the external system """ integration_connection_id: str = pydantic.Field() """ Integration connection instance ID """ source_parent_entity_id: str = pydantic.Field() """ Folder ID in the external system this file was synced from """ source_mime_type: str = pydantic.Field() """ Original MIME type in the external system """ source_modified_time: dt.datetime = pydantic.Field() """ Last modified time from the external system """ root_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ KB folder ID of the sync root, used to query all entities under a sync tree """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/external_folder_sync_info.py000066400000000000000000000026651523660243400315140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .external_sync_provider import ExternalSyncProvider class ExternalFolderSyncInfo(UncheckedBaseModel): """ Metadata for a KB folder that mirrors an external source folder. """ type: ExternalSyncProvider = pydantic.Field(default="google_drive") """ Provider identifier """ source_entity_id: str = pydantic.Field() """ Entity ID in the external system """ integration_connection_id: str = pydantic.Field() """ Integration connection instance ID """ root_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ KB folder ID of the sync root. None means this folder is the root. """ sync_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Opaque cursor for incremental sync, interpreted by the provider """ last_sync_at: typing.Optional[int] = pydantic.Field(default=None) """ Unix timestamp of last completed sync """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/external_sync_job_trigger.py000066400000000000000000000002651523660243400315150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ExternalSyncJobTrigger = typing.Union[typing.Literal["on_demand", "on_connect", "auto"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/external_sync_job_type.py000066400000000000000000000002461523660243400310320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ExternalSyncJobType = typing.Union[typing.Literal["full", "incremental"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/external_sync_provider.py000066400000000000000000000002061523660243400310450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ExternalSyncProvider = typing.Literal["google_drive"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/feature_status_common_model.py000066400000000000000000000011751523660243400320510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FeatureStatusCommonModel(UncheckedBaseModel): enabled: typing.Optional[bool] = None used: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/features_usage_common_model.py000066400000000000000000000034641523660243400320200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .feature_status_common_model import FeatureStatusCommonModel from .tests_feature_usage_common_model import TestsFeatureUsageCommonModel from .workflow_features_usage_common_model import WorkflowFeaturesUsageCommonModel class FeaturesUsageCommonModel(UncheckedBaseModel): language_detection: typing.Optional[FeatureStatusCommonModel] = None transfer_to_agent: typing.Optional[FeatureStatusCommonModel] = None transfer_to_number: typing.Optional[FeatureStatusCommonModel] = None multivoice: typing.Optional[FeatureStatusCommonModel] = None dtmf_tones: typing.Optional[FeatureStatusCommonModel] = None external_mcp_servers: typing.Optional[FeatureStatusCommonModel] = None pii_zrm_workspace: typing.Optional[bool] = None pii_zrm_agent: typing.Optional[bool] = None tool_dynamic_variable_updates: typing.Optional[FeatureStatusCommonModel] = None is_livekit: typing.Optional[bool] = None voicemail_detection: typing.Optional[FeatureStatusCommonModel] = None dtmf_input: typing.Optional[FeatureStatusCommonModel] = None workflow: typing.Optional[WorkflowFeaturesUsageCommonModel] = None agent_testing: typing.Optional[TestsFeatureUsageCommonModel] = None versioning: typing.Optional[FeatureStatusCommonModel] = None file_input: typing.Optional[FeatureStatusCommonModel] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/feedback_item.py000066400000000000000000000001521523660243400270170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing FeedbackItem = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/field_conflict.py000066400000000000000000000024141523660243400272240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conflict_section import ConflictSection class FieldConflict(UncheckedBaseModel): path: str = pydantic.Field() """ Identifier of the conflicting field relative to its section: a dot-path within conversation_config/platform_settings, or a procedure id. """ section: ConflictSection = pydantic.Field() """ Which config section this path belongs to. """ base_value: typing.Optional[typing.Any] = pydantic.Field(default=None) """ Value at the common ancestor (merge base). """ source_value: typing.Optional[typing.Any] = pydantic.Field(default=None) """ Value on the source branch tip. """ target_value: typing.Optional[typing.Any] = pydantic.Field(default=None) """ Value on the target branch tip. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/file_input_config.py000066400000000000000000000022361523660243400277450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FileInputConfig(UncheckedBaseModel): enabled: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, users may attach images or PDFs in chat when the LLM supports multimodal input. """ max_files_in_memory: typing.Optional[int] = pydantic.Field(default=None) """ Number of most-recent files kept in memory during a conversation. Older files are summarized and their bytes freed. """ max_files_per_conversation: typing.Optional[int] = pydantic.Field(default=None) """ Total files a user can upload in one conversation. Uploads are billed per file. Use -1 for no limit, or a value >= max_files_in_memory. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/file_input_config_workflow_override.py000066400000000000000000000022561523660243400336000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FileInputConfigWorkflowOverride(UncheckedBaseModel): enabled: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, users may attach images or PDFs in chat when the LLM supports multimodal input. """ max_files_in_memory: typing.Optional[int] = pydantic.Field(default=None) """ Number of most-recent files kept in memory during a conversation. Older files are summarized and their bytes freed. """ max_files_per_conversation: typing.Optional[int] = pydantic.Field(default=None) """ Total files a user can upload in one conversation. Uploads are billed per file. Use -1 for no limit, or a value >= max_files_in_memory. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/file_refresh_status.py000066400000000000000000000016651523660243400303270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .crawl_status import CrawlStatus class FileRefreshStatus(UncheckedBaseModel): """ In-flight/last refresh state for an externally-synced KB file. """ status: typing.Optional[CrawlStatus] = None enqueued_at: typing.Optional[int] = None started_at: typing.Optional[int] = None completed_at: typing.Optional[int] = None last_synced_at: typing.Optional[int] = None error_message: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/final_output.py000066400000000000000000000016421523660243400267730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class FinalOutput(UncheckedBaseModel): is_final: typing_extensions.Annotated[ typing.Optional[typing.Literal[True]], FieldMetadata(alias="isFinal"), pydantic.Field( alias="isFinal", description="Indicates if the generation is complete. If set to `True`, `audio` will be null.", ), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/final_output_multi.py000066400000000000000000000022371523660243400302060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class FinalOutputMulti(UncheckedBaseModel): """ Server payload indicating the final output for a specific context. """ is_final: typing_extensions.Annotated[ typing.Literal[True], FieldMetadata(alias="isFinal"), pydantic.Field(alias="isFinal", description="Indicates this is the final message for the context."), ] = True context_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="contextId"), pydantic.Field(alias="contextId", description="The context_id for which this is the final message."), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/final_transcript.py000066400000000000000000000011371523660243400276230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FinalTranscript(UncheckedBaseModel): message_type: typing.Optional[str] = None text: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/final_transcript_with_timestamps.py000066400000000000000000000015231523660243400331230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .final_transcript_with_timestamps_words_item import FinalTranscriptWithTimestampsWordsItem class FinalTranscriptWithTimestamps(UncheckedBaseModel): message_type: typing.Optional[str] = None text: str language_code: typing.Optional[str] = None words: typing.Optional[typing.List[FinalTranscriptWithTimestampsWordsItem]] = 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 final_transcript_with_timestamps_words_item.py000066400000000000000000000043101523660243400352750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .final_transcript_with_timestamps_words_item_characters_item import ( FinalTranscriptWithTimestampsWordsItemCharactersItem, ) from .final_transcript_with_timestamps_words_item_type import FinalTranscriptWithTimestampsWordsItemType class FinalTranscriptWithTimestampsWordsItem(UncheckedBaseModel): """ Word-level detail of the transcription with timing information. """ text: str = pydantic.Field() """ The word or sound that was transcribed. """ start: typing.Optional[float] = pydantic.Field(default=None) """ The start time of the word or sound in seconds. """ end: typing.Optional[float] = pydantic.Field(default=None) """ The end time of the word or sound in seconds. """ type: FinalTranscriptWithTimestampsWordsItemType = pydantic.Field() """ The type of the word or sound. 'audio_event' is used for non-word sounds like laughter or footsteps. """ speaker_id: typing.Optional[str] = pydantic.Field(default=None) """ Unique identifier for the speaker of this word. """ logprob: float = pydantic.Field() """ The log of the probability with which this word was predicted. Logprobs are in range [-infinity, 0], higher logprobs indicate a higher confidence the model has in its predictions. """ characters: typing.Optional[typing.List[FinalTranscriptWithTimestampsWordsItemCharactersItem]] = pydantic.Field( default=None ) """ The characters that make up the word and their timing information. """ channel_index: typing.Optional[int] = pydantic.Field(default=None) """ The channel this word was spoken on (for multichannel audio). Null for single-channel transcriptions. """ 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 final_transcript_with_timestamps_words_item_characters_item.py000066400000000000000000000016411523660243400405160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FinalTranscriptWithTimestampsWordsItemCharactersItem(UncheckedBaseModel): text: str = pydantic.Field() """ The character that was transcribed. """ start: typing.Optional[float] = pydantic.Field(default=None) """ The start time of the character in seconds. """ end: typing.Optional[float] = pydantic.Field(default=None) """ The end time of the character 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 final_transcript_with_timestamps_words_item_type.py000066400000000000000000000003101523660243400363320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing FinalTranscriptWithTimestampsWordsItemType = typing.Union[typing.Literal["word", "spacing", "audio_event"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/fine_tuning_response.py000066400000000000000000000060221523660243400305020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .fine_tuning_response_state_value import FineTuningResponseStateValue from .manual_verification_response import ManualVerificationResponse from .verification_attempt_response import VerificationAttemptResponse class FineTuningResponse(UncheckedBaseModel): is_allowed_to_fine_tune: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the user is allowed to fine-tune the voice. """ state: typing.Optional[typing.Dict[str, FineTuningResponseStateValue]] = pydantic.Field(default=None) """ The state of the fine-tuning process for each model. """ verification_failures: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of verification failures in the fine-tuning process. """ verification_attempts_count: typing.Optional[int] = pydantic.Field(default=None) """ The number of verification attempts in the fine-tuning process. """ manual_verification_requested: typing.Optional[bool] = pydantic.Field(default=None) """ Whether a manual verification was requested for the fine-tuning process. """ language: typing.Optional[str] = pydantic.Field(default=None) """ The language of the fine-tuning process. """ progress: typing.Optional[typing.Dict[str, typing.Optional[float]]] = pydantic.Field(default=None) """ The progress of the fine-tuning process. """ message: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None) """ The message of the fine-tuning process. """ dataset_duration_seconds: typing.Optional[float] = pydantic.Field(default=None) """ The duration of the dataset in seconds. """ verification_attempts: typing.Optional[typing.List[VerificationAttemptResponse]] = pydantic.Field(default=None) """ The number of verification attempts. """ slice_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of slice IDs. """ manual_verification: typing.Optional[ManualVerificationResponse] = pydantic.Field(default=None) """ The manual verification of the fine-tuning process. """ max_verification_attempts: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of verification attempts. """ next_max_verification_attempts_reset_unix_ms: typing.Optional[int] = pydantic.Field(default=None) """ The next maximum verification attempts reset time in Unix milliseconds. """ finetuning_state: typing.Optional[typing.Any] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/fine_tuning_response_state_value.py000066400000000000000000000003511523660243400330750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing FineTuningResponseStateValue = typing.Union[ typing.Literal["not_started", "queued", "fine_tuning", "fine_tuned", "failed", "delayed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/finetune_created_by.py000066400000000000000000000002601523660243400302530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing FinetuneCreatedBy = typing.Union[typing.Literal["self", "workspace", "elevenlabs"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/finetune_visibility.py000066400000000000000000000002601523660243400303410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing FinetuneVisibility = typing.Union[typing.Literal["private", "workspace", "public"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/flush_context.py000066400000000000000000000020371523660243400271460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FlushContext(UncheckedBaseModel): """ Payload to flush the audio buffer for a specific context. """ context_id: str = pydantic.Field() """ The context_id to flush. """ text: typing.Optional[str] = pydantic.Field(default=None) """ The text to append to the buffer to be flushed. """ flush: bool = pydantic.Field() """ If true, flushes the audio buffer for the specified context. If false, the context will remain open and the text will be appended to the buffer to be generated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/focus_guardrail.py000066400000000000000000000011171523660243400274300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class FocusGuardrail(UncheckedBaseModel): is_enabled: typing.Optional[bool] = 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 forced_alignment_character_response_model.py000066400000000000000000000017011523660243400346110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ForcedAlignmentCharacterResponseModel(UncheckedBaseModel): """ Model representing a single character with its timing information from the aligner. """ text: str = pydantic.Field() """ The character that was transcribed. """ start: float = pydantic.Field() """ The start time of the character in seconds. """ end: float = pydantic.Field() """ The end time of the character 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/forced_alignment_response_model.py000066400000000000000000000023701523660243400326570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .forced_alignment_character_response_model import ForcedAlignmentCharacterResponseModel from .forced_alignment_word_response_model import ForcedAlignmentWordResponseModel class ForcedAlignmentResponseModel(UncheckedBaseModel): """ Model representing the response from the aligner service. """ characters: typing.List[ForcedAlignmentCharacterResponseModel] = pydantic.Field() """ List of characters with their timing information. """ words: typing.List[ForcedAlignmentWordResponseModel] = pydantic.Field() """ List of words with their timing information. """ loss: float = pydantic.Field() """ The average alignment loss/confidence score for the entire transcript, calculated from all characters. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/forced_alignment_word_response_model.py000066400000000000000000000021071523660243400337100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ForcedAlignmentWordResponseModel(UncheckedBaseModel): """ Model representing a single word with its timing information from the aligner. """ text: str = pydantic.Field() """ The word that was transcribed. """ start: float = pydantic.Field() """ The start time of the word in seconds. """ end: float = pydantic.Field() """ The end time of the word in seconds. """ loss: float = pydantic.Field() """ The average alignment loss/confidence score for this word, calculated from its constituent characters. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/frustrated_conversation_ref.py000066400000000000000000000015241523660243400320720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .frustrated_conversation_ref_overall_label import FrustratedConversationRefOverallLabel class FrustratedConversationRef(UncheckedBaseModel): conversation_id: str agent_id: str start_time_unix_secs: int overall_label: FrustratedConversationRefOverallLabel overall_sentiment_score: float overall_frustration_score: float 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 frustrated_conversation_ref_overall_label.py000066400000000000000000000003041523660243400346710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing FrustratedConversationRefOverallLabel = typing.Union[typing.Literal["positive", "neutral", "negative"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/gender.py000066400000000000000000000001441523660243400255220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing Gender = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/generate_voice_request.py000066400000000000000000000001621523660243400310050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GenerateVoiceRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/generation_chunk_input.py000066400000000000000000000060731523660243400310270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_ref_chunk import AudioRefChunk from .generation_chunk_input_condition_strength import GenerationChunkInputConditionStrength from .generation_chunk_input_context_adherence import GenerationChunkInputContextAdherence class GenerationChunkInput(UncheckedBaseModel): text: str = pydantic.Field() """ The text config to be generated for this chunk. Can contain section name in square brackets, e.g. [Verse 1], lyrics lines, and inline directions in curly braces, e.g. {scratching}. """ duration_ms: int = pydantic.Field() """ The duration of the chunk in milliseconds. Must be between 3000ms and 120000ms. """ positive_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should be present in this chunk. Use English language for best results. The styles for the first chunk are the most important as they set the overall tone and genre. Styles for subsequent chunks can be used to add nuance, progression, emphasis, or change the direction of the song. Aim to have at least 6-7 styles in early chunks until the direction is established. Generic styles like 'great production quality' are good default styles to append to the list. """ negative_styles: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The styles and musical directions that should not be present in this chunk. Use English language for best results. Leaving empty is a good default, only use this field if you want to explicitly avoid a particular style or direction. """ context_adherence: typing.Optional[GenerationChunkInputContextAdherence] = pydantic.Field(default=None) """ How much the model adheres to the context of its surrounding chunks. Low adherence means the model can deviate from the context and be more creative. High adherence means the model will be more consistent with the context. """ conditioning_ref: typing.Optional[AudioRefChunk] = pydantic.Field(default=None) """ The audio reference to condition the generation on. The first chunk is the most important as it will influence the generation of all subsequent chunks. Thus, if you want to apply conditioning to the entire song, start conditioning from the first chunk. """ condition_strength: typing.Optional[GenerationChunkInputConditionStrength] = pydantic.Field(default=None) """ How strongly the model adheres to the conditioning reference. Low strength means the model will be more creative and deviate from the reference. High strength means the model will be more consistent with the reference. """ 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 generation_chunk_input_condition_strength.py000066400000000000000000000003031523660243400347220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GenerationChunkInputConditionStrength = typing.Union[typing.Literal["low", "medium", "high", "xhigh"], typing.Any] generation_chunk_input_context_adherence.py000066400000000000000000000002711523660243400345040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GenerationChunkInputContextAdherence = typing.Union[typing.Literal["low", "medium", "high"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/generation_chunk_output.py000066400000000000000000000061021523660243400312210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_ref_chunk import AudioRefChunk from .generation_chunk_output_condition_strength import GenerationChunkOutputConditionStrength from .generation_chunk_output_context_adherence import GenerationChunkOutputContextAdherence class GenerationChunkOutput(UncheckedBaseModel): text: str = pydantic.Field() """ The text config to be generated for this chunk. Can contain section name in square brackets, e.g. [Verse 1], lyrics lines, and inline directions in curly braces, e.g. {scratching}. """ duration_ms: int = pydantic.Field() """ The duration of the chunk in milliseconds. Must be between 3000ms and 120000ms. """ positive_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should be present in this chunk. Use English language for best results. The styles for the first chunk are the most important as they set the overall tone and genre. Styles for subsequent chunks can be used to add nuance, progression, emphasis, or change the direction of the song. Aim to have at least 6-7 styles in early chunks until the direction is established. Generic styles like 'great production quality' are good default styles to append to the list. """ negative_styles: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The styles and musical directions that should not be present in this chunk. Use English language for best results. Leaving empty is a good default, only use this field if you want to explicitly avoid a particular style or direction. """ context_adherence: typing.Optional[GenerationChunkOutputContextAdherence] = pydantic.Field(default=None) """ How much the model adheres to the context of its surrounding chunks. Low adherence means the model can deviate from the context and be more creative. High adherence means the model will be more consistent with the context. """ conditioning_ref: typing.Optional[AudioRefChunk] = pydantic.Field(default=None) """ The audio reference to condition the generation on. The first chunk is the most important as it will influence the generation of all subsequent chunks. Thus, if you want to apply conditioning to the entire song, start conditioning from the first chunk. """ condition_strength: typing.Optional[GenerationChunkOutputConditionStrength] = pydantic.Field(default=None) """ How strongly the model adheres to the conditioning reference. Low strength means the model will be more creative and deviate from the reference. High strength means the model will be more consistent with the reference. """ 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 generation_chunk_output_condition_strength.py000066400000000000000000000003041523660243400351240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GenerationChunkOutputConditionStrength = typing.Union[typing.Literal["low", "medium", "high", "xhigh"], typing.Any] generation_chunk_output_context_adherence.py000066400000000000000000000002721523660243400347060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GenerationChunkOutputContextAdherence = typing.Union[typing.Literal["low", "medium", "high"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/generation_config.py000066400000000000000000000052151523660243400277420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GenerationConfig(UncheckedBaseModel): chunk_length_schedule: typing.Optional[typing.List[float]] = pydantic.Field(default=None) """ This is an advanced setting that most users shouldn't need to use. It relates to our generation schedule. Our WebSocket service incorporates a buffer system designed to optimize the Time To First Byte (TTFB) while maintaining high-quality streaming. All text sent to the WebSocket endpoint is added to this buffer and only when that buffer reaches a certain size is an audio generation attempted. This is because our model provides higher quality audio when the model has longer inputs, and can deduce more context about how the text should be delivered. The buffer ensures smooth audio data delivery and is automatically emptied with a final audio generation either when the stream is closed, or upon sending a `flush` command. We have advanced settings for changing the chunk schedule, which can improve latency at the cost of quality by generating audio more frequently with smaller text inputs. The `chunk_length_schedule` determines the minimum amount of text that needs to be sent and present in our buffer before audio starts being generated. This is to maximise the amount of context available to the model to improve audio quality, whilst balancing latency of the returned audio chunks. The default value for `chunk_length_schedule` is: [120, 160, 250, 290]. This means that the first chunk of audio will not be generated until you send text that totals at least 120 characters long. The next chunk of audio will only be generated once a further 160 characters have been sent. The third audio chunk will be generated after the next 250 characters. Then the fourth, and beyond, will be generated in sets of at least 290 characters. Customize this array to suit your needs. If you want to generate audio more frequently to optimise latency, you can reduce the values in the array. Note that setting the values too low may result in lower quality audio. Please test and adjust as needed. Each item should be in the range 50-500. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/generation_source_context.py000066400000000000000000000020171523660243400315360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .reference_video import ReferenceVideo class GenerationSourceContext(UncheckedBaseModel): source_type: typing.Optional[typing.Literal["generation"]] = None generation_id: str prompt: typing.Optional[str] = None model_id: str model_provider: typing.Optional[str] = None generation_session_id: typing.Optional[str] = None session_iteration_id: typing.Optional[str] = None model_parameters: typing.Optional[typing.Dict[str, typing.Any]] = None extend_video: typing.Optional[ReferenceVideo] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/genesys_bot_outcome.py000066400000000000000000000002441523660243400303330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GenesysBotOutcome = typing.Union[typing.Literal["success", "escalate"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/genesys_region.py000066400000000000000000000010511523660243400272740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GenesysRegion = typing.Union[ typing.Literal[ "us_east_1", "eu_west_1", "ap_southeast_2", "ap_northeast_1", "eu_central_1", "us_west_2", "ca_central_1", "ap_northeast_2", "eu_west_2", "ap_south_1", "us_east_2", "sa_east_1", "me_central_1", "ap_northeast_3", "eu_central_2", "mx_central_1", "ap_southeast_1", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agent_embed_response_model.py000066400000000000000000000012411523660243400324440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .widget_config_response import WidgetConfigResponse class GetAgentEmbedResponseModel(UncheckedBaseModel): agent_id: str widget_config: WidgetConfigResponse 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 get_agent_knowledgebase_size_response_model.py000066400000000000000000000011251523660243400351560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetAgentKnowledgebaseSizeResponseModel(UncheckedBaseModel): number_of_pages: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agent_link_response_model.py000066400000000000000000000015241523660243400323310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_token_response_model import ConversationTokenResponseModel class GetAgentLinkResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ token: typing.Optional[ConversationTokenResponseModel] = pydantic.Field(default=None) """ The token data for the agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agent_response_model.py000066400000000000000000000054571523660243400313250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata_response_model import AgentMetadataResponseModel from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel from .agent_workflow_response_model import AgentWorkflowResponseModel from .conversational_config import ConversationalConfig from .get_agent_response_model_phone_numbers_item import GetAgentResponseModelPhoneNumbersItem from .get_whats_app_account_response import GetWhatsAppAccountResponse from .resource_access_info import ResourceAccessInfo class GetAgentResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ name: str = pydantic.Field() """ The name of the agent """ conversation_config: ConversationalConfig = pydantic.Field() """ The conversation configuration of the agent """ metadata: AgentMetadataResponseModel = pydantic.Field() """ The metadata of the agent """ platform_settings: typing.Optional[AgentPlatformSettingsResponseModel] = pydantic.Field(default=None) """ The platform settings of the agent """ phone_numbers: typing.Optional[typing.List[GetAgentResponseModelPhoneNumbersItem]] = pydantic.Field(default=None) """ The phone numbers of the agent """ whatsapp_accounts: typing.Optional[typing.List[GetWhatsAppAccountResponse]] = pydantic.Field(default=None) """ WhatsApp accounts assigned to the agent """ workflow: typing.Optional[AgentWorkflowResponseModel] = pydantic.Field(default=None) """ The workflow of the agent """ access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the agent for the user """ tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Agent tags used to categorize the agent """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the version the agent is on """ branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the branch the agent is on """ main_branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the main branch for this agent """ 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 update_forward_refs(GetAgentResponseModel) get_agent_response_model_phone_numbers_item.py000066400000000000000000000062731523660243400352050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .get_phone_number_inbound_sip_trunk_config_response_model import GetPhoneNumberInboundSipTrunkConfigResponseModel from .get_phone_number_outbound_sip_trunk_config_response_model import GetPhoneNumberOutboundSipTrunkConfigResponseModel from .livekit_stack_type import LivekitStackType from .phone_number_agent_info import PhoneNumberAgentInfo class GetAgentResponseModelPhoneNumbersItem_Exotel(UncheckedBaseModel): provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class GetAgentResponseModelPhoneNumbersItem_SipTrunk(UncheckedBaseModel): provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = None livekit_stack: LivekitStackType store_sip_messages: typing.Optional[bool] = 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 class GetAgentResponseModelPhoneNumbersItem_Twilio(UncheckedBaseModel): provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 GetAgentResponseModelPhoneNumbersItem = typing_extensions.Annotated[ typing.Union[ GetAgentResponseModelPhoneNumbersItem_Exotel, GetAgentResponseModelPhoneNumbersItem_SipTrunk, GetAgentResponseModelPhoneNumbersItem_Twilio, ], UnionMetadata(discriminant="provider"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agent_test_folder_response_model.py000066400000000000000000000020201523660243400336760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_test_folder_path_segment_response_model import AgentTestFolderPathSegmentResponseModel class GetAgentTestFolderResponseModel(UncheckedBaseModel): id: str name: str folder_path: typing.Optional[typing.List[AgentTestFolderPathSegmentResponseModel]] = pydantic.Field(default=None) """ The path from the root folder to the current folder. """ children_count: typing.Optional[int] = pydantic.Field(default=None) """ The number of direct children (tests and subfolders) in this folder """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agent_topics_response_model.py000066400000000000000000000013361523660243400326760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_topic_response_model import AgentTopicResponseModel class GetAgentTopicsResponseModel(UncheckedBaseModel): topics: typing.List[AgentTopicResponseModel] window_start_unix_secs: int window_end_unix_secs: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_agents_page_response_model.py000066400000000000000000000017461523660243400325010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_summary_response_model import AgentSummaryResponseModel class GetAgentsPageResponseModel(UncheckedBaseModel): agents: typing.List[AgentSummaryResponseModel] = pydantic.Field() """ A list of agents and their metadata """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ The next cursor to paginate through the agents """ has_more: bool = pydantic.Field() """ Whether there are more agents to paginate through """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_analytics_summary_params.py000066400000000000000000000013201523660243400322210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetAnalyticsSummaryParams(UncheckedBaseModel): """ Get a summary of key business analytics for a time period. """ smb_tool_type: typing.Optional[typing.Literal["get_analytics_summary"]] = 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 get_appointment_by_confirmation_number_params.py000066400000000000000000000020521523660243400355510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetAppointmentByConfirmationNumberParams(UncheckedBaseModel): """ Look up an appointment by the booking confirmation number the caller quotes. The confirmation number is the 8-character code shown on the booking confirmation page (e.g. ``#01ABCDEF``). Callers may read it back with or without the leading ``#`` and with varied spacing; the tool normalizes the input and does a prefix match on the stored calendar item id. """ smb_tool_type: typing.Optional[typing.Literal["get_appointment_by_confirmation_number"]] = 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 get_audio_isolation_history_response_model.py000066400000000000000000000013531523660243400351020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_isolation_history_item_response_model import AudioIsolationHistoryItemResponseModel class GetAudioIsolationHistoryResponseModel(UncheckedBaseModel): items: typing.List[AudioIsolationHistoryItemResponseModel] has_more: bool 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 get_audio_native_project_settings_response_model.py000066400000000000000000000020311523660243400362460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_native_project_settings_response_model import AudioNativeProjectSettingsResponseModel class GetAudioNativeProjectSettingsResponseModel(UncheckedBaseModel): enabled: bool = pydantic.Field() """ Whether the project is enabled. """ snapshot_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the latest snapshot of the project. """ settings: typing.Optional[AudioNativeProjectSettingsResponseModel] = pydantic.Field(default=None) """ The settings of the project. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_booking_page_settings_params.py000066400000000000000000000012071523660243400330250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetBookingPageSettingsParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["get_booking_page_settings"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_booking_slug_status_params.py000066400000000000000000000012031523660243400325420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetBookingSlugStatusParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["get_booking_slug_status"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_chapter_request.py000066400000000000000000000001571523660243400303170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetChapterRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_chapter_snapshots_request.py000066400000000000000000000001701523660243400324140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetChapterSnapshotsRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_chapters_request.py000066400000000000000000000001601523660243400304740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetChaptersRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_chapters_response.py000066400000000000000000000012001523660243400306360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .chapter_response import ChapterResponse class GetChaptersResponse(UncheckedBaseModel): chapters: typing.List[ChapterResponse] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_client_appointments_params.py000066400000000000000000000012701523660243400325400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetClientAppointmentsParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["get_client_appointments"]] = None include_cancelled: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_client_by_phone_params.py000066400000000000000000000012761523660243400316300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetClientByPhoneParams(UncheckedBaseModel): """ Look up a client by their exact phone number. """ smb_tool_type: typing.Optional[typing.Literal["get_client_by_phone"]] = 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 get_conv_ai_dashboard_settings_response_model.py000066400000000000000000000014271523660243400355060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_conv_ai_dashboard_settings_response_model_charts_item import GetConvAiDashboardSettingsResponseModelChartsItem class GetConvAiDashboardSettingsResponseModel(UncheckedBaseModel): charts: typing.Optional[typing.List[GetConvAiDashboardSettingsResponseModelChartsItem]] = 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 get_conv_ai_dashboard_settings_response_model_charts_item.py000066400000000000000000000040211523660243400400610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess(UncheckedBaseModel): type: typing.Literal["call_success"] = "call_success" name: 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 GetConvAiDashboardSettingsResponseModelChartsItem_Criteria(UncheckedBaseModel): type: typing.Literal["criteria"] = "criteria" name: str criteria_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 class GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection(UncheckedBaseModel): type: typing.Literal["data_collection"] = "data_collection" name: str data_collection_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 GetConvAiDashboardSettingsResponseModelChartsItem = typing_extensions.Annotated[ typing.Union[ GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_conv_ai_settings_response_model.py000066400000000000000000000025541523660243400335600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_webhooks import ConvAiWebhooks from .conversation_initiation_client_data_webhook import ConversationInitiationClientDataWebhook from .livekit_stack_type import LivekitStackType class GetConvAiSettingsResponseModel(UncheckedBaseModel): conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = None webhooks: typing.Optional[ConvAiWebhooks] = None can_use_mcp_servers: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the workspace can use MCP servers """ rag_retention_period_days: typing.Optional[int] = None conversation_embedding_retention_days: typing.Optional[int] = pydantic.Field(default=None) """ Days to retain conversation embeddings. None means use the system default (30 days). """ default_livekit_stack: typing.Optional[LivekitStackType] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_conversation_response_model.py000066400000000000000000000047211523660243400327320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_analysis_common_model import ConversationHistoryAnalysisCommonModel from .conversation_history_metadata_common_model import ConversationHistoryMetadataCommonModel from .conversation_history_transcript_response_model import ConversationHistoryTranscriptResponseModel from .conversation_initiation_client_data_request_output import ConversationInitiationClientDataRequestOutput from .get_conversation_response_model_status import GetConversationResponseModelStatus from .visited_agent_ref import VisitedAgentRef class GetConversationResponseModel(UncheckedBaseModel): agent_id: str agent_name: typing.Optional[str] = None conversation_product: typing.Optional[str] = None status: GetConversationResponseModelStatus user_id: typing.Optional[str] = None branch_id: typing.Optional[str] = None version_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the agent version used for this conversation """ metadata: ConversationHistoryMetadataCommonModel analysis: typing.Optional[ConversationHistoryAnalysisCommonModel] = None visited_agents: typing.Optional[typing.List[VisitedAgentRef]] = None conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestOutput] = None environment: typing.Optional[str] = None conversation_id: str has_audio: bool has_user_audio: bool has_response_audio: bool has_auxiliary_audio: bool transcript: typing.List[ConversationHistoryTranscriptResponseModel] tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Conversation tag ids assigned to this conversation. """ otlp_traces: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ OpenTelemetry trace payload when the request uses format=opentelemetry; otherwise omitted. """ 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 update_forward_refs(GetConversationResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_conversation_response_model_status.py000066400000000000000000000003401523660243400343260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetConversationResponseModelStatus = typing.Union[ typing.Literal["initiated", "in-progress", "processing", "done", "failed"], typing.Any ] get_conversation_tags_page_response_model.py000066400000000000000000000014031523660243400346570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_tag_response_model import ConversationTagResponseModel class GetConversationTagsPageResponseModel(UncheckedBaseModel): conversation_tags: typing.List[ConversationTagResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 get_conversation_users_page_response_model.py000066400000000000000000000013731523660243400350700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_user_response_model import ConversationUserResponseModel class GetConversationUsersPageResponseModel(UncheckedBaseModel): users: typing.List[ConversationUserResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_conversations_page_response_model.py000066400000000000000000000014101523660243400341010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_summary_response_model import ConversationSummaryResponseModel class GetConversationsPageResponseModel(UncheckedBaseModel): conversations: typing.List[ConversationSummaryResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_crawl_job_response_model.py000066400000000000000000000020731523660243400321600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .crawl_status import CrawlStatus from .crawl_type import CrawlType class GetCrawlJobResponseModel(UncheckedBaseModel): type: typing.Optional[CrawlType] = None seed_url: str pattern: typing.Optional[str] = None max_depth: int max_pages: int status: typing.Optional[CrawlStatus] = None pages_identified: typing.Optional[int] = None pages_scraped: typing.Optional[int] = None pages_skipped: typing.Optional[int] = None pages_failed: typing.Optional[int] = None root_folder_id: str updated_at: int id: str created_at: int 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 get_knowledge_base_dependent_agents_response_model.py000066400000000000000000000017321523660243400365000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dependent_branch_info import DependentBranchInfo from .get_knowledge_base_dependent_agents_response_model_agents_item import ( GetKnowledgeBaseDependentAgentsResponseModelAgentsItem, ) class GetKnowledgeBaseDependentAgentsResponseModel(UncheckedBaseModel): agents: typing.List[GetKnowledgeBaseDependentAgentsResponseModelAgentsItem] branches: typing.Optional[typing.List[DependentBranchInfo]] = None next_cursor: typing.Optional[str] = None has_more: bool 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 get_knowledge_base_dependent_agents_response_model_agents_item.py000066400000000000000000000034561523660243400410640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetKnowledgeBaseDependentAgentsResponseModelAgentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Available, GetKnowledgeBaseDependentAgentsResponseModelAgentsItem_Unknown, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_knowledge_base_file_response_model.py000066400000000000000000000042401523660243400341640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .content_format import ContentFormat from .document_usage_mode_enum import DocumentUsageModeEnum from .external_file_sync_info import ExternalFileSyncInfo from .file_refresh_status import FileRefreshStatus from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseFileResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None filename: str external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = pydantic.Field(default=None) """ In-flight or last refresh state for an externally-synced file. Used by clients to render sync progress and disable re-sync while a refresh is queued or processing. """ is_frozen: typing.Optional[bool] = 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 get_knowledge_base_folder_response_model.py000066400000000000000000000042511523660243400344430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_folder_sync_info import ExternalFolderSyncInfo from .kb_external_sync_job import KbExternalSyncJob from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseFolderResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ children_count: int document_count: int = pydantic.Field() """ Number of non-folder documents anywhere in this folder's subtree (recursive). Counting stops past 1000; """ auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = None active_sync_job: typing.Optional[KbExternalSyncJob] = pydantic.Field(default=None) """ Most recent (in-flight or terminal) external sync job for this folder, if any. Used by clients to render sync progress. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_knowledge_base_list_response_model.py000066400000000000000000000014621523660243400342230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_knowledge_base_list_response_model_documents_item import GetKnowledgeBaseListResponseModelDocumentsItem class GetKnowledgeBaseListResponseModel(UncheckedBaseModel): documents: typing.List[GetKnowledgeBaseListResponseModelDocumentsItem] next_cursor: typing.Optional[str] = None has_more: bool 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 get_knowledge_base_list_response_model_documents_item.py000066400000000000000000000131541523660243400372440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_file_sync_info import ExternalFileSyncInfo from .external_folder_sync_info import ExternalFolderSyncInfo from .file_refresh_status import FileRefreshStatus from .get_knowledge_base_summary_file_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_text_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_url_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseListResponseModelDocumentsItem_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class GetKnowledgeBaseListResponseModelDocumentsItem_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = 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 class GetKnowledgeBaseListResponseModelDocumentsItem_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] 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 GetKnowledgeBaseListResponseModelDocumentsItem_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] url: str auto_sync_info: typing.Optional[AutoSyncInfo] = 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 GetKnowledgeBaseListResponseModelDocumentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseListResponseModelDocumentsItem_File, GetKnowledgeBaseListResponseModelDocumentsItem_Folder, GetKnowledgeBaseListResponseModelDocumentsItem_Text, GetKnowledgeBaseListResponseModelDocumentsItem_Url, ], UnionMetadata(discriminant="type"), ] get_knowledge_base_summary_file_response_model.py000066400000000000000000000043661523660243400356730ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_file_sync_info import ExternalFileSyncInfo from .file_refresh_status import FileRefreshStatus from .get_knowledge_base_summary_file_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseSummaryFileResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. """ external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 get_knowledge_base_summary_file_response_model_dependent_agents_item.py000066400000000000000000000035071523660243400422740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem_Unknown, ], UnionMetadata(discriminant="type"), ] get_knowledge_base_summary_folder_response_model.py000066400000000000000000000045231523660243400362220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_folder_sync_info import ExternalFolderSyncInfo from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseSummaryFolderResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. """ children_count: int document_count: int = pydantic.Field() """ Number of non-folder documents anywhere in this folder's subtree (recursive). Counting stops past 1000; """ auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = 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 get_knowledge_base_summary_folder_response_model_dependent_agents_item.py000066400000000000000000000035211523660243400426240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem_Unknown, ], UnionMetadata(discriminant="type"), ] get_knowledge_base_summary_text_response_model.py000066400000000000000000000035671523660243400357420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .document_usage_mode_enum import DocumentUsageModeEnum from .get_knowledge_base_summary_text_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseSummaryTextResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. """ 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 get_knowledge_base_summary_text_response_model_dependent_agents_item.py000066400000000000000000000035071523660243400423410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem_Unknown, ], UnionMetadata(discriminant="type"), ] get_knowledge_base_summary_url_response_model.py000066400000000000000000000037431523660243400355540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .get_knowledge_base_summary_url_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseSummaryUrlResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. """ url: str auto_sync_info: typing.Optional[AutoSyncInfo] = 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 get_knowledge_base_summary_url_response_model_dependent_agents_item.py000066400000000000000000000035021523660243400421520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem = typing_extensions.Annotated[ typing.Union[ GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Available, GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem_Unknown, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_knowledge_base_text_response_model.py000066400000000000000000000030771523660243400342400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_format import ContentFormat from .document_usage_mode_enum import DocumentUsageModeEnum from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseTextResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ extracted_inner_html: str content_format: typing.Optional[ContentFormat] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_knowledge_base_url_response_model.py000066400000000000000000000032551523660243400340540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auto_sync_info import AutoSyncInfo from .content_format import ContentFormat from .document_usage_mode_enum import DocumentUsageModeEnum from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel from .resource_access_info import ResourceAccessInfo class GetKnowledgeBaseUrlResponseModel(UncheckedBaseModel): id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder, or null if the document is at the root level. """ folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentResponseModel]] = pydantic.Field( default=None ) """ The folder path segments leading to this entity, from root to parent folder. """ url: str extracted_inner_html: str content_format: typing.Optional[ContentFormat] = None auto_sync_info: typing.Optional[AutoSyncInfo] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_library_voices_response.py000066400000000000000000000020101523660243400320410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .library_voice_response import LibraryVoiceResponse class GetLibraryVoicesResponse(UncheckedBaseModel): voices: typing.List[LibraryVoiceResponse] = pydantic.Field() """ The list of shared voices """ has_more: bool = pydantic.Field() """ Whether there are more shared voices in subsequent pages. """ total_count: typing.Optional[int] = pydantic.Field(default=None) """ The total number of shared voices matching the query. """ last_sort_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_live_count_response.py000066400000000000000000000012121523660243400311770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetLiveCountResponse(UncheckedBaseModel): count: int = pydantic.Field() """ The number of active ongoing conversations. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_or_create_rag_index_request_model.py000066400000000000000000000017151523660243400340350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class GetOrCreateRagIndexRequestModel(UncheckedBaseModel): document_id: str = pydantic.Field() """ ID of the knowledgebase document for which to retrieve the index """ create_if_missing: bool = pydantic.Field() """ Whether to create the RAG index if it does not exist """ model: EmbeddingModelEnum = pydantic.Field() """ Embedding model to use for the RAG index """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_phone_number_exotel_response_model.py000066400000000000000000000026401523660243400342570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .phone_number_agent_info import PhoneNumberAgentInfo class GetPhoneNumberExotelResponseModel(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ phone_number_id: str = pydantic.Field() """ The ID of the phone number """ assigned_agent: typing.Optional[PhoneNumberAgentInfo] = pydantic.Field(default=None) """ The agent that is assigned to the phone number """ 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 get_phone_number_inbound_sip_trunk_config_response_model.py000066400000000000000000000032611523660243400377610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sip_media_encryption_enum import SipMediaEncryptionEnum class GetPhoneNumberInboundSipTrunkConfigResponseModel(UncheckedBaseModel): allowed_addresses: typing.List[str] = pydantic.Field() """ List of IP addresses that are allowed to use the trunk. Each item in the list can be an individual IP address or a Classless Inter-Domain Routing notation representing a CIDR block. """ allowed_numbers: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of phone numbers that are allowed to use the trunk. """ media_encryption: SipMediaEncryptionEnum has_auth_credentials: bool = pydantic.Field() """ Whether authentication credentials are configured """ username: typing.Optional[str] = pydantic.Field(default=None) """ SIP trunk username (if available) """ remote_domains: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Domains of remote SIP servers used to validate TLS certificates. """ attributes_to_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Map of dynamic variable name to header name for attributes_to_headers """ 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 get_phone_number_outbound_sip_trunk_config_response_model.py000066400000000000000000000040421523660243400401600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_codec import MediaCodec from .sip_media_encryption_enum import SipMediaEncryptionEnum from .sip_trunk_transport_enum import SipTrunkTransportEnum class GetPhoneNumberOutboundSipTrunkConfigResponseModel(UncheckedBaseModel): """ SIP Trunk configuration details for a phone number """ address: str = pydantic.Field() """ Hostname or IP the SIP INVITE is sent to """ transport: SipTrunkTransportEnum = pydantic.Field() """ Protocol to use for SIP transport """ media_encryption: SipMediaEncryptionEnum = pydantic.Field() """ Whether or not to encrypt media (data layer). """ headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ SIP headers for INVITE request """ attributes_to_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Map of dynamic variable name to header name for attributes_to_headers """ has_auth_credentials: bool = pydantic.Field() """ Whether authentication credentials are configured """ username: typing.Optional[str] = pydantic.Field(default=None) """ SIP trunk username (if available) """ has_outbound_trunk: typing.Optional[bool] = pydantic.Field(default=None) """ Whether a LiveKit SIP outbound trunk is configured """ enabled_codecs: typing.Optional[typing.List[MediaCodec]] = pydantic.Field(default=None) """ Media codecs that are offered in the SDP for outbound calls. If empty, all supported codecs are offered. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_phone_number_response.py000066400000000000000000000001641523660243400315160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetPhoneNumberResponse = typing.Any get_phone_number_sip_trunk_response_model.py000066400000000000000000000046661523660243400347300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_phone_number_inbound_sip_trunk_config_response_model import GetPhoneNumberInboundSipTrunkConfigResponseModel from .get_phone_number_outbound_sip_trunk_config_response_model import GetPhoneNumberOutboundSipTrunkConfigResponseModel from .livekit_stack_type import LivekitStackType from .phone_number_agent_info import PhoneNumberAgentInfo class GetPhoneNumberSipTrunkResponseModel(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ phone_number_id: str = pydantic.Field() """ The ID of the phone number """ assigned_agent: typing.Optional[PhoneNumberAgentInfo] = pydantic.Field(default=None) """ The agent that is assigned to the phone number """ provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = pydantic.Field(default=None) """ Configuration of the Outbound SIP trunk - if configured. """ inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = pydantic.Field(default=None) """ Configuration of the Inbound SIP trunk - if configured. """ livekit_stack: LivekitStackType = pydantic.Field() """ Type of Livekit stack used for this number. """ store_sip_messages: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to store SIP messages for this phone number. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_phone_number_twilio_response_model.py000066400000000000000000000026401523660243400342660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .phone_number_agent_info import PhoneNumberAgentInfo class GetPhoneNumberTwilioResponseModel(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ label: str = pydantic.Field() """ Label for the phone number """ supports_inbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports inbound calls """ supports_outbound: typing.Optional[bool] = pydantic.Field(default=None) """ This field is deprecated and will be removed in the future. Whether this phone number supports outbound calls """ phone_number_id: str = pydantic.Field() """ The ID of the phone number """ assigned_agent: typing.Optional[PhoneNumberAgentInfo] = pydantic.Field(default=None) """ The agent that is assigned to the phone number """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_project_request.py000066400000000000000000000001571523660243400303370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetProjectRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_projects_request.py000066400000000000000000000001601523660243400305140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetProjectsRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_projects_response.py000066400000000000000000000013171523660243400306670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_response import ProjectResponse class GetProjectsResponse(UncheckedBaseModel): projects: typing.List[ProjectResponse] = pydantic.Field() """ A list of projects with their metadata. """ 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 get_pronunciation_dictionaries_metadata_response_model.py000066400000000000000000000021341523660243400374220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_pronunciation_dictionary_metadata_response import GetPronunciationDictionaryMetadataResponse class GetPronunciationDictionariesMetadataResponseModel(UncheckedBaseModel): pronunciation_dictionaries: typing.List[GetPronunciationDictionaryMetadataResponse] = pydantic.Field() """ A list of pronunciation dictionaries and their metadata. """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ The next cursor to use for pagination. """ has_more: bool = pydantic.Field() """ Whether there are more pronunciation dictionaries to fetch. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_pronunciation_dictionaries_response.py000066400000000000000000000002021523660243400344530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetPronunciationDictionariesResponse = typing.Any get_pronunciation_dictionary_metadata_response.py000066400000000000000000000037131523660243400357360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_pronunciation_dictionary_metadata_response_permission_on_resource import ( GetPronunciationDictionaryMetadataResponsePermissionOnResource, ) class GetPronunciationDictionaryMetadataResponse(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the pronunciation dictionary. """ latest_version_id: str = pydantic.Field() """ The ID of the latest version of the pronunciation dictionary. """ latest_version_rules_num: int = pydantic.Field() """ The number of rules in the latest version of the pronunciation dictionary. """ name: str = pydantic.Field() """ The name of the pronunciation dictionary. """ permission_on_resource: typing.Optional[GetPronunciationDictionaryMetadataResponsePermissionOnResource] = ( 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. """ creation_time_unix: int = pydantic.Field() """ The creation time of the pronunciation dictionary in Unix timestamp. """ archived_time_unix: typing.Optional[int] = pydantic.Field(default=None) """ The archive time of the pronunciation dictionary in Unix timestamp. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow get_pronunciation_dictionary_metadata_response_permission_on_resource.py000066400000000000000000000003521523660243400426050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GetPronunciationDictionaryMetadataResponsePermissionOnResource = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_pronunciation_dictionary_response.py000066400000000000000000000002001523660243400341410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GetPronunciationDictionaryResponse = typing.Any get_pronunciation_dictionary_with_rules_response_model.py000066400000000000000000000044621523660243400375250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_pronunciation_dictionary_with_rules_response_model_permission_on_resource import ( GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource, ) from .get_pronunciation_dictionary_with_rules_response_model_rules_item import ( GetPronunciationDictionaryWithRulesResponseModelRulesItem, ) class GetPronunciationDictionaryWithRulesResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the pronunciation dictionary. """ latest_version_id: str = pydantic.Field() """ The ID of the latest version of the pronunciation dictionary. """ latest_version_rules_num: int = pydantic.Field() """ The number of rules in the latest version of the pronunciation dictionary. """ name: str = pydantic.Field() """ The name of the pronunciation dictionary. """ permission_on_resource: typing.Optional[GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource] = ( 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. """ creation_time_unix: int = pydantic.Field() """ The creation time of the pronunciation dictionary in Unix timestamp. """ archived_time_unix: typing.Optional[int] = pydantic.Field(default=None) """ The archive time of the pronunciation dictionary in Unix timestamp. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the pronunciation dictionary. """ rules: typing.List[GetPronunciationDictionaryWithRulesResponseModelRulesItem] = pydantic.Field() """ The rules in the latest version 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow get_pronunciation_dictionary_with_rules_response_model_permission_on_resource.py000066400000000000000000000003601523660243400443710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing GetPronunciationDictionaryWithRulesResponseModelPermissionOnResource = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] get_pronunciation_dictionary_with_rules_response_model_rules_item.py000066400000000000000000000033401523660243400417470ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias(UncheckedBaseModel): type: typing.Literal["alias"] = "alias" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None alias: 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 GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme(UncheckedBaseModel): type: typing.Literal["phoneme"] = "phoneme" string_to_replace: str case_sensitive: typing.Optional[bool] = None word_boundaries: typing.Optional[bool] = None phoneme: str alphabet: 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 GetPronunciationDictionaryWithRulesResponseModelRulesItem = typing_extensions.Annotated[ typing.Union[ GetPronunciationDictionaryWithRulesResponseModelRulesItem_Alias, GetPronunciationDictionaryWithRulesResponseModelRulesItem_Phoneme, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_response_unit_test_response_model.py000066400000000000000000000045741523660243400341620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_failure_response_example import AgentFailureResponseExample from .agent_successful_response_example import AgentSuccessfulResponseExample from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput class GetResponseUnitTestResponseModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ A prompt that evaluates whether the agent's response is successful. Should return True or False. """ success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered successful """ failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered failures """ id: str name: 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 update_forward_refs(GetResponseUnitTestResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_schedule_params.py000066400000000000000000000012511523660243400302540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetScheduleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["get_schedule"]] = None include_location_filter: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_secret_dependencies_response_model.py000066400000000000000000000015621523660243400342130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_secret_dependencies_response_model_dependencies import GetSecretDependenciesResponseModelDependencies class GetSecretDependenciesResponseModel(UncheckedBaseModel): dependencies: GetSecretDependenciesResponseModelDependencies next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for fetching the next page of dependencies """ 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 get_secret_dependencies_response_model_dependencies.py000066400000000000000000000012661523660243400366430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .dependent_phone_number_identifier import DependentPhoneNumberIdentifier from .get_secret_dependencies_response_model_dependencies_one_item import ( GetSecretDependenciesResponseModelDependenciesOneItem, ) from .get_secret_dependencies_response_model_dependencies_zero_item import ( GetSecretDependenciesResponseModelDependenciesZeroItem, ) GetSecretDependenciesResponseModelDependencies = typing.Union[ typing.List[GetSecretDependenciesResponseModelDependenciesZeroItem], typing.List[GetSecretDependenciesResponseModelDependenciesOneItem], typing.List[DependentPhoneNumberIdentifier], ] get_secret_dependencies_response_model_dependencies_one_item.py000066400000000000000000000034511523660243400405200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetSecretDependenciesResponseModelDependenciesOneItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetSecretDependenciesResponseModelDependenciesOneItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetSecretDependenciesResponseModelDependenciesOneItem = typing_extensions.Annotated[ typing.Union[ GetSecretDependenciesResponseModelDependenciesOneItem_Available, GetSecretDependenciesResponseModelDependenciesOneItem_Unknown, ], UnionMetadata(discriminant="type"), ] get_secret_dependencies_response_model_dependencies_zero_item.py000066400000000000000000000032371523660243400407200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel class GetSecretDependenciesResponseModelDependenciesZeroItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" id: str name: str created_at_unix_secs: int access_level: DependentAvailableToolIdentifierAccessLevel 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 GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" 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 GetSecretDependenciesResponseModelDependenciesZeroItem = typing_extensions.Annotated[ typing.Union[ GetSecretDependenciesResponseModelDependenciesZeroItem_Available, GetSecretDependenciesResponseModelDependenciesZeroItem_Unknown, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_simulation_test_response_model.py000066400000000000000000000072421523660243400334440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .llm import Llm from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .tool_response_mock_config_output import ToolResponseMockConfigOutput class GetSimulationTestResponseModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ Deprecated legacy single success criterion. Use success_conditions instead. At least one of success_condition or success_conditions is required. """ success_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of prompts that evaluate whether the simulation was successful. If provided, all criteria are evaluated and merged into a final result. Capped at the maximum number of evaluation criteria. """ simulation_scenario: typing.Optional[str] = pydantic.Field(default=None) """ Description of the simulation scenario and user persona for simulation tests. """ simulation_max_turns: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of conversation turns for simulation tests. """ simulation_environment: typing.Optional[str] = pydantic.Field(default=None) """ The environment to use when running this simulation test. If not provided, defaults to 'production'. """ tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = pydantic.Field(default=None) """ Configuration for which tools to mock and fallback behavior. """ tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = pydantic.Field( default=None ) """ Test-specific response mocks, keyed by tool ID. Applied ahead of the tool's shared mocks and only within this test. Only take effect for tools that are mocked (see tool_mock_config). """ evaluation_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for evaluating simulation results. """ simulated_user_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model for the simulated user. """ id: str name: 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 update_forward_refs(GetSimulationTestResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_sip_log_messages_response.py000066400000000000000000000013351523660243400323610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sip_log_message import SipLogMessage class GetSipLogMessagesResponse(UncheckedBaseModel): sip_messages: typing.List[SipLogMessage] next_cursor: typing.Optional[str] = None has_more: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_speech_history_response.py000066400000000000000000000021351523660243400320650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speech_history_item_response import SpeechHistoryItemResponse class GetSpeechHistoryResponse(UncheckedBaseModel): history: typing.List[SpeechHistoryItemResponse] = pydantic.Field() """ A list of speech history items. """ last_history_item_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the last history item. """ has_more: bool = pydantic.Field() """ Whether there are more history items to fetch. """ scanned_until: typing.Optional[int] = pydantic.Field(default=None) """ The timestamp of the last history item. """ 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 get_test_invocations_page_response_model.py000066400000000000000000000020201523660243400345160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .list_response_meta import ListResponseMeta from .test_invocation_summary_response_model import TestInvocationSummaryResponseModel class GetTestInvocationsPageResponseModel(UncheckedBaseModel): meta: typing.Optional[ListResponseMeta] = None results: typing.List[TestInvocationSummaryResponseModel] next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for the next page of results """ has_more: bool = pydantic.Field() """ Whether there are more results available """ 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 get_test_suite_invocation_response_model.py000066400000000000000000000025711523660243400345630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .bucketing_status import BucketingStatus from .test_run_result_summary import TestRunResultSummary from .unit_test_run_response_model import UnitTestRunResponseModel class GetTestSuiteInvocationResponseModel(UncheckedBaseModel): id: str agent_id: typing.Optional[str] = None branch_id: typing.Optional[str] = None created_at: typing.Optional[int] = None folder_id: typing.Optional[str] = None repeat_count: typing.Optional[int] = None bucketing_status: typing.Optional[BucketingStatus] = pydantic.Field(default=None) """ None when repeat_count==1 (no bucketing). Otherwise tracks bucketing lifecycle. """ result_groups: typing.Optional[typing.List[TestRunResultSummary]] = None test_runs: typing.List[UnitTestRunResponseModel] 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 update_forward_refs(GetTestSuiteInvocationResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_tests_page_response_model.py000066400000000000000000000013551523660243400323560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .unit_test_summary_response_model import UnitTestSummaryResponseModel class GetTestsPageResponseModel(UncheckedBaseModel): tests: typing.List[UnitTestSummaryResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 get_tests_summaries_by_ids_response_model.py000066400000000000000000000014341523660243400347170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .unit_test_summary_response_model import UnitTestSummaryResponseModel class GetTestsSummariesByIdsResponseModel(UncheckedBaseModel): tests: typing.Dict[str, UnitTestSummaryResponseModel] = pydantic.Field() """ Dictionary mapping test IDs to their summary information """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_tool_call_unit_test_response_model.py000066400000000000000000000043231523660243400342640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput class GetToolCallUnitTestResponseModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = pydantic.Field(default=None) """ How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. """ check_any_tool_matches: typing.Optional[bool] = pydantic.Field(default=None) """ If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. """ id: str name: 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 update_forward_refs(GetToolCallUnitTestResponseModel) get_tool_dependent_agents_response_model.py000066400000000000000000000016541523660243400345070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dependent_branch_info import DependentBranchInfo from .get_tool_dependent_agents_response_model_agents_item import GetToolDependentAgentsResponseModelAgentsItem class GetToolDependentAgentsResponseModel(UncheckedBaseModel): agents: typing.List[GetToolDependentAgentsResponseModelAgentsItem] branches: typing.Optional[typing.List[DependentBranchInfo]] = None next_cursor: typing.Optional[str] = None has_more: bool 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 get_tool_dependent_agents_response_model_agents_item.py000066400000000000000000000033701523660243400370630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class GetToolDependentAgentsResponseModelAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 GetToolDependentAgentsResponseModelAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 GetToolDependentAgentsResponseModelAgentsItem = typing_extensions.Annotated[ typing.Union[ GetToolDependentAgentsResponseModelAgentsItem_Available, GetToolDependentAgentsResponseModelAgentsItem_Unknown ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_tool_executions_page_response_model.py000066400000000000000000000013641523660243400344370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .tool_execution_response_model import ToolExecutionResponseModel class GetToolExecutionsPageResponseModel(UncheckedBaseModel): executions: typing.List[ToolExecutionResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_voice_accents_response_model.py000066400000000000000000000013571523660243400330270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice_accent_response_model import VoiceAccentResponseModel class GetVoiceAccentsResponseModel(UncheckedBaseModel): accents: typing.List[VoiceAccentResponseModel] = pydantic.Field() """ A list of available voice accents. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_voices_response.py000066400000000000000000000012401523660243400303210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice import Voice class GetVoicesResponse(UncheckedBaseModel): voices: typing.List[Voice] = pydantic.Field() """ A list of available voices. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_voices_v_2_response.py000066400000000000000000000031261523660243400310740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice import Voice class GetVoicesV2Response(UncheckedBaseModel): voices: typing.List[Voice] = pydantic.Field() """ The list of voices matching the query. """ has_more: bool = pydantic.Field() """ Indicates whether there are more voices available in subsequent pages. Use this flag (and next_page_token) for reliable pagination instead of relying on total_count. """ total_count: int = pydantic.Field() """ The total count of voices matching the query. This value is a live snapshot that reflects the current state of the database and may change between requests as users create, modify, or delete voices. For reliable pagination, use the has_more flag instead of relying on this value. Only request this field when you actually need the total count (e.g., for display purposes), as calculating it incurs a performance cost. """ next_page_token: typing.Optional[str] = pydantic.Field(default=None) """ Token to retrieve the next page of results. Pass this value to the next request to continue pagination. Null if there are no more results. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_whats_app_account_response.py000066400000000000000000000017741523660243400325470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class GetWhatsAppAccountResponse(UncheckedBaseModel): business_account_id: str phone_number_id: str business_account_name: str phone_number_name: str phone_number: str assigned_agent_id: typing.Optional[str] = None enable_messaging: typing.Optional[bool] = None enable_audio_message_response: typing.Optional[bool] = None enable_typing_indicator: typing.Optional[bool] = None assigned_agent_name: typing.Optional[str] = None is_token_expired: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/get_workspace_secrets_response_model.py000066400000000000000000000015141523660243400337430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conv_ai_workspace_stored_secret_config import ConvAiWorkspaceStoredSecretConfig class GetWorkspaceSecretsResponseModel(UncheckedBaseModel): secrets: typing.List[ConvAiWorkspaceStoredSecretConfig] next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for fetching the next page of secrets """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/group_management_activity_id.py000066400000000000000000000001411523660243400321730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. GroupManagementActivityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/guardrail_execution_mode.py000066400000000000000000000002531523660243400313200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GuardrailExecutionMode = typing.Union[typing.Literal["streaming", "blocking"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/guardrail_type.py000066400000000000000000000011021523660243400272640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing GuardrailType = typing.Union[ typing.Literal[ "custom", "prompt_injection", "self_harm_intent", "violence_graphic", "sexual", "violence", "harassment", "sexual_minors", "self_harm", "self_harm_instructions", "harassment_threatening", "hate", "hate_threatening", "profanity", "religion_or_politics", "medical_and_legal", "guardrail", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/guardrails_v_1_input.py000066400000000000000000000020541523660243400304010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_guardrail_input import ContentGuardrailInput from .custom_guardrail_input import CustomGuardrailInput from .focus_guardrail import FocusGuardrail from .prompt_injection_guardrail import PromptInjectionGuardrail class GuardrailsV1Input(UncheckedBaseModel): version: typing.Optional[typing.Literal["1"]] = None focus: typing.Optional[FocusGuardrail] = None prompt_injection: typing.Optional[PromptInjectionGuardrail] = None content: typing.Optional[ContentGuardrailInput] = None custom: typing.Optional[CustomGuardrailInput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/guardrails_v_1_output.py000066400000000000000000000020631523660243400306020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_guardrail_output import ContentGuardrailOutput from .custom_guardrail_output import CustomGuardrailOutput from .focus_guardrail import FocusGuardrail from .prompt_injection_guardrail import PromptInjectionGuardrail class GuardrailsV1Output(UncheckedBaseModel): version: typing.Optional[typing.Literal["1"]] = None focus: typing.Optional[FocusGuardrail] = None prompt_injection: typing.Optional[PromptInjectionGuardrail] = None content: typing.Optional[ContentGuardrailOutput] = None custom: typing.Optional[CustomGuardrailOutput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/history_alignment_response_model.py000066400000000000000000000016561523660243400331240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class HistoryAlignmentResponseModel(UncheckedBaseModel): characters: typing.List[str] = pydantic.Field() """ The characters in the alignment. """ character_start_times_seconds: typing.List[float] = pydantic.Field() """ The start times of the characters in seconds. """ character_end_times_seconds: typing.List[float] = pydantic.Field() """ The end times of the characters 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/history_alignments_response_model.py000066400000000000000000000015631523660243400333040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .history_alignment_response_model import HistoryAlignmentResponseModel class HistoryAlignmentsResponseModel(UncheckedBaseModel): alignment: HistoryAlignmentResponseModel = pydantic.Field() """ The alignment of the text. """ normalized_alignment: HistoryAlignmentResponseModel = pydantic.Field() """ The normalized alignment of the text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/history_item_response.py000066400000000000000000000012141523660243400307120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class HistoryItemResponse(UncheckedBaseModel): state: typing.Optional[typing.Any] = None voice_category: typing.Optional[typing.Any] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/html_export_options.py000066400000000000000000000014761523660243400304070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class HtmlExportOptions(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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/http_request_model.py000066400000000000000000000021121523660243400301620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .url_model import UrlModel class HttpRequestModel(UncheckedBaseModel): """ HTTP request details. Spec: https://schema.ocsf.io/1.6.0/objects/http_request """ http_method: str = pydantic.Field() """ HTTP method (GET, POST, etc.) """ url: UrlModel = pydantic.Field() """ Request URL object """ user_agent: typing.Optional[str] = pydantic.Field(default=None) """ User agent string """ x_forwarded_for: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ X-Forwarded-For header as a list """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/http_validation_error.py000066400000000000000000000012261523660243400306620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .validation_error import ValidationError class HttpValidationError(UncheckedBaseModel): detail: typing.Optional[typing.List[ValidationError]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/icon.py000066400000000000000000000015671523660243400252200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class Icon(UncheckedBaseModel): """ An icon for display in user interfaces. """ src: str mime_type: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="mimeType"), pydantic.Field(alias="mimeType") ] = None sizes: typing.Optional[typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/image_analysis.py000066400000000000000000000014241523660243400272450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .image_analysis_result import ImageAnalysisResult from .image_analysis_status import ImageAnalysisStatus class ImageAnalysis(UncheckedBaseModel): status: ImageAnalysisStatus data: typing.Optional[ImageAnalysisResult] = None updated_at_ms: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/image_analysis_result.py000066400000000000000000000017251523660243400306470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .image_subject import ImageSubject class ImageAnalysisResult(UncheckedBaseModel): title: str description: str content_type: typing.Optional[str] = None mood_and_style: typing.Optional[str] = None composition_notes: typing.Optional[str] = None visible_text: typing.Optional[str] = pydantic.Field(default=None) """ Readable text overlaid or shown in the image, if any. """ subjects: typing.Optional[typing.List[ImageSubject]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/image_analysis_status.py000066400000000000000000000002641523660243400306510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ImageAnalysisStatus = typing.Union[typing.Literal["processing", "completed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/image_avatar.py000066400000000000000000000012061523660243400266760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ImageAvatar(UncheckedBaseModel): url: typing.Optional[str] = pydantic.Field(default=None) """ The URL of the avatar """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/image_subject.py000066400000000000000000000011031523660243400270530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ImageSubject(UncheckedBaseModel): name: str description: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/inbound_sip_trunk_config_request_model.py000066400000000000000000000035071523660243400342750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sip_media_encryption_enum import SipMediaEncryptionEnum from .sip_trunk_credentials_request_model import SipTrunkCredentialsRequestModel class InboundSipTrunkConfigRequestModel(UncheckedBaseModel): allowed_addresses: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of IP addresses that are allowed to use the trunk. Each item in the list can be an individual IP address or a Classless Inter-Domain Routing notation representing a CIDR block. """ allowed_numbers: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of phone numbers that are allowed to use the trunk. """ media_encryption: typing.Optional[SipMediaEncryptionEnum] = pydantic.Field(default=None) """ Whether or not to encrypt media (data layer). """ credentials: typing.Optional[SipTrunkCredentialsRequestModel] = pydantic.Field(default=None) """ Optional digest authentication credentials (username/password). """ remote_domains: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Domains of remote SIP servers used to validate TLS certificates. """ attributes_to_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Map of dynamic variable name to header name for attributes_to_headers """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/init_payload.py000066400000000000000000000015341523660243400267360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class InitPayload(UncheckedBaseModel): """ Payload for the session initialisation message sent by ElevenLabs. """ type: typing.Literal["init"] = pydantic.Field(default="init") """ The message type identifier. """ conversation_id: str = pydantic.Field() """ Unique identifier for this conversation session. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/initialise_context.py000066400000000000000000000042721523660243400301620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .generation_config import GenerationConfig from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .realtime_voice_settings import RealtimeVoiceSettings class InitialiseContext(UncheckedBaseModel): """ Payload to initialize or re-initialize a TTS context with specific settings and initial text for multi-stream connections. """ text: str = pydantic.Field() """ The initial text to synthesize. Should end with a single space. """ voice_settings: typing.Optional[RealtimeVoiceSettings] = None generation_config: typing.Optional[GenerationConfig] = None pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional list of pronunciation dictionary locators to be used for this context. """ xi_api_key: typing.Optional[str] = pydantic.Field(default=None) """ Your ElevenLabs API key. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. """ authorization: typing.Optional[str] = pydantic.Field(default=None) """ Your authorization bearer token. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ An identifier for the text-to-speech context. If omitted, a default context ID may be assigned by the server. If provided, this message will create a new context with this ID or re-initialize an existing one with the new settings and text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/initialize_connection.py000066400000000000000000000040351523660243400306410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .generation_config import GenerationConfig from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .realtime_voice_settings import RealtimeVoiceSettings class InitializeConnection(UncheckedBaseModel): text: typing.Literal[" "] = pydantic.Field(default=" ") """ The initial text that must be sent is a blank space. """ voice_settings: typing.Optional[RealtimeVoiceSettings] = None generation_config: typing.Optional[GenerationConfig] = None pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional list of pronunciation dictionary locators. If provided, these dictionaries will be used to modify pronunciation of matching text. Must only be provided in the first message. Note: Pronunciation dictionary matches will only be respected within a provided chunk. """ xi_api_key: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="xi-api-key"), pydantic.Field( alias="xi-api-key", description="Your ElevenLabs API key. This can only be included in the first message and is not needed if present in the header.", ), ] = None authorization: typing.Optional[str] = pydantic.Field(default=None) """ Your authorization bearer token. This can only be included in the first message and is not needed if present in the header. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/initialize_connection_multi.py000066400000000000000000000035371523660243400320610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .generation_config import GenerationConfig from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .realtime_voice_settings import RealtimeVoiceSettings class InitializeConnectionMulti(UncheckedBaseModel): """ Payload to initialize a new context in a multi-stream WebSocket connection. """ text: typing.Literal[" "] = pydantic.Field(default=" ") """ Must be a single space character to initiate the context. """ voice_settings: typing.Optional[RealtimeVoiceSettings] = None generation_config: typing.Optional[GenerationConfig] = None pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional pronunciation dictionaries for this context. """ xi_api_key: typing.Optional[str] = pydantic.Field(default=None) """ Your ElevenLabs API key (if not in header). For this context's first message only. """ authorization: typing.Optional[str] = pydantic.Field(default=None) """ Your authorization bearer token (if not in header). For this context's first message only. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ A unique identifier for the first context created in the websocket. If not provided, a default context will be used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/input_audio_chunk_payload.py000066400000000000000000000024321523660243400315010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class InputAudioChunkPayload(UncheckedBaseModel): """ Payload for sending audio chunks from client to server. """ message_type: typing.Literal["input_audio_chunk"] = pydantic.Field(default="input_audio_chunk") """ The message type identifier. """ audio_base_64: str = pydantic.Field() """ Base64-encoded audio data. """ commit: bool = pydantic.Field() """ Whether to commit the transcription after this chunk. """ sample_rate: int = pydantic.Field() """ Sample rate of the audio in Hz. """ previous_text: typing.Optional[str] = pydantic.Field(default=None) """ Send text context to the model. Can only be sent alongside the first audio chunk. If sent in a subsequent chunk, an error 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/integration_type.py000066400000000000000000000002541523660243400276440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing IntegrationType = typing.Union[typing.Literal["mcp_server", "mcp_integration"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/interaction_budget.py000066400000000000000000000002761523660243400301350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing InteractionBudget = typing.Union[typing.Literal["realtime", "5_minutes", "10_minutes", "1_hour"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/internal_alerting_webhook_notifier.py000066400000000000000000000023251523660243400333770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .alerting_webhook_header import AlertingWebhookHeader from .alerting_webhook_method import AlertingWebhookMethod class InternalAlertingWebhookNotifier(UncheckedBaseModel): type: typing.Optional[typing.Literal["webhook"]] = None url: str = pydantic.Field() """ The URL to send alert lifecycle notifications to. """ method: typing.Optional[AlertingWebhookMethod] = pydantic.Field(default=None) """ HTTP method used when calling the webhook URL. """ headers: typing.Optional[typing.List[AlertingWebhookHeader]] = pydantic.Field(default=None) """ Custom request headers sent with every notification. Secret header values are encrypted at rest and never returned by the API. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/invoice_response.py000066400000000000000000000044631523660243400276400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .discount_response_model import DiscountResponseModel from .invoice_response_payment_intent_status import InvoiceResponsePaymentIntentStatus from .invoice_response_payment_intent_statusses_item import InvoiceResponsePaymentIntentStatussesItem class InvoiceResponse(UncheckedBaseModel): amount_due_cents: int = pydantic.Field() """ The amount due in cents. """ subtotal_cents: typing.Optional[int] = pydantic.Field(default=None) """ The subtotal amount in cents before tax (exclusive of tax and discounts). """ tax_cents: typing.Optional[int] = pydantic.Field(default=None) """ The tax amount in cents. """ discount_percent_off: typing.Optional[float] = pydantic.Field(default=None) """ Deprecated. Use [discounts] instead. The discount applied to the invoice. E.g. [20.0f] for 20% off. """ discount_amount_off: typing.Optional[float] = pydantic.Field(default=None) """ Deprecated. Use [discounts] instead. The discount applied to the invoice. E.g. [20.0f] for 20 cents off. """ discounts: typing.List[DiscountResponseModel] = pydantic.Field() """ The discounts applied to the invoice. """ next_payment_attempt_unix: int = pydantic.Field() """ The Unix timestamp of the next payment attempt. -1 when there is no next payment attempt. """ payment_intent_status: typing.Optional[InvoiceResponsePaymentIntentStatus] = pydantic.Field(default=None) """ Deprecated. Use [payment_intent_statusses] instead. The status of this invoice's first payment intent. None when there is no payment intent. """ payment_intent_statusses: typing.List[InvoiceResponsePaymentIntentStatussesItem] = pydantic.Field() """ The statuses of this invoice's payment intents. Empty list when there are no payment intents. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/invoice_response_payment_intent_status.py000066400000000000000000000005521523660243400343540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing InvoiceResponsePaymentIntentStatus = typing.Union[ typing.Literal[ "canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded", ], typing.Any, ] invoice_response_payment_intent_statusses_item.py000066400000000000000000000005611523660243400360260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing InvoiceResponsePaymentIntentStatussesItem = typing.Union[ typing.Literal[ "canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/item_id.py000066400000000000000000000001161523660243400256670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. ItemId = str elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/kb_external_sync_job.py000066400000000000000000000024241523660243400304450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .crawl_status import CrawlStatus from .external_sync_job_trigger import ExternalSyncJobTrigger from .external_sync_job_type import ExternalSyncJobType from .external_sync_provider import ExternalSyncProvider class KbExternalSyncJob(UncheckedBaseModel): type: ExternalSyncProvider = "google_drive" folder_id: str integration_connection_id: str triggered_by: ExternalSyncJobTrigger status: typing.Optional[CrawlStatus] = None sync_type: typing.Optional[ExternalSyncJobType] = None items_identified: typing.Optional[int] = None items_processed: typing.Optional[int] = None error_message: typing.Optional[str] = None started_at: typing.Optional[int] = None completed_at: typing.Optional[int] = None updated_at: int id: str created_at: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/keep_context_alive.py000066400000000000000000000017501523660243400301320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KeepContextAlive(UncheckedBaseModel): """ Payload to keep a specific context alive by resetting its inactivity timeout. Empty text is ignored but resets the clock. """ text: typing.Literal[""] = pydantic.Field(default="") """ An empty string. This text is ignored by the server but its presence resets the inactivity timeout for the specified context. """ context_id: str = pydantic.Field() """ The identifier of the context to keep alive. """ 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 knowledge_base_bulk_delete_successful_response_model.py000066400000000000000000000013031523660243400370420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_deleted_response_model import KnowledgeBaseDeletedResponseModel class KnowledgeBaseBulkDeleteSuccessfulResponseModel(UncheckedBaseModel): data: KnowledgeBaseDeletedResponseModel 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 knowledge_base_content_search_response_model.py000066400000000000000000000013661523660243400353340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_content_search_result import KnowledgeBaseContentSearchResult class KnowledgeBaseContentSearchResponseModel(UncheckedBaseModel): results: typing.List[KnowledgeBaseContentSearchResult] next_cursor: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_content_search_result.py000066400000000000000000000015551523660243400337130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_content_search_result_document import KnowledgeBaseContentSearchResultDocument from .search_highlight_segment import SearchHighlightSegment class KnowledgeBaseContentSearchResult(UncheckedBaseModel): document: KnowledgeBaseContentSearchResultDocument search_snippet: typing.Optional[typing.List[SearchHighlightSegment]] = None score: float 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 knowledge_base_content_search_result_document.py000066400000000000000000000130661523660243400355320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_file_sync_info import ExternalFileSyncInfo from .external_folder_sync_info import ExternalFolderSyncInfo from .file_refresh_status import FileRefreshStatus from .get_knowledge_base_summary_file_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_text_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_url_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class KnowledgeBaseContentSearchResultDocument_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class KnowledgeBaseContentSearchResultDocument_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = 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 class KnowledgeBaseContentSearchResultDocument_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] 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 KnowledgeBaseContentSearchResultDocument_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] url: str auto_sync_info: typing.Optional[AutoSyncInfo] = 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 KnowledgeBaseContentSearchResultDocument = typing_extensions.Annotated[ typing.Union[ KnowledgeBaseContentSearchResultDocument_File, KnowledgeBaseContentSearchResultDocument_Folder, KnowledgeBaseContentSearchResultDocument_Text, KnowledgeBaseContentSearchResultDocument_Url, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_deleted_response_model.py000066400000000000000000000011011523660243400340050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseDeletedResponseModel(UncheckedBaseModel): 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_dependent_type.py000066400000000000000000000002651523660243400323220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing KnowledgeBaseDependentType = typing.Union[typing.Literal["direct", "transitive", "all"], typing.Any] knowledge_base_document_chunk_response_model.py000066400000000000000000000011461523660243400353370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseDocumentChunkResponseModel(UncheckedBaseModel): id: str name: str content: 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 knowledge_base_document_chunks_response_model.py000066400000000000000000000014141523660243400355200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel class KnowledgeBaseDocumentChunksResponseModel(UncheckedBaseModel): chunks: typing.List[KnowledgeBaseDocumentChunkResponseModel] next_cursor: 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 knowledge_base_document_metadata_response_model.py000066400000000000000000000012231523660243400360030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseDocumentMetadataResponseModel(UncheckedBaseModel): created_at_unix_secs: int last_updated_at_unix_secs: int size_bytes: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_document_type.py000066400000000000000000000002661523660243400321730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing KnowledgeBaseDocumentType = typing.Union[typing.Literal["file", "url", "text", "folder"], typing.Any] knowledge_base_folder_path_segment_response_model.py000066400000000000000000000011611523660243400363370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseFolderPathSegmentResponseModel(UncheckedBaseModel): id: str name: 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 knowledge_base_folder_path_segment_summary_response_model.py000066400000000000000000000011221523660243400401110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseFolderPathSegmentSummaryResponseModel(UncheckedBaseModel): 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_locator.py000066400000000000000000000021101523660243400307450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .document_usage_mode_enum import DocumentUsageModeEnum from .knowledge_base_document_type import KnowledgeBaseDocumentType class KnowledgeBaseLocator(UncheckedBaseModel): type: KnowledgeBaseDocumentType = pydantic.Field() """ The type of the knowledge base """ name: str = pydantic.Field() """ The name of the knowledge base """ id: str = pydantic.Field() """ The ID of the knowledge base """ usage_mode: typing.Optional[DocumentUsageModeEnum] = pydantic.Field(default=None) """ The usage mode of the knowledge base """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_rag_chunk_model.py000066400000000000000000000011461523660243400324330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseRagChunkModel(UncheckedBaseModel): chunk_id: str document_id: str content: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_rag_tool_config.py000066400000000000000000000010551523660243400324440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseRagToolConfig(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_rag_tool_result_model.py000066400000000000000000000023161523660243400336760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_rag_chunk_model import KnowledgeBaseRagChunkModel from .knowledge_base_rag_tool_status import KnowledgeBaseRagToolStatus class KnowledgeBaseRagToolResultModel(UncheckedBaseModel): status: typing.Optional[KnowledgeBaseRagToolStatus] = None chunk_count: typing.Optional[int] = pydantic.Field(default=None) """ Number of relevant chunks retrieved """ message: typing.Optional[str] = pydantic.Field(default=None) """ Human-readable status for the LLM about the search results """ chunks: typing.Optional[typing.List[KnowledgeBaseRagChunkModel]] = pydantic.Field(default=None) """ Retrieved chunks; populated only in the rag-result-in-tool-result mode """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_rag_tool_status.py000066400000000000000000000002771523660243400325270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing KnowledgeBaseRagToolStatus = typing.Union[typing.Literal["success", "no_documents", "no_results"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_sort_by.py000066400000000000000000000002731523660243400307730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing KnowledgeBaseSortBy = typing.Union[typing.Literal["name", "created_at", "updated_at", "size"], typing.Any] knowledge_base_source_file_url_response_model.py000066400000000000000000000012461523660243400355130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class KnowledgeBaseSourceFileUrlResponseModel(UncheckedBaseModel): signed_url: str = pydantic.Field() """ Signed URL to download the source file directly """ 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 knowledge_base_summary_batch_successful_response_model.py000066400000000000000000000014121523660243400374220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_summary_batch_successful_response_model_data import ( KnowledgeBaseSummaryBatchSuccessfulResponseModelData, ) class KnowledgeBaseSummaryBatchSuccessfulResponseModel(UncheckedBaseModel): data: KnowledgeBaseSummaryBatchSuccessfulResponseModelData 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 knowledge_base_summary_batch_successful_response_model_data.py000066400000000000000000000132421523660243400404170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .auto_sync_info import AutoSyncInfo from .document_usage_mode_enum import DocumentUsageModeEnum from .external_file_sync_info import ExternalFileSyncInfo from .external_folder_sync_info import ExternalFolderSyncInfo from .file_refresh_status import FileRefreshStatus from .get_knowledge_base_summary_file_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_text_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, ) from .get_knowledge_base_summary_url_response_model_dependent_agents_item import ( GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_folder_path_segment_summary_response_model import ( KnowledgeBaseFolderPathSegmentSummaryResponseModel, ) from .resource_access_info import ResourceAccessInfo class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File(UncheckedBaseModel): type: typing.Literal["file"] = "file" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] external_sync_info: typing.Optional[ExternalFileSyncInfo] = None auto_sync_info: typing.Optional[AutoSyncInfo] = None refresh_status: typing.Optional[FileRefreshStatus] = None is_frozen: typing.Optional[bool] = 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 class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder(UncheckedBaseModel): type: typing.Literal["folder"] = "folder" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] children_count: int document_count: int auto_sync_info: typing.Optional[AutoSyncInfo] = None external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None is_frozen: typing.Optional[bool] = 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 class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] 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 KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url(UncheckedBaseModel): type: typing.Literal["url"] = "url" id: str name: str metadata: KnowledgeBaseDocumentMetadataResponseModel supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] url: str auto_sync_info: typing.Optional[AutoSyncInfo] = 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 KnowledgeBaseSummaryBatchSuccessfulResponseModelData = typing_extensions.Annotated[ typing.Union[ KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text, KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_tool_config.py000066400000000000000000000012431523660243400316120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .search_strategy import SearchStrategy class KnowledgeBaseToolConfig(UncheckedBaseModel): enabled_strategies: typing.Optional[typing.List[SearchStrategy]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_tool_info.py000066400000000000000000000014101523660243400312740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .search_strategy import SearchStrategy class KnowledgeBaseToolInfo(UncheckedBaseModel): enabled_strategies: typing.Optional[typing.List[SearchStrategy]] = pydantic.Field(default=None) """ Search strategies exposed to the model. Must be non-empty. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_tool_result_model.py000066400000000000000000000014021523660243400330400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_tool_status import KnowledgeBaseToolStatus class KnowledgeBaseToolResultModel(UncheckedBaseModel): status: typing.Optional[KnowledgeBaseToolStatus] = None chunk_count: typing.Optional[int] = None message: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/knowledge_base_tool_status.py000066400000000000000000000003051523660243400316660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing KnowledgeBaseToolStatus = typing.Union[typing.Literal["success", "no_matching_documents", "no_results"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_added_response.py000066400000000000000000000010721523660243400311010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguageAddedResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_detection_tool_config.py000066400000000000000000000016341523660243400324660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguageDetectionToolConfig(UncheckedBaseModel): only_at_conversation_start: typing.Optional[bool] = pydantic.Field(default=None) """ If no language switch happens in the first 2 user turns, later attempts fail and the conversation stays in the current language. If the language switches during those turns, later switching stays available. Enable to reduce the possibility of false switching. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_detection_tool_result_model.py000066400000000000000000000013041523660243400337110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguageDetectionToolResultModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None reason: typing.Optional[str] = None language: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_info.py000066400000000000000000000014121523660243400270530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguageInfo(UncheckedBaseModel): code: str = pydantic.Field() """ The language code (e.g. 'en', 'fr', 'es-ES'). """ label: str = pydantic.Field() """ The human-readable language name (e.g. 'English', 'French', 'Spanish (Spain)'). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_pair_info.py000066400000000000000000000015051523660243400300710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .language_info import LanguageInfo class LanguagePairInfo(UncheckedBaseModel): source_language: LanguageInfo = pydantic.Field() """ The source language. """ destination_languages: typing.List[LanguageInfo] = pydantic.Field() """ The available destination languages for this source language. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_preset_input.py000066400000000000000000000022251523660243400306440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_input import ConversationConfigClientOverrideInput from .language_preset_translation import LanguagePresetTranslation class LanguagePresetInput(UncheckedBaseModel): overrides: ConversationConfigClientOverrideInput = pydantic.Field() """ The overrides for the language preset """ first_message_translation: typing.Optional[LanguagePresetTranslation] = pydantic.Field(default=None) """ The translation of the first message """ soft_timeout_translation: typing.Optional[LanguagePresetTranslation] = pydantic.Field(default=None) """ The translation of the soft timeout message """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_preset_output.py000066400000000000000000000022311523660243400310420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .language_preset_translation import LanguagePresetTranslation class LanguagePresetOutput(UncheckedBaseModel): overrides: ConversationConfigClientOverrideOutput = pydantic.Field() """ The overrides for the language preset """ first_message_translation: typing.Optional[LanguagePresetTranslation] = pydantic.Field(default=None) """ The translation of the first message """ soft_timeout_translation: typing.Optional[LanguagePresetTranslation] = pydantic.Field(default=None) """ The translation of the soft timeout message """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_preset_translation.py000066400000000000000000000011201523660243400320340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguagePresetTranslation(UncheckedBaseModel): source_hash: str text: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/language_response.py000066400000000000000000000013271523660243400277630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LanguageResponse(UncheckedBaseModel): language_id: str = pydantic.Field() """ The unique identifier of the language. """ name: str = pydantic.Field() """ The name of the language. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/languages_response.py000066400000000000000000000025721523660243400301510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .language_info import LanguageInfo from .language_pair_info import LanguagePairInfo class LanguagesResponse_Pair(UncheckedBaseModel): kind: typing.Literal["pair"] = "pair" language_pairs: typing.List[LanguagePairInfo] 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 LanguagesResponse_Single(UncheckedBaseModel): kind: typing.Literal["single"] = "single" languages: typing.List[LanguageInfo] 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 LanguagesResponse = typing_extensions.Annotated[ typing.Union[LanguagesResponse_Pair, LanguagesResponse_Single], UnionMetadata(discriminant="kind") ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/leave_message_params.py000066400000000000000000000011611523660243400304210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LeaveMessageParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["leave_message"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/library_voice_response.py000066400000000000000000000116621523660243400310340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .library_voice_response_category import LibraryVoiceResponseCategory from .verified_voice_language_response_model import VerifiedVoiceLanguageResponseModel class LibraryVoiceResponse(UncheckedBaseModel): public_owner_id: str = pydantic.Field() """ The public owner id of the voice. """ voice_id: str = pydantic.Field() """ The id of the voice. """ date_unix: int = pydantic.Field() """ The date the voice was added to the library in Unix time. """ name: str = pydantic.Field() """ The name of the voice. """ accent: str = pydantic.Field() """ The accent of the voice. """ gender: str = pydantic.Field() """ The gender of the voice. """ age: str = pydantic.Field() """ The age of the voice. """ descriptive: str = pydantic.Field() """ The descriptive of the voice. """ use_case: str = pydantic.Field() """ The use case of the voice. """ category: LibraryVoiceResponseCategory = pydantic.Field() """ The category of the voice. """ language: typing.Optional[str] = pydantic.Field(default=None) """ The language of the voice. """ locale: typing.Optional[str] = pydantic.Field(default=None) """ The locale of the voice. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the voice. """ preview_url: typing.Optional[str] = pydantic.Field(default=None) """ The preview URL of the voice. """ usage_character_count_1_y: typing_extensions.Annotated[ int, FieldMetadata(alias="usage_character_count_1y"), pydantic.Field( alias="usage_character_count_1y", description="The usage character count of the voice in the last year." ), ] usage_character_count_7_d: typing_extensions.Annotated[ int, FieldMetadata(alias="usage_character_count_7d"), pydantic.Field( alias="usage_character_count_7d", description="The usage character count of the voice in the last 7 days." ), ] play_api_usage_character_count_1_y: typing_extensions.Annotated[ int, FieldMetadata(alias="play_api_usage_character_count_1y"), pydantic.Field( alias="play_api_usage_character_count_1y", description="The play API usage character count of the voice in the last year.", ), ] cloned_by_count: int = pydantic.Field() """ The number of times the voice has been cloned. """ rate: typing.Optional[float] = pydantic.Field(default=None) """ The rate multiplier of the voice. """ fiat_rate: typing.Optional[float] = pydantic.Field(default=None) """ The rate of the voice in USD per 1000 credits. null if default """ free_users_allowed: bool = pydantic.Field() """ Whether free users are allowed to use the voice. """ live_moderation_enabled: bool = pydantic.Field() """ Whether live moderation is enabled for the voice. """ featured: bool = pydantic.Field() """ Whether the voice is featured. """ verified_languages: typing.Optional[typing.List[VerifiedVoiceLanguageResponseModel]] = pydantic.Field(default=None) """ The verified languages of the voice. """ notice_period: typing.Optional[int] = pydantic.Field(default=None) """ The notice period of the voice. """ instagram_username: typing.Optional[str] = pydantic.Field(default=None) """ The Instagram username of the voice. """ twitter_username: typing.Optional[str] = pydantic.Field(default=None) """ The Twitter username of the voice. """ youtube_username: typing.Optional[str] = pydantic.Field(default=None) """ The YouTube username of the voice. """ tiktok_username: typing.Optional[str] = pydantic.Field(default=None) """ The TikTok username of the voice. """ image_url: typing.Optional[str] = pydantic.Field(default=None) """ The image URL of the voice. """ is_added_by_user: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice was added by the user. """ is_bookmarked: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is bookmarked by the current user. Only relevant when is_added_by_user is True. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/library_voice_response_category.py000066400000000000000000000003521523660243400327230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LibraryVoiceResponseCategory = typing.Union[ typing.Literal["generated", "cloned", "premade", "professional", "famous", "high_quality"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_agent_procedures_params.py000066400000000000000000000012001523660243400321770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListAgentProceduresParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_agent_procedures"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_agent_references_params.py000066400000000000000000000012001523660243400321450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListAgentReferencesParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_agent_references"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_agent_rules_params.py000066400000000000000000000011661523660243400311710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListAgentRulesParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_agent_rules"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_assets_params.py000066400000000000000000000012631523660243400301610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListAssetsParams(UncheckedBaseModel): list_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None smb_tool_type: typing.Optional[typing.Literal["list_assets"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_auth_connections_response.py000066400000000000000000000013621523660243400325750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .list_auth_connections_response_auth_connections_item import ListAuthConnectionsResponseAuthConnectionsItem class ListAuthConnectionsResponse(UncheckedBaseModel): auth_connections: typing.List[ListAuthConnectionsResponseAuthConnectionsItem] 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 list_auth_connections_response_auth_connections_item.py000066400000000000000000000330711523660243400371610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .api_integration_o_auth_2_auth_code_response_scope_separator import ( ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ) from .api_integration_o_auth_2_custom_app_response_scope_separator import ( ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ) from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus from .o_auth_2_jwt_response_algorithm import OAuth2JwtResponseAlgorithm from .o_auth_2_jwt_response_token_response_field import OAuth2JwtResponseTokenResponseField from .private_key_jwt_response_algorithm import PrivateKeyJwtResponseAlgorithm class ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_auth_code"] = "api_integration_oauth2_auth_code" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2AuthCodeResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_custom_app"] = "api_integration_oauth2_custom_app" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2CustomAppResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str client_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["basic_auth"] = "basic_auth" name: str provider: str username: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["bearer_auth"] = "bearer_auth" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["custom_header_auth"] = "custom_header_auth" name: str provider: str header_name: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_Mtls(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["mtls"] = "mtls" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_client_credentials"] = "oauth2_client_credentials" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, 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 class ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_jwt"] = "oauth2_jwt" name: str provider: str algorithm: typing.Optional[OAuth2JwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None token_url: str scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[OAuth2JwtResponseTokenResponseField] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["private_key_jwt"] = "private_key_jwt" name: str provider: str algorithm: typing.Optional[PrivateKeyJwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["refresh_token_auth"] = "refresh_token_auth" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["slack_bot_auth"] = "slack_bot_auth" name: str provider: typing.Optional[typing.Literal["Slack"]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["url_secret"] = "url_secret" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["whatsapp_auth"] = "whatsapp_auth" name: str provider: typing.Optional[typing.Literal["whatsapp"]] = None phone_number_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 ListAuthConnectionsResponseAuthConnectionsItem = typing_extensions.Annotated[ typing.Union[ ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2AuthCode, ListAuthConnectionsResponseAuthConnectionsItem_ApiIntegrationOauth2CustomApp, ListAuthConnectionsResponseAuthConnectionsItem_BasicAuth, ListAuthConnectionsResponseAuthConnectionsItem_BearerAuth, ListAuthConnectionsResponseAuthConnectionsItem_CustomHeaderAuth, ListAuthConnectionsResponseAuthConnectionsItem_Mtls, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2ClientCredentials, ListAuthConnectionsResponseAuthConnectionsItem_Oauth2Jwt, ListAuthConnectionsResponseAuthConnectionsItem_PrivateKeyJwt, ListAuthConnectionsResponseAuthConnectionsItem_RefreshTokenAuth, ListAuthConnectionsResponseAuthConnectionsItem_SlackBotAuth, ListAuthConnectionsResponseAuthConnectionsItem_UrlSecret, ListAuthConnectionsResponseAuthConnectionsItem_WhatsappAuth, ], UnionMetadata(discriminant="auth_type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_calendar_events_params.py000066400000000000000000000012621523660243400320130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListCalendarEventsParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_calendar_events"]] = None include_cancelled: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_client_interactions_params.py000066400000000000000000000012061523660243400327140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListClientInteractionsParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_client_interactions"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_clients_params.py000066400000000000000000000013131523660243400303140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListClientsParams(UncheckedBaseModel): """ List clients ordered by most recently updated, with an optional limit. """ smb_tool_type: typing.Optional[typing.Literal["list_clients"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_crawl_jobs_response_model.py000066400000000000000000000013241523660243400325350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_crawl_job_response_model import GetCrawlJobResponseModel class ListCrawlJobsResponseModel(UncheckedBaseModel): crawl_jobs: typing.List[GetCrawlJobResponseModel] next_cursor: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_customer_facing_agents_params.py000066400000000000000000000017561523660243400333770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListCustomerFacingAgentsParams(UncheckedBaseModel): """ List every customer-facing agent on the workspace. The assistant uses this whenever it needs to act on a specific customer-facing agent (rules, config edits, etc.) so it can pick the right ``agent_id`` to pass to mutating tools. Mirrors the ``list_services`` / ``list_clients`` pattern: read once, then mutate by id. """ smb_tool_type: typing.Optional[typing.Literal["list_customer_facing_agents"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_group_sessions_params.py000066400000000000000000000016751523660243400317500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListGroupSessionsParams(UncheckedBaseModel): """ List scheduled group sessions for a group service in a date range. Group services are scheduled in advance (e.g. yoga classes, workshops) and callers register against an existing session. Use this for group services; use ``check_service_availability`` for appointment / rental services. """ smb_tool_type: typing.Optional[typing.Literal["list_group_sessions"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_holidays_params.py000066400000000000000000000011611523660243400304700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListHolidaysParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_holidays"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_locations_params.py000066400000000000000000000013011523660243400306430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListLocationsParams(UncheckedBaseModel): """ Params + Reception-proxied ``run()`` for list_locations. """ smb_tool_type: typing.Optional[typing.Literal["list_locations"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_mcp_tools_response_model.py000066400000000000000000000017731523660243400324170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .tool import Tool class ListMcpToolsResponseModel(UncheckedBaseModel): """ Response model for testing tools available on an MCP server. """ success: bool = pydantic.Field() """ Indicates if the operation was successful. """ tools: typing.List[Tool] = pydantic.Field() """ A list of tools available on the MCP server. """ error_message: typing.Optional[str] = pydantic.Field(default=None) """ Error message if the operation was not successful. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_orders_response.py000066400000000000000000000013021523660243400305220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .order_summary import OrderSummary class ListOrdersResponse(UncheckedBaseModel): orders: typing.List[OrderSummary] = pydantic.Field() """ The list of orders matching the query. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_procedures_response_model.py000066400000000000000000000014331523660243400325640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_list_item_response_model import ProcedureListItemResponseModel class ListProceduresResponseModel(UncheckedBaseModel): procedures: typing.List[ProcedureListItemResponseModel] = pydantic.Field() """ Procedures on the branch with their draft-aware metadata. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_products_params.py000066400000000000000000000012671523660243400305260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListProductsParams(UncheckedBaseModel): list_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None smb_tool_type: typing.Optional[typing.Literal["list_products"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_response_agent_branch_summary.py000066400000000000000000000013701523660243400334210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_branch_summary import AgentBranchSummary from .list_response_meta import ListResponseMeta class ListResponseAgentBranchSummary(UncheckedBaseModel): meta: typing.Optional[ListResponseMeta] = None results: typing.List[AgentBranchSummary] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_response_meta.py000066400000000000000000000012341523660243400301560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListResponseMeta(UncheckedBaseModel): total: typing.Optional[int] = None page: typing.Optional[int] = None page_size: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_services_params.py000066400000000000000000000012671523660243400305060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListServicesParams(UncheckedBaseModel): list_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None smb_tool_type: typing.Optional[typing.Literal["list_services"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_speech_engines_response.py000066400000000000000000000017251523660243400322140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speech_engine_summary_response import SpeechEngineSummaryResponse class ListSpeechEnginesResponse(UncheckedBaseModel): speech_engines: typing.List[SpeechEngineSummaryResponse] = pydantic.Field() """ The speech engines matching the query """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for fetching the next page """ has_more: bool = pydantic.Field() """ Whether there are more results """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_staff_params.py000066400000000000000000000012611523660243400277600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListStaffParams(UncheckedBaseModel): list_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None smb_tool_type: typing.Optional[typing.Literal["list_staff"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_transfer_rules_params.py000066400000000000000000000011741523660243400317160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ListTransferRulesParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["list_transfer_rules"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/list_whats_app_accounts_response.py000066400000000000000000000012521523660243400331150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .get_whats_app_account_response import GetWhatsAppAccountResponse class ListWhatsAppAccountsResponse(UncheckedBaseModel): items: typing.List[GetWhatsAppAccountResponse] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/literal_json_schema_property.py000066400000000000000000000060361523660243400322350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .literal_json_schema_property_constant_value import LiteralJsonSchemaPropertyConstantValue from .literal_json_schema_property_type import LiteralJsonSchemaPropertyType class LiteralJsonSchemaProperty(UncheckedBaseModel): """ Schema property for literal JSON types. IMPORTANT: Only ONE of the following fields can be set: description (LLM provides value), dynamic_variable (value from variable), is_system_provided (system provides value), constant_value (fixed value), or is_omitted (parameter is omitted). These are mutually exclusive. """ type: LiteralJsonSchemaPropertyType description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the property. When set, the LLM will provide the value based on this description. Mutually exclusive with dynamic_variable, is_system_provided, constant_value, and is_omitted. """ enum: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of allowed string values for string type parameters """ is_system_provided: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the value will be populated by the system at runtime. Used by API Integration Webhook tools for templating. Mutually exclusive with description, dynamic_variable, constant_value, and is_omitted. """ dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ The name of the dynamic variable to use for this property's value. Mutually exclusive with description, is_system_provided, constant_value, and is_omitted. """ allowed_values_dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the LLM provides the value but the runtime rejects any value not present in the list held by this dynamic variable. Use to let the LLM pick from a server-verified set (e.g. the IDs the current user is allowed to access). Requires description; mutually exclusive with dynamic_variable, is_system_provided, constant_value, and is_omitted. """ constant_value: typing.Optional[LiteralJsonSchemaPropertyConstantValue] = pydantic.Field(default=None) """ A constant value to use for this property. Mutually exclusive with description, dynamic_variable, is_system_provided, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, is_system_provided, and constant_value. """ 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 literal_json_schema_property_constant_value.py000066400000000000000000000002351523660243400352560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing LiteralJsonSchemaPropertyConstantValue = typing.Union[str, int, float, bool] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/literal_json_schema_property_type.py000066400000000000000000000004201523660243400332650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LiteralJsonSchemaPropertyType = typing.Union[ typing.Literal["boolean"], typing.Literal["string"], typing.Literal["integer"], typing.Literal["number"], typing.List[str], ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/livekit_stack_type.py000066400000000000000000000002421523660243400301520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LivekitStackType = typing.Union[typing.Literal["standard", "static"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm.py000066400000000000000000000055761523660243400250600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing Llm = typing.Union[ typing.Literal[ "gpt-4o-mini", "gpt-4o", "gpt-4", "gpt-4-turbo", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5.1", "gpt-5.2", "gpt-5.2-chat-latest", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5-mini", "gpt-5-nano", "gpt-3.5-turbo", "gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-3.1-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-flash-lite", "gemini-3.5-flash", "gemini-3.5-flash-lite", "gemini-3.6-flash", "claude-sonnet-4-5", "claude-opus-4-7", "claude-opus-4-8", "claude-sonnet-4-6", "claude-sonnet-5", "claude-sonnet-4", "claude-haiku-4-5", "claude-3-7-sonnet", "claude-3-5-sonnet", "claude-3-5-sonnet-v1", "claude-3-haiku", "grok-beta", "custom-llm", "qwen3-4b", "qwen3-30b-a3b", "qwen36-35b-a3b", "qwen35-397b-a17b", "gpt-oss-20b", "gpt-oss-120b", "glm-45-air-fp8", "gemini-2.5-flash-preview-09-2025", "gemini-2.5-flash-lite-preview-09-2025", "gemini-2.5-flash-preview-05-20", "gemini-2.5-flash-preview-04-17", "gemini-2.5-flash-lite-preview-06-17", "gemini-2.0-flash-lite-001", "gemini-2.0-flash-001", "gemini-1.5-flash-002", "gemini-1.5-flash-001", "gemini-1.5-pro-002", "gemini-1.5-pro-001", "claude-sonnet-4@20250514", "claude-sonnet-4-5@20250929", "claude-haiku-4-5@20251001", "claude-3-7-sonnet@20250219", "claude-3-5-sonnet@20240620", "claude-3-5-sonnet-v2@20241022", "claude-3-haiku@20240307", "gpt-5-2025-08-07", "gpt-5.1-2025-11-13", "gpt-5.2-2025-12-11", "gpt-5.4-2026-03-05", "gpt-5.4-mini-2026-03-17", "gpt-5.4-nano-2026-03-17", "gpt-5.5-2026-04-23", "gpt-5-mini-2025-08-07", "gpt-5-nano-2025-08-07", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", "gpt-4o-mini-2024-07-18", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4-0613", "gpt-4-0314", "gpt-4-turbo-2024-04-09", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-1106", "watt-tool-8b", "watt-tool-70b", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_category_usage.py000066400000000000000000000013261523660243400301260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_usage_output import LlmUsageOutput class LlmCategoryUsage(UncheckedBaseModel): irreversible_generation: typing.Optional[LlmUsageOutput] = None initiated_generation: typing.Optional[LlmUsageOutput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_deprecation_config_model.py000066400000000000000000000025401523660243400321260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LlmDeprecationConfigModel(UncheckedBaseModel): warning_start_days: int = pydantic.Field() """ Number of days before the provider deprecation date when warnings start being shown. """ fallback_start_days: int = pydantic.Field() """ Number of days before the provider deprecation date when traffic starts being routed to the replacement model. """ fallback_complete_days: int = pydantic.Field() """ Number of days before the provider deprecation date when all traffic is routed to the replacement model. """ fallback_start_percentage: int = pydantic.Field() """ Percentage of traffic routed to the replacement model when fallback begins. """ fallback_complete_percentage: int = pydantic.Field() """ Percentage of traffic routed to the replacement model when fallback is complete. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_deprecation_info_model.py000066400000000000000000000040631523660243400316160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm from .llm_deprecation_config_model import LlmDeprecationConfigModel class LlmDeprecationInfoModel(UncheckedBaseModel): llm: Llm = pydantic.Field() """ The identifier of the deprecated LLM model. """ is_deprecated: bool = pydantic.Field() """ Whether this model is currently deprecated. True if the model is immediately deprecated or within the warning period. """ is_in_warning_period: typing.Optional[bool] = pydantic.Field(default=None) """ Whether this model is currently in the warning period before deprecation. """ is_in_fallback_period: typing.Optional[bool] = pydantic.Field(default=None) """ Whether traffic is currently being progressively routed to the replacement model. """ fallback_percentage: typing.Optional[int] = pydantic.Field(default=None) """ Current percentage of traffic being routed to the replacement model (0-100). """ provider_deprecation_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The date when the model provider will deprecate this model. Null for immediately deprecated models. """ replacement_model: typing.Optional[Llm] = pydantic.Field(default=None) """ The model that replaces this deprecated model. Traffic will be automatically routed to this model. """ deprecation_config: typing.Optional[LlmDeprecationConfigModel] = pydantic.Field(default=None) """ Custom deprecation timing configuration for this model. Null if using the default configuration. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_info_model_input.py000066400000000000000000000045611523660243400304630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm from .llm_deprecation_info_model import LlmDeprecationInfoModel from .llm_reasoning_effort import LlmReasoningEffort from .regional_processing_surcharge_info import RegionalProcessingSurchargeInfo class LlmInfoModelInput(UncheckedBaseModel): llm: Llm = pydantic.Field() """ The model identifier. """ is_checkpoint: bool = pydantic.Field() """ Whether this is a pinned checkpoint version of a model rather than a top-level alias. """ max_tokens_limit: int = pydantic.Field() """ Maximum number of output tokens the model can generate. """ max_context_limit: int = pydantic.Field() """ Maximum number of input context tokens the model supports. """ supports_image_input: bool = pydantic.Field() """ Whether the model supports image file inputs during conversations. """ supports_document_input: bool = pydantic.Field() """ Whether the model supports document (PDF) file inputs during conversations. """ supports_parallel_tool_calls: bool = pydantic.Field() """ Whether the model supports calling multiple tools in parallel. """ available_reasoning_efforts: typing.Optional[typing.List[LlmReasoningEffort]] = pydantic.Field(default=None) """ Available reasoning effort levels for this model. Null if the model does not support configurable reasoning. """ deprecation_info: typing.Optional[LlmDeprecationInfoModel] = pydantic.Field(default=None) """ Deprecation information if this model is deprecated or scheduled for deprecation. Null if the model is not affected. """ regional_processing_surcharge: typing.Optional[RegionalProcessingSurchargeInfo] = pydantic.Field(default=None) """ Regional processing surcharge details if this model has additional costs in the current deployment region. Null if no surcharge applies. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_info_model_output.py000066400000000000000000000045621523660243400306650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm from .llm_deprecation_info_model import LlmDeprecationInfoModel from .llm_reasoning_effort import LlmReasoningEffort from .regional_processing_surcharge_info import RegionalProcessingSurchargeInfo class LlmInfoModelOutput(UncheckedBaseModel): llm: Llm = pydantic.Field() """ The model identifier. """ is_checkpoint: bool = pydantic.Field() """ Whether this is a pinned checkpoint version of a model rather than a top-level alias. """ max_tokens_limit: int = pydantic.Field() """ Maximum number of output tokens the model can generate. """ max_context_limit: int = pydantic.Field() """ Maximum number of input context tokens the model supports. """ supports_image_input: bool = pydantic.Field() """ Whether the model supports image file inputs during conversations. """ supports_document_input: bool = pydantic.Field() """ Whether the model supports document (PDF) file inputs during conversations. """ supports_parallel_tool_calls: bool = pydantic.Field() """ Whether the model supports calling multiple tools in parallel. """ available_reasoning_efforts: typing.Optional[typing.List[LlmReasoningEffort]] = pydantic.Field(default=None) """ Available reasoning effort levels for this model. Null if the model does not support configurable reasoning. """ deprecation_info: typing.Optional[LlmDeprecationInfoModel] = pydantic.Field(default=None) """ Deprecation information if this model is deprecated or scheduled for deprecation. Null if the model is not affected. """ regional_processing_surcharge: typing.Optional[RegionalProcessingSurchargeInfo] = pydantic.Field(default=None) """ Regional processing surcharge details if this model has additional costs in the current deployment region. Null if no surcharge applies. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_input_output_tokens_usage.py000066400000000000000000000015611523660243400324540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_tokens_category_usage import LlmTokensCategoryUsage class LlmInputOutputTokensUsage(UncheckedBaseModel): input: typing.Optional[LlmTokensCategoryUsage] = None input_cache_read: typing.Optional[LlmTokensCategoryUsage] = None input_cache_write: typing.Optional[LlmTokensCategoryUsage] = None output_total: typing.Optional[LlmTokensCategoryUsage] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_list_response_model_input.py000066400000000000000000000017561523660243400324240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_deprecation_config_model import LlmDeprecationConfigModel from .llm_info_model_input import LlmInfoModelInput class LlmListResponseModelInput(UncheckedBaseModel): llms: typing.List[LlmInfoModelInput] = pydantic.Field() """ List of all available LLM models that can be used with agents. """ default_deprecation_config: LlmDeprecationConfigModel = pydantic.Field() """ The default deprecation timing configuration used for models without a custom override. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_list_response_model_output.py000066400000000000000000000017621523660243400326220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_deprecation_config_model import LlmDeprecationConfigModel from .llm_info_model_output import LlmInfoModelOutput class LlmListResponseModelOutput(UncheckedBaseModel): llms: typing.List[LlmInfoModelOutput] = pydantic.Field() """ List of all available LLM models that can be used with agents. """ default_deprecation_config: LlmDeprecationConfigModel = pydantic.Field() """ The default deprecation timing configuration used for models without a custom override. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_literal_json_schema_property.py000066400000000000000000000015341523660243400330770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_literal_json_schema_property_type import LlmLiteralJsonSchemaPropertyType class LlmLiteralJsonSchemaProperty(UncheckedBaseModel): type: LlmLiteralJsonSchemaPropertyType description: str enum: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of allowed string values for string type parameters """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_literal_json_schema_property_type.py000066400000000000000000000004231523660243400341340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LlmLiteralJsonSchemaPropertyType = typing.Union[ typing.Literal["boolean"], typing.Literal["string"], typing.Literal["integer"], typing.Literal["number"], typing.List[str], ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_parameter_evaluation_strategy.py000066400000000000000000000012541523660243400332560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LlmParameterEvaluationStrategy(UncheckedBaseModel): description: str = pydantic.Field() """ A description of the evaluation strategy to use for the test. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_reasoning_effort.py000066400000000000000000000003201523660243400304500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LlmReasoningEffort = typing.Union[ typing.Literal["none", "minimal", "low", "medium", "high", "xhigh", "max"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_schema_override.py000066400000000000000000000013201523660243400302560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LlmSchemaOverride(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ Prompt override for the LLM. If not provided, the original schema description is used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_tokens_category_usage.py000066400000000000000000000011731523660243400315110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LlmTokensCategoryUsage(UncheckedBaseModel): tokens: typing.Optional[int] = None price: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_usage_calculator_llm_response_model.py000066400000000000000000000011641523660243400344040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm class LlmUsageCalculatorLlmResponseModel(UncheckedBaseModel): llm: Llm price_per_minute: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_usage_calculator_response_model.py000066400000000000000000000013131523660243400335340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_usage_calculator_llm_response_model import LlmUsageCalculatorLlmResponseModel class LlmUsageCalculatorResponseModel(UncheckedBaseModel): llm_prices: typing.List[LlmUsageCalculatorLlmResponseModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_usage_input.py000066400000000000000000000012731523660243400274510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_input_output_tokens_usage import LlmInputOutputTokensUsage class LlmUsageInput(UncheckedBaseModel): model_usage: typing.Optional[typing.Dict[str, LlmInputOutputTokensUsage]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/llm_usage_output.py000066400000000000000000000012741523660243400276530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm_input_output_tokens_usage import LlmInputOutputTokensUsage class LlmUsageOutput(UncheckedBaseModel): model_usage: typing.Optional[typing.Dict[str, LlmInputOutputTokensUsage]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/load_memory_entry_tool_error_status.py000066400000000000000000000002651523660243400336630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LoadMemoryEntryToolErrorStatus = typing.Union[typing.Literal["not_found", "invalid_id"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/loadable_memory_entry.py000066400000000000000000000011301523660243400306260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class LoadableMemoryEntry(UncheckedBaseModel): entry_id: str summary: str text: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/lock_reason.py000066400000000000000000000003321523660243400265540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing LockReason = typing.Union[ typing.Literal["trial_ended", "subscription_downgrade", "exposed_publicly", "self_disabled"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/manual_source.py000066400000000000000000000012361523660243400271160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ManualSource(UncheckedBaseModel): type: typing.Optional[typing.Literal["manual"]] = None created_by_user_id: str notes: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/manual_verification_file_response.py000066400000000000000000000017451523660243400332220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ManualVerificationFileResponse(UncheckedBaseModel): file_id: str = pydantic.Field() """ The ID of the file. """ file_name: str = pydantic.Field() """ The name of the file. """ mime_type: str = pydantic.Field() """ The MIME type of the file. """ size_bytes: int = pydantic.Field() """ The size of the file in bytes. """ upload_date_unix: int = pydantic.Field() """ The date of the file in Unix time. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/manual_verification_response.py000066400000000000000000000017341523660243400322210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .manual_verification_file_response import ManualVerificationFileResponse class ManualVerificationResponse(UncheckedBaseModel): extra_text: str = pydantic.Field() """ The extra text of the manual verification. """ request_time_unix: int = pydantic.Field() """ The date of the manual verification in Unix time. """ files: typing.List[ManualVerificationFileResponse] = pydantic.Field() """ The files of the manual verification. """ 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 match_anything_parameter_evaluation_strategy.py000066400000000000000000000010731523660243400354070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class MatchAnythingParameterEvaluationStrategy(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_approval_policy.py000066400000000000000000000003341523660243400303210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing McpApprovalPolicy = typing.Union[ typing.Literal["auto_approve_all", "require_approval_all", "require_approval_per_tool"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_input.py000066400000000000000000000135501523660243400311740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_approval_policy import McpApprovalPolicy from .mcp_server_config_input_auth_connection import McpServerConfigInputAuthConnection from .mcp_server_config_input_request_headers_value import McpServerConfigInputRequestHeadersValue from .mcp_server_config_input_request_meta_value import McpServerConfigInputRequestMetaValue from .mcp_server_config_input_secret_token import McpServerConfigInputSecretToken from .mcp_server_config_input_url import McpServerConfigInputUrl from .mcp_server_transport import McpServerTransport from .mcp_tool_approval_hash import McpToolApprovalHash from .mcp_tool_config_override_input import McpToolConfigOverrideInput from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class McpServerConfigInput(UncheckedBaseModel): approval_policy: typing.Optional[McpApprovalPolicy] = None tool_approval_hashes: typing.Optional[typing.List[McpToolApprovalHash]] = pydantic.Field(default=None) """ List of tool approval hashes for per-tool approval when approval_policy is REQUIRE_APPROVAL_PER_TOOL """ transport: typing.Optional[McpServerTransport] = pydantic.Field(default=None) """ The transport type used to connect to the MCP server """ url: McpServerConfigInputUrl = pydantic.Field() """ The URL of the MCP server, if this contains a secret please store as a workspace secret, otherwise store as a plain string. Must use https """ secret_token: typing.Optional[McpServerConfigInputSecretToken] = pydantic.Field(default=None) """ The secret token (Authorization header) stored as a workspace secret or in-place secret """ request_headers: typing.Optional[typing.Dict[str, McpServerConfigInputRequestHeadersValue]] = pydantic.Field( default=None ) """ The headers included in the request """ request_meta: typing.Optional[typing.Dict[str, McpServerConfigInputRequestMetaValue]] = pydantic.Field(default=None) """ Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. """ auth_connection: typing.Optional[McpServerConfigInputAuthConnection] = pydantic.Field(default=None) """ Optional auth connection to use for authentication with this MCP server """ name: str description: typing.Optional[str] = None force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, all tools from this MCP server will require pre-tool execution speech. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. Applies to every tool from this MCP server unless overridden per tool. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while any tool from this MCP server is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. Applies to every tool from this MCP server unless overridden per tool. """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution for all tools from this MCP server """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play for all tools from this MCP server """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how all tools from this MCP server execute: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for each MCP tool call to complete. Must be between 5 and 300 seconds (inclusive). """ tool_config_overrides: typing.Optional[typing.List[McpToolConfigOverrideInput]] = pydantic.Field(default=None) """ List of per-tool configuration overrides that override the server-level defaults for specific tools """ disable_compression: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to disable HTTP compression for this MCP server. Enable this if the server does not support compressed responses. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_input_auth_connection.py000066400000000000000000000005111523660243400344250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .auth_connection_locator import AuthConnectionLocator from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator McpServerConfigInputAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] mcp_server_config_input_request_headers_value.py000066400000000000000000000006011523660243400355450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigInputRequestHeadersValue = typing.Union[ str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] mcp_server_config_input_request_meta_value.py000066400000000000000000000006201523660243400350610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigInputRequestMetaValue = typing.Union[ str, int, float, bool, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_input_secret_token.py000066400000000000000000000004501523660243400337340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_secret_locator import ConvAiSecretLocator from .conv_ai_user_secret_db_model import ConvAiUserSecretDbModel McpServerConfigInputSecretToken = typing.Union[ConvAiSecretLocator, ConvAiUserSecretDbModel] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_input_url.py000066400000000000000000000003121523660243400320460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigInputUrl = typing.Union[str, ConvAiSecretLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_output.py000066400000000000000000000136111523660243400313730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_approval_policy import McpApprovalPolicy from .mcp_server_config_output_auth_connection import McpServerConfigOutputAuthConnection from .mcp_server_config_output_request_headers_value import McpServerConfigOutputRequestHeadersValue from .mcp_server_config_output_request_meta_value import McpServerConfigOutputRequestMetaValue from .mcp_server_config_output_secret_token import McpServerConfigOutputSecretToken from .mcp_server_config_output_url import McpServerConfigOutputUrl from .mcp_server_transport import McpServerTransport from .mcp_tool_approval_hash import McpToolApprovalHash from .mcp_tool_config_override_output import McpToolConfigOverrideOutput from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode class McpServerConfigOutput(UncheckedBaseModel): approval_policy: typing.Optional[McpApprovalPolicy] = None tool_approval_hashes: typing.Optional[typing.List[McpToolApprovalHash]] = pydantic.Field(default=None) """ List of tool approval hashes for per-tool approval when approval_policy is REQUIRE_APPROVAL_PER_TOOL """ transport: typing.Optional[McpServerTransport] = pydantic.Field(default=None) """ The transport type used to connect to the MCP server """ url: McpServerConfigOutputUrl = pydantic.Field() """ The URL of the MCP server, if this contains a secret please store as a workspace secret, otherwise store as a plain string. Must use https """ secret_token: typing.Optional[McpServerConfigOutputSecretToken] = pydantic.Field(default=None) """ The secret token (Authorization header) stored as a workspace secret or in-place secret """ request_headers: typing.Optional[typing.Dict[str, McpServerConfigOutputRequestHeadersValue]] = pydantic.Field( default=None ) """ The headers included in the request """ request_meta: typing.Optional[typing.Dict[str, McpServerConfigOutputRequestMetaValue]] = pydantic.Field( default=None ) """ Entries sent in the MCP `_meta` field of tools/call requests. Values may be JSON scalars, or references to a workspace secret, dynamic variable, or environment variable resolved per call. """ auth_connection: typing.Optional[McpServerConfigOutputAuthConnection] = pydantic.Field(default=None) """ Optional auth connection to use for authentication with this MCP server """ name: str description: typing.Optional[str] = None force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, all tools from this MCP server will require pre-tool execution speech. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. Applies to every tool from this MCP server unless overridden per tool. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while any tool from this MCP server is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. Applies to every tool from this MCP server unless overridden per tool. """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution for all tools from this MCP server """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play for all tools from this MCP server """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how all tools from this MCP server execute: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for each MCP tool call to complete. Must be between 5 and 300 seconds (inclusive). """ tool_config_overrides: typing.Optional[typing.List[McpToolConfigOverrideOutput]] = pydantic.Field(default=None) """ List of per-tool configuration overrides that override the server-level defaults for specific tools """ disable_compression: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to disable HTTP compression for this MCP server. Enable this if the server does not support compressed responses. """ 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 mcp_server_config_output_auth_connection.py000066400000000000000000000005121523660243400345500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .auth_connection_locator import AuthConnectionLocator from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator McpServerConfigOutputAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] mcp_server_config_output_request_headers_value.py000066400000000000000000000006021523660243400357470ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigOutputRequestHeadersValue = typing.Union[ str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] mcp_server_config_output_request_meta_value.py000066400000000000000000000006211523660243400352630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigOutputRequestMetaValue = typing.Union[ str, int, float, bool, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_output_secret_token.py000066400000000000000000000004511523660243400341360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_secret_locator import ConvAiSecretLocator from .conv_ai_user_secret_db_model import ConvAiUserSecretDbModel McpServerConfigOutputSecretToken = typing.Union[ConvAiSecretLocator, ConvAiUserSecretDbModel] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_config_output_url.py000066400000000000000000000003131523660243400322500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_secret_locator import ConvAiSecretLocator McpServerConfigOutputUrl = typing.Union[str, ConvAiSecretLocator] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_metadata_response_model.py000066400000000000000000000011651523660243400333650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class McpServerMetadataResponseModel(UncheckedBaseModel): created_at: int owner_user_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_response_model.py000066400000000000000000000026411523660243400315250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_server_config_output import McpServerConfigOutput from .mcp_server_metadata_response_model import McpServerMetadataResponseModel from .mcp_server_response_model_dependent_agents_item import McpServerResponseModelDependentAgentsItem from .resource_access_info import ResourceAccessInfo class McpServerResponseModel(UncheckedBaseModel): """ Response model representing an MCP Server configuration. """ id: str config: McpServerConfigOutput access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the MCP Server """ dependent_agents: typing.Optional[typing.List[McpServerResponseModelDependentAgentsItem]] = pydantic.Field( default=None ) """ List of agents that depend on this MCP Server. """ metadata: McpServerMetadataResponseModel = pydantic.Field() """ The metadata of the MCP Server """ 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 mcp_server_response_model_dependent_agents_item.py000066400000000000000000000033441523660243400360540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel class McpServerResponseModelDependentAgentsItem_Available(UncheckedBaseModel): type: typing.Literal["available"] = "available" referenced_resource_ids: typing.Optional[typing.List[str]] = None id: str name: str created_at_unix_secs: int access_level: DependentAvailableAgentIdentifierAccessLevel 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 McpServerResponseModelDependentAgentsItem_Unknown(UncheckedBaseModel): type: typing.Literal["unknown"] = "unknown" referenced_resource_ids: typing.Optional[typing.List[str]] = None 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 McpServerResponseModelDependentAgentsItem = typing_extensions.Annotated[ typing.Union[ McpServerResponseModelDependentAgentsItem_Available, McpServerResponseModelDependentAgentsItem_Unknown ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_server_transport.py000066400000000000000000000002501523660243400305350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing McpServerTransport = typing.Union[typing.Literal["SSE", "STREAMABLE_HTTP"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_servers_response_model.py000066400000000000000000000013531523660243400317070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_server_response_model import McpServerResponseModel class McpServersResponseModel(UncheckedBaseModel): """ Response model for a list of MCP Server configurations. """ mcp_servers: typing.List[McpServerResponseModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_tool_approval_hash.py000066400000000000000000000020131523660243400307760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_tool_approval_policy import McpToolApprovalPolicy class McpToolApprovalHash(UncheckedBaseModel): """ Model for storing tool approval hashes for per-tool approval. """ tool_name: str = pydantic.Field() """ The name of the MCP tool """ tool_hash: str = pydantic.Field() """ SHA256 hash of the tool's parameters and description """ approval_policy: typing.Optional[McpToolApprovalPolicy] = pydantic.Field(default=None) """ The approval policy for this tool """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_tool_approval_policy.py000066400000000000000000000002671523660243400313630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing McpToolApprovalPolicy = typing.Union[typing.Literal["auto_approved", "requires_approval"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_tool_config_override_input.py000066400000000000000000000067021523660243400325430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .mcp_tool_config_override_input_input_overrides_value import McpToolConfigOverrideInputInputOverridesValue from .mcp_tool_config_override_input_tool_call_sound import McpToolConfigOverrideInputToolCallSound from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .tool_response_mock_config_input import ToolResponseMockConfigInput class McpToolConfigOverrideInput(UncheckedBaseModel): tool_name: str = pydantic.Field() """ The name of the MCP tool """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ If set, overrides the server's pre_tool_speech setting for this tool. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ If set, overrides the server's interruption_mode setting for this tool. """ tool_call_sound: typing.Optional[McpToolConfigOverrideInputToolCallSound] = pydantic.Field(default=None) """ Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ If set, overrides the server's tool_call_sound_behavior setting for this tool """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ If set, overrides the server's execution_mode setting for this tool """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ If set, overrides the server's response timeout for this MCP tool (seconds). """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Dynamic variable assignments for this MCP tool """ input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideInputInputOverridesValue]] ] = pydantic.Field(default=None) """ Mapping of json path to input override configuration """ response_mocks: typing.Optional[typing.List[ToolResponseMockConfigInput]] = pydantic.Field(default=None) """ Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. """ 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 mcp_tool_config_override_input_input_overrides_value.py000066400000000000000000000050651523660243400371620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class McpToolConfigOverrideInputInputOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 McpToolConfigOverrideInputInputOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 McpToolConfigOverrideInputInputOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class McpToolConfigOverrideInputInputOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 McpToolConfigOverrideInputInputOverridesValue = typing_extensions.Annotated[ typing.Union[ McpToolConfigOverrideInputInputOverridesValue_Constant, McpToolConfigOverrideInputInputOverridesValue_DynamicVariable, McpToolConfigOverrideInputInputOverridesValue_Llm, McpToolConfigOverrideInputInputOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] mcp_tool_config_override_input_tool_call_sound.py000066400000000000000000000003461523660243400357220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .tool_call_sound_type import ToolCallSoundType McpToolConfigOverrideInputToolCallSound = typing.Union[ToolCallSoundType, typing.Literal["off"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mcp_tool_config_override_output.py000066400000000000000000000067141523660243400327470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .mcp_tool_config_override_output_input_overrides_value import McpToolConfigOverrideOutputInputOverridesValue from .mcp_tool_config_override_output_tool_call_sound import McpToolConfigOverrideOutputToolCallSound from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .tool_response_mock_config_output import ToolResponseMockConfigOutput class McpToolConfigOverrideOutput(UncheckedBaseModel): tool_name: str = pydantic.Field() """ The name of the MCP tool """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If set, overrides the server's force_pre_tool_speech setting for this tool. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ If set, overrides the server's pre_tool_speech setting for this tool. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If set, overrides the server's disable_interruptions setting for this tool. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ If set, overrides the server's interruption_mode setting for this tool. """ tool_call_sound: typing.Optional[McpToolConfigOverrideOutputToolCallSound] = pydantic.Field(default=None) """ Overrides the server's tool_call_sound setting for this tool. A sound name plays that sound; 'off' overrides to no sound (silence); null means do not override (inherit the server default). """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ If set, overrides the server's tool_call_sound_behavior setting for this tool """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ If set, overrides the server's execution_mode setting for this tool """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ If set, overrides the server's response timeout for this MCP tool (seconds). """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Dynamic variable assignments for this MCP tool """ input_overrides: typing.Optional[ typing.Dict[str, typing.Optional[McpToolConfigOverrideOutputInputOverridesValue]] ] = pydantic.Field(default=None) """ Mapping of json path to input override configuration """ response_mocks: typing.Optional[typing.List[ToolResponseMockConfigOutput]] = pydantic.Field(default=None) """ Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. """ 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 mcp_tool_config_override_output_input_overrides_value.py000066400000000000000000000050761523660243400373650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class McpToolConfigOverrideOutputInputOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 McpToolConfigOverrideOutputInputOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class McpToolConfigOverrideOutputInputOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 McpToolConfigOverrideOutputInputOverridesValue = typing_extensions.Annotated[ typing.Union[ McpToolConfigOverrideOutputInputOverridesValue_Constant, McpToolConfigOverrideOutputInputOverridesValue_DynamicVariable, McpToolConfigOverrideOutputInputOverridesValue_Llm, McpToolConfigOverrideOutputInputOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] mcp_tool_config_override_output_tool_call_sound.py000066400000000000000000000003471523660243400361240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .tool_call_sound_type import ToolCallSoundType McpToolConfigOverrideOutputToolCallSound = typing.Union[ToolCallSoundType, typing.Literal["off"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/media_codec.py000066400000000000000000000002551523660243400264750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MediaCodec = typing.Union[typing.Literal["G722/8000", "PCMU/8000", "PCMA/8000"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/media_id.py000066400000000000000000000001171523660243400260110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. MediaId = str elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/memory_entry_search_result.py000066400000000000000000000014541523660243400317370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .memory_entry_search_result_source import MemoryEntrySearchResultSource class MemoryEntrySearchResult(UncheckedBaseModel): entry_id: str version: int summary: typing.Optional[str] = None text: typing.Optional[str] = None source: typing.Optional[MemoryEntrySearchResultSource] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/memory_entry_search_result_source.py000066400000000000000000000003741523660243400333170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .conversation_source import ConversationSource from .manual_source import ManualSource MemoryEntrySearchResultSource = typing.Union[ConversationSource, ManualSource] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/merge_preview_response_model.py000066400000000000000000000073241523660243400322230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata_response_model import AgentMetadataResponseModel from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel from .agent_workflow_response_model import AgentWorkflowResponseModel from .conversational_config import ConversationalConfig from .field_conflict import FieldConflict from .get_whats_app_account_response import GetWhatsAppAccountResponse from .merge_preview_response_model_phone_numbers_item import MergePreviewResponseModelPhoneNumbersItem from .resource_access_info import ResourceAccessInfo class MergePreviewResponseModel(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ name: str = pydantic.Field() """ The name of the agent """ conversation_config: ConversationalConfig = pydantic.Field() """ The conversation configuration of the agent """ metadata: AgentMetadataResponseModel = pydantic.Field() """ The metadata of the agent """ platform_settings: typing.Optional[AgentPlatformSettingsResponseModel] = pydantic.Field(default=None) """ The platform settings of the agent """ phone_numbers: typing.Optional[typing.List[MergePreviewResponseModelPhoneNumbersItem]] = pydantic.Field( default=None ) """ The phone numbers of the agent """ whatsapp_accounts: typing.Optional[typing.List[GetWhatsAppAccountResponse]] = pydantic.Field(default=None) """ WhatsApp accounts assigned to the agent """ workflow: typing.Optional[AgentWorkflowResponseModel] = pydantic.Field(default=None) """ The workflow of the agent """ access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the agent for the user """ tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Agent tags used to categorize the agent """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the version the agent is on """ branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the branch the agent is on """ main_branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the main branch for this agent """ overridden_fields: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Dot-paths of config fields where both branches modified the same field relative to their common ancestor (conflicts). Present regardless of which side wins the conflict. """ conflicts: typing.Optional[typing.List[FieldConflict]] = pydantic.Field(default=None) """ Structured view of the same conflicts as overridden_fields, each carrying the value on the base (common ancestor), source branch, and target branch so the divergence can be presented and resolved field-by-field. """ source_identical_to_target: typing.Optional[bool] = pydantic.Field(default=None) """ True when the merge/rebase would be a no-op, i.e. the merged result is identical to the source branch tip. The rebase endpoint rejects in this case. """ 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 update_forward_refs(MergePreviewResponseModel) merge_preview_response_model_phone_numbers_item.py000066400000000000000000000063271523660243400361100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .get_phone_number_inbound_sip_trunk_config_response_model import GetPhoneNumberInboundSipTrunkConfigResponseModel from .get_phone_number_outbound_sip_trunk_config_response_model import GetPhoneNumberOutboundSipTrunkConfigResponseModel from .livekit_stack_type import LivekitStackType from .phone_number_agent_info import PhoneNumberAgentInfo class MergePreviewResponseModelPhoneNumbersItem_Exotel(UncheckedBaseModel): provider: typing.Literal["exotel"] = "exotel" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 class MergePreviewResponseModelPhoneNumbersItem_SipTrunk(UncheckedBaseModel): provider: typing.Literal["sip_trunk"] = "sip_trunk" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None provider_config: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None outbound_trunk: typing.Optional[GetPhoneNumberOutboundSipTrunkConfigResponseModel] = None inbound_trunk: typing.Optional[GetPhoneNumberInboundSipTrunkConfigResponseModel] = None livekit_stack: LivekitStackType store_sip_messages: typing.Optional[bool] = 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 class MergePreviewResponseModelPhoneNumbersItem_Twilio(UncheckedBaseModel): provider: typing.Literal["twilio"] = "twilio" phone_number: str label: str supports_inbound: typing.Optional[bool] = None supports_outbound: typing.Optional[bool] = None phone_number_id: str assigned_agent: typing.Optional[PhoneNumberAgentInfo] = 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 MergePreviewResponseModelPhoneNumbersItem = typing_extensions.Annotated[ typing.Union[ MergePreviewResponseModelPhoneNumbersItem_Exotel, MergePreviewResponseModelPhoneNumbersItem_SipTrunk, MergePreviewResponseModelPhoneNumbersItem_Twilio, ], UnionMetadata(discriminant="provider"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/message_search_sort_by.py000066400000000000000000000002551523660243400307730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MessageSearchSortBy = typing.Union[typing.Literal["search_score", "created_at"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/messages_search_response.py000066400000000000000000000017271523660243400313400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .list_response_meta import ListResponseMeta from .messages_search_result import MessagesSearchResult class MessagesSearchResponse(UncheckedBaseModel): meta: typing.Optional[ListResponseMeta] = None results: typing.List[MessagesSearchResult] next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor for the next page of results """ has_more: bool = pydantic.Field() """ Whether there are more results available """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/messages_search_result.py000066400000000000000000000024241523660243400310130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .search_highlight_segment import SearchHighlightSegment class MessagesSearchResult(UncheckedBaseModel): """ transcript_index: index of the message in the conversation transcript chunk_text: text of the transcript; transcript messages if very long could have several chunks. chunk_highlights: chunk_text split into matched/unmatched segments for highlighting. Only populated for keyword/text search, not semantic search. score: similarity score of the message to the search query """ conversation_id: str agent_id: str agent_name: typing.Optional[str] = None transcript_index: int chunk_text: str chunk_highlights: typing.Optional[typing.List[SearchHighlightSegment]] = None score: float conversation_start_time_unix_secs: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/metric_record.py000066400000000000000000000010701523660243400270760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class MetricRecord(UncheckedBaseModel): elapsed_time: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/metric_type.py000066400000000000000000000005601523660243400266040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MetricType = typing.Union[ typing.Literal[ "credits", "tts_characters", "minutes_used", "request_count", "ttfb_avg", "ttfb_p95", "fiat_units_spent", "concurrency", "concurrency_average", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mock_no_match_behavior.py000066400000000000000000000002601523660243400307350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MockNoMatchBehavior = typing.Union[typing.Literal["call_real_tool", "raise_error"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mocking_strategy.py000066400000000000000000000002461523660243400276320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MockingStrategy = typing.Union[typing.Literal["all", "selected", "none"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/model.py000066400000000000000000000057301523660243400253640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .language_response import LanguageResponse from .model_rates_response_model import ModelRatesResponseModel class Model(UncheckedBaseModel): model_id: str = pydantic.Field() """ The unique identifier of the model. """ name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the model. """ can_be_finetuned: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model can be finetuned. """ can_do_text_to_speech: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model can do text-to-speech. """ can_do_voice_conversion: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model can do voice conversion. """ can_use_style: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model can use style. """ can_use_speaker_boost: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model can use speaker boost. """ serves_pro_voices: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model serves pro voices. """ token_cost_factor: typing.Optional[float] = pydantic.Field(default=None) """ The cost factor for the model. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the model. """ requires_alpha_access: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the model requires alpha access. """ max_characters_request_free_user: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of characters that can be requested by a free user. """ max_characters_request_subscribed_user: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of characters that can be requested by a subscribed user. """ maximum_text_length_per_request: typing.Optional[int] = pydantic.Field(default=None) """ The maximum length of text that can be requested for this model. """ languages: typing.Optional[typing.List[LanguageResponse]] = pydantic.Field(default=None) """ The languages supported by the model. """ model_rates: typing.Optional[ModelRatesResponseModel] = pydantic.Field(default=None) """ The rates for the model. """ concurrency_group: typing.Optional[str] = pydantic.Field(default=None) """ The concurrency group for the model. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/model_rates_response_model.py000066400000000000000000000015221523660243400316530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ModelRatesResponseModel(UncheckedBaseModel): character_cost_multiplier: float = pydantic.Field() """ The cost multiplier for characters. """ cost_discount_multiplier: typing.Optional[float] = pydantic.Field(default=None) """ Discount multiplier applied to cost estimates. Defaults to 1.0 (no discount). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/model_settings_response_model.py000066400000000000000000000015311523660243400323750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ModelSettingsResponseModel(UncheckedBaseModel): stability: typing.Optional[float] = pydantic.Field(default=None) """ Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/moderation_config.py000066400000000000000000000024011523660243400277420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .threshold_guardrail import ThresholdGuardrail class ModerationConfig(UncheckedBaseModel): sexual: typing.Optional[ThresholdGuardrail] = None violence: typing.Optional[ThresholdGuardrail] = None violence_graphic: typing.Optional[ThresholdGuardrail] = None harassment: typing.Optional[ThresholdGuardrail] = None harassment_threatening: typing.Optional[ThresholdGuardrail] = None hate: typing.Optional[ThresholdGuardrail] = None hate_threatening: typing.Optional[ThresholdGuardrail] = None self_harm_instructions: typing.Optional[ThresholdGuardrail] = None self_harm: typing.Optional[ThresholdGuardrail] = None self_harm_intent: typing.Optional[ThresholdGuardrail] = None sexual_minors: typing.Optional[ThresholdGuardrail] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/moderation_guardrail_input.py000066400000000000000000000014211523660243400316670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .guardrail_execution_mode import GuardrailExecutionMode from .moderation_config import ModerationConfig class ModerationGuardrailInput(UncheckedBaseModel): execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ModerationConfig] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/moderation_guardrail_output.py000066400000000000000000000014221523660243400320710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .guardrail_execution_mode import GuardrailExecutionMode from .moderation_config import ModerationConfig class ModerationGuardrailOutput(UncheckedBaseModel): execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ModerationConfig] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/mtls_auth_response.py000066400000000000000000000017501523660243400302000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class MtlsAuthResponse(UncheckedBaseModel): """ Response model for mTLS auth connections. """ name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 multichannel_speech_to_text_response_model.py000066400000000000000000000023761523660243400350660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speech_to_text_chunk_response_model import SpeechToTextChunkResponseModel class MultichannelSpeechToTextResponseModel(UncheckedBaseModel): """ Response model for multichannel speech-to-text transcription. """ transcripts: typing.List[SpeechToTextChunkResponseModel] = pydantic.Field() """ List of transcripts, one for each audio channel. Each transcript contains the text and word-level details for its respective channel. """ transcription_id: typing.Optional[str] = pydantic.Field(default=None) """ The transcription ID of the response. """ audio_duration_secs: typing.Optional[float] = pydantic.Field(default=None) """ The duration of the audio that was transcribed across all channels 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/multipart_music_response.py000066400000000000000000000016211523660243400314160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .detailed_music_response import DetailedMusicResponse class MultipartMusicResponse(UncheckedBaseModel): """ Multipart response structure with JSON metadata and binary audio """ metadata: DetailedMusicResponse = pydantic.Field() """ JSON metadata about the generated audio """ audio: bytes = pydantic.Field() """ Binary audio data in the requested format """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_allowed_output_formats.py000066400000000000000000000004371523660243400322650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .allowed_output_formats import AllowedOutputFormats from .music_only_output_formats import MusicOnlyOutputFormats MusicAllowedOutputFormats = typing.Union[AllowedOutputFormats, MusicOnlyOutputFormats] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_explore_song_source_context.py000066400000000000000000000014311523660243400333060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class MusicExploreSongSourceContext(UncheckedBaseModel): music_explore_song_id: str title: typing.Optional[str] = None description: typing.Optional[str] = None bpm: typing.Optional[int] = None vocals: typing.Optional[str] = None lyrics: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_finetune_failure_reason.py000066400000000000000000000003411523660243400323500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MusicFinetuneFailureReason = typing.Union[ typing.Literal["audio_processing_failed", "copyright_violation", "training_failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_finetune_page_response_model.py000066400000000000000000000020301523660243400333610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .music_finetune_response_model import MusicFinetuneResponseModel class MusicFinetunePageResponseModel(UncheckedBaseModel): finetunes: typing.List[MusicFinetuneResponseModel] = pydantic.Field() """ The finetunes in this page. """ next_cursor: typing.Optional[str] = pydantic.Field(default=None) """ Cursor to pass as `cursor` to fetch the next page; `null` when there are no more results. """ has_more: bool = pydantic.Field() """ Whether more finetunes are available beyond this page. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_finetune_response_model.py000066400000000000000000000042371523660243400324000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .finetune_created_by import FinetuneCreatedBy from .finetune_visibility import FinetuneVisibility from .music_finetune_failure_reason import MusicFinetuneFailureReason from .music_finetune_status import MusicFinetuneStatus class MusicFinetuneResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ Unique identifier of the finetune. """ name: str = pydantic.Field() """ Name of the finetune. """ tags: typing.List[str] = pydantic.Field() """ Tags associated with the finetune. """ primary_genre: typing.Optional[str] = pydantic.Field(default=None) """ Primary musical genre of the finetune. """ model_id: str = pydantic.Field() """ The base music model the finetune was trained on. """ created_at: dt.datetime = pydantic.Field() """ When the finetune was created (UTC). """ visibility: FinetuneVisibility = pydantic.Field() """ Who can access this finetune: `private` (only you), `workspace` (members of your workspace), `public` (ElevenLabs-curated, available to everyone). """ created_by: FinetuneCreatedBy = pydantic.Field() """ Who created the finetune: `self`, `workspace`, or `elevenlabs`. """ status: MusicFinetuneStatus = pydantic.Field() """ Training lifecycle status: pending, in_progress, completed, failed, and blocked. """ training_progress: float = pydantic.Field() """ Training progress from 0.0 to 1.0. """ failure_reason: typing.Optional[MusicFinetuneFailureReason] = pydantic.Field(default=None) """ Reason the finetune failed or was blocked, if applicable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_finetune_status.py000066400000000000000000000003211523660243400306730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MusicFinetuneStatus = typing.Union[ typing.Literal["pending", "in_progress", "completed", "failed", "blocked"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_generation_mode.py000066400000000000000000000002761523660243400306230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MusicGenerationMode = typing.Union[typing.Literal["track", "loop", "ambience", "video_to_music"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_only_output_formats.py000066400000000000000000000003341523660243400316130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing MusicOnlyOutputFormats = typing.Union[ typing.Literal["mp3_48000_128", "mp3_48000_192", "mp3_48000_240", "mp3_48000_320"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_output_format.py000066400000000000000000000003511523660243400303660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .music_allowed_output_formats import MusicAllowedOutputFormats MusicOutputFormat = typing.Union[MusicAllowedOutputFormats, typing.Literal["auto"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_prompt.py000066400000000000000000000023001523660243400267730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .song_section import SongSection class MusicPrompt(UncheckedBaseModel): """ Composition plan for the `music_v1` model. Using this field with any other model will result in an error. """ positive_global_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should be present in the entire song. Use English language for best result. """ negative_global_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should not be present in the entire song. Use English language for best result. """ sections: typing.List[SongSection] = pydantic.Field() """ The sections of the song. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_upload_response.py000066400000000000000000000024701523660243400306640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .music_upload_response_composition_plan import MusicUploadResponseCompositionPlan from .word_timestamp import WordTimestamp class MusicUploadResponse(UncheckedBaseModel): """ Response model for music upload endpoint. """ song_id: str = pydantic.Field() """ Unique identifier for the uploaded song """ composition_plan: typing.Optional[MusicUploadResponseCompositionPlan] = pydantic.Field(default=None) """ The composition plan extracted from the uploaded song. Only present if `extract_composition_plan` was provided in the request body. """ words_timestamps: typing.Optional[typing.List[WordTimestamp]] = pydantic.Field(default=None) """ Word-level timestamps transcribed from the uploaded song. Only present if `with_timestamps` was True in the request body """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/music_upload_response_composition_plan.py000066400000000000000000000003651523660243400343220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .composition_plan import CompositionPlan from .music_prompt import MusicPrompt MusicUploadResponseCompositionPlan = typing.Union[MusicPrompt, CompositionPlan] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/non_streaming_output_formats.py000066400000000000000000000003651523660243400323010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing NonStreamingOutputFormats = typing.Union[ typing.Literal["wav_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/normalized_alignment.py000066400000000000000000000042241523660243400304630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class NormalizedAlignment(UncheckedBaseModel): """ Alignment information for the generated audio given the input normalized text sequence. """ char_start_times_ms: typing_extensions.Annotated[ typing.Optional[typing.List[int]], FieldMetadata(alias="charStartTimesMs"), pydantic.Field( alias="charStartTimesMs", description="A list of starting times (in milliseconds) for each character in the normalized text as it\ncorresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio.\nNote these times are relative to the returned chunk from the model, and not the\nfull audio response.", ), ] = None char_durations_ms: typing_extensions.Annotated[ typing.Optional[typing.List[int]], FieldMetadata(alias="charDurationsMs"), pydantic.Field( alias="charDurationsMs", description="A list of durations (in milliseconds) for each character in the normalized text as it\ncorresponds to the audio. For instance, the character 'H' lasts for 3 ms in the audio.\nNote these times are relative to the returned chunk from the model, and not the\nfull audio response.", ), ] = None chars: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of characters in the normalized text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. The length of this list should be the same as the lengths of `charStartTimesMs` and `charDurationsMs`. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/numeric_distribution_aggregate.py000066400000000000000000000013141523660243400325250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class NumericDistributionAggregate(UncheckedBaseModel): count: typing.Optional[int] = None sum: typing.Optional[float] = None min: typing.Optional[float] = None max: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/o_auth_2_client_creds_response.py000066400000000000000000000027561523660243400324250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class OAuth2ClientCredsResponse(UncheckedBaseModel): """ Response model for oauth2 client creds """ name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = pydantic.Field(default=None) """ If True, send client credentials in Authorization header as Basic Auth instead of request body """ id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Custom headers configured for OAuth2 token requests """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/o_auth_2_jwt_response.py000066400000000000000000000046011523660243400305620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus from .o_auth_2_jwt_response_algorithm import OAuth2JwtResponseAlgorithm from .o_auth_2_jwt_response_token_response_field import OAuth2JwtResponseTokenResponseField class OAuth2JwtResponse(UncheckedBaseModel): """ Response model for OAuth2 JWT auth connections """ name: str provider: str algorithm: typing.Optional[OAuth2JwtResponseAlgorithm] = pydantic.Field(default=None) """ JWT signing algorithm """ key_id: typing.Optional[str] = pydantic.Field(default=None) """ Key ID (kid) for JWT header - useful for key rotation """ issuer: str = pydantic.Field() """ JWT issuer (iss claim) """ audience: str = pydantic.Field() """ JWT audience (aud claim) """ subject: str = pydantic.Field() """ JWT subject (sub claim) """ expiration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ Token expiration time in seconds """ extra_params: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Additional custom claims to include in the JWT """ token_url: str = pydantic.Field() """ Token endpoint URL for exchanging JWT for access token """ scopes: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ OAuth2 scopes to request when exchanging JWT for access token """ token_response_field: typing.Optional[OAuth2JwtResponseTokenResponseField] = pydantic.Field(default=None) """ Token field to extract from the token endpoint response. """ id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/o_auth_2_jwt_response_algorithm.py000066400000000000000000000003221523660243400326240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing OAuth2JwtResponseAlgorithm = typing.Union[ typing.Literal["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"], typing.Any ] o_auth_2_jwt_response_token_response_field.py000066400000000000000000000002731523660243400347650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing OAuth2JwtResponseTokenResponseField = typing.Union[typing.Literal["access_token", "id_token"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/object_json_schema_property_input.py000066400000000000000000000051131523660243400332610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .object_json_schema_property_input_property_kind import ObjectJsonSchemaPropertyInputPropertyKind from .required_constraints import RequiredConstraints class ObjectJsonSchemaPropertyInput(UncheckedBaseModel): property_kind: typing.Optional[ObjectJsonSchemaPropertyInputPropertyKind] = None description: typing.Optional[str] = None dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the entire parameter is populated from this dynamic variable at runtime. Mutually exclusive with description (LLM-provided value), constant_value, and is_omitted. """ constant_value: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ When set, the entire object uses this constant JSON value at runtime. Mutually exclusive with description (LLM-provided object), dynamic_variable, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, and constant_value. """ type: typing.Optional[typing.Literal["object"]] = None required: typing.Optional[typing.List[str]] = None properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyInputPropertiesValue"]] = None required_constraints: typing.Optional[RequiredConstraints] = 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 from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( ObjectJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) object_json_schema_property_input_properties_value.py000066400000000000000000000010201523660243400366430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .literal_json_schema_property import LiteralJsonSchemaProperty if typing.TYPE_CHECKING: from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput ObjectJsonSchemaPropertyInputPropertiesValue = typing.Union[ LiteralJsonSchemaProperty, "ObjectJsonSchemaPropertyInput", "ArrayJsonSchemaPropertyInput" ] object_json_schema_property_input_property_kind.py000066400000000000000000000002701523660243400361520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ObjectJsonSchemaPropertyInputPropertyKind = typing.Union[typing.Literal["array", "object"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/object_json_schema_property_output.py000066400000000000000000000046361523660243400334730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .required_constraints import RequiredConstraints class ObjectJsonSchemaPropertyOutput(UncheckedBaseModel): description: typing.Optional[str] = None dynamic_variable: typing.Optional[str] = pydantic.Field(default=None) """ When set, the entire parameter is populated from this dynamic variable at runtime. Mutually exclusive with description (LLM-provided value), constant_value, and is_omitted. """ constant_value: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ When set, the entire object uses this constant JSON value at runtime. Mutually exclusive with description (LLM-provided object), dynamic_variable, and is_omitted. """ is_omitted: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this parameter will be completely omitted from the request. Only valid for optional parameters. Mutually exclusive with description, dynamic_variable, and constant_value. """ type: typing.Optional[typing.Literal["object"]] = None required: typing.Optional[typing.List[str]] = None properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyOutputPropertiesValue"]] = None required_constraints: typing.Optional[RequiredConstraints] = 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 from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( ObjectJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) object_json_schema_property_output_properties_value.py000066400000000000000000000010271523660243400370530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .literal_json_schema_property import LiteralJsonSchemaProperty if typing.TYPE_CHECKING: from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput ObjectJsonSchemaPropertyOutputPropertiesValue = typing.Union[ LiteralJsonSchemaProperty, "ObjectJsonSchemaPropertyOutput", "ArrayJsonSchemaPropertyOutput" ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/omit_schema_override.py000066400000000000000000000010451523660243400304460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class OmitSchemaOverride(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/open_ai_audio_format.py000066400000000000000000000001571523660243400304250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing OpenAiAudioFormat = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/opener_config.py000066400000000000000000000013621523660243400270760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .llm import Llm class OpenerConfig(UncheckedBaseModel): llm: Llm = pydantic.Field() """ Model used to speak a fast opener while the main model generates its full reply. Must be a hosted model (not a bring-your-own LLM type). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/opt_in_sms_reminder_params.py000066400000000000000000000011731523660243400316630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class OptInSmsReminderParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["opt_in_sms_reminder"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/opt_out_sms_reminder_params.py000066400000000000000000000011751523660243400320660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class OptOutSmsReminderParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["opt_out_sms_reminder"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/orb_avatar.py000066400000000000000000000014051523660243400263770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class OrbAvatar(UncheckedBaseModel): color_1: typing.Optional[str] = pydantic.Field(default=None) """ The first color of the avatar """ color_2: typing.Optional[str] = pydantic.Field(default=None) """ The second color of the avatar """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/orchestrator_tool_mock_behavior_config.py000066400000000000000000000024711523660243400342540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mock_no_match_behavior import MockNoMatchBehavior from .mocking_strategy import MockingStrategy class OrchestratorToolMockBehaviorConfig(UncheckedBaseModel): """ Orchestrator-side config: tools are identified by resolved names. """ mocking_strategy: typing.Optional[MockingStrategy] = pydantic.Field(default=None) """ Which tools to mock: 'all' mocks every mockable tool, 'selected' mocks only those in mocked_tool_names/mocked_tool_ids, 'none' disables mocking. """ fallback_strategy: typing.Optional[MockNoMatchBehavior] = pydantic.Field(default=None) """ Behavior when no mock matches a tool call. """ mocked_tool_names: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Tool names to mock. Only used when mocking_strategy is 'selected'. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_deliverables_response.py000066400000000000000000000014051523660243400320310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .deliverable_info import DeliverableInfo class OrderDeliverablesResponse(UncheckedBaseModel): deliverables: typing.List[DeliverableInfo] = pydantic.Field() """ The list of delivered files for the order. Empty if the order is not yet completed. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_id.py000066400000000000000000000001171523660243400260450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. OrderId = str elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_item_info.py000066400000000000000000000017251523660243400274300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .item_id import ItemId from .order_item_request_output import OrderItemRequestOutput from .quote_info import QuoteInfo class OrderItemInfo(UncheckedBaseModel): item_id: ItemId = pydantic.Field() """ The ID of the order item. """ item: OrderItemRequestOutput = pydantic.Field() """ The item configuration details. """ quote: typing.Optional[QuoteInfo] = pydantic.Field(default=None) """ The quoted price for this item. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_item_kind.py000066400000000000000000000002561523660243400274200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing OrderItemKind = typing.Union[typing.Literal["dub", "subtitles", "transcription"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_item_request_input.py000066400000000000000000000046031523660243400314020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .cue_options_request import CueOptionsRequest from .media_id import MediaId class OrderItemRequestInput_Dub(UncheckedBaseModel): kind: typing.Literal["dub"] = "dub" media_id: MediaId source_language: str destination_languages: typing.List[str] include_captions: bool include_source_captions: bool instructions: typing.Optional[str] = None captions_sdh: typing.Optional[bool] = 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 class OrderItemRequestInput_Subtitles(UncheckedBaseModel): kind: typing.Literal["subtitles"] = "subtitles" media_ids: typing.List[MediaId] source_language: str destination_languages: typing.List[str] cue_options: typing.Optional[CueOptionsRequest] = None sdh: typing.Optional[bool] = None instructions: 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 class OrderItemRequestInput_Transcription(UncheckedBaseModel): kind: typing.Literal["transcription"] = "transcription" media_ids: typing.List[MediaId] source_language: str verbatim: typing.Optional[bool] = None instructions: 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 OrderItemRequestInput = typing_extensions.Annotated[ typing.Union[OrderItemRequestInput_Dub, OrderItemRequestInput_Subtitles, OrderItemRequestInput_Transcription], UnionMetadata(discriminant="kind"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_item_request_output.py000066400000000000000000000046121523660243400316030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .cue_options_request import CueOptionsRequest from .media_id import MediaId class OrderItemRequestOutput_Dub(UncheckedBaseModel): kind: typing.Literal["dub"] = "dub" media_id: MediaId source_language: str destination_languages: typing.List[str] include_captions: bool include_source_captions: bool instructions: typing.Optional[str] = None captions_sdh: typing.Optional[bool] = 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 class OrderItemRequestOutput_Subtitles(UncheckedBaseModel): kind: typing.Literal["subtitles"] = "subtitles" media_ids: typing.List[MediaId] source_language: str destination_languages: typing.List[str] cue_options: typing.Optional[CueOptionsRequest] = None sdh: typing.Optional[bool] = None instructions: 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 class OrderItemRequestOutput_Transcription(UncheckedBaseModel): kind: typing.Literal["transcription"] = "transcription" media_ids: typing.List[MediaId] source_language: str verbatim: typing.Optional[bool] = None instructions: 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 OrderItemRequestOutput = typing_extensions.Annotated[ typing.Union[OrderItemRequestOutput_Dub, OrderItemRequestOutput_Subtitles, OrderItemRequestOutput_Transcription], UnionMetadata(discriminant="kind"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_media_response.py000066400000000000000000000021601523660243400304460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_id import MediaId class OrderMediaResponse(UncheckedBaseModel): media_id: MediaId = pydantic.Field() """ The ID of the media file. """ name: str = pydantic.Field() """ The original filename of the uploaded media. """ content_type: str = pydantic.Field() """ The MIME type of the media file (e.g. 'video/mp4'). """ language: typing.Optional[str] = pydantic.Field(default=None) """ The detected or declared language of the media, if available. """ signed_url: str = pydantic.Field() """ A time-limited URL to download the media file. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_response.py000066400000000000000000000044111523660243400273100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .order_id import OrderId from .order_item_info import OrderItemInfo from .order_state import OrderState class OrderResponse(UncheckedBaseModel): order_id: OrderId = pydantic.Field() """ The ID of the order. """ name: str = pydantic.Field() """ The display name of the order. """ state: OrderState = pydantic.Field() """ The current state of the order. """ items: typing.List[OrderItemInfo] = pydantic.Field() """ The list of items in this order with their quotes. """ total_amount_usd: typing.Optional[float] = pydantic.Field(default=None) """ The total price for all items in USD. Excluded from response until quotes are available. """ sandbox: typing.Optional[bool] = pydantic.Field(default=None) """ Whether this is a sandbox order that auto-progresses without producer intervention. """ created_at: dt.datetime = pydantic.Field() """ The timestamp when the order was created. """ submitted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when the order was submitted, if applicable. """ paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when payment was received, if applicable. """ accepted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when the order was accepted for production, if applicable. """ completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when the order was completed, if applicable. """ cancel_reason: typing.Optional[str] = pydantic.Field(default=None) """ The reason the order was cancelled, if applicable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_state.py000066400000000000000000000003641523660243400265750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing OrderState = typing.Union[ typing.Literal["open", "submitted", "paid", "accepted", "rejected", "done", "cancelling", "cancelled", "expired"], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/order_summary.py000066400000000000000000000032571523660243400271560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .order_id import OrderId from .order_state import OrderState class OrderSummary(UncheckedBaseModel): order_id: OrderId = pydantic.Field() """ The ID of the order. """ name: str = pydantic.Field() """ The display name of the order. """ state: OrderState = pydantic.Field() """ The current state of the order. """ total_amount_usd: typing.Optional[float] = pydantic.Field(default=None) """ The total price for all items in USD. Excluded from response until quotes are available. """ sandbox: typing.Optional[bool] = pydantic.Field(default=None) """ Whether this is a sandbox order that auto-progresses without producer intervention. """ submitted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when the order was submitted, if applicable. """ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The timestamp when the order was last modified, if applicable. """ cancel_reason: typing.Optional[str] = pydantic.Field(default=None) """ The reason the order was cancelled, if applicable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/outbound_call_recipient.py000066400000000000000000000016071523660243400311570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput class OutboundCallRecipient(UncheckedBaseModel): id: typing.Optional[str] = None phone_number: typing.Optional[str] = None whatsapp_user_id: typing.Optional[str] = None conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/outbound_call_recipient_response_model.py000066400000000000000000000020711523660243400342510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .batch_call_recipient_status import BatchCallRecipientStatus from .conversation_initiation_client_data_internal import ConversationInitiationClientDataInternal class OutboundCallRecipientResponseModel(UncheckedBaseModel): id: str phone_number: typing.Optional[str] = None whatsapp_user_id: typing.Optional[str] = None status: BatchCallRecipientStatus created_at_unix: int updated_at_unix: int conversation_id: typing.Optional[str] = None conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataInternal] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/outbound_sip_trunk_config_request_model.py000066400000000000000000000040231523660243400344700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_codec import MediaCodec from .sip_media_encryption_enum import SipMediaEncryptionEnum from .sip_trunk_credentials_request_model import SipTrunkCredentialsRequestModel from .sip_trunk_transport_enum import SipTrunkTransportEnum class OutboundSipTrunkConfigRequestModel(UncheckedBaseModel): address: str = pydantic.Field() """ Hostname or IP the SIP INVITE is sent to. """ transport: typing.Optional[SipTrunkTransportEnum] = pydantic.Field(default=None) """ Protocol to use for SIP transport (signalling layer). """ media_encryption: typing.Optional[SipMediaEncryptionEnum] = pydantic.Field(default=None) """ Whether or not to encrypt media (data layer). """ headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ SIP X-* headers for INVITE request. These headers are sent as-is and may help identify this call. """ attributes_to_headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Map of dynamic variable name to header name for attributes_to_headers """ credentials: typing.Optional[SipTrunkCredentialsRequestModel] = pydantic.Field(default=None) """ Optional digest authentication credentials (username/password). If not provided, ACL authentication is assumed. """ enabled_codecs: typing.Optional[typing.List[MediaCodec]] = pydantic.Field(default=None) """ Media codecs that should be offered in the SDP for outbound calls. If empty, all supported codecs are offered. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/output_format.py000066400000000000000000000006251523660243400271720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing OutputFormat = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "ulaw_8000", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/paired_languages_response.py000066400000000000000000000013641523660243400314730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .language_pair_info import LanguagePairInfo class PairedLanguagesResponse(UncheckedBaseModel): language_pairs: typing.List[LanguagePairInfo] = pydantic.Field() """ The list of available source-to-destination language mappings. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/partial_transcript_payload.py000066400000000000000000000015451523660243400317020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PartialTranscriptPayload(UncheckedBaseModel): """ Payload for partial transcription results that may change. """ message_type: typing.Literal["partial_transcript"] = pydantic.Field(default="partial_transcript") """ The message type identifier. """ text: str = pydantic.Field() """ Partial transcription text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/patch_workspace_webhook_response_model.py000066400000000000000000000014251523660243400342520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PatchWorkspaceWebhookResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace webhook patch 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pdf_export_options.py000066400000000000000000000014751523660243400302130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PdfExportOptions(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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pending_blocks_metadata_model.py000066400000000000000000000012071523660243400322600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PendingBlocksMetadataModel(UncheckedBaseModel): target_global_offset_ms: typing.Optional[int] = None block_ids: typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pending_cancellation_response_model.py000066400000000000000000000013321523660243400335140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PendingCancellationResponseModel(UncheckedBaseModel): kind: typing.Optional[typing.Literal["cancellation"]] = None timestamp_seconds: int = pydantic.Field() """ The timestamp of the cancellation. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pending_clip_task.py000066400000000000000000000015061523660243400277360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pending_clip_task_type import PendingClipTaskType class PendingClipTask(UncheckedBaseModel): type: PendingClipTaskType progress: typing.Optional[float] = None started_at_ms: typing.Optional[int] = None updated_at_ms: typing.Optional[int] = None metadata: typing.Optional[typing.Dict[str, typing.Any]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pending_clip_task_type.py000066400000000000000000000003501523660243400307730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PendingClipTaskType = typing.Union[ typing.Literal["preprocessing", "speech_import", "dubbing", "video_to_music", "media_generation"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pending_external_audios_metadata_model.py000066400000000000000000000012301523660243400341650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PendingExternalAudiosMetadataModel(UncheckedBaseModel): target_global_offset_ms: typing.Optional[int] = None external_audio_ids: typing.List[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 pending_subscription_switch_response_model.py000066400000000000000000000021341523660243400351070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .billing_period import BillingPeriod from .pending_subscription_switch_response_model_next_tier import PendingSubscriptionSwitchResponseModelNextTier class PendingSubscriptionSwitchResponseModel(UncheckedBaseModel): kind: typing.Optional[typing.Literal["change"]] = None next_tier: PendingSubscriptionSwitchResponseModelNextTier = pydantic.Field() """ The tier to change to. """ next_billing_period: BillingPeriod = pydantic.Field() """ The billing period to change to. """ timestamp_seconds: int = pydantic.Field() """ The timestamp of the change. """ 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 pending_subscription_switch_response_model_next_tier.py000066400000000000000000000006461523660243400371760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing PendingSubscriptionSwitchResponseModelNextTier = typing.Union[ typing.Literal[ "free", "starter", "creator", "pro", "growing_business", "scale_2024_08_10", "grant_tier_1_2025_07_23", "grant_tier_2_2025_07_23", "trial", "enterprise", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/permission_type.py000066400000000000000000000031351523660243400275120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PermissionType = typing.Union[ typing.Literal[ "text_to_speech", "speech_to_speech", "speech_to_text", "models_read", "models_write", "voices_read", "voices_write", "speech_history_read", "speech_history_write", "sound_generation", "audio_isolation", "voice_generation", "dubbing_read", "dubbing_write", "pronunciation_dictionaries_read", "pronunciation_dictionaries_write", "user_read", "user_write", "projects_read", "projects_write", "audio_native_read", "audio_native_write", "workspace_read", "workspace_write", "forced_alignment", "convai_read", "convai_write", "music_generation", "image_video_generation", "flows", "templates", "add_voice_from_voice_library", "create_instant_voice_clone", "create_professional_voice_clone", "publish_voice_to_voice_library", "share_voice_externally", "create_user_api_key", "workspace_analytics_full_read", "webhooks_write", "service_account_write", "group_members_manage", "workspace_members_read", "workspace_members_invite", "workspace_members_remove", "terms_of_service_accept", "audit_log_read", "conversation_privacy_manage", "copy_resources_cross_workspace", "synthid_detector", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/phone_number_agent_info.py000066400000000000000000000017671523660243400311440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PhoneNumberAgentInfo(UncheckedBaseModel): agent_id: str = pydantic.Field() """ The ID of the agent """ agent_name: str = pydantic.Field() """ The name of the agent """ environment: typing.Optional[str] = pydantic.Field(default=None) """ Environment to use for resolving environment variables on calls to this number. """ branch_id: typing.Optional[str] = pydantic.Field(default=None) """ Agent branch to use for calls to this number. """ 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 phone_number_dynamic_variable_transfer_destination.py000066400000000000000000000011271523660243400365400ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PhoneNumberDynamicVariableTransferDestination(UncheckedBaseModel): phone_number: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/phone_number_transfer.py000066400000000000000000000037131523660243400306500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .phone_number_transfer_custom_sip_headers_item import PhoneNumberTransferCustomSipHeadersItem from .phone_number_transfer_post_dial_digits import PhoneNumberTransferPostDialDigits from .phone_number_transfer_transfer_destination import PhoneNumberTransferTransferDestination from .transfer_type_enum import TransferTypeEnum from .uui_transfer_config import UuiTransferConfig class PhoneNumberTransfer(UncheckedBaseModel): custom_sip_headers: typing.Optional[typing.List[PhoneNumberTransferCustomSipHeadersItem]] = pydantic.Field( default=None ) """ Custom SIP headers to include when transferring the call. Each header can be either a static value or a dynamic variable reference. """ transfer_destination: PhoneNumberTransferTransferDestination transfer_type: typing.Optional[TransferTypeEnum] = None uui: typing.Optional[UuiTransferConfig] = pydantic.Field(default=None) """ User-to-User Information (RFC 7433) to attach to SIP REFER transfers. Carries call context such as CRM identifiers or escalation reason across the transfer boundary. """ post_dial_digits: typing.Optional[PhoneNumberTransferPostDialDigits] = pydantic.Field(default=None) """ DTMF digits to send after call connects (e.g., 'ww1234' for extension). Can be either a static value or a dynamic variable reference. Use 'w' for 0.5s pause. Only supported for Twilio transfers. """ phone_number: typing.Optional[str] = None 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 phone_number_transfer_custom_sip_headers_item.py000066400000000000000000000025751523660243400355540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class PhoneNumberTransferCustomSipHeadersItem_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" key: str value: 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 PhoneNumberTransferCustomSipHeadersItem_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" key: str value: 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 PhoneNumberTransferCustomSipHeadersItem = typing_extensions.Annotated[ typing.Union[PhoneNumberTransferCustomSipHeadersItem_Dynamic, PhoneNumberTransferCustomSipHeadersItem_Static], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/phone_number_transfer_destination.py000066400000000000000000000011101523660243400332360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PhoneNumberTransferDestination(UncheckedBaseModel): phone_number: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/phone_number_transfer_post_dial_digits.py000066400000000000000000000025051523660243400342470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class PhoneNumberTransferPostDialDigits_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" value: 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 PhoneNumberTransferPostDialDigits_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" value: 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 PhoneNumberTransferPostDialDigits = typing_extensions.Annotated[ typing.Union[PhoneNumberTransferPostDialDigits_Dynamic, PhoneNumberTransferPostDialDigits_Static], UnionMetadata(discriminant="type"), ] phone_number_transfer_transfer_destination.py000066400000000000000000000047111523660243400350750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class PhoneNumberTransferTransferDestination_Phone(UncheckedBaseModel): type: typing.Literal["phone"] = "phone" phone_number: 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 PhoneNumberTransferTransferDestination_PhoneDynamicVariable(UncheckedBaseModel): type: typing.Literal["phone_dynamic_variable"] = "phone_dynamic_variable" phone_number: 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 PhoneNumberTransferTransferDestination_SipUri(UncheckedBaseModel): type: typing.Literal["sip_uri"] = "sip_uri" sip_uri: 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 PhoneNumberTransferTransferDestination_SipUriDynamicVariable(UncheckedBaseModel): type: typing.Literal["sip_uri_dynamic_variable"] = "sip_uri_dynamic_variable" sip_uri: 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 PhoneNumberTransferTransferDestination = typing_extensions.Annotated[ typing.Union[ PhoneNumberTransferTransferDestination_Phone, PhoneNumberTransferTransferDestination_PhoneDynamicVariable, PhoneNumberTransferTransferDestination_SipUri, PhoneNumberTransferTransferDestination_SipUriDynamicVariable, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/ping_payload.py000066400000000000000000000013301523660243400267220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PingPayload(UncheckedBaseModel): """ Keep-alive ping sent periodically by ElevenLabs. """ type: typing.Literal["ping"] = pydantic.Field(default="ping") """ The message type identifier. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/platform_category.py000066400000000000000000000003341523660243400300000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PlatformCategory = typing.Union[ typing.Literal["voice", "silence", "burst", "asr", "text_message", "reception", "other"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/platform_category_usage.py000066400000000000000000000013671523660243400311730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PlatformCategoryUsage(UncheckedBaseModel): """ Accumulated charge for a single :class:`PlatformCategory`. """ credits: typing.Optional[int] = None price: typing.Optional[float] = None quantity: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/platform_usage.py000066400000000000000000000014241523660243400272700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .platform_category_usage import PlatformCategoryUsage class PlatformUsage(UncheckedBaseModel): """ Per-category breakdown of ``platform_charge`` (the analogue of ``llm_usage``). """ category_usage: typing.Optional[typing.Dict[str, PlatformCategoryUsage]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/play_dtmf_result_error_model.py000066400000000000000000000012401523660243400322220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PlayDtmfResultErrorModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/play_dtmf_result_success_model.py000066400000000000000000000012501523660243400325420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PlayDtmfResultSuccessModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None dtmf_tones: str 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/play_dtmf_tool_config.py000066400000000000000000000023511523660243400306210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PlayDtmfToolConfig(UncheckedBaseModel): """ Allows the agent to play DTMF tones during a phone call. This tool can be used to interact with automated phone systems, such as navigating phone menus, entering extensions, or inputting numeric codes. """ use_out_of_band_dtmf: typing.Optional[bool] = pydantic.Field(default=None) """ Send DTMF tones as out-of-band RTP events (RFC 4733) instead of in-band audio. Only effective for SIP trunk imported numbers. """ suppress_turn_after_dtmf: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the agent will not generate further speech after playing DTMF tones. This prevents the agent's speech from interfering with IVR systems. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_bulletin_mode.py000066400000000000000000000013311523660243400306140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .podcast_bulletin_mode_data import PodcastBulletinModeData class PodcastBulletinMode(UncheckedBaseModel): bulletin: PodcastBulletinModeData = pydantic.Field() """ The voice settings for the bulletin. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_bulletin_mode_data.py000066400000000000000000000012031523660243400316030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PodcastBulletinModeData(UncheckedBaseModel): host_voice_id: str = pydantic.Field() """ The ID of the host voice. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_conversation_mode.py000066400000000000000000000013611523660243400315130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .podcast_conversation_mode_data import PodcastConversationModeData class PodcastConversationMode(UncheckedBaseModel): conversation: PodcastConversationModeData = pydantic.Field() """ The voice settings for the conversation. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_conversation_mode_data.py000066400000000000000000000013421523660243400325030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PodcastConversationModeData(UncheckedBaseModel): host_voice_id: str = pydantic.Field() """ The ID of the host voice. """ guest_voice_id: str = pydantic.Field() """ The ID of the guest voice. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_project_response_model.py000066400000000000000000000013221523660243400325360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_response import ProjectResponse class PodcastProjectResponseModel(UncheckedBaseModel): project: ProjectResponse = pydantic.Field() """ The project associated with the created podcast. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_text_source.py000066400000000000000000000013641523660243400303440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PodcastTextSource(UncheckedBaseModel): type: typing.Literal["text"] = pydantic.Field(default="text") """ The type of source to create. """ text: str = pydantic.Field() """ The text to create the podcast from. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/podcast_url_source.py000066400000000000000000000013571523660243400301640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PodcastUrlSource(UncheckedBaseModel): type: typing.Literal["url"] = pydantic.Field(default="url") """ The type of source to create. """ url: str = pydantic.Field() """ The URL to create the podcast from. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pong_payload.py000066400000000000000000000013021523660243400267270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PongPayload(UncheckedBaseModel): """ Reply to a `ping` message. """ type: typing.Literal["pong"] = pydantic.Field(default="pong") """ The message type identifier. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/position_input.py000066400000000000000000000011531523660243400273420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PositionInput(UncheckedBaseModel): x: typing.Optional[float] = None y: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/position_output.py000066400000000000000000000010741523660243400275450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PositionOutput(UncheckedBaseModel): x: float y: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/post_agent_avatar_response_model.py000066400000000000000000000011561523660243400330610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PostAgentAvatarResponseModel(UncheckedBaseModel): agent_id: str avatar_url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/post_dial_digits_dynamic_variable.py000066400000000000000000000012141523660243400331470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PostDialDigitsDynamicVariable(UncheckedBaseModel): value: str = pydantic.Field() """ The dynamic variable name to resolve """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/post_dial_digits_static.py000066400000000000000000000012451523660243400311510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PostDialDigitsStatic(UncheckedBaseModel): value: str = pydantic.Field() """ DTMF digits to send after call connects (e.g., 'ww1234' for extension) """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/post_workspace_secret_response_model.py000066400000000000000000000012031523660243400337610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PostWorkspaceSecretResponseModel(UncheckedBaseModel): type: typing.Literal["stored"] = "stored" secret_id: str name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pre_tool_speech_mode.py000066400000000000000000000002451523660243400304360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PreToolSpeechMode = typing.Union[typing.Literal["auto", "force", "off"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/preview_audio_db_model.py000066400000000000000000000015261523660243400307520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PreviewAudioDbModel(UncheckedBaseModel): voice_id: typing.Optional[str] = None text: typing.Optional[str] = None audio_url: str hls_manifest_url: typing.Optional[str] = None dash_manifest_url: typing.Optional[str] = None is_auto_generated: typing.Optional[bool] = None generated_at_unix: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/price.py000066400000000000000000000012121523660243400253550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .currency import Currency class Price(UncheckedBaseModel): """ Currency/amount pair. """ amount: str currency: Currency 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/privacy_config_input.py000066400000000000000000000033121523660243400304770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_redaction_config import ConversationHistoryRedactionConfig class PrivacyConfigInput(UncheckedBaseModel): record_voice: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to record the conversation """ retention_days: typing.Optional[int] = pydantic.Field(default=None) """ The number of days to retain the conversation. -1 indicates there is no retention limit """ delete_transcript_and_pii: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to delete the transcript and PII """ delete_audio: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to delete the audio """ apply_to_existing_conversations: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to apply the privacy settings to existing conversations """ zero_retention_mode: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable zero retention mode - no PII data is stored """ conversation_history_redaction: typing.Optional[ConversationHistoryRedactionConfig] = pydantic.Field(default=None) """ Config for PII redaction in the conversation history """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/privacy_config_output.py000066400000000000000000000033131523660243400307010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_redaction_config import ConversationHistoryRedactionConfig class PrivacyConfigOutput(UncheckedBaseModel): record_voice: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to record the conversation """ retention_days: typing.Optional[int] = pydantic.Field(default=None) """ The number of days to retain the conversation. -1 indicates there is no retention limit """ delete_transcript_and_pii: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to delete the transcript and PII """ delete_audio: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to delete the audio """ apply_to_existing_conversations: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to apply the privacy settings to existing conversations """ zero_retention_mode: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable zero retention mode - no PII data is stored """ conversation_history_redaction: typing.Optional[ConversationHistoryRedactionConfig] = pydantic.Field(default=None) """ Config for PII redaction in the conversation history """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/private_key_jwt_response.py000066400000000000000000000035531523660243400314110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus from .private_key_jwt_response_algorithm import PrivateKeyJwtResponseAlgorithm class PrivateKeyJwtResponse(UncheckedBaseModel): """ Response model for Private Key JWT auth connections """ name: str provider: str algorithm: typing.Optional[PrivateKeyJwtResponseAlgorithm] = pydantic.Field(default=None) """ JWT signing algorithm """ key_id: typing.Optional[str] = pydantic.Field(default=None) """ Key ID (kid) for JWT header - useful for key rotation """ issuer: str = pydantic.Field() """ JWT issuer (iss claim) """ audience: str = pydantic.Field() """ JWT audience (aud claim) """ subject: str = pydantic.Field() """ JWT subject (sub claim) """ expiration_seconds: typing.Optional[int] = pydantic.Field(default=None) """ Token expiration time in seconds """ extra_params: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Additional custom claims to include in the JWT """ id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/private_key_jwt_response_algorithm.py000066400000000000000000000003261523660243400334520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PrivateKeyJwtResponseAlgorithm = typing.Union[ typing.Literal["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_at_version_input.py000066400000000000000000000041351523660243400317220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrail_config import CustomGuardrailConfig from .procedure_type import ProcedureType class ProcedureAtVersionInput(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ name: str = pydantic.Field() """ Procedure name """ type: typing.Optional[ProcedureType] = None trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ referenced_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Tool IDs referenced in the procedure content """ referenced_kb_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Knowledge base IDs referenced in the procedure content """ referenced_procedure_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Procedure IDs referenced in the procedure content """ referenced_dynamic_variables: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Dynamic variable names used in the procedure content """ content: str = pydantic.Field() """ Procedure content """ guardrails: typing.Optional[typing.List[CustomGuardrailConfig]] = None agent_id: str = pydantic.Field() """ Agent ID of the procedure """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Version ID of a version of the procedure. None for a procedure never versioned. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_at_version_output.py000066400000000000000000000041361523660243400321240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_guardrail_config import CustomGuardrailConfig from .procedure_type import ProcedureType class ProcedureAtVersionOutput(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ name: str = pydantic.Field() """ Procedure name """ type: typing.Optional[ProcedureType] = None trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ referenced_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Tool IDs referenced in the procedure content """ referenced_kb_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Knowledge base IDs referenced in the procedure content """ referenced_procedure_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Procedure IDs referenced in the procedure content """ referenced_dynamic_variables: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Dynamic variable names used in the procedure content """ content: str = pydantic.Field() """ Procedure content """ guardrails: typing.Optional[typing.List[CustomGuardrailConfig]] = None agent_id: str = pydantic.Field() """ Agent ID of the procedure """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Version ID of a version of the procedure. None for a procedure never versioned. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_at_version_response_model.py000066400000000000000000000024641523660243400336040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_type import ProcedureType class ProcedureAtVersionResponseModel(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Version ID of a version of the procedure. None for a procedure never versioned. """ name: str = pydantic.Field() """ Procedure name """ content: str = pydantic.Field() """ Procedure content """ type: typing.Optional[ProcedureType] = pydantic.Field(default=None) """ Procedure type """ trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_draft_response_model.py000066400000000000000000000022071523660243400325260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_type import ProcedureType class ProcedureDraftResponseModel(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ name: str = pydantic.Field() """ Procedure name """ content: str = pydantic.Field() """ Procedure content """ type: typing.Optional[ProcedureType] = pydantic.Field(default=None) """ Procedure type """ trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_list_item_response_model.py000066400000000000000000000027721523660243400334260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_type import ProcedureType class ProcedureListItemResponseModel(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Version ID of a version of the procedure. None for a procedure never versioned. """ name: typing.Optional[str] = pydantic.Field(default=None) """ Procedure name """ type: typing.Optional[ProcedureType] = pydantic.Field(default=None) """ Procedure type """ trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ has_draft: bool = pydantic.Field() """ True when the procedure has unpublished draft changes on this branch (a newly created or edited procedure not yet published). When true, the name, type, and trigger reflect that draft. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_ref_response_model.py000066400000000000000000000036231523660243400322050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_type import ProcedureType class ProcedureRefResponseModel(UncheckedBaseModel): procedure_id: str = pydantic.Field() """ Procedure ID """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ Version ID of a version of the procedure. None for a procedure never versioned. """ name: typing.Optional[str] = pydantic.Field(default=None) """ Procedure name """ type: typing.Optional[ProcedureType] = pydantic.Field(default=None) """ Procedure type """ trigger: typing.Optional[str] = pydantic.Field(default=None) """ When the agent should use this procedure. Empty string means this is a sub-procedure that should only start when another procedure references it. """ referenced_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Tool IDs referenced in the procedure content """ referenced_kb_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Knowledge base IDs referenced in the procedure content """ referenced_procedure_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Procedure IDs referenced in the procedure content """ referenced_dynamic_variables: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Dynamic variable names used in the procedure content """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_type.py000066400000000000000000000002471523660243400273130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProcedureType = typing.Union[typing.Literal["free_form", "deterministic"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/procedure_validation_error.py000066400000000000000000000013661523660243400317000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ProcedureValidationError(UncheckedBaseModel): path: str = pydantic.Field() """ JSON path to the error, e.g. 'trigger', 'steps[0].instruction' """ message: str = pydantic.Field() """ Human-readable error message """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_creation_meta_response_model.py000066400000000000000000000020671523660243400337220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_creation_meta_response_model_status import ProjectCreationMetaResponseModelStatus from .project_creation_meta_type import ProjectCreationMetaType class ProjectCreationMetaResponseModel(UncheckedBaseModel): creation_progress: float = pydantic.Field() """ The progress of the project creation. """ status: ProjectCreationMetaResponseModelStatus = pydantic.Field() """ The status of the project creation action. """ type: ProjectCreationMetaType = pydantic.Field() """ The type of the project creation action. """ 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 project_creation_meta_response_model_status.py000066400000000000000000000003361523660243400352430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ProjectCreationMetaResponseModelStatus = typing.Union[ typing.Literal["draft", "pending", "creating", "finished", "failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_creation_meta_type.py000066400000000000000000000003521523660243400316600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectCreationMetaType = typing.Union[ typing.Literal["blank", "generate_podcast", "auto_assign_voices", "dub_video", "import_speech"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response.py000066400000000000000000000202631523660243400315260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_model import CaptionStyleModel from .chapter_response import ChapterResponse from .direct_publishing_read_response_model import DirectPublishingReadResponseModel from .project_creation_meta_response_model import ProjectCreationMetaResponseModel from .project_extended_response_access_level import ProjectExtendedResponseAccessLevel from .project_extended_response_apply_text_normalization import ProjectExtendedResponseApplyTextNormalization from .project_extended_response_aspect_ratio import ProjectExtendedResponseAspectRatio from .project_extended_response_assets_item import ProjectExtendedResponseAssetsItem from .project_extended_response_fiction import ProjectExtendedResponseFiction from .project_extended_response_source_type import ProjectExtendedResponseSourceType from .project_extended_response_target_audience import ProjectExtendedResponseTargetAudience from .project_state import ProjectState from .project_voice_response_model import ProjectVoiceResponseModel from .pronunciation_dictionary_locator_response_model import PronunciationDictionaryLocatorResponseModel from .pronunciation_dictionary_version_response_model import PronunciationDictionaryVersionResponseModel from .quality_preset_type import QualityPresetType from .studio_agent_settings_model import StudioAgentSettingsModel from .voice import Voice class ProjectExtendedResponse(UncheckedBaseModel): project_id: str = pydantic.Field() """ The ID of the project. """ name: str = pydantic.Field() """ The name of the project. """ create_date_unix: int = pydantic.Field() """ The creation date of the project. """ created_by_user_id: typing.Optional[str] = pydantic.Field(default=None) """ The user ID who created the project. """ default_title_voice_ref_id: str = pydantic.Field() """ The default title project voice reference ID. """ default_paragraph_voice_ref_id: str = pydantic.Field() """ The default paragraph project voice reference ID. """ default_model_id: str = pydantic.Field() """ The default model ID. """ last_conversion_date_unix: typing.Optional[int] = pydantic.Field(default=None) """ The last conversion date of the project. """ can_be_downloaded: bool = pydantic.Field() """ Whether the project can be downloaded. """ title: typing.Optional[str] = pydantic.Field(default=None) """ The title of the project. """ author: typing.Optional[str] = pydantic.Field(default=None) """ The author of the project. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the project. """ genres: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of genres of the project. """ cover_image_url: typing.Optional[str] = pydantic.Field(default=None) """ The cover image URL of the project. """ target_audience: typing.Optional[ProjectExtendedResponseTargetAudience] = pydantic.Field(default=None) """ The target audience of the project. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Two-letter language code (ISO 639-1) of the language of the project. """ content_type: typing.Optional[str] = pydantic.Field(default=None) """ The content type of the project, e.g. 'Novel' or 'Short Story' """ original_publication_date: typing.Optional[str] = pydantic.Field(default=None) """ The original publication date of the project. """ mature_content: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the project contains mature content. """ isbn_number: typing.Optional[str] = pydantic.Field(default=None) """ The ISBN number of the project. """ volume_normalization: bool = pydantic.Field() """ Whether the project uses volume normalization. """ state: ProjectState = pydantic.Field() """ The state of the project. """ access_level: ProjectExtendedResponseAccessLevel = pydantic.Field() """ The access level of the project. """ fiction: typing.Optional[ProjectExtendedResponseFiction] = pydantic.Field(default=None) """ Whether the project is fiction. """ quality_check_on: bool = pydantic.Field() """ Whether quality check is enabled for this project. """ quality_check_on_when_bulk_convert: bool = pydantic.Field() """ Whether quality check is enabled on the project when bulk converting. """ creation_meta: typing.Optional[ProjectCreationMetaResponseModel] = pydantic.Field(default=None) """ The creation meta of the project. """ source_type: typing.Optional[ProjectExtendedResponseSourceType] = pydantic.Field(default=None) """ The source type of the project. """ chapters_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether chapters are enabled for the project. """ captions_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether captions are enabled for the project. """ caption_style: typing.Optional[CaptionStyleModel] = pydantic.Field(default=None) """ Global styling to be applied to all captions """ caption_style_template_overrides: typing.Optional[typing.Dict[str, typing.Optional[CaptionStyleModel]]] = ( pydantic.Field(default=None) ) """ Styling changes that have been made to the provided templates """ public_share_id: typing.Optional[str] = pydantic.Field(default=None) """ The public share ID of the project. """ aspect_ratio: typing.Optional[ProjectExtendedResponseAspectRatio] = pydantic.Field(default=None) """ The aspect ratio of the project. """ agent_settings: typing.Optional[StudioAgentSettingsModel] = pydantic.Field(default=None) """ Agent-related settings for the project """ quality_preset: QualityPresetType = pydantic.Field() """ The quality preset level of the project. """ chapters: typing.List[ChapterResponse] = pydantic.Field() """ List of chapters of the project and their metadata. """ pronunciation_dictionary_versions: typing.List[PronunciationDictionaryVersionResponseModel] = pydantic.Field() """ List of pronunciation dictionary versions of the project and their metadata. """ pronunciation_dictionary_locators: typing.List[PronunciationDictionaryLocatorResponseModel] = pydantic.Field() """ List of pronunciation dictionary locators. """ apply_text_normalization: ProjectExtendedResponseApplyTextNormalization = pydantic.Field() """ Whether text normalization is applied to the project. """ experimental: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Experimental features for the project. """ assets: typing.List[ProjectExtendedResponseAssetsItem] = pydantic.Field() """ List of uploaded assets e.g. videos, audios. """ voices: typing.List[ProjectVoiceResponseModel] = pydantic.Field() """ List of configured project voices. """ base_voices: typing.Optional[typing.List[Voice]] = pydantic.Field(default=None) """ List of voices used by the project. """ publishing_read: typing.Optional[DirectPublishingReadResponseModel] = pydantic.Field(default=None) """ The ElevenReader data if the book was published. """ default_title_voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The default title voice ID. """ default_paragraph_voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The default paragraph voice ID. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response_access_level.py000066400000000000000000000003101523660243400342250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseAccessLevel = typing.Union[typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any] project_extended_response_apply_text_normalization.py000066400000000000000000000003251523660243400366630ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseApplyTextNormalization = typing.Union[ typing.Literal["auto", "on", "off", "apply_english"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response_aspect_ratio.py000066400000000000000000000002741523660243400342630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseAspectRatio = typing.Union[typing.Literal["16:9", "9:16", "4:5", "1:1"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response_assets_item.py000066400000000000000000000145421523660243400341310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .asset_transcription import AssetTranscription from .audio_analysis import AudioAnalysis from .canvas_placement import CanvasPlacement from .clip_animation import ClipAnimation from .generation_source_context import GenerationSourceContext from .image_analysis import ImageAnalysis from .pending_blocks_metadata_model import PendingBlocksMetadataModel from .pending_clip_task import PendingClipTask from .pending_external_audios_metadata_model import PendingExternalAudiosMetadataModel from .project_external_audio_response_model_source_context import ProjectExternalAudioResponseModelSourceContext from .project_video_thumbnail_sheet_response_model import ProjectVideoThumbnailSheetResponseModel from .video_analysis import VideoAnalysis class ProjectExtendedResponseAssetsItem_Video(UncheckedBaseModel): type: typing.Literal["video"] = "video" video_id: str filename: str signed_url: typing.Optional[str] = None signed_preview_url: typing.Optional[str] = None offset_ms: int duration_ms: int volume_gain_db: float muted: bool fade_in_ms: typing.Optional[int] = None fade_out_ms: typing.Optional[int] = None width: int height: int codec: str order: str created_at_ms: int updated_at_ms: int error: typing.Optional[str] = None thumbnail_interval_seconds: float thumbnail_size: typing.List[int] thumbnail_sheets: typing.List[ProjectVideoThumbnailSheetResponseModel] start_time_ms: int end_time_ms: typing.Optional[int] = None asset_preview_signed_url: typing.Optional[str] = None source_video_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None pending_blocks_metadata: typing.Optional[PendingBlocksMetadataModel] = None pending_external_audios_metadata: typing.Optional[PendingExternalAudiosMetadataModel] = None speech_imported: typing.Optional[bool] = None pending_task: typing.Optional[PendingClipTask] = None audio_track_ready: typing.Optional[bool] = None export_format_ready: typing.Optional[bool] = None current_snapshot_id: typing.Optional[str] = None source_context: typing.Optional[GenerationSourceContext] = None analysis: typing.Optional[VideoAnalysis] = None transcription: typing.Optional[AssetTranscription] = None canvas_placement: typing.Optional[CanvasPlacement] = None animation: typing.Optional[ClipAnimation] = None playback_speed: typing.Optional[float] = None opacity: typing.Optional[float] = None track_id: typing.Optional[str] = None preview_job_progress: typing.Optional[float] = None import_speech_progress: typing.Optional[float] = 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 class ProjectExtendedResponseAssetsItem_Audio(UncheckedBaseModel): type: typing.Literal["audio"] = "audio" external_audio_id: str filename: str signed_url: typing.Optional[str] = None offset_ms: int duration_ms: int start_time_ms: int end_time_ms: typing.Optional[int] = None order: str track_id: str created_at_ms: int updated_at_ms: int volume_gain_db: typing.Optional[float] = None muted: typing.Optional[bool] = None fade_in_ms: typing.Optional[int] = None fade_out_ms: typing.Optional[int] = None source_external_audio_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None pending_blocks_metadata: typing.Optional[PendingBlocksMetadataModel] = None pending_external_audios_metadata: typing.Optional[PendingExternalAudiosMetadataModel] = None speech_imported: typing.Optional[bool] = None pending_task: typing.Optional[PendingClipTask] = None error: typing.Optional[str] = None current_snapshot_id: typing.Optional[str] = None source_context: typing.Optional[ProjectExternalAudioResponseModelSourceContext] = None analysis: typing.Optional[AudioAnalysis] = None transcription: typing.Optional[AssetTranscription] = None import_speech_progress: typing.Optional[float] = 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 class ProjectExtendedResponseAssetsItem_Image(UncheckedBaseModel): type: typing.Literal["image"] = "image" image_id: str filename: str signed_url: typing.Optional[str] = None thumbnail_signed_url: typing.Optional[str] = None source: typing.Optional[typing.Literal["upload"]] = None file_size_bytes: int width: int height: int track_id: typing.Optional[str] = None offset_ms: int duration_ms: int order: str canvas_placement: CanvasPlacement animation: typing.Optional[ClipAnimation] = None opacity: typing.Optional[float] = None created_at_ms: int updated_at_ms: int current_snapshot_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None error: typing.Optional[str] = None pending_task: typing.Optional[PendingClipTask] = None analysis: typing.Optional[ImageAnalysis] = 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 ProjectExtendedResponseAssetsItem = typing_extensions.Annotated[ typing.Union[ ProjectExtendedResponseAssetsItem_Video, ProjectExtendedResponseAssetsItem_Audio, ProjectExtendedResponseAssetsItem_Image, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response_fiction.py000066400000000000000000000002641523660243400332400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseFiction = typing.Union[typing.Literal["fiction", "non-fiction"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_extended_response_source_type.py000066400000000000000000000003371523660243400341470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseSourceType = typing.Union[ typing.Literal["blank", "book", "article", "genfm", "video", "screenplay"], typing.Any ] project_extended_response_target_audience.py000066400000000000000000000003271523660243400346510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ProjectExtendedResponseTargetAudience = typing.Union[ typing.Literal["children", "young adult", "adult", "all ages"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_external_audio_response_model.py000066400000000000000000000042741523660243400341150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .asset_transcription import AssetTranscription from .audio_analysis import AudioAnalysis from .pending_blocks_metadata_model import PendingBlocksMetadataModel from .pending_clip_task import PendingClipTask from .pending_external_audios_metadata_model import PendingExternalAudiosMetadataModel from .project_external_audio_response_model_source_context import ProjectExternalAudioResponseModelSourceContext class ProjectExternalAudioResponseModel(UncheckedBaseModel): external_audio_id: str filename: str signed_url: typing.Optional[str] = None offset_ms: int duration_ms: int start_time_ms: int end_time_ms: typing.Optional[int] = None order: str track_id: str created_at_ms: int updated_at_ms: int volume_gain_db: typing.Optional[float] = None muted: typing.Optional[bool] = None fade_in_ms: typing.Optional[int] = None fade_out_ms: typing.Optional[int] = None source_external_audio_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None pending_blocks_metadata: typing.Optional[PendingBlocksMetadataModel] = None pending_external_audios_metadata: typing.Optional[PendingExternalAudiosMetadataModel] = None speech_imported: typing.Optional[bool] = None pending_task: typing.Optional[PendingClipTask] = None error: typing.Optional[str] = None current_snapshot_id: typing.Optional[str] = None source_context: typing.Optional[ProjectExternalAudioResponseModelSourceContext] = None analysis: typing.Optional[AudioAnalysis] = None transcription: typing.Optional[AssetTranscription] = None import_speech_progress: typing.Optional[float] = 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 project_external_audio_response_model_source_context.py000066400000000000000000000053151523660243400371570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class ProjectExternalAudioResponseModelSourceContext_MusicExploreSong(UncheckedBaseModel): source_type: typing.Literal["music_explore_song"] = "music_explore_song" music_explore_song_id: str title: typing.Optional[str] = None description: typing.Optional[str] = None bpm: typing.Optional[int] = None vocals: typing.Optional[str] = None lyrics: 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 class ProjectExternalAudioResponseModelSourceContext_Sfx(UncheckedBaseModel): source_type: typing.Literal["sfx"] = "sfx" sound_generation_history_item_id: typing.Optional[str] = None text: typing.Optional[str] = None generation_config: typing.Optional[typing.Dict[str, typing.Any]] = 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 class ProjectExternalAudioResponseModelSourceContext_Song(UncheckedBaseModel): source_type: typing.Literal["song"] = "song" song_id: str chat_id: typing.Optional[str] = None title: typing.Optional[str] = None description: typing.Optional[str] = None genres: typing.Optional[typing.List[str]] = None languages: typing.Optional[typing.List[str]] = None is_explicit: typing.Optional[bool] = None bpm: typing.Optional[int] = None generation_settings: typing.Optional[typing.Dict[str, typing.Any]] = 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 ProjectExternalAudioResponseModelSourceContext = typing_extensions.Annotated[ typing.Union[ ProjectExternalAudioResponseModelSourceContext_MusicExploreSong, ProjectExternalAudioResponseModelSourceContext_Sfx, ProjectExternalAudioResponseModelSourceContext_Song, ], UnionMetadata(discriminant="source_type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_image_response_model.py000066400000000000000000000030431523660243400321650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .canvas_placement import CanvasPlacement from .clip_animation import ClipAnimation from .image_analysis import ImageAnalysis from .pending_clip_task import PendingClipTask class ProjectImageResponseModel(UncheckedBaseModel): image_id: str filename: str signed_url: typing.Optional[str] = None thumbnail_signed_url: typing.Optional[str] = None source: typing.Optional[typing.Literal["upload"]] = None file_size_bytes: int width: int height: int track_id: typing.Optional[str] = None offset_ms: int duration_ms: int order: str canvas_placement: CanvasPlacement animation: typing.Optional[ClipAnimation] = None opacity: typing.Optional[float] = None created_at_ms: int updated_at_ms: int current_snapshot_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None error: typing.Optional[str] = None pending_task: typing.Optional[PendingClipTask] = None analysis: typing.Optional[ImageAnalysis] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_muted_tracks_response_model.py000066400000000000000000000012501523660243400335660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ProjectMutedTracksResponseModel(UncheckedBaseModel): chapter_ids: typing.List[str] = pydantic.Field() """ List of chapter IDs that have muted tracks. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response.py000066400000000000000000000135631523660243400276530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .caption_style_model import CaptionStyleModel from .project_creation_meta_response_model import ProjectCreationMetaResponseModel from .project_response_access_level import ProjectResponseAccessLevel from .project_response_aspect_ratio import ProjectResponseAspectRatio from .project_response_fiction import ProjectResponseFiction from .project_response_source_type import ProjectResponseSourceType from .project_response_target_audience import ProjectResponseTargetAudience from .project_state import ProjectState from .studio_agent_settings_model import StudioAgentSettingsModel class ProjectResponse(UncheckedBaseModel): project_id: str = pydantic.Field() """ The ID of the project. """ name: str = pydantic.Field() """ The name of the project. """ create_date_unix: int = pydantic.Field() """ The creation date of the project. """ created_by_user_id: typing.Optional[str] = pydantic.Field(default=None) """ The user ID who created the project. """ default_title_voice_ref_id: str = pydantic.Field() """ The default title project voice reference ID. """ default_paragraph_voice_ref_id: str = pydantic.Field() """ The default paragraph project voice reference ID. """ default_model_id: str = pydantic.Field() """ The default model ID. """ last_conversion_date_unix: typing.Optional[int] = pydantic.Field(default=None) """ The last conversion date of the project. """ can_be_downloaded: bool = pydantic.Field() """ Whether the project can be downloaded. """ title: typing.Optional[str] = pydantic.Field(default=None) """ The title of the project. """ author: typing.Optional[str] = pydantic.Field(default=None) """ The author of the project. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the project. """ genres: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of genres of the project. """ cover_image_url: typing.Optional[str] = pydantic.Field(default=None) """ The cover image URL of the project. """ target_audience: typing.Optional[ProjectResponseTargetAudience] = pydantic.Field(default=None) """ The target audience of the project. """ language: typing.Optional[str] = pydantic.Field(default=None) """ Two-letter language code (ISO 639-1) of the language of the project. """ content_type: typing.Optional[str] = pydantic.Field(default=None) """ The content type of the project, e.g. 'Novel' or 'Short Story' """ original_publication_date: typing.Optional[str] = pydantic.Field(default=None) """ The original publication date of the project. """ mature_content: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the project contains mature content. """ isbn_number: typing.Optional[str] = pydantic.Field(default=None) """ The ISBN number of the project. """ volume_normalization: bool = pydantic.Field() """ Whether the project uses volume normalization. """ state: ProjectState = pydantic.Field() """ The state of the project. """ access_level: ProjectResponseAccessLevel = pydantic.Field() """ The access level of the project. """ fiction: typing.Optional[ProjectResponseFiction] = pydantic.Field(default=None) """ Whether the project is fiction. """ quality_check_on: bool = pydantic.Field() """ Whether quality check is enabled for this project. """ quality_check_on_when_bulk_convert: bool = pydantic.Field() """ Whether quality check is enabled on the project when bulk converting. """ creation_meta: typing.Optional[ProjectCreationMetaResponseModel] = pydantic.Field(default=None) """ The creation meta of the project. """ source_type: typing.Optional[ProjectResponseSourceType] = pydantic.Field(default=None) """ The source type of the project. """ chapters_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether chapters are enabled for the project. """ captions_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether captions are enabled for the project. """ caption_style: typing.Optional[CaptionStyleModel] = pydantic.Field(default=None) """ Global styling to be applied to all captions """ caption_style_template_overrides: typing.Optional[typing.Dict[str, typing.Optional[CaptionStyleModel]]] = ( pydantic.Field(default=None) ) """ Styling changes that have been made to the provided templates """ public_share_id: typing.Optional[str] = pydantic.Field(default=None) """ The public share ID of the project. """ aspect_ratio: typing.Optional[ProjectResponseAspectRatio] = pydantic.Field(default=None) """ The aspect ratio of the project. """ agent_settings: typing.Optional[StudioAgentSettingsModel] = pydantic.Field(default=None) """ Agent-related settings for the project """ default_title_voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The default title voice ID. """ default_paragraph_voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The default paragraph voice ID. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response_access_level.py000066400000000000000000000003001523660243400323440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectResponseAccessLevel = typing.Union[typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response_aspect_ratio.py000066400000000000000000000002641523660243400324020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectResponseAspectRatio = typing.Union[typing.Literal["16:9", "9:16", "4:5", "1:1"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response_fiction.py000066400000000000000000000002541523660243400313570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectResponseFiction = typing.Union[typing.Literal["fiction", "non-fiction"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response_source_type.py000066400000000000000000000003271523660243400322660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectResponseSourceType = typing.Union[ typing.Literal["blank", "book", "article", "genfm", "video", "screenplay"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_response_target_audience.py000066400000000000000000000003111523660243400330410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectResponseTargetAudience = typing.Union[typing.Literal["children", "young adult", "adult", "all ages"], typing.Any] project_snapshot_extended_response_model.py000066400000000000000000000026441523660243400345510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_model import CharacterAlignmentModel class ProjectSnapshotExtendedResponseModel(UncheckedBaseModel): project_snapshot_id: str = pydantic.Field() """ The ID of the project snapshot. """ project_id: str = pydantic.Field() """ The ID of the project. """ created_at_unix: int = pydantic.Field() """ The creation date of the project snapshot. """ name: str = pydantic.Field() """ The name of the project snapshot. """ audio_upload: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ (Deprecated) """ zip_upload: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ (Deprecated) """ character_alignments: typing.List[CharacterAlignmentModel] audio_duration_secs: float = pydantic.Field() """ The total 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_snapshot_response.py000066400000000000000000000022461523660243400315660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ProjectSnapshotResponse(UncheckedBaseModel): project_snapshot_id: str = pydantic.Field() """ The ID of the project snapshot. """ project_id: str = pydantic.Field() """ The ID of the project. """ created_at_unix: int = pydantic.Field() """ The creation date of the project snapshot. """ name: str = pydantic.Field() """ The name of the project snapshot. """ audio_upload: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ (Deprecated) """ zip_upload: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ (Deprecated) """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_snapshots_response.py000066400000000000000000000013411523660243400317440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .project_snapshot_response import ProjectSnapshotResponse class ProjectSnapshotsResponse(UncheckedBaseModel): snapshots: typing.List[ProjectSnapshotResponse] = pydantic.Field() """ List of project snapshots. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_state.py000066400000000000000000000002711523660243400271250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ProjectState = typing.Union[typing.Literal["creating", "default", "converting", "in_queue"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_video_response_model.py000066400000000000000000000056371523660243400322240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .asset_transcription import AssetTranscription from .canvas_placement import CanvasPlacement from .clip_animation import ClipAnimation from .generation_source_context import GenerationSourceContext from .pending_blocks_metadata_model import PendingBlocksMetadataModel from .pending_clip_task import PendingClipTask from .pending_external_audios_metadata_model import PendingExternalAudiosMetadataModel from .project_video_thumbnail_sheet_response_model import ProjectVideoThumbnailSheetResponseModel from .video_analysis import VideoAnalysis class ProjectVideoResponseModel(UncheckedBaseModel): video_id: str filename: str signed_url: typing.Optional[str] = None signed_preview_url: typing.Optional[str] = None offset_ms: int duration_ms: int volume_gain_db: float muted: bool fade_in_ms: typing.Optional[int] = None fade_out_ms: typing.Optional[int] = None width: int height: int codec: str order: str created_at_ms: int updated_at_ms: int error: typing.Optional[str] = None thumbnail_interval_seconds: float thumbnail_size: typing.List[int] thumbnail_sheets: typing.List[ProjectVideoThumbnailSheetResponseModel] start_time_ms: int end_time_ms: typing.Optional[int] = None asset_preview_signed_url: typing.Optional[str] = None source_video_id: typing.Optional[str] = None source_asset_id: typing.Optional[str] = None source_platform_asset_id: typing.Optional[str] = None pending_blocks_metadata: typing.Optional[PendingBlocksMetadataModel] = None pending_external_audios_metadata: typing.Optional[PendingExternalAudiosMetadataModel] = None speech_imported: typing.Optional[bool] = None pending_task: typing.Optional[PendingClipTask] = None audio_track_ready: typing.Optional[bool] = None export_format_ready: typing.Optional[bool] = None current_snapshot_id: typing.Optional[str] = None source_context: typing.Optional[GenerationSourceContext] = None analysis: typing.Optional[VideoAnalysis] = None transcription: typing.Optional[AssetTranscription] = None canvas_placement: typing.Optional[CanvasPlacement] = None animation: typing.Optional[ClipAnimation] = None playback_speed: typing.Optional[float] = None opacity: typing.Optional[float] = None track_id: typing.Optional[str] = None preview_job_progress: typing.Optional[float] = None import_speech_progress: typing.Optional[float] = 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 project_video_thumbnail_sheet_response_model.py000066400000000000000000000012151523660243400353640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ProjectVideoThumbnailSheetResponseModel(UncheckedBaseModel): start_thumbnail_index: int thumbnail_count: int signed_cloud_url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/project_voice_response_model.py000066400000000000000000000014061523660243400322110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ProjectVoiceResponseModel(UncheckedBaseModel): project_voice_ref_id: str voice_id: str alias: str stability: float similarity_boost: float style: float is_pinned: bool use_speaker_boost: bool volume_gain: float speed: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent.py000066400000000000000000000001511523660243400267530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing PromptAgent = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_input.py000066400000000000000000000114111523660243400322040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .built_in_tools_input import BuiltInToolsInput from .custom_llm import CustomLlm from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm from .llm_reasoning_effort import LlmReasoningEffort from .prompt_agent_api_model_input_backup_llm_config import PromptAgentApiModelInputBackupLlmConfig from .prompt_agent_api_model_input_tools_item import PromptAgentApiModelInputToolsItem from .rag_config_input import RagConfigInput class PromptAgentApiModelInput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ reasoning_effort: typing.Optional[LlmReasoningEffort] = pydantic.Field(default=None) """ Reasoning effort of the model. Only available for some models. """ thinking_budget: typing.Optional[int] = pydantic.Field(default=None) """ Max number of tokens used for thinking. Use 0 to turn off if supported by the model. """ enable_reasoning_summary: typing.Optional[bool] = pydantic.Field(default=None) """ Enable model reasoning summaries. When disabled, we do not request summaries from provider if possible for faster TTFB. Not ZRM compatible. """ temperature: typing.Optional[float] = pydantic.Field(default=None) """ The temperature for the LLM. Defaults to 0. Set to null to omit the parameter from the LLM request entirely (useful for custom LLMs that reject the temperature field). """ max_tokens: typing.Optional[int] = pydantic.Field(default=None) """ If greater than 0, maximum number of tokens the LLM can predict """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ built_in_tools: typing.Optional[BuiltInToolsInput] = pydantic.Field(default=None) """ Built-in system tools to be used by the agent """ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of MCP server ids to be used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None) """ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' """ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to remove the default personality lines from the system prompt """ rag: typing.Optional[RagConfigInput] = pydantic.Field(default=None) """ Configuration for RAG """ timezone: typing.Optional[str] = pydantic.Field(default=None) """ Timezone for displaying current time in system prompt. If set, the current time will be included in the system prompt using this timezone. Must be a valid timezone name (e.g., 'America/New_York', 'Europe/London', 'UTC'). Recommended for accurate time-aware responses; without this, the agent has no knowledge of the current date/time unless you provide it via dynamic variables or tools, which can lead to incorrect or hallucinated time references. """ backup_llm_config: typing.Optional[PromptAgentApiModelInputBackupLlmConfig] = pydantic.Field(default=None) """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. """ tools: typing.Optional[typing.List[PromptAgentApiModelInputToolsItem]] = pydantic.Field(default=None) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead """ 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 update_forward_refs(PromptAgentApiModelInput) prompt_agent_api_model_input_backup_llm_config.py000066400000000000000000000044011523660243400356440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .llm import Llm class PromptAgentApiModelInputBackupLlmConfig_Default(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["default"] = "default" 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 PromptAgentApiModelInputBackupLlmConfig_Disabled(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["disabled"] = "disabled" 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 PromptAgentApiModelInputBackupLlmConfig_Override(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["override"] = "override" order: typing.List[Llm] 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 PromptAgentApiModelInputBackupLlmConfig = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelInputBackupLlmConfig_Default, PromptAgentApiModelInputBackupLlmConfig_Disabled, PromptAgentApiModelInputBackupLlmConfig_Override, ], UnionMetadata(discriminant="preference"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_input_tools_item.py000066400000000000000000000201231523660243400344420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_input_params import SystemToolConfigInputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput class PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None tool_version: typing.Optional[str] = None api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = 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 class PromptAgentApiModelInputToolsItem_Client(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class PromptAgentApiModelInputToolsItem_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelInputToolsItem_Smb(UncheckedBaseModel): value: typing.Any type: typing.Literal["smb"] = "smb" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelInputToolsItem_System(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None params: SystemToolConfigInputParams 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 PromptAgentApiModelInputToolsItem_Webhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigInput 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 PromptAgentApiModelInputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelInputToolsItem_Client, PromptAgentApiModelInputToolsItem_Mcp, PromptAgentApiModelInputToolsItem_Smb, PromptAgentApiModelInputToolsItem_System, PromptAgentApiModelInputToolsItem_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( PromptAgentApiModelInputToolsItem_Client, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) update_forward_refs(PromptAgentApiModelInputToolsItem_System) update_forward_refs(PromptAgentApiModelInputToolsItem_Webhook) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_output.py000066400000000000000000000114271523660243400324140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .built_in_tools_output import BuiltInToolsOutput from .custom_llm import CustomLlm from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm from .llm_reasoning_effort import LlmReasoningEffort from .prompt_agent_api_model_output_backup_llm_config import PromptAgentApiModelOutputBackupLlmConfig from .prompt_agent_api_model_output_tools_item import PromptAgentApiModelOutputToolsItem from .rag_config_output import RagConfigOutput class PromptAgentApiModelOutput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ reasoning_effort: typing.Optional[LlmReasoningEffort] = pydantic.Field(default=None) """ Reasoning effort of the model. Only available for some models. """ thinking_budget: typing.Optional[int] = pydantic.Field(default=None) """ Max number of tokens used for thinking. Use 0 to turn off if supported by the model. """ enable_reasoning_summary: typing.Optional[bool] = pydantic.Field(default=None) """ Enable model reasoning summaries. When disabled, we do not request summaries from provider if possible for faster TTFB. Not ZRM compatible. """ temperature: typing.Optional[float] = pydantic.Field(default=None) """ The temperature for the LLM. Defaults to 0. Set to null to omit the parameter from the LLM request entirely (useful for custom LLMs that reject the temperature field). """ max_tokens: typing.Optional[int] = pydantic.Field(default=None) """ If greater than 0, maximum number of tokens the LLM can predict """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ built_in_tools: typing.Optional[BuiltInToolsOutput] = pydantic.Field(default=None) """ Built-in system tools to be used by the agent """ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of MCP server ids to be used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None) """ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' """ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to remove the default personality lines from the system prompt """ rag: typing.Optional[RagConfigOutput] = pydantic.Field(default=None) """ Configuration for RAG """ timezone: typing.Optional[str] = pydantic.Field(default=None) """ Timezone for displaying current time in system prompt. If set, the current time will be included in the system prompt using this timezone. Must be a valid timezone name (e.g., 'America/New_York', 'Europe/London', 'UTC'). Recommended for accurate time-aware responses; without this, the agent has no knowledge of the current date/time unless you provide it via dynamic variables or tools, which can lead to incorrect or hallucinated time references. """ backup_llm_config: typing.Optional[PromptAgentApiModelOutputBackupLlmConfig] = pydantic.Field(default=None) """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. """ tools: typing.Optional[typing.List[PromptAgentApiModelOutputToolsItem]] = pydantic.Field(default=None) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead """ 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 update_forward_refs(PromptAgentApiModelOutput) prompt_agent_api_model_output_backup_llm_config.py000066400000000000000000000044101523660243400360450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .llm import Llm class PromptAgentApiModelOutputBackupLlmConfig_Default(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["default"] = "default" 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 PromptAgentApiModelOutputBackupLlmConfig_Disabled(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["disabled"] = "disabled" 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 PromptAgentApiModelOutputBackupLlmConfig_Override(UncheckedBaseModel): """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ preference: typing.Literal["override"] = "override" order: typing.List[Llm] 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 PromptAgentApiModelOutputBackupLlmConfig = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelOutputBackupLlmConfig_Default, PromptAgentApiModelOutputBackupLlmConfig_Disabled, PromptAgentApiModelOutputBackupLlmConfig_Override, ], UnionMetadata(discriminant="preference"), ] prompt_agent_api_model_output_tools_item.py000066400000000000000000000175621523660243400346010ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_output_params import SystemToolConfigOutputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput class PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" name: str description: str response_timeout_secs: int disable_interruptions: bool interruption_mode: ToolInterruptionMode force_pre_tool_speech: bool pre_tool_speech: PreToolSpeechMode assignments: typing.List[DynamicVariableAssignment] tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: ToolCallSoundBehavior tool_error_handling_mode: ToolErrorHandlingMode dynamic_variables: DynamicVariablesConfig execution_mode: ToolExecutionMode tool_version: str api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = 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 class PromptAgentApiModelOutputToolsItem_Client(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class PromptAgentApiModelOutputToolsItem_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelOutputToolsItem_Smb(UncheckedBaseModel): value: typing.Any type: typing.Literal["smb"] = "smb" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelOutputToolsItem_System(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None 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 class PromptAgentApiModelOutputToolsItem_Webhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigOutput 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 PromptAgentApiModelOutputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelOutputToolsItem_Client, PromptAgentApiModelOutputToolsItem_Mcp, PromptAgentApiModelOutputToolsItem_Smb, PromptAgentApiModelOutputToolsItem_System, PromptAgentApiModelOutputToolsItem_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( PromptAgentApiModelOutputToolsItem_Client, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) update_forward_refs(PromptAgentApiModelOutputToolsItem_System) update_forward_refs(PromptAgentApiModelOutputToolsItem_Webhook) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_override_config.py000066400000000000000000000023641523660243400342200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PromptAgentApiModelOverrideConfig(UncheckedBaseModel): prompt: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the prompt field. """ llm: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the llm field. """ tool_ids: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the tool_ids field. """ native_mcp_server_ids: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the native_mcp_server_ids field. """ knowledge_base: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the knowledge_base field. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_override_input.py000066400000000000000000000026601523660243400341110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm class PromptAgentApiModelOverrideInput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_api_model_override_output.py000066400000000000000000000026611523660243400343130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm class PromptAgentApiModelOverrideOutput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ 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 prompt_agent_api_model_workflow_override_input.py000066400000000000000000000120261523660243400357610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .built_in_tools_workflow_override_input import BuiltInToolsWorkflowOverrideInput from .custom_llm import CustomLlm from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm from .llm_reasoning_effort import LlmReasoningEffort from .prompt_agent_api_model_workflow_override_input_backup_llm_config import ( PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig, ) from .prompt_agent_api_model_workflow_override_input_tools_item import PromptAgentApiModelWorkflowOverrideInputToolsItem from .rag_config_workflow_override_input import RagConfigWorkflowOverrideInput class PromptAgentApiModelWorkflowOverrideInput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ reasoning_effort: typing.Optional[LlmReasoningEffort] = pydantic.Field(default=None) """ Reasoning effort of the model. Only available for some models. """ thinking_budget: typing.Optional[int] = pydantic.Field(default=None) """ Max number of tokens used for thinking. Use 0 to turn off if supported by the model. """ enable_reasoning_summary: typing.Optional[bool] = pydantic.Field(default=None) """ Enable model reasoning summaries. When disabled, we do not request summaries from provider if possible for faster TTFB. Not ZRM compatible. """ temperature: typing.Optional[float] = pydantic.Field(default=None) """ The temperature for the LLM. Defaults to 0. Set to null to omit the parameter from the LLM request entirely (useful for custom LLMs that reject the temperature field). """ max_tokens: typing.Optional[int] = pydantic.Field(default=None) """ If greater than 0, maximum number of tokens the LLM can predict """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ built_in_tools: typing.Optional[BuiltInToolsWorkflowOverrideInput] = pydantic.Field(default=None) """ Built-in system tools to be used by the agent """ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of MCP server ids to be used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None) """ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' """ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to remove the default personality lines from the system prompt """ rag: typing.Optional[RagConfigWorkflowOverrideInput] = pydantic.Field(default=None) """ Configuration for RAG """ timezone: typing.Optional[str] = pydantic.Field(default=None) """ Timezone for displaying current time in system prompt. If set, the current time will be included in the system prompt using this timezone. Must be a valid timezone name (e.g., 'America/New_York', 'Europe/London', 'UTC'). Recommended for accurate time-aware responses; without this, the agent has no knowledge of the current date/time unless you provide it via dynamic variables or tools, which can lead to incorrect or hallucinated time references. """ backup_llm_config: typing.Optional[PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig] = pydantic.Field( default=None ) """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. """ tools: typing.Optional[typing.List[PromptAgentApiModelWorkflowOverrideInputToolsItem]] = pydantic.Field( default=None ) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead """ 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 update_forward_refs(PromptAgentApiModelWorkflowOverrideInput) prompt_agent_api_model_workflow_override_input_backup_llm_config.py000066400000000000000000000005551523660243400415030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .backup_llm_default import BackupLlmDefault from .backup_llm_disabled import BackupLlmDisabled from .backup_llm_override import BackupLlmOverride PromptAgentApiModelWorkflowOverrideInputBackupLlmConfig = typing.Union[ BackupLlmDefault, BackupLlmDisabled, BackupLlmOverride ] prompt_agent_api_model_workflow_override_input_tools_item.py000066400000000000000000000205231523660243400402200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_input_params import SystemToolConfigInputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput class PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None tool_version: typing.Optional[str] = None api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = 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 class PromptAgentApiModelWorkflowOverrideInputToolsItem_Client(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb(UncheckedBaseModel): value: typing.Any type: typing.Literal["smb"] = "smb" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelWorkflowOverrideInputToolsItem_System(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None params: SystemToolConfigInputParams 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 PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigInput 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 PromptAgentApiModelWorkflowOverrideInputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelWorkflowOverrideInputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideInputToolsItem_Client, PromptAgentApiModelWorkflowOverrideInputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideInputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideInputToolsItem_System, PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( PromptAgentApiModelWorkflowOverrideInputToolsItem_Client, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) update_forward_refs(PromptAgentApiModelWorkflowOverrideInputToolsItem_System) update_forward_refs(PromptAgentApiModelWorkflowOverrideInputToolsItem_Webhook) prompt_agent_api_model_workflow_override_output.py000066400000000000000000000120551523660243400361640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .built_in_tools_workflow_override_output import BuiltInToolsWorkflowOverrideOutput from .custom_llm import CustomLlm from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm from .llm_reasoning_effort import LlmReasoningEffort from .prompt_agent_api_model_workflow_override_output_backup_llm_config import ( PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig, ) from .prompt_agent_api_model_workflow_override_output_tools_item import ( PromptAgentApiModelWorkflowOverrideOutputToolsItem, ) from .rag_config_workflow_override_output import RagConfigWorkflowOverrideOutput class PromptAgentApiModelWorkflowOverrideOutput(UncheckedBaseModel): prompt: typing.Optional[str] = pydantic.Field(default=None) """ The prompt for the agent """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ The LLM to query with the prompt and the chat history. If using data residency, the LLM must be supported in the data residency environment """ reasoning_effort: typing.Optional[LlmReasoningEffort] = pydantic.Field(default=None) """ Reasoning effort of the model. Only available for some models. """ thinking_budget: typing.Optional[int] = pydantic.Field(default=None) """ Max number of tokens used for thinking. Use 0 to turn off if supported by the model. """ enable_reasoning_summary: typing.Optional[bool] = pydantic.Field(default=None) """ Enable model reasoning summaries. When disabled, we do not request summaries from provider if possible for faster TTFB. Not ZRM compatible. """ temperature: typing.Optional[float] = pydantic.Field(default=None) """ The temperature for the LLM. Defaults to 0. Set to null to omit the parameter from the LLM request entirely (useful for custom LLMs that reject the temperature field). """ max_tokens: typing.Optional[int] = pydantic.Field(default=None) """ If greater than 0, maximum number of tokens the LLM can predict """ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of IDs of tools used by the agent """ built_in_tools: typing.Optional[BuiltInToolsWorkflowOverrideOutput] = pydantic.Field(default=None) """ Built-in system tools to be used by the agent """ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of MCP server ids to be used by the agent """ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of Native MCP server ids to be used by the agent """ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ A list of knowledge bases to be used by the agent """ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None) """ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' """ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to remove the default personality lines from the system prompt """ rag: typing.Optional[RagConfigWorkflowOverrideOutput] = pydantic.Field(default=None) """ Configuration for RAG """ timezone: typing.Optional[str] = pydantic.Field(default=None) """ Timezone for displaying current time in system prompt. If set, the current time will be included in the system prompt using this timezone. Must be a valid timezone name (e.g., 'America/New_York', 'Europe/London', 'UTC'). Recommended for accurate time-aware responses; without this, the agent has no knowledge of the current date/time unless you provide it via dynamic variables or tools, which can lead to incorrect or hallucinated time references. """ backup_llm_config: typing.Optional[PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig] = pydantic.Field( default=None ) """ Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. """ tools: typing.Optional[typing.List[PromptAgentApiModelWorkflowOverrideOutputToolsItem]] = pydantic.Field( default=None ) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead """ 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 update_forward_refs(PromptAgentApiModelWorkflowOverrideOutput) prompt_agent_api_model_workflow_override_output_backup_llm_config.py000066400000000000000000000005561523660243400417050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .backup_llm_default import BackupLlmDefault from .backup_llm_disabled import BackupLlmDisabled from .backup_llm_override import BackupLlmOverride PromptAgentApiModelWorkflowOverrideOutputBackupLlmConfig = typing.Union[ BackupLlmDefault, BackupLlmDisabled, BackupLlmOverride ] prompt_agent_api_model_workflow_override_output_tools_item.py000066400000000000000000000201621523660243400404200ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .api_integration_webhook_overrides import ApiIntegrationWebhookOverrides from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_output_params import SystemToolConfigOutputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput class PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" name: str description: str response_timeout_secs: int disable_interruptions: bool interruption_mode: ToolInterruptionMode force_pre_tool_speech: bool pre_tool_speech: PreToolSpeechMode assignments: typing.List[DynamicVariableAssignment] tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: ToolCallSoundBehavior tool_error_handling_mode: ToolErrorHandlingMode dynamic_variables: DynamicVariablesConfig execution_mode: ToolExecutionMode tool_version: str api_integration_id: str api_integration_connection_id: str api_schema_overrides: typing.Optional[ApiIntegrationWebhookOverrides] = 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 class PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb(UncheckedBaseModel): value: typing.Any type: typing.Literal["smb"] = "smb" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class PromptAgentApiModelWorkflowOverrideOutputToolsItem_System(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None 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 class PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigOutput 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 PromptAgentApiModelWorkflowOverrideOutputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentApiModelWorkflowOverrideOutputToolsItem_ApiIntegrationWebhook, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Mcp, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Smb, PromptAgentApiModelWorkflowOverrideOutputToolsItem_System, PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( PromptAgentApiModelWorkflowOverrideOutputToolsItem_Client, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) update_forward_refs(PromptAgentApiModelWorkflowOverrideOutputToolsItem_System) update_forward_refs(PromptAgentApiModelWorkflowOverrideOutputToolsItem_Webhook) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_agent_db_model.py000066400000000000000000000011241523660243400306010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PromptAgentDbModel(UncheckedBaseModel): tools: typing.Optional[typing.Any] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_evaluation_criteria.py000066400000000000000000000047441523660243400317220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope from .criteria_scoring_mode import CriteriaScoringMode from .llm import Llm class PromptEvaluationCriteria(UncheckedBaseModel): """ An evaluation using the transcript and a prompt for a yes/no achieved answer """ id: str = pydantic.Field() """ The unique identifier for the evaluation criteria """ name: str type: typing.Optional[typing.Literal["prompt"]] = pydantic.Field(default=None) """ The type of evaluation criteria """ conversation_goal_prompt: str = pydantic.Field() """ The prompt that the agent should use to evaluate the conversation """ use_knowledge_base: typing.Optional[bool] = pydantic.Field(default=None) """ When evaluating the prompt, should the agent's knowledge base be used. """ scope: typing.Optional[AnalysisScope] = pydantic.Field(default=None) """ The scope of transcript context used when evaluating this criterion. 'conversation' uses the full transcript; 'agent' uses only the portion where the defining agent was active. """ llm: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for this evaluation criteria. If not set, uses agent's analysis_llm default. """ scoring_mode: typing.Optional[CriteriaScoringMode] = pydantic.Field(default=None) """ How this criterion is scored. 'binary' resolves to success/failure/unknown. 'numeric_uniform' returns a number on the [0, max_score] scale which is normalized into the aggregate conversation success percentage. """ max_score: typing.Optional[int] = pydantic.Field(default=None) """ Maximum value of the numeric score scale (minimum is always 0). Only used when scoring_mode is 'numeric_uniform'. """ score_instructions: typing.Optional[str] = pydantic.Field(default=None) """ Optional free-text instructions describing how to assign values on the numeric scale. Only used when scoring_mode is 'numeric_uniform'. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/prompt_injection_guardrail.py000066400000000000000000000011311523660243400316700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PromptInjectionGuardrail(UncheckedBaseModel): is_enabled: typing.Optional[bool] = 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 pronunciation_dictionary_alias_rule_request_model.py000066400000000000000000000020711523660243400364450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryAliasRuleRequestModel(UncheckedBaseModel): string_to_replace: str = pydantic.Field() """ The string to replace. Must be a non-empty string. """ case_sensitive: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule should match case-sensitively. """ word_boundaries: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule should only match at word boundaries. """ alias: str = pydantic.Field() """ The alias for the string to be replaced. """ 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 pronunciation_dictionary_alias_rule_response_model.py000066400000000000000000000016051523660243400366150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryAliasRuleResponseModel(UncheckedBaseModel): string_to_replace: str case_sensitive: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule matches case-sensitively. """ word_boundaries: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule only matches at word boundaries. """ alias: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/pronunciation_dictionary_locator.py000066400000000000000000000015621523660243400331230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryLocator(UncheckedBaseModel): """ Identifies a specific pronunciation dictionary to use """ pronunciation_dictionary_id: str = pydantic.Field() """ The unique identifier of the pronunciation dictionary """ version_id: str = pydantic.Field() """ The version identifier 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow pronunciation_dictionary_locator_response_model.py000066400000000000000000000012201523660243400361310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryLocatorResponseModel(UncheckedBaseModel): pronunciation_dictionary_id: str version_id: 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 pronunciation_dictionary_phoneme_rule_request_model.py000066400000000000000000000022131523660243400370050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryPhonemeRuleRequestModel(UncheckedBaseModel): string_to_replace: str = pydantic.Field() """ The string to replace. Must be a non-empty string. """ case_sensitive: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule should match case-sensitively. """ word_boundaries: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule should only match at word boundaries. """ phoneme: str = pydantic.Field() """ The phoneme rule. """ alphabet: str = pydantic.Field() """ The alphabet to use with the phoneme rule. """ 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 pronunciation_dictionary_phoneme_rule_response_model.py000066400000000000000000000016331523660243400371600ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryPhonemeRuleResponseModel(UncheckedBaseModel): string_to_replace: str case_sensitive: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule matches case-sensitively. """ word_boundaries: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the rule only matches at word boundaries. """ phoneme: str alphabet: 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 pronunciation_dictionary_rules_response_model.py000066400000000000000000000016131523660243400356260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryRulesResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the pronunciation dictionary. """ version_id: str = pydantic.Field() """ The version ID of the pronunciation dictionary. """ version_rules_num: int = pydantic.Field() """ The number of rules in the version 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow pronunciation_dictionary_version_locator.py000066400000000000000000000015571523660243400346150ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PronunciationDictionaryVersionLocator(UncheckedBaseModel): pronunciation_dictionary_id: str = pydantic.Field() """ The ID of the pronunciation dictionary. """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the version of the pronunciation dictionary. If not provided, the latest version will be used. """ 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 pronunciation_dictionary_version_response_model.py000066400000000000000000000020671523660243400361650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pronunciation_dictionary_version_response_model_permission_on_resource import ( PronunciationDictionaryVersionResponseModelPermissionOnResource, ) class PronunciationDictionaryVersionResponseModel(UncheckedBaseModel): version_id: str version_rules_num: int 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 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 pronunciation_dictionary_version_response_model_permission_on_resource.py000066400000000000000000000003531523660243400430340ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing PronunciationDictionaryVersionResponseModelPermissionOnResource = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] pydantic_pronunciation_dictionary_version_locator.py000066400000000000000000000021141523660243400364760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class PydanticPronunciationDictionaryVersionLocator(UncheckedBaseModel): """ A locator for other documents to be able to reference a specific dictionary and it's version. This is a pydantic version of PronunciationDictionaryVersionLocatorDBModel. Required to ensure compat with the rest of the agent data models. """ pronunciation_dictionary_id: str = pydantic.Field() """ The ID of the pronunciation dictionary """ version_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the version 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: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/quality_preset_type.py000066400000000000000000000002741523660243400303750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing QualityPresetType = typing.Union[typing.Literal["standard", "high", "ultra", "ultra_lossless"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/query_params_json_schema.py000066400000000000000000000013401523660243400313360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .literal_json_schema_property import LiteralJsonSchemaProperty class QueryParamsJsonSchema(UncheckedBaseModel): properties: typing.Dict[str, LiteralJsonSchemaProperty] required: typing.Optional[typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/quote_info.py000066400000000000000000000013001523660243400264210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class QuoteInfo(UncheckedBaseModel): amount_usd: float = pydantic.Field() """ The quoted price for this item in USD. Use the order's total_amount_usd for the combined order total. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_chunk_metadata.py000066400000000000000000000011461523660243400300620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RagChunkMetadata(UncheckedBaseModel): document_id: str chunk_id: str vector_distance: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_config_input.py000066400000000000000000000034451523660243400276020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class RagConfigInput(UncheckedBaseModel): enabled: typing.Optional[bool] = None embedding_model: typing.Optional[EmbeddingModelEnum] = None max_vector_distance: typing.Optional[float] = pydantic.Field(default=None) """ Maximum vector distance of retrieved chunks. """ max_documents_length: typing.Optional[int] = pydantic.Field(default=None) """ Maximum total length of document chunks retrieved from RAG. """ max_retrieved_rag_chunks_count: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of RAG document chunks to initially retrieve from the vector store. These are then further filtered by vector distance and total length. """ num_candidates: typing.Optional[int] = pydantic.Field(default=None) """ Number of candidates evaluated in ANN vector search. Higher number means better results, but higher latency. Minimum recommended value is 100. If disabled, the default value is used. """ query_rewrite_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for rewriting user queries before RAG retrieval. The conversation history will be automatically appended at the end. If not set, the default prompt will be used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_config_output.py000066400000000000000000000034461523660243400300040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class RagConfigOutput(UncheckedBaseModel): enabled: typing.Optional[bool] = None embedding_model: typing.Optional[EmbeddingModelEnum] = None max_vector_distance: typing.Optional[float] = pydantic.Field(default=None) """ Maximum vector distance of retrieved chunks. """ max_documents_length: typing.Optional[int] = pydantic.Field(default=None) """ Maximum total length of document chunks retrieved from RAG. """ max_retrieved_rag_chunks_count: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of RAG document chunks to initially retrieve from the vector store. These are then further filtered by vector distance and total length. """ num_candidates: typing.Optional[int] = pydantic.Field(default=None) """ Number of candidates evaluated in ANN vector search. Higher number means better results, but higher latency. Minimum recommended value is 100. If disabled, the default value is used. """ query_rewrite_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for rewriting user queries before RAG retrieval. The conversation history will be automatically appended at the end. If not set, the default prompt will be used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_config_workflow_override_input.py000066400000000000000000000034651523660243400334350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class RagConfigWorkflowOverrideInput(UncheckedBaseModel): enabled: typing.Optional[bool] = None embedding_model: typing.Optional[EmbeddingModelEnum] = None max_vector_distance: typing.Optional[float] = pydantic.Field(default=None) """ Maximum vector distance of retrieved chunks. """ max_documents_length: typing.Optional[int] = pydantic.Field(default=None) """ Maximum total length of document chunks retrieved from RAG. """ max_retrieved_rag_chunks_count: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of RAG document chunks to initially retrieve from the vector store. These are then further filtered by vector distance and total length. """ num_candidates: typing.Optional[int] = pydantic.Field(default=None) """ Number of candidates evaluated in ANN vector search. Higher number means better results, but higher latency. Minimum recommended value is 100. If disabled, the default value is used. """ query_rewrite_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for rewriting user queries before RAG retrieval. The conversation history will be automatically appended at the end. If not set, the default prompt will be used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_config_workflow_override_output.py000066400000000000000000000034661523660243400336370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class RagConfigWorkflowOverrideOutput(UncheckedBaseModel): enabled: typing.Optional[bool] = None embedding_model: typing.Optional[EmbeddingModelEnum] = None max_vector_distance: typing.Optional[float] = pydantic.Field(default=None) """ Maximum vector distance of retrieved chunks. """ max_documents_length: typing.Optional[int] = pydantic.Field(default=None) """ Maximum total length of document chunks retrieved from RAG. """ max_retrieved_rag_chunks_count: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of RAG document chunks to initially retrieve from the vector store. These are then further filtered by vector distance and total length. """ num_candidates: typing.Optional[int] = pydantic.Field(default=None) """ Number of candidates evaluated in ANN vector search. Higher number means better results, but higher latency. Minimum recommended value is 100. If disabled, the default value is used. """ query_rewrite_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for rewriting user queries before RAG retrieval. The conversation history will be automatically appended at the end. If not set, the default prompt will be used. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_document_index_response_model.py000066400000000000000000000015511523660243400332150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum from .rag_document_index_usage import RagDocumentIndexUsage from .rag_index_status import RagIndexStatus class RagDocumentIndexResponseModel(UncheckedBaseModel): id: str model: EmbeddingModelEnum status: RagIndexStatus progress_percentage: float document_model_index_usage: RagDocumentIndexUsage 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_document_index_usage.py000066400000000000000000000010751523660243400313040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RagDocumentIndexUsage(UncheckedBaseModel): used_bytes: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_document_indexes_response_model.py000066400000000000000000000012701523660243400335430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .rag_document_index_response_model import RagDocumentIndexResponseModel class RagDocumentIndexesResponseModel(UncheckedBaseModel): indexes: typing.List[RagDocumentIndexResponseModel] 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 rag_index_batch_successful_response_model.py000066400000000000000000000012551523660243400346410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .rag_document_index_response_model import RagDocumentIndexResponseModel class RagIndexBatchSuccessfulResponseModel(UncheckedBaseModel): data: RagDocumentIndexResponseModel 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 rag_index_overview_embedding_model_response_model.py000066400000000000000000000012461523660243400363450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum class RagIndexOverviewEmbeddingModelResponseModel(UncheckedBaseModel): model: EmbeddingModelEnum used_bytes: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_index_overview_response_model.py000066400000000000000000000014241523660243400332440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .rag_index_overview_embedding_model_response_model import RagIndexOverviewEmbeddingModelResponseModel class RagIndexOverviewResponseModel(UncheckedBaseModel): total_used_bytes: int total_max_bytes: int models: typing.List[RagIndexOverviewEmbeddingModelResponseModel] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_index_status.py000066400000000000000000000005261523660243400276250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing RagIndexStatus = typing.Union[ typing.Literal[ "new", "created", "processing", "failed", "succeeded", "rag_limit_exceeded", "document_too_small", "cannot_index_folder", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/rag_retrieval_info.py000066400000000000000000000015161523660243400301230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .embedding_model_enum import EmbeddingModelEnum from .rag_chunk_metadata import RagChunkMetadata class RagRetrievalInfo(UncheckedBaseModel): chunks: typing.List[RagChunkMetadata] embedding_model: EmbeddingModelEnum retrieval_query: str rag_latency_secs: float used_chunk_ids: typing.Optional[typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/read_legal_terms.py000066400000000000000000000012371523660243400275530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ReadLegalTerms(UncheckedBaseModel): terms: typing.Optional[str] = None start_date: typing.Optional[str] = None end_date: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/read_metadata_chapter_db_model.py000066400000000000000000000016521523660243400323710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ReadMetadataChapterDbModel(UncheckedBaseModel): chapter_name: str word_count: int char_count: int starting_char_offset: int has_parsed_html: typing.Optional[bool] = None has_summary: typing.Optional[bool] = None duration_seconds: typing.Optional[float] = None file_number: typing.Optional[str] = None is_fallback_name: typing.Optional[bool] = None chapter_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/reader_resource_response_model.py000066400000000000000000000015361523660243400325330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .reader_resource_response_model_resource_type import ReaderResourceResponseModelResourceType class ReaderResourceResponseModel(UncheckedBaseModel): resource_type: ReaderResourceResponseModelResourceType = pydantic.Field() """ The type of resource. """ resource_id: str = pydantic.Field() """ The ID of the resource. """ 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 reader_resource_response_model_resource_type.py000066400000000000000000000002711523660243400354170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ReaderResourceResponseModelResourceType = typing.Union[typing.Literal["read", "collection"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/realtime_voice_settings.py000066400000000000000000000025451523660243400311740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RealtimeVoiceSettings(UncheckedBaseModel): stability: typing.Optional[float] = pydantic.Field(default=None) """ Defines the stability for voice settings. """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ Defines the similarity boost for voice settings. """ style: typing.Optional[float] = pydantic.Field(default=None) """ Defines the style for voice settings. This parameter is available on V2+ models. """ use_speaker_boost: typing.Optional[bool] = pydantic.Field(default=None) """ Defines the use speaker boost for voice settings. This parameter is available on V2+ models. """ speed: typing.Optional[float] = pydantic.Field(default=None) """ Controls the speed of the generated speech. Values range from 0.7 to 1.2, with 1.0 being the default speed. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/recording_response.py000066400000000000000000000020031523660243400301440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RecordingResponse(UncheckedBaseModel): recording_id: str = pydantic.Field() """ The ID of the recording. """ mime_type: str = pydantic.Field() """ The MIME type of the recording. """ size_bytes: int = pydantic.Field() """ The size of the recording in bytes. """ upload_date_unix: int = pydantic.Field() """ The date of the recording in Unix time. """ transcription: str = pydantic.Field() """ The transcription of the recording. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/reference_video.py000066400000000000000000000014511523660243400274040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .studio_clip_reference import StudioClipReference class ReferenceVideo(UncheckedBaseModel): generation_id: typing.Optional[str] = None content_asset_id: typing.Optional[str] = None template_node_id: typing.Optional[str] = None studio_clip: typing.Optional[StudioClipReference] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/referenced_tool_common_model.py000066400000000000000000000015501523660243400321470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .referenced_tool_common_model_type import ReferencedToolCommonModelType class ReferencedToolCommonModel(UncheckedBaseModel): """ Reference to a tool for unit test evaluation. """ id: str = pydantic.Field() """ The ID of the tool """ type: ReferencedToolCommonModelType = pydantic.Field() """ The type of the tool """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/referenced_tool_common_model_type.py000066400000000000000000000003641523660243400332120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ReferencedToolCommonModelType = typing.Union[ typing.Literal["system", "webhook", "client", "workflow", "api_integration_webhook", "mcp", "code"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/refresh_token_auth_response.py000066400000000000000000000022401523660243400320520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class RefreshTokenAuthResponse(UncheckedBaseModel): """ Response model for OAuth2 refresh-token-grant auth connections """ name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/regex_parameter_evaluation_strategy.py000066400000000000000000000012431523660243400336020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RegexParameterEvaluationStrategy(UncheckedBaseModel): pattern: str = pydantic.Field() """ A regex pattern to match the agent's response against. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/region_config_request.py000066400000000000000000000016261523660243400306440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .twilio_edge_location import TwilioEdgeLocation from .twilio_region_id import TwilioRegionId class RegionConfigRequest(UncheckedBaseModel): region_id: TwilioRegionId = pydantic.Field() """ Region ID """ token: str = pydantic.Field() """ Auth Token for this region """ edge_location: TwilioEdgeLocation = pydantic.Field() """ Edge location for this region """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/regional_processing_surcharge_info.py000066400000000000000000000013111523660243400333650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RegionalProcessingSurchargeInfo(UncheckedBaseModel): multiplier: float = pydantic.Field() """ The surcharge multiplier applied to this model's pricing (e.g. 1.1 for a 10% surcharge). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/register_for_group_session_params.py000066400000000000000000000013171523660243400332750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RegisterForGroupSessionParams(UncheckedBaseModel): """ Register a client for a scheduled group session. """ smb_tool_type: typing.Optional[typing.Literal["register_for_group_session"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/register_media_response.py000066400000000000000000000012471523660243400311640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_id import MediaId class RegisterMediaResponse(UncheckedBaseModel): media_id: MediaId = pydantic.Field() """ The ID of the uploaded media file. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/remove_member_from_group_request.py000066400000000000000000000001721523660243400331120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing RemoveMemberFromGroupRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/remove_order_item_response.py000066400000000000000000000012171523660243400317040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RemoveOrderItemResponse(UncheckedBaseModel): success: bool = pydantic.Field() """ Whether the item was successfully removed. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/render.py000066400000000000000000000015531523660243400255420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_media_reference import DubbingMediaReference from .render_status import RenderStatus from .render_type import RenderType 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/render_status.py000066400000000000000000000002541523660243400271420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing RenderStatus = typing.Union[typing.Literal["complete", "processing", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/render_type.py000066400000000000000000000003211523660243400265730ustar00rootroot00000000000000# 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", "zip"], typing.Any ] replicate_voice_to_isolated_environment_response_model.py000066400000000000000000000012671523660243400374530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ReplicateVoiceToIsolatedEnvironmentResponseModel(UncheckedBaseModel): voice_id: str = pydantic.Field() """ Voice ID of the replicated voice in the target residency. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/report_knowledge_gap_params.py000066400000000000000000000011761523660243400320300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ReportKnowledgeGapParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["report_knowledge_gap"]] = 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 request_pvc_manual_verification_response_model.py000066400000000000000000000014441523660243400357400ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/required_constraint.py000066400000000000000000000012371523660243400303460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RequiredConstraint(UncheckedBaseModel): """ A set of fields that must all be present to satisfy this constraint. """ required: typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/required_constraints.py000066400000000000000000000015031523660243400305250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .required_constraint import RequiredConstraint class RequiredConstraints(UncheckedBaseModel): """ Wrapper for anyOf/allOf composition constraints scoped to required fields. """ any_of: typing.Optional[typing.List[RequiredConstraint]] = None all_of: typing.Optional[typing.List[RequiredConstraint]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/resource_access_info.py000066400000000000000000000042331523660243400304440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .resource_access_info_access_source import ResourceAccessInfoAccessSource from .resource_access_info_anonymous_access_level_override import ResourceAccessInfoAnonymousAccessLevelOverride from .resource_access_info_role import ResourceAccessInfoRole class ResourceAccessInfo(UncheckedBaseModel): is_creator: bool = pydantic.Field() """ Whether the user making the request is the creator of the agent """ creator_name: str = pydantic.Field() """ Name of the agent's creator """ creator_email: str = pydantic.Field() """ Email of the agent's creator """ role: ResourceAccessInfoRole = pydantic.Field() """ The role of the user making the request """ anonymous_access_level_override: typing.Optional[ResourceAccessInfoAnonymousAccessLevelOverride] = pydantic.Field( default=None ) """ The access level for anonymous users. If None, the resource is not shared publicly. """ access_source: typing.Optional[ResourceAccessInfoAccessSource] = pydantic.Field(default=None) """ Why the requesting user has access to this resource. 'creator' = caller is the owner. 'explicit' = caller (or one of their workspace groups) is listed in role_to_group_ids beyond the workspace-wide everyone group. 'workspace_default' = the workspace-wide everyone group is listed in role_to_group_ids (every non-anon workspace member, including admins, sees this resource). 'workspace_admin' = caller is a workspace admin and the admin seat is the *only* path to access; reserved for docs nobody else can see. Lets the UI disclose why an admin-bypass viewer sees a doc that wasn't explicitly shared with them. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/resource_access_info_access_source.py000066400000000000000000000003371523660243400333460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ResourceAccessInfoAccessSource = typing.Union[ typing.Literal["creator", "explicit", "workspace_admin", "workspace_default"], typing.Any ] resource_access_info_anonymous_access_level_override.py000066400000000000000000000003321523660243400371000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ResourceAccessInfoAnonymousAccessLevelOverride = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/resource_access_info_role.py000066400000000000000000000002741523660243400314660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ResourceAccessInfoRole = typing.Union[typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/resource_metadata_response_model.py000066400000000000000000000036771523660243400330610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .resource_metadata_response_model_anonymous_access_level_override import ( ResourceMetadataResponseModelAnonymousAccessLevelOverride, ) from .share_option_response_model import ShareOptionResponseModel from .workspace_resource_type import WorkspaceResourceType class ResourceMetadataResponseModel(UncheckedBaseModel): resource_id: str = pydantic.Field() """ The ID of the resource. """ resource_name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the resource, if available. """ resource_type: WorkspaceResourceType = pydantic.Field() """ The type of the resource. """ creator_user_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the user who created the resource. """ anonymous_access_level_override: typing.Optional[ResourceMetadataResponseModelAnonymousAccessLevelOverride] = ( pydantic.Field(default=None) ) """ The access level for anonymous users. If None, the resource is not shared publicly. """ role_to_group_ids: typing.Dict[str, typing.List[str]] = pydantic.Field() """ A mapping of roles to group IDs. When the resource is shared with a user, the group id is the user's id. """ share_options: typing.List[ShareOptionResponseModel] = pydantic.Field() """ List of options for sharing the resource further in the workspace. These are users who don't have access to the resource yet. """ 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 resource_metadata_response_model_anonymous_access_level_override.py000066400000000000000000000003451523660243400415060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ResourceMetadataResponseModelAnonymousAccessLevelOverride = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/response_filter.py000066400000000000000000000025001523660243400274570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .response_filter_mode import ResponseFilterMode class ResponseFilter(UncheckedBaseModel): """ Configuration for filtering tool responses before they are visible to the agent. """ mode: typing.Optional[ResponseFilterMode] = pydantic.Field(default=None) """ Controls how tool responses are filtered. 'all' returns entire response, 'allow' returns only specified paths, 'hide_all' hides the entire response. """ filters: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Dot notation paths to include when mode is 'allow' (e.g., ['ticket.id', 'ticket.status']). """ content_type: typing.Optional[typing.Literal["application/json"]] = pydantic.Field(default=None) """ Content type for response filtering. Only 'application/json' responses are filtered. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/response_filter_mode.py000066400000000000000000000002521523660243400304650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ResponseFilterMode = typing.Union[typing.Literal["all", "allow", "hide_all"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/response_unit_test_model.py000066400000000000000000000045131523660243400313760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_failure_response_example import AgentFailureResponseExample from .agent_successful_response_example import AgentSuccessfulResponseExample from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput class ResponseUnitTestModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ A prompt that evaluates whether the agent's response is successful. Should return True or False. """ success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered successful """ failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered failures """ 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 update_forward_refs(ResponseUnitTestModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/restore_calendar_event_params.py000066400000000000000000000012021523660243400323320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RestoreCalendarEventParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["restore_calendar_event"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/retry_trigger_action.py000066400000000000000000000013141523660243400305030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class RetryTriggerAction(UncheckedBaseModel): feedback: typing.Optional[str] = pydantic.Field(default=None) """ Custom feedback to inject into the agent when retrying after guardrail trigger. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/review_response_model.py000066400000000000000000000021401523660243400306530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .review_response_model_reject_reasons_item import ReviewResponseModelRejectReasonsItem from .review_response_model_review_status import ReviewResponseModelReviewStatus class ReviewResponseModel(UncheckedBaseModel): review_status: ReviewResponseModelReviewStatus reviewed_at_unix: int reviewed_by: typing.Optional[str] = None reject_reasons: typing.Optional[typing.List[ReviewResponseModelRejectReasonsItem]] = None scores_breakdown: typing.Optional[typing.Dict[str, typing.Optional[int]]] = None rejected_details: typing.Optional[str] = None explanation: 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 review_response_model_reject_reasons_item.py000066400000000000000000000011561523660243400347060ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing ReviewResponseModelRejectReasonsItem = typing.Union[ typing.Literal[ "lacks_structure", "doesnt_open", "not_literary_work", "language_not_supported", "too_short", "duplicate", "promotional", "formatting_issues", "low_quality", "metadata_incomplete", "metadata_inaccurate", "typos", "review_error", "spam", "legal_violation", "content_policy", "public_domain", "other", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/review_response_model_review_status.py000066400000000000000000000003051523660243400336400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ReviewResponseModelReviewStatus = typing.Union[typing.Literal["approved", "edits_required", "rejected"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/review_status.py000066400000000000000000000003311523660243400271600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ReviewStatus = typing.Union[ typing.Literal["not_requested", "pending", "declined", "allowed", "allowed_with_changes"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/run_subagent_tool_config_input.py000066400000000000000000000013531523660243400325560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .sub_agent_input import SubAgentInput class RunSubagentToolConfigInput(UncheckedBaseModel): agents: typing.List[SubAgentInput] 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 update_forward_refs(RunSubagentToolConfigInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/run_subagent_tool_config_output.py000066400000000000000000000013601523660243400327550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .sub_agent_output import SubAgentOutput class RunSubagentToolConfigOutput(UncheckedBaseModel): agents: typing.List[SubAgentOutput] 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 update_forward_refs(RunSubagentToolConfigOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/safety_common_model_input.py000066400000000000000000000014511523660243400315220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .safety_evaluation import SafetyEvaluation class SafetyCommonModelInput(UncheckedBaseModel): """ Safety object that has the information of safety evaluations based on used voice. """ ivc: typing.Optional[SafetyEvaluation] = None non_ivc: typing.Optional[SafetyEvaluation] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/safety_common_model_output.py000066400000000000000000000014521523660243400317240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .safety_evaluation import SafetyEvaluation class SafetyCommonModelOutput(UncheckedBaseModel): """ Safety object that has the information of safety evaluations based on used voice. """ ivc: typing.Optional[SafetyEvaluation] = None non_ivc: typing.Optional[SafetyEvaluation] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/safety_evaluation.py000066400000000000000000000016671523660243400300130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .safety_rule import SafetyRule class SafetyEvaluation(UncheckedBaseModel): """ Safety evaluation of the agent. Prompt and first message is taken into account. The unsafe reason is provided from the evaluation """ is_unsafe: typing.Optional[bool] = None llm_reason: typing.Optional[str] = None safety_prompt_version: typing.Optional[int] = None matched_rule_id: typing.Optional[typing.List[SafetyRule]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/safety_response_model.py000066400000000000000000000013101523660243400306430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/safety_rule.py000066400000000000000000000005671523660243400266110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SafetyRule = typing.Union[ typing.Literal[ "sexual_minors", "forget_moderation", "extremism", "scam_fraud", "political", "self_harm", "illegal_distribution_medical", "sexual_adults", "unknown", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sample_config_db_model.py000066400000000000000000000015151523660243400307140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sample_config_db_model_parent_type import SampleConfigDbModelParentType class SampleConfigDbModel(UncheckedBaseModel): is_sample: typing.Optional[bool] = None parent_id: typing.Optional[str] = None parent_type: typing.Optional[SampleConfigDbModelParentType] = None chapter_ids: typing.Optional[typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sample_config_db_model_parent_type.py000066400000000000000000000002571523660243400333300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SampleConfigDbModelParentType = typing.Union[typing.Literal["read", "collection"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/save_voice_preview_request.py000066400000000000000000000001651523660243400317150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SaveVoicePreviewRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/say_node_literal_message_input.py000066400000000000000000000016361523660243400325250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .translated_string import TranslatedString class SayNodeLiteralMessageInput(UncheckedBaseModel): type: typing.Optional[typing.Literal["literal"]] = None text: str = pydantic.Field() """ Literal text message to be spoken by the agent. """ text_translations: typing.Optional[typing.Dict[str, TranslatedString]] = pydantic.Field(default=None) """ Translations for the text field """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/say_node_literal_message_output.py000066400000000000000000000015661523660243400327300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .translated_string import TranslatedString class SayNodeLiteralMessageOutput(UncheckedBaseModel): type: typing.Literal["literal"] = "literal" text: str = pydantic.Field() """ Literal text message to be spoken by the agent. """ text_translations: typing.Dict[str, TranslatedString] = pydantic.Field() """ Translations for the text field """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/say_node_prompt_message_input.py000066400000000000000000000013271523660243400324070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SayNodePromptMessageInput(UncheckedBaseModel): type: typing.Optional[typing.Literal["prompt"]] = None prompt: str = pydantic.Field() """ LLM prompt describing what message should be generated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/say_node_prompt_message_output.py000066400000000000000000000013131523660243400326030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SayNodePromptMessageOutput(UncheckedBaseModel): type: typing.Literal["prompt"] = "prompt" prompt: str = pydantic.Field() """ LLM prompt describing what message should be generated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/schedule_group_session_params.py000066400000000000000000000016671523660243400324070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScheduleGroupSessionParams(UncheckedBaseModel): """ Schedule a single instance of a group service. The session's duration is derived from the parent service so the assistant only has to pin start time, the (optional) instructor / room, and the location. Participants register separately via ``register_for_group_session``. """ smb_tool_type: typing.Optional[typing.Literal["schedule_group_session"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scim_group_response_model.py000066400000000000000000000014441523660243400315270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .seat_type import SeatType class ScimGroupResponseModel(UncheckedBaseModel): scim_external_id: typing.Optional[str] = None display_name: str created_at_unix: typing.Optional[int] = None updated_at_unix: typing.Optional[int] = None seat_type: typing.Optional[SeatType] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scoped_analysis_result.py000066400000000000000000000031101523660243400310300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_scope import AnalysisScope from .conversation_history_evaluation_criteria_result_common_model import ( ConversationHistoryEvaluationCriteriaResultCommonModel, ) from .data_collection_result_common_model import DataCollectionResultCommonModel from .evaluation_success_result import EvaluationSuccessResult class ScopedAnalysisResult(UncheckedBaseModel): scope: AnalysisScope = pydantic.Field() """ The scope of the analysis. 'conversation' uses the full transcript; 'agent' uses only the portion where the defining agent was active. """ source_agent_id: str source_branch_id: typing.Optional[str] = pydantic.Field(default=None) """ Branch of the agent for this scoped block; disambiguates repeated agent_id. """ evaluation_criteria_results: typing.Optional[ typing.Dict[str, ConversationHistoryEvaluationCriteriaResultCommonModel] ] = None data_collection_results: typing.Optional[typing.Dict[str, DataCollectionResultCommonModel]] = None successful: EvaluationSuccessResult success_score: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_auth_error_payload.py000066400000000000000000000014761523660243400315010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeAuthErrorPayload(UncheckedBaseModel): """ Payload for authentication errors. """ message_type: typing.Literal["auth_error"] = pydantic.Field(default="auth_error") """ The message type identifier. """ error: str = pydantic.Field() """ Authentication error details. """ 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 scribe_chunk_size_exceeded_error_payload.py000066400000000000000000000015471523660243400344500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeChunkSizeExceededErrorPayload(UncheckedBaseModel): """ Payload for chunk size exceeded errors. """ message_type: typing.Literal["chunk_size_exceeded"] = pydantic.Field(default="chunk_size_exceeded") """ The message type identifier. """ error: str = pydantic.Field() """ Chunk size exceeded error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_error_payload.py000066400000000000000000000015101523660243400304450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeErrorPayload(UncheckedBaseModel): """ Payload for error events during transcription. """ message_type: typing.Literal["error"] = pydantic.Field(default="error") """ The message type identifier. """ error: str = pydantic.Field() """ Error message describing what went wrong. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_input_error_payload.py000066400000000000000000000014571523660243400316760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeInputErrorPayload(UncheckedBaseModel): """ Payload for input errors. """ message_type: typing.Literal["input_error"] = pydantic.Field(default="input_error") """ The message type identifier. """ error: str = pydantic.Field() """ Input error details. """ 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 scribe_insufficient_audio_activity_error_payload.py000066400000000000000000000016171523660243400362410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeInsufficientAudioActivityErrorPayload(UncheckedBaseModel): """ Payload for insufficient audio activity errors. """ message_type: typing.Literal["insufficient_audio_activity"] = pydantic.Field(default="insufficient_audio_activity") """ The message type identifier. """ error: str = pydantic.Field() """ Insufficient audio activity error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_invalid_request_error.py000066400000000000000000000012041523660243400322120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeInvalidRequestError(UncheckedBaseModel): message_type: typing.Literal["invalid_request"] = "invalid_request" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_queue_overflow_error_payload.py000066400000000000000000000015171523660243400336030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeQueueOverflowErrorPayload(UncheckedBaseModel): """ Payload for queue overflow errors. """ message_type: typing.Literal["queue_overflow"] = pydantic.Field(default="queue_overflow") """ The message type identifier. """ error: str = pydantic.Field() """ Queue overflow error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_quota_exceeded_error_payload.py000066400000000000000000000015171523660243400335130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeQuotaExceededErrorPayload(UncheckedBaseModel): """ Payload for quota exceeded errors. """ message_type: typing.Literal["quota_exceeded"] = pydantic.Field(default="quota_exceeded") """ The message type identifier. """ error: str = pydantic.Field() """ Quota exceeded error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_rate_limited_error_payload.py000066400000000000000000000015051523660243400331730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeRateLimitedErrorPayload(UncheckedBaseModel): """ Payload for rate limited errors. """ message_type: typing.Literal["rate_limited"] = pydantic.Field(default="rate_limited") """ The message type identifier. """ error: str = pydantic.Field() """ Rate limited error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_resource_exhausted_error_payload.py000066400000000000000000000015431523660243400344340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeResourceExhaustedErrorPayload(UncheckedBaseModel): """ Payload for resource exhausted errors. """ message_type: typing.Literal["resource_exhausted"] = pydantic.Field(default="resource_exhausted") """ The message type identifier. """ error: str = pydantic.Field() """ Resource exhausted error details. """ 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 scribe_session_time_limit_exceeded_error_payload.py000066400000000000000000000016161523660243400362020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeSessionTimeLimitExceededErrorPayload(UncheckedBaseModel): """ Payload for session time limit exceeded errors. """ message_type: typing.Literal["session_time_limit_exceeded"] = pydantic.Field(default="session_time_limit_exceeded") """ The message type identifier. """ error: str = pydantic.Field() """ Session time limit exceeded error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_throttled_error_payload.py000066400000000000000000000015051523660243400325420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeThrottledErrorPayload(UncheckedBaseModel): """ Payload for throttled errors. """ message_type: typing.Literal["commit_throttled"] = pydantic.Field(default="commit_throttled") """ The message type identifier. """ error: str = pydantic.Field() """ Throttled error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_transcriber_error_payload.py000066400000000000000000000015151523660243400330500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeTranscriberErrorPayload(UncheckedBaseModel): """ Payload for transcriber errors. """ message_type: typing.Literal["transcriber_error"] = pydantic.Field(default="transcriber_error") """ The message type identifier. """ error: str = pydantic.Field() """ Transcriber error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/scribe_unaccepted_terms_error_payload.py000066400000000000000000000015311523660243400340550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ScribeUnacceptedTermsErrorPayload(UncheckedBaseModel): """ Payload for unaccepted terms errors. """ message_type: typing.Literal["unaccepted_terms"] = pydantic.Field(default="unaccepted_terms") """ The message type identifier. """ error: str = pydantic.Field() """ Unaccepted terms error details. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/search_clients_params.py000066400000000000000000000012741523660243400306140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SearchClientsParams(UncheckedBaseModel): """ Search for clients by name, phone number, or email. """ smb_tool_type: typing.Optional[typing.Literal["search_clients"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/search_highlight_segment.py000066400000000000000000000011121523660243400312700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SearchHighlightSegment(UncheckedBaseModel): value: str is_hit: bool 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/search_strategy.py000066400000000000000000000002561523660243400274510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SearchStrategy = typing.Union[typing.Literal["cat", "keyword", "semantic", "ls"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/seat_type.py000066400000000000000000000003041523660243400262510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SeatType = typing.Union[typing.Literal["workspace_admin", "workspace_member", "workspace_lite_member"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/secret_dependency_resource_type.py000066400000000000000000000002741523660243400327150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SecretDependencyResourceType = typing.Union[typing.Literal["tools", "agents", "phone_numbers"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/secret_dependency_type.py000066400000000000000000000002311523660243400307770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SecretDependencyType = typing.Literal["conversation_initiation_webhook"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/section_source.py000066400000000000000000000017661523660243400273150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange class SectionSource(UncheckedBaseModel): song_id: str = pydantic.Field() """ The ID of the song to source the section from. You can find the song ID in the response headers when you generate a song. """ range: TimeRange = pydantic.Field() """ The range to extract from the source song. """ negative_ranges: typing.Optional[typing.List[TimeRange]] = pydantic.Field(default=None) """ The ranges to exclude from the 'range'. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_create_response.py000066400000000000000000000011171523660243400311620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentCreateResponse(UncheckedBaseModel): version: int new_segment: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_delete_response.py000066400000000000000000000010721523660243400311610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentDeleteResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_dub_response.py000066400000000000000000000010671523660243400304750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentDubResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_migration_response.py000066400000000000000000000010751523660243400317130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentMigrationResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_subtitle_frame.py000066400000000000000000000011561523660243400310110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentSubtitleFrame(UncheckedBaseModel): start_time: float end_time: float lines: typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_transcription_response.py000066400000000000000000000011011523660243400326070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentTranscriptionResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_translation_response.py000066400000000000000000000010771523660243400322620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentTranslationResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segment_update_response.py000066400000000000000000000010721523660243400312010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SegmentUpdateResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/segmented_json_export_options.py000066400000000000000000000015071523660243400324420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/send_text.py000066400000000000000000000050611523660243400262560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .generation_config import GenerationConfig from .realtime_voice_settings import RealtimeVoiceSettings class SendText(UncheckedBaseModel): text: str = pydantic.Field() """ The text to be sent to the API for audio generation. Should always end with a single space string. """ try_trigger_generation: typing.Optional[bool] = pydantic.Field(default=None) """ This is an advanced setting that most users shouldn't need to use. It relates to our generation schedule. Use this to attempt to immediately trigger the generation of audio, overriding the `chunk_length_schedule`. Unlike flush, `try_trigger_generation` will only generate audio if our buffer contains more than a minimum threshold of characters, this is to ensure a higher quality response from our model. Note that overriding the chunk schedule to generate small amounts of text may result in lower quality audio, therefore, only use this parameter if you really need text to be processed immediately. We generally recommend keeping the default value of `false` and adjusting the `chunk_length_schedule` in the `generation_config` instead. """ voice_settings: typing.Optional[RealtimeVoiceSettings] = pydantic.Field(default=None) """ The voice settings field can be provided in the first `InitializeConnection` message and then must either be not provided or not changed. """ generator_config: typing.Optional[GenerationConfig] = pydantic.Field(default=None) """ The generator config field can be provided in the first `InitializeConnection` message and then must either be not provided or not changed. """ flush: typing.Optional[bool] = pydantic.Field(default=None) """ Flush forces the generation of audio. Set this value to true when you have finished sending text, but want to keep the websocket connection open. This is useful when you want to ensure that the last chunk of audio is generated even when the length of text sent is smaller than the value set in chunk_length_schedule (e.g. 120 or 50). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/send_text_multi.py000066400000000000000000000020551523660243400274700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SendTextMulti(UncheckedBaseModel): """ Payload to send text for synthesis to an existing context. """ text: str = pydantic.Field() """ Text to synthesize. Should end with a single space. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ The target context_id for this text. """ flush: typing.Optional[bool] = pydantic.Field(default=None) """ If true, flushes the audio buffer for the specified context. If false, the text will be appended to the buffer to be generated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sentiment_aggregate.py000066400000000000000000000020241523660243400302710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SentimentAggregate(UncheckedBaseModel): scored_conversation_count: int positive_count: int neutral_count: int negative_count: int average_sentiment_score: typing.Optional[float] = None average_frustration_score: typing.Optional[float] = None recent_scored_conversation_count: int recent_positive_count: int recent_neutral_count: int recent_negative_count: int recent_average_sentiment_score: typing.Optional[float] = None recent_average_frustration_score: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sentiment_analysis_settings.py000066400000000000000000000010541523660243400321100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SentimentAnalysisSettings(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/session_started_payload.py000066400000000000000000000020701523660243400312000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .session_started_payload_config import SessionStartedPayloadConfig class SessionStartedPayload(UncheckedBaseModel): """ Payload sent when the transcription session is successfully started. """ message_type: typing.Literal["session_started"] = pydantic.Field(default="session_started") """ The message type identifier. """ session_id: str = pydantic.Field() """ Unique identifier for the session. """ config: SessionStartedPayloadConfig = pydantic.Field() """ Configuration for the transcription session. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/session_started_payload_config.py000066400000000000000000000055701523660243400325350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .audio_format_enum import AudioFormatEnum from .session_started_payload_config_commit_strategy import SessionStartedPayloadConfigCommitStrategy class SessionStartedPayloadConfig(UncheckedBaseModel): """ Configuration for the transcription session. """ sample_rate: typing.Optional[int] = pydantic.Field(default=None) """ Sample rate of the audio in Hz. """ audio_format: typing.Optional[AudioFormatEnum] = None language_code: typing.Optional[str] = pydantic.Field(default=None) """ Language code in ISO 639-1 or ISO 639-3 format. """ commit_strategy: typing.Optional[SessionStartedPayloadConfigCommitStrategy] = pydantic.Field(default=None) """ Strategy for committing transcriptions. """ vad_silence_threshold_secs: typing.Optional[float] = pydantic.Field(default=None) """ Silence threshold in seconds. """ vad_threshold: typing.Optional[float] = pydantic.Field(default=None) """ Threshold for voice activity detection. """ min_speech_duration_ms: typing.Optional[int] = pydantic.Field(default=None) """ Minimum speech duration in milliseconds. """ min_silence_duration_ms: typing.Optional[int] = pydantic.Field(default=None) """ Minimum silence duration in milliseconds. """ model_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the model to use for transcription. """ enable_logging: typing.Optional[bool] = pydantic.Field(default=None) """ 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. Zero retention mode may only be used by enterprise customers. """ include_timestamps: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the session will include word-level timestamps in the committed transcript. """ include_language_detection: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the session will include language detection in the committed transcript. """ keyterms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of keyterms the model is biased towards. """ no_verbatim: typing.Optional[bool] = pydantic.Field(default=None) """ Whether filler words and disfluencies are removed from the transcript. """ 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 session_started_payload_config_commit_strategy.py000066400000000000000000000002661523660243400357450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing SessionStartedPayloadConfigCommitStrategy = typing.Union[typing.Literal["manual", "vad"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/set_booking_slug_params.py000066400000000000000000000011661523660243400311630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SetBookingSlugParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["set_booking_slug"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/severity_id.py000066400000000000000000000001221523660243400266000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. SeverityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sfx_model_id.py000066400000000000000000000002071523660243400267120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SfxModelId = typing.Literal["eleven_text_to_sound_v2"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sfx_source_context.py000066400000000000000000000014151523660243400302040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SfxSourceContext(UncheckedBaseModel): """ Context for sound effect clips. """ sound_generation_history_item_id: typing.Optional[str] = None text: typing.Optional[str] = None generation_config: typing.Optional[typing.Dict[str, typing.Any]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/share_option_response_model.py000066400000000000000000000016551523660243400320560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .share_option_response_model_type import ShareOptionResponseModelType class ShareOptionResponseModel(UncheckedBaseModel): name: str = pydantic.Field() """ The name of the principal. """ id: str = pydantic.Field() """ The ID of the principal. """ type: ShareOptionResponseModelType = pydantic.Field() """ The type of the principal: user, group, or service account (under 'key'). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/share_option_response_model_type.py000066400000000000000000000002601523660243400331060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ShareOptionResponseModelType = typing.Union[typing.Literal["user", "group", "key"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/similar_voice.py000066400000000000000000000013401523660243400271020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice_category import VoiceCategory class SimilarVoice(UncheckedBaseModel): voice_id: str name: str category: VoiceCategory description: typing.Optional[str] = None preview_url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/similar_voices_for_speaker_response.py000066400000000000000000000012011523660243400335570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .similar_voice import SimilarVoice class SimilarVoicesForSpeakerResponse(UncheckedBaseModel): voices: typing.List[SimilarVoice] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/simulation_library_settings.py000066400000000000000000000010541523660243400321070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SimulationLibrarySettings(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/simulation_test_model.py000066400000000000000000000071611523660243400306670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .llm import Llm from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .tool_response_mock_config_output import ToolResponseMockConfigOutput class SimulationTestModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ Deprecated legacy single success criterion. Use success_conditions instead. At least one of success_condition or success_conditions is required. """ success_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of prompts that evaluate whether the simulation was successful. If provided, all criteria are evaluated and merged into a final result. Capped at the maximum number of evaluation criteria. """ simulation_scenario: typing.Optional[str] = pydantic.Field(default=None) """ Description of the simulation scenario and user persona for simulation tests. """ simulation_max_turns: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of conversation turns for simulation tests. """ simulation_environment: typing.Optional[str] = pydantic.Field(default=None) """ The environment to use when running this simulation test. If not provided, defaults to 'production'. """ tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = pydantic.Field(default=None) """ Configuration for which tools to mock and fallback behavior. """ tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = pydantic.Field( default=None ) """ Test-specific response mocks, keyed by tool ID. Applied ahead of the tool's shared mocks and only within this test. Only take effect for tools that are mocked (see tool_mock_config). """ evaluation_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for evaluating simulation results. """ simulated_user_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model for the simulated user. """ 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 update_forward_refs(SimulationTestModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/simulation_tool_mock_behavior_config.py000066400000000000000000000025351523660243400337220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .mock_no_match_behavior import MockNoMatchBehavior from .mocking_strategy import MockingStrategy class SimulationToolMockBehaviorConfig(UncheckedBaseModel): """ Simulation/preview-side config: tools are identified by IDs, resolved to names at runtime. """ mocking_strategy: typing.Optional[MockingStrategy] = pydantic.Field(default=None) """ Which tools to mock: 'all' mocks every mockable tool, 'selected' mocks only those in mocked_tool_names/mocked_tool_ids, 'none' disables mocking. """ fallback_strategy: typing.Optional[MockNoMatchBehavior] = pydantic.Field(default=None) """ Behavior when no mock matches a tool call. """ mocked_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Tool IDs to mock. Resolved to tool names before being passed to the orchestrator. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/single_languages_response.py000066400000000000000000000013041523660243400315020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .language_info import LanguageInfo class SingleLanguagesResponse(UncheckedBaseModel): languages: typing.List[LanguageInfo] = pydantic.Field() """ The list of available languages. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/single_test_run_request_model.py000066400000000000000000000023561523660243400324210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SingleTestRunRequestModel(UncheckedBaseModel): test_id: str = pydantic.Field() """ ID of the test to run """ workflow_node_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the workflow node to run the test on. If not provided, the test will be run on the agent's default workflow node. """ root_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the root folder to run the test on. If not provided, the test will be run on the agent's default folder. """ root_folder_name: typing.Optional[str] = pydantic.Field(default=None) """ Name of the root folder to run the test on. If not provided, the test will be run on the agent's default folder. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/single_use_token_response_model.py000066400000000000000000000012731523660243400327150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SingleUseTokenResponseModel(UncheckedBaseModel): token: str = pydantic.Field() """ A time bound single use token that expires after 15 minutes. Will be consumed on use. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/single_use_token_type.py000066400000000000000000000003021523660243400306500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SingleUseTokenType = typing.Union[typing.Literal["realtime_scribe", "batch_scribe", "tts_websocket"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_log_message.py000066400000000000000000000015071523660243400274220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sip_log_message_direction import SipLogMessageDirection class SipLogMessage(UncheckedBaseModel): call_id: str phone_numbers: typing.List[str] local_address: str remote_address: str transport: str raw_message: str error_message: str direction: SipLogMessageDirection created_at_unix_micro: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_log_message_direction.py000066400000000000000000000002371523660243400314610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SipLogMessageDirection = typing.Union[typing.Literal["in", "out"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_media_encryption_enum.py000066400000000000000000000002651523660243400315120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SipMediaEncryptionEnum = typing.Union[typing.Literal["disabled", "allowed", "required"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_trunk_credentials_request_model.py000066400000000000000000000014231523660243400336020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SipTrunkCredentialsRequestModel(UncheckedBaseModel): username: str = pydantic.Field() """ SIP trunk username """ password: typing.Optional[str] = pydantic.Field(default=None) """ SIP trunk password - if not specified, then remain unchanged """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_trunk_outbound_call_response.py000066400000000000000000000012611523660243400331250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SipTrunkOutboundCallResponse(UncheckedBaseModel): success: bool message: str conversation_id: typing.Optional[str] = None sip_call_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_trunk_transport_enum.py000066400000000000000000000002561523660243400314400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SipTrunkTransportEnum = typing.Union[typing.Literal["auto", "udp", "tcp", "tls"], typing.Any] sip_uri_dynamic_variable_transfer_destination.py000066400000000000000000000011151523660243400355260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SipUriDynamicVariableTransferDestination(UncheckedBaseModel): sip_uri: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sip_uri_transfer_destination.py000066400000000000000000000010761523660243400322420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SipUriTransferDestination(UncheckedBaseModel): sip_uri: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/skip_turn_tool_config.py000066400000000000000000000021751523660243400306640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SkipTurnToolConfig(UncheckedBaseModel): """ Allows the agent to explicitly skip its turn. This tool should be invoked by the LLM when the user indicates they would like to think or take a short pause before continuing the conversation—e.g. when they say: "Give me a second", "Let me think", or "One moment please". After calling this tool, the assistant should not speak until the user speaks again, or another normal turn-taking condition is met. The tool itself has no parameters and performs no side-effects other than informing the backend that the current turn generation is complete. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/skip_turn_tool_response_model.py000066400000000000000000000012231523660243400324260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SkipTurnToolResponseModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/slack_bot_auth_response.py000066400000000000000000000020551523660243400311610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class SlackBotAuthResponse(UncheckedBaseModel): """ Response model for the internal Slack BYO bot auth connection. """ name: str provider: typing.Optional[typing.Literal["Slack"]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/smb_client_access_config.py000066400000000000000000000014501523660243400312440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SmbClientAccessConfig(UncheckedBaseModel): enable_secure_mode: typing.Optional[bool] = None identity_verification_enabled: typing.Optional[bool] = None identity_verification_email_enabled: typing.Optional[bool] = None identity_verification_sms_enabled: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sms_conversation_info.py000066400000000000000000000014411523660243400306660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .sms_conversation_info_direction import SmsConversationInfoDirection class SmsConversationInfo(UncheckedBaseModel): direction: SmsConversationInfoDirection phone_number_id: typing.Optional[str] = None sms_user_phone_number: str agent_phone_number: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sms_conversation_info_direction.py000066400000000000000000000002571523660243400327320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SmsConversationInfoDirection = typing.Union[typing.Literal["inbound", "outbound"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/soft_timeout_config.py000066400000000000000000000050661523660243400303340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SoftTimeoutConfig(UncheckedBaseModel): """ Configuration for soft timeout functionality during LLM response generation. """ timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before showing the predefined message while waiting for LLM response. Set to -1 to disable. """ message: typing.Optional[str] = pydantic.Field(default=None) """ Message to show when the first soft timeout is reached while waiting for LLM response. Supports dynamic variables (e.g., {{system__time}}, {{custom_variable}}). """ additional_soft_timeout_messages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Extra static filler messages for subsequent soft timeouts in the same LLM generation. The first timeout uses `message`. If fewer messages are configured than `max_soft_timeouts_per_generation`, the last configured message is repeated; otherwise a built-in filler is used. """ use_llm_generated_message: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled, the soft timeout message will be generated dynamically instead of using the static message. """ randomize_fillers: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled, shuffle the order of static soft timeout messages once at the start of each turn. Only applies when use_llm_generated_message is false. """ max_soft_timeouts_per_generation: typing.Optional[int] = pydantic.Field(default=None) """ Maximum filler messages while waiting for a single LLM response. Fires every timeout_seconds until the LLM streams content or this limit is reached. """ llm_generated_message_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for generating the soft timeout filler message when use_llm_generated_message is enabled. Recent conversation context is provided as a separate user message. If not set, the default prompt will be used. Supports dynamic variables (e.g., {{system__time}}, {{custom_variable}}). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/soft_timeout_config_override.py000066400000000000000000000014431523660243400322260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SoftTimeoutConfigOverride(UncheckedBaseModel): message: typing.Optional[str] = pydantic.Field(default=None) """ Message to show when the first soft timeout is reached while waiting for LLM response. Supports dynamic variables (e.g., {{system__time}}, {{custom_variable}}). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/soft_timeout_config_override_config.py000066400000000000000000000012701523660243400335510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SoftTimeoutConfigOverrideConfig(UncheckedBaseModel): message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the message field. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/soft_timeout_config_workflow_override.py000066400000000000000000000047441523660243400341670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SoftTimeoutConfigWorkflowOverride(UncheckedBaseModel): timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) """ Time in seconds before showing the predefined message while waiting for LLM response. Set to -1 to disable. """ message: typing.Optional[str] = pydantic.Field(default=None) """ Message to show when the first soft timeout is reached while waiting for LLM response. Supports dynamic variables (e.g., {{system__time}}, {{custom_variable}}). """ additional_soft_timeout_messages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Extra static filler messages for subsequent soft timeouts in the same LLM generation. The first timeout uses `message`. If fewer messages are configured than `max_soft_timeouts_per_generation`, the last configured message is repeated; otherwise a built-in filler is used. """ use_llm_generated_message: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled, the soft timeout message will be generated dynamically instead of using the static message. """ randomize_fillers: typing.Optional[bool] = pydantic.Field(default=None) """ If enabled, shuffle the order of static soft timeout messages once at the start of each turn. Only applies when use_llm_generated_message is false. """ max_soft_timeouts_per_generation: typing.Optional[int] = pydantic.Field(default=None) """ Maximum filler messages while waiting for a single LLM response. Fires every timeout_seconds until the LLM streams content or this limit is reached. """ llm_generated_message_prompt_override: typing.Optional[str] = pydantic.Field(default=None) """ Custom prompt for generating the soft timeout filler message when use_llm_generated_message is enabled. Recent conversation context is provided as a separate user message. If not set, the default prompt will be used. Supports dynamic variables (e.g., {{system__time}}, {{custom_variable}}). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/song_metadata.py000066400000000000000000000020651523660243400270700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SongMetadata(UncheckedBaseModel): title: typing.Optional[str] = pydantic.Field(default=None) """ The title of the song """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the song """ genres: typing.List[str] = pydantic.Field() """ The genres of the song """ languages: typing.List[str] = pydantic.Field() """ The languages of the song """ is_explicit: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the song is explicit """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/song_section.py000066400000000000000000000030371523660243400267540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .section_source import SectionSource class SongSection(UncheckedBaseModel): section_name: str = pydantic.Field() """ The name of the section. Must be between 1 and 100 characters. """ positive_local_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should be present in this section. Use English language for best result. """ negative_local_styles: typing.List[str] = pydantic.Field() """ The styles and musical directions that should not be present in this section. Use English language for best result. """ duration_ms: int = pydantic.Field() """ The duration of the section in milliseconds. Must be between 3000ms and 120000ms. """ lines: typing.List[str] = pydantic.Field() """ The lyrics of the section. Max 30 lines per section and max 200 characters per line. """ source_from: typing.Optional[SectionSource] = pydantic.Field(default=None) """ Optional source to extract the section from. Used for inpainting. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/song_source_context.py000066400000000000000000000017011523660243400303500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SongSourceContext(UncheckedBaseModel): song_id: str chat_id: typing.Optional[str] = None title: typing.Optional[str] = None description: typing.Optional[str] = None genres: typing.Optional[typing.List[str]] = None languages: typing.Optional[typing.List[str]] = None is_explicit: typing.Optional[bool] = None bpm: typing.Optional[int] = None generation_settings: typing.Optional[typing.Dict[str, typing.Any]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sort_direction.py000066400000000000000000000002301523660243400273010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SortDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_audio_response_model.py000066400000000000000000000015051523660243400321710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeakerAudioResponseModel(UncheckedBaseModel): audio_base_64: str = pydantic.Field() """ The base64 encoded audio. """ media_type: str = pydantic.Field() """ The media type of the audio. """ duration_secs: float = pydantic.Field() """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_created_response.py000066400000000000000000000011171523660243400313160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeakerCreatedResponse(UncheckedBaseModel): version: int speaker_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_response_model.py000066400000000000000000000017001523660243400310050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .utterance_response_model import UtteranceResponseModel class SpeakerResponseModel(UncheckedBaseModel): 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_segment.py000066400000000000000000000014441523660243400274360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbed_segment import DubbedSegment from .segment_subtitle_frame import SegmentSubtitleFrame class SpeakerSegment(UncheckedBaseModel): id: str start_time: float end_time: float text: str subtitles: typing.List[SegmentSubtitleFrame] dubs: typing.Dict[str, DubbedSegment] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_separation_response_model.py000066400000000000000000000024351523660243400332400ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speaker_response_model import SpeakerResponseModel from .speaker_separation_response_model_status import SpeakerSeparationResponseModelStatus class SpeakerSeparationResponseModel(UncheckedBaseModel): 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow speaker_separation_response_model_status.py000066400000000000000000000003271523660243400345620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing SpeakerSeparationResponseModelStatus = typing.Union[ typing.Literal["not_started", "pending", "completed", "failed"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_track.py000066400000000000000000000013431523660243400270760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dubbing_media_reference import DubbingMediaReference class SpeakerTrack(UncheckedBaseModel): id: str media_ref: DubbingMediaReference speaker_name: str voices: typing.Dict[str, str] segments: typing.List[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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speaker_updated_response.py000066400000000000000000000010731523660243400313360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeakerUpdatedResponse(UncheckedBaseModel): version: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_engine_config.py000066400000000000000000000016761523660243400304120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speech_engine_config_request_headers_value import SpeechEngineConfigRequestHeadersValue class SpeechEngineConfig(UncheckedBaseModel): ws_url: str = pydantic.Field() """ The WebSocket URL for the transcript server """ request_headers: typing.Optional[typing.Dict[str, SpeechEngineConfigRequestHeadersValue]] = pydantic.Field( default=None ) """ Headers to include in the WebSocket connection request """ 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 speech_engine_config_request_headers_value.py000066400000000000000000000004531523660243400347620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_secret_locator import ConvAiSecretLocator SpeechEngineConfigRequestHeadersValue = typing.Union[str, ConvAiSecretLocator, ConvAiDynamicVariable] speech_engine_conversation_initiation_client_data_config.py000066400000000000000000000013341523660243400376720ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeechEngineConversationInitiationClientDataConfig(UncheckedBaseModel): first_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the first message can be overridden by the client """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_engine_response.py000066400000000000000000000060501523660243400307720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_call_limits import AgentCallLimits from .agent_metadata_db_model import AgentMetadataDbModel from .asr_conversational_config import AsrConversationalConfig from .base_turn_config import BaseTurnConfig from .conversation_config_output import ConversationConfigOutput from .privacy_config_output import PrivacyConfigOutput from .resource_access_info import ResourceAccessInfo from .speech_engine_config import SpeechEngineConfig from .speech_engine_conversation_initiation_client_data_config import SpeechEngineConversationInitiationClientDataConfig from .tts_conversational_config_output import TtsConversationalConfigOutput from .vad_config import VadConfig class SpeechEngineResponse(UncheckedBaseModel): speech_engine_id: str = pydantic.Field() """ The speech engine resource ID """ name: str = pydantic.Field() """ Human-readable name for the speech engine """ speech_engine: SpeechEngineConfig = pydantic.Field() """ WebSocket connection settings for the upstream transcript server """ asr: AsrConversationalConfig = pydantic.Field() """ Automatic speech recognition configuration """ tts: TtsConversationalConfigOutput = pydantic.Field() """ Text-to-speech output configuration """ turn: BaseTurnConfig = pydantic.Field() """ Turn detection configuration """ vad: VadConfig = pydantic.Field() """ Configuration for voice activity detection """ conversation: ConversationConfigOutput = pydantic.Field() """ Conversation-level settings including client events and duration limits """ privacy: PrivacyConfigOutput = pydantic.Field() """ Privacy settings controlling recording, retention, and PII handling """ call_limits: AgentCallLimits = pydantic.Field() """ Concurrency and daily conversation limits for this speech engine """ language: str = pydantic.Field() """ ISO language code used by the speech engine (e.g. 'en') """ tags: typing.List[str] = pydantic.Field() """ Arbitrary tags for categorization and filtering """ overrides: SpeechEngineConversationInitiationClientDataConfig = pydantic.Field() """ Override settings the client may set during conversation initiation """ metadata: AgentMetadataDbModel = pydantic.Field() """ Creation and update timestamps with source information """ access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the speech engine for the user """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_engine_summary_response.py000066400000000000000000000021771523660243400325550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .resource_access_info import ResourceAccessInfo class SpeechEngineSummaryResponse(UncheckedBaseModel): speech_engine_id: str = pydantic.Field() """ The speech engine resource ID """ name: str = pydantic.Field() """ Human-readable name for the speech engine """ created_at_unix_secs: int = pydantic.Field() """ Creation time in Unix seconds """ tags: typing.List[str] = pydantic.Field() """ Arbitrary tags for categorization and filtering """ access_info: ResourceAccessInfo = pydantic.Field() """ The access information of the speech engine for the user """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_history_item_response.py000066400000000000000000000064131523660243400322470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dialogue_input_response_model import DialogueInputResponseModel from .history_alignments_response_model import HistoryAlignmentsResponseModel from .speech_history_item_response_source import SpeechHistoryItemResponseSource from .speech_history_item_response_voice_category import SpeechHistoryItemResponseVoiceCategory class SpeechHistoryItemResponse(UncheckedBaseModel): history_item_id: str = pydantic.Field() """ The ID of the history item. """ request_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the request. """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the voice used. """ model_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the model. """ voice_name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the voice. """ voice_category: typing.Optional[SpeechHistoryItemResponseVoiceCategory] = pydantic.Field(default=None) """ The category of the voice. Either 'premade', 'cloned', 'generated' or 'professional'. """ text: typing.Optional[str] = pydantic.Field(default=None) """ The text used to generate the audio item. """ date_unix: int = pydantic.Field() """ Unix timestamp of when the item was created. """ character_count_change_from: int = pydantic.Field() """ The character count change from. """ character_count_change_to: int = pydantic.Field() """ The character count change to. """ content_type: str = pydantic.Field() """ The content type of the generated item. """ state: typing.Any settings: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ The settings of the history item. """ share_link_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the share link. """ source: typing.Optional[SpeechHistoryItemResponseSource] = pydantic.Field(default=None) """ The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing, PlayAPI, PD (pronunciation dictionary) or ConvAI (Agents Platform). """ alignments: typing.Optional[HistoryAlignmentsResponseModel] = pydantic.Field(default=None) """ The alignments of the history item. """ dialogue: typing.Optional[typing.List[DialogueInputResponseModel]] = pydantic.Field(default=None) """ The dialogue (voice and text pairs) used to generate the audio item. If this is set then the top level `text` and `voice_id` fields will be empty. """ output_format: typing.Optional[str] = pydantic.Field(default=None) """ The output format the audio was originally generated in. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_history_item_response_source.py000066400000000000000000000004371523660243400336270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SpeechHistoryItemResponseSource = typing.Union[ typing.Literal[ "TTS", "STS", "Projects", "PD", "AN", "Dubbing", "PlayAPI", "ConvAI", "VoiceGeneration", "InVPC", "Flows" ], typing.Any, ] speech_history_item_response_voice_category.py000066400000000000000000000003321523660243400352440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing SpeechHistoryItemResponseVoiceCategory = typing.Union[ typing.Literal["premade", "cloned", "generated", "professional"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_to_text_character_response_model.py000066400000000000000000000016171523660243400344130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeechToTextCharacterResponseModel(UncheckedBaseModel): text: str = pydantic.Field() """ The character that was transcribed. """ start: typing.Optional[float] = pydantic.Field(default=None) """ The start time of the character in seconds. """ end: typing.Optional[float] = pydantic.Field(default=None) """ The end time of the character 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_to_text_chunk_response_model.py000066400000000000000000000042171523660243400335660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .additional_format_response_model import AdditionalFormatResponseModel from .detected_entity import DetectedEntity from .speech_to_text_word_response_model import SpeechToTextWordResponseModel class SpeechToTextChunkResponseModel(UncheckedBaseModel): """ Chunk-level detail of the transcription with timing information. """ language_code: str = pydantic.Field() """ The detected language code (e.g. 'eng' for English). """ language_probability: float = pydantic.Field() """ The confidence score of the language detection (0 to 1). """ text: str = pydantic.Field() """ The raw text of the transcription. """ words: typing.List[SpeechToTextWordResponseModel] = pydantic.Field() """ List of words with their timing information. """ channel_index: typing.Optional[int] = pydantic.Field(default=None) """ The channel index this transcript belongs to (for multichannel audio). """ additional_formats: typing.Optional[typing.List[typing.Optional[AdditionalFormatResponseModel]]] = pydantic.Field( default=None ) """ Requested additional formats of the transcript. """ transcription_id: typing.Optional[str] = pydantic.Field(default=None) """ The transcription ID of the response. """ entities: typing.Optional[typing.List[DetectedEntity]] = pydantic.Field(default=None) """ List of detected entities with their text, type, and character positions in the transcript. """ audio_duration_secs: typing.Optional[float] = pydantic.Field(default=None) """ The duration of the audio that was transcribed 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_to_text_webhook_response_model.py000066400000000000000000000016021523660243400341070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SpeechToTextWebhookResponseModel(UncheckedBaseModel): message: str = pydantic.Field() """ The message of the webhook response. """ request_id: str = pydantic.Field() """ The request ID of the webhook response. """ transcription_id: typing.Optional[str] = pydantic.Field(default=None) """ The transcription ID of the webhook response. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_to_text_word_response_model.py000066400000000000000000000041251523660243400334270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speech_to_text_character_response_model import SpeechToTextCharacterResponseModel from .speech_to_text_word_response_model_type import SpeechToTextWordResponseModelType class SpeechToTextWordResponseModel(UncheckedBaseModel): """ Word-level detail of the transcription with timing information. """ text: str = pydantic.Field() """ The word or sound that was transcribed. """ start: typing.Optional[float] = pydantic.Field(default=None) """ The start time of the word or sound in seconds. """ end: typing.Optional[float] = pydantic.Field(default=None) """ The end time of the word or sound in seconds. """ type: SpeechToTextWordResponseModelType = pydantic.Field() """ The type of the word or sound. 'audio_event' is used for non-word sounds like laughter or footsteps. """ speaker_id: typing.Optional[str] = pydantic.Field(default=None) """ Unique identifier for the speaker of this word. """ logprob: float = pydantic.Field() """ The log of the probability with which this word was predicted. Logprobs are in range [-infinity, 0], higher logprobs indicate a higher confidence the model has in its predictions. """ characters: typing.Optional[typing.List[SpeechToTextCharacterResponseModel]] = pydantic.Field(default=None) """ The characters that make up the word and their timing information. """ channel_index: typing.Optional[int] = pydantic.Field(default=None) """ The channel this word was spoken on (for multichannel audio). Null for single-channel transcriptions. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/speech_to_text_word_response_model_type.py000066400000000000000000000002771523660243400344740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SpeechToTextWordResponseModelType = typing.Union[typing.Literal["word", "spacing", "audio_event"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/spelling_patience.py000066400000000000000000000002331523660243400277420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SpellingPatience = typing.Union[typing.Literal["auto", "off"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/srt_export_options.py000066400000000000000000000015661523660243400302530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SrtExportOptions(UncheckedBaseModel): max_characters_per_line: typing.Optional[int] = None 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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/start_procedure_tool_config_input.py000066400000000000000000000013031523660243400332620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_at_version_input import ProcedureAtVersionInput class StartProcedureToolConfigInput(UncheckedBaseModel): procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionInput]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/start_procedure_tool_config_output.py000066400000000000000000000013071523660243400334670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .procedure_at_version_output import ProcedureAtVersionOutput class StartProcedureToolConfigOutput(UncheckedBaseModel): procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionOutput]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/start_procedure_tool_error_status.py000066400000000000000000000003101523660243400333270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing StartProcedureToolErrorStatus = typing.Union[typing.Literal["not_found", "invalid_name", "already_active"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/start_pvc_voice_training_response_model.py000066400000000000000000000014261523660243400344450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/start_speaker_separation_response_model.py000066400000000000000000000014271523660243400344550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/status_id.py000066400000000000000000000001201523660243400262470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. StatusId = int streaming_audio_chunk_with_timestamps_and_voice_segments_response_model.py000066400000000000000000000026741523660243400430660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_response_model import CharacterAlignmentResponseModel from .voice_segment import VoiceSegment class StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel(UncheckedBaseModel): audio_base_64: typing_extensions.Annotated[ str, FieldMetadata(alias="audio_base64"), pydantic.Field(alias="audio_base64", description="Base64 encoded audio data"), ] alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the original text """ normalized_alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the normalized text """ voice_segments: typing.List[VoiceSegment] = pydantic.Field() """ Voice segments for the audio """ 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 streaming_audio_chunk_with_timestamps_response.py000066400000000000000000000024141523660243400357620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .character_alignment_response_model import CharacterAlignmentResponseModel class StreamingAudioChunkWithTimestampsResponse(UncheckedBaseModel): audio_base_64: typing_extensions.Annotated[ str, FieldMetadata(alias="audio_base64"), pydantic.Field(alias="audio_base64", description="Base64 encoded audio data"), ] alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the original text """ normalized_alignment: typing.Optional[CharacterAlignmentResponseModel] = pydantic.Field(default=None) """ Timestamp information for each character in the normalized text """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_agent_settings_model.py000066400000000000000000000013211523660243400320410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .studio_agent_tool_settings_model import StudioAgentToolSettingsModel class StudioAgentSettingsModel(UncheckedBaseModel): tool_settings: typing.Optional[typing.Dict[str, StudioAgentToolSettingsModel]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_agent_tool_settings_model.py000066400000000000000000000011441523660243400331010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class StudioAgentToolSettingsModel(UncheckedBaseModel): skip_confirmation: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_clip_reference.py000066400000000000000000000014531523660243400306160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .studio_clip_reference_clip_type import StudioClipReferenceClipType class StudioClipReference(UncheckedBaseModel): project_id: str chapter_id: str clip_type: StudioClipReferenceClipType clip_id: str block_id: typing.Optional[str] = None preview_url: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_clip_reference_clip_type.py000066400000000000000000000003071523660243400326630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing StudioClipReferenceClipType = typing.Union[typing.Literal["video", "image", "external_audio", "tts_node"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_text_style_outline_model.py000066400000000000000000000011641523660243400327730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class StudioTextStyleOutlineModel(UncheckedBaseModel): enabled: bool color: str opacity: float width: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/studio_text_style_shadow_model.py000066400000000000000000000012321523660243400325750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class StudioTextStyleShadowModel(UncheckedBaseModel): enabled: bool color: str opacity: float blur: float offset_x: float offset_y: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sub_agent_input.py000066400000000000000000000027641523660243400274560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class SubAgentInput(UncheckedBaseModel): agent_id: str branch_id: typing.Optional[str] = None description: str parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = 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 from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( SubAgentInput, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/sub_agent_output.py000066400000000000000000000030071523660243400276460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class SubAgentOutput(UncheckedBaseModel): agent_id: str branch_id: typing.Optional[str] = None description: str parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = 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 from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( SubAgentOutput, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subagent_run_result_details.py000066400000000000000000000012131523660243400320530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SubagentRunResultDetails(UncheckedBaseModel): sub_conversation_id: typing.Optional[str] = None agent_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/submit_business_info_params.py000066400000000000000000000013441523660243400320550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SubmitBusinessInfoParams(UncheckedBaseModel): """ Finalize the onboarding interview: create a text knowledge source and mark done. """ smb_tool_type: typing.Optional[typing.Literal["submit_business_info"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/submit_order_response.py000066400000000000000000000016741523660243400307030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .order_id import OrderId from .order_state import OrderState class SubmitOrderResponse(UncheckedBaseModel): order_id: OrderId = pydantic.Field() """ The ID of the submitted order. """ state: OrderState = pydantic.Field() """ The current state of the order after submission. """ submitted_at: dt.datetime = pydantic.Field() """ The timestamp when the order was submitted. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subscription.py000066400000000000000000000127601523660243400270110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .billing_period import BillingPeriod from .character_refresh_period import CharacterRefreshPeriod from .currency import Currency from .invoice_response import InvoiceResponse from .price import Price from .subscription_max_credit_limit_extension import SubscriptionMaxCreditLimitExtension from .subscription_pending_change import SubscriptionPendingChange from .subscription_status_type import SubscriptionStatusType class Subscription(UncheckedBaseModel): tier: str = pydantic.Field() """ The tier of the user's subscription. """ character_count: int = pydantic.Field() """ The number of characters used by the user. """ character_limit: int = pydantic.Field() """ The maximum number of characters allowed in the current billing period. """ max_character_limit_extension: typing.Optional[int] = pydantic.Field(default=None) """ Deprecated: use `max_credit_limit_extension`. Maximum number of characters that the character limit can be exceeded by. Managed by the workspace admin. """ max_credit_limit_extension: SubscriptionMaxCreditLimitExtension = pydantic.Field() """ Maximum number of credits that the credit limit can be exceeded by. Managed by the workspace admin. `"unlimited"` means no cap, `0` means usage-based billing is disabled. """ can_extend_character_limit: bool = pydantic.Field() """ Whether the workspace is entitled to enter overages (usage-based billing). """ allowed_to_extend_character_limit: bool = pydantic.Field() """ Deprecated: use `max_credit_limit_extension != 0`. Whether the user is allowed to extend their character limit. """ next_character_count_reset_unix: typing.Optional[int] = pydantic.Field(default=None) """ The Unix timestamp of the next character count reset. """ voice_slots_used: int = pydantic.Field() """ The number of voice slots used by the user. """ professional_voice_slots_used: int = pydantic.Field() """ The number of professional voice slots used. For consolidated billing this is the group-wide count across all workspaces in the group; see professional_voice_slots_used_in_workspace for the current workspace only. """ professional_voice_slots_used_in_workspace: int = pydantic.Field() """ The number of professional voice slots used in the current workspace. For consolidated billing, professional_voice_slots_used counts across all workspaces in the group, while this counts only the current workspace. """ voice_limit: int = pydantic.Field() """ The maximum number of voice slots allowed for the user. """ max_voice_add_edits: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of voice add/edits allowed for the user. """ voice_add_edit_counter: int = pydantic.Field() """ The number of voice add/edits used by the user. """ professional_voice_limit: int = pydantic.Field() """ The maximum number of professional voices allowed for the user. """ can_extend_voice_limit: bool = pydantic.Field() """ Whether the user can extend their voice limit. """ can_use_instant_voice_cloning: bool = pydantic.Field() """ Whether the user can use instant voice cloning. """ can_use_professional_voice_cloning: bool = pydantic.Field() """ Whether the user can use professional voice cloning. """ currency: typing.Optional[Currency] = pydantic.Field(default=None) """ The currency of the user's subscription. """ current_overage: Price = pydantic.Field() """ The current usage-based overage cost. """ status: SubscriptionStatusType = pydantic.Field() """ The status of the user's subscription. """ billing_period: typing.Optional[BillingPeriod] = pydantic.Field(default=None) """ The billing period of the user's subscription. """ character_refresh_period: typing.Optional[CharacterRefreshPeriod] = pydantic.Field(default=None) """ The character refresh period of the user's subscription. """ next_invoice: typing.Optional[InvoiceResponse] = pydantic.Field(default=None) """ The next invoice for the user. """ open_invoices: typing.List[InvoiceResponse] = pydantic.Field() """ The open invoices for the user. """ has_open_invoices: bool = pydantic.Field() """ Whether the user has open invoices. """ pending_change: typing.Optional[SubscriptionPendingChange] = pydantic.Field(default=None) """ The pending change for the user. """ has_used_starter_coupon_on_account: typing.Optional[bool] = pydantic.Field(default=None) """ True if any workspace owned by this user's auth account has redeemed the starter first-month discount coupon. """ has_used_creator_coupon_on_account: typing.Optional[bool] = pydantic.Field(default=None) """ True if any workspace owned by this user's auth account has redeemed the creator first-month discount coupon. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subscription_max_credit_limit_extension.py000066400000000000000000000002451523660243400344750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SubscriptionMaxCreditLimitExtension = typing.Union[int, typing.Literal["unlimited"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subscription_pending_change.py000066400000000000000000000005651523660243400320220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .pending_cancellation_response_model import PendingCancellationResponseModel from .pending_subscription_switch_response_model import PendingSubscriptionSwitchResponseModel SubscriptionPendingChange = typing.Union[PendingSubscriptionSwitchResponseModel, PendingCancellationResponseModel] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subscription_response.py000066400000000000000000000107461523660243400307310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .billing_period import BillingPeriod from .character_refresh_period import CharacterRefreshPeriod from .currency import Currency from .price import Price from .subscription_response_max_credit_limit_extension import SubscriptionResponseMaxCreditLimitExtension from .subscription_status_type import SubscriptionStatusType class SubscriptionResponse(UncheckedBaseModel): tier: str = pydantic.Field() """ The tier of the user's subscription. """ character_count: int = pydantic.Field() """ The number of characters used by the user. """ character_limit: int = pydantic.Field() """ The maximum number of characters allowed in the current billing period. """ max_character_limit_extension: typing.Optional[int] = pydantic.Field(default=None) """ Deprecated: use `max_credit_limit_extension`. Maximum number of characters that the character limit can be exceeded by. Managed by the workspace admin. """ max_credit_limit_extension: SubscriptionResponseMaxCreditLimitExtension = pydantic.Field() """ Maximum number of credits that the credit limit can be exceeded by. Managed by the workspace admin. `"unlimited"` means no cap, `0` means usage-based billing is disabled. """ can_extend_character_limit: bool = pydantic.Field() """ Whether the workspace is entitled to enter overages (usage-based billing). """ allowed_to_extend_character_limit: bool = pydantic.Field() """ Deprecated: use `max_credit_limit_extension != 0`. Whether the user is allowed to extend their character limit. """ next_character_count_reset_unix: typing.Optional[int] = pydantic.Field(default=None) """ The Unix timestamp of the next character count reset. """ voice_slots_used: int = pydantic.Field() """ The number of voice slots used by the user. """ professional_voice_slots_used: int = pydantic.Field() """ The number of professional voice slots used. For consolidated billing this is the group-wide count across all workspaces in the group; see professional_voice_slots_used_in_workspace for the current workspace only. """ professional_voice_slots_used_in_workspace: int = pydantic.Field() """ The number of professional voice slots used in the current workspace. For consolidated billing, professional_voice_slots_used counts across all workspaces in the group, while this counts only the current workspace. """ voice_limit: int = pydantic.Field() """ The maximum number of voice slots allowed for the user. """ max_voice_add_edits: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of voice add/edits allowed for the user. """ voice_add_edit_counter: int = pydantic.Field() """ The number of voice add/edits used by the user. """ professional_voice_limit: int = pydantic.Field() """ The maximum number of professional voices allowed for the user. """ can_extend_voice_limit: bool = pydantic.Field() """ Whether the user can extend their voice limit. """ can_use_instant_voice_cloning: bool = pydantic.Field() """ Whether the user can use instant voice cloning. """ can_use_professional_voice_cloning: bool = pydantic.Field() """ Whether the user can use professional voice cloning. """ currency: typing.Optional[Currency] = pydantic.Field(default=None) """ The currency of the user's subscription. """ current_overage: Price = pydantic.Field() """ The current usage-based overage cost. """ status: SubscriptionStatusType = pydantic.Field() """ The status of the user's subscription. """ billing_period: typing.Optional[BillingPeriod] = pydantic.Field(default=None) """ The billing period of the user's subscription. """ character_refresh_period: typing.Optional[CharacterRefreshPeriod] = pydantic.Field(default=None) """ The character refresh period of the user's subscription. """ 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 subscription_response_max_credit_limit_extension.py000066400000000000000000000002551523660243400363350ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing SubscriptionResponseMaxCreditLimitExtension = typing.Union[int, typing.Literal["unlimited"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subscription_status_type.py000066400000000000000000000003411523660243400314450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing SubscriptionStatusType = typing.Union[ typing.Literal["trialing", "active", "incomplete", "past_due", "free", "free_disabled"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/subtitle_order_item_request.py000066400000000000000000000031251523660243400320740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .cue_options_request import CueOptionsRequest from .media_id import MediaId class SubtitleOrderItemRequest(UncheckedBaseModel): media_ids: typing.List[MediaId] = pydantic.Field() """ The IDs of the uploaded media files to generate subtitles for. """ source_language: str = pydantic.Field() """ The language code of the source media (e.g. 'en', 'es'). """ destination_languages: typing.List[str] = pydantic.Field() """ List of target language codes. Subtitles will be generated for each media file in each destination language. """ cue_options: typing.Optional[CueOptionsRequest] = pydantic.Field(default=None) """ Formatting options for subtitle cues such as duration, line count, and character limits. """ sdh: typing.Optional[bool] = pydantic.Field(default=None) """ Whether subtitles should use SDH format, which includes descriptions for deaf and hard-of-hearing viewers. """ instructions: typing.Optional[str] = pydantic.Field(default=None) """ Optional free-text instructions for the subtitling team. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/suggested_audio_tag.py000066400000000000000000000014551523660243400302720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SuggestedAudioTag(UncheckedBaseModel): tag: str = pydantic.Field() """ Audio tag to use (for best performance, 1-2 words, e.g., 'happy', 'excited') """ description: typing.Optional[str] = pydantic.Field(default=None) """ Optional description of when to use this tag """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/supported_voice.py000066400000000000000000000020461523660243400274730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .tts_model_family import TtsModelFamily from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency class SupportedVoice(UncheckedBaseModel): label: str voice_id: str description: typing.Optional[str] = None language: typing.Optional[str] = None model_family: typing.Optional[TtsModelFamily] = None optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = None stability: typing.Optional[float] = None speed: typing.Optional[float] = None similarity_boost: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/system_evaluation_criteria.py000066400000000000000000000011561523660243400317170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class SystemEvaluationCriteria(UncheckedBaseModel): user_sentiment_score: float user_frustration_score: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/system_tool_config_input.py000066400000000000000000000077271523660243400314210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_input_params import SystemToolConfigInputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_interruption_mode import ToolInterruptionMode class SystemToolConfigInput(UncheckedBaseModel): """ A system tool is a tool that is used to call a system method in the server """ type: typing.Optional[typing.Literal["system"]] = pydantic.Field(default=None) """ The type of tool """ name: str description: typing.Optional[str] = pydantic.Field(default=None) """ Description of when the tool should be used and what it does. Leave empty to use the default description that's optimized for the specific tool type. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ params: SystemToolConfigInputParams 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 update_forward_refs(SystemToolConfigInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/system_tool_config_input_params.py000066400000000000000000000162671523660243400327630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .agent_transfer_input import AgentTransferInput from .phone_number_transfer import PhoneNumberTransfer from .procedure_at_version_input import ProcedureAtVersionInput from .search_strategy import SearchStrategy from .sub_agent_input import SubAgentInput 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_EndProcedure(UncheckedBaseModel): system_tool_type: typing.Literal["end_procedure"] = "end_procedure" procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionInput]] = 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 class SystemToolConfigInputParams_KnowledgeBase(UncheckedBaseModel): system_tool_type: typing.Literal["knowledge_base"] = "knowledge_base" enabled_strategies: typing.Optional[typing.List[SearchStrategy]] = 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 class SystemToolConfigInputParams_KnowledgeBaseRag(UncheckedBaseModel): system_tool_type: typing.Literal["knowledge_base_rag"] = "knowledge_base_rag" 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" only_at_conversation_start: typing.Optional[bool] = 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 class SystemToolConfigInputParams_PlayKeypadTouchTone(UncheckedBaseModel): system_tool_type: typing.Literal["play_keypad_touch_tone"] = "play_keypad_touch_tone" use_out_of_band_dtmf: typing.Optional[bool] = None suppress_turn_after_dtmf: typing.Optional[bool] = 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 class SystemToolConfigInputParams_RunSubagent(UncheckedBaseModel): system_tool_type: typing.Literal["run_subagent"] = "run_subagent" agents: typing.List[SubAgentInput] 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_SkipTurn(UncheckedBaseModel): system_tool_type: typing.Literal["skip_turn"] = "skip_turn" 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_StartProcedure(UncheckedBaseModel): system_tool_type: typing.Literal["start_procedure"] = "start_procedure" procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionInput]] = 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 class SystemToolConfigInputParams_TransferToAgent(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_agent"] = "transfer_to_agent" transfers: typing.List[AgentTransferInput] 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_TransferToNumber(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_number"] = "transfer_to_number" transfers: typing.List[PhoneNumberTransfer] enable_client_message: typing.Optional[bool] = 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 class SystemToolConfigInputParams_VoicemailDetection(UncheckedBaseModel): system_tool_type: typing.Literal["voicemail_detection"] = "voicemail_detection" voicemail_message: 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 SystemToolConfigInputParams = typing_extensions.Annotated[ typing.Union[ SystemToolConfigInputParams_EndCall, SystemToolConfigInputParams_EndProcedure, SystemToolConfigInputParams_KnowledgeBase, SystemToolConfigInputParams_KnowledgeBaseRag, SystemToolConfigInputParams_LanguageDetection, SystemToolConfigInputParams_PlayKeypadTouchTone, SystemToolConfigInputParams_RunSubagent, SystemToolConfigInputParams_SkipTurn, SystemToolConfigInputParams_StartProcedure, SystemToolConfigInputParams_TransferToAgent, SystemToolConfigInputParams_TransferToNumber, SystemToolConfigInputParams_VoicemailDetection, ], UnionMetadata(discriminant="system_tool_type"), ] update_forward_refs(SystemToolConfigInputParams_RunSubagent) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/system_tool_config_output.py000066400000000000000000000077341523660243400316200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_output_params import SystemToolConfigOutputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_interruption_mode import ToolInterruptionMode class SystemToolConfigOutput(UncheckedBaseModel): """ A system tool is a tool that is used to call a system method in the server """ type: typing.Optional[typing.Literal["system"]] = pydantic.Field(default=None) """ The type of tool """ name: str description: typing.Optional[str] = pydantic.Field(default=None) """ Description of when the tool should be used and what it does. Leave empty to use the default description that's optimized for the specific tool type. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ 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 update_forward_refs(SystemToolConfigOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/system_tool_config_output_params.py000066400000000000000000000163331523660243400331560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .agent_transfer_output import AgentTransferOutput from .phone_number_transfer import PhoneNumberTransfer from .procedure_at_version_output import ProcedureAtVersionOutput from .search_strategy import SearchStrategy from .sub_agent_output import SubAgentOutput 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_EndProcedure(UncheckedBaseModel): system_tool_type: typing.Literal["end_procedure"] = "end_procedure" procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionOutput]] = 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 class SystemToolConfigOutputParams_KnowledgeBase(UncheckedBaseModel): system_tool_type: typing.Literal["knowledge_base"] = "knowledge_base" enabled_strategies: typing.Optional[typing.List[SearchStrategy]] = 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 class SystemToolConfigOutputParams_KnowledgeBaseRag(UncheckedBaseModel): system_tool_type: typing.Literal["knowledge_base_rag"] = "knowledge_base_rag" 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" only_at_conversation_start: typing.Optional[bool] = 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 class SystemToolConfigOutputParams_PlayKeypadTouchTone(UncheckedBaseModel): system_tool_type: typing.Literal["play_keypad_touch_tone"] = "play_keypad_touch_tone" use_out_of_band_dtmf: typing.Optional[bool] = None suppress_turn_after_dtmf: typing.Optional[bool] = 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 class SystemToolConfigOutputParams_RunSubagent(UncheckedBaseModel): system_tool_type: typing.Literal["run_subagent"] = "run_subagent" agents: typing.List[SubAgentOutput] 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_SkipTurn(UncheckedBaseModel): system_tool_type: typing.Literal["skip_turn"] = "skip_turn" 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_StartProcedure(UncheckedBaseModel): system_tool_type: typing.Literal["start_procedure"] = "start_procedure" procedures: typing.Optional[typing.Dict[str, ProcedureAtVersionOutput]] = 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 class SystemToolConfigOutputParams_TransferToAgent(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_agent"] = "transfer_to_agent" transfers: typing.List[AgentTransferOutput] 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_TransferToNumber(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_number"] = "transfer_to_number" transfers: typing.List[PhoneNumberTransfer] enable_client_message: typing.Optional[bool] = 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 class SystemToolConfigOutputParams_VoicemailDetection(UncheckedBaseModel): system_tool_type: typing.Literal["voicemail_detection"] = "voicemail_detection" voicemail_message: 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 SystemToolConfigOutputParams = typing_extensions.Annotated[ typing.Union[ SystemToolConfigOutputParams_EndCall, SystemToolConfigOutputParams_EndProcedure, SystemToolConfigOutputParams_KnowledgeBase, SystemToolConfigOutputParams_KnowledgeBaseRag, SystemToolConfigOutputParams_LanguageDetection, SystemToolConfigOutputParams_PlayKeypadTouchTone, SystemToolConfigOutputParams_RunSubagent, SystemToolConfigOutputParams_SkipTurn, SystemToolConfigOutputParams_StartProcedure, SystemToolConfigOutputParams_TransferToAgent, SystemToolConfigOutputParams_TransferToNumber, SystemToolConfigOutputParams_VoicemailDetection, ], UnionMetadata(discriminant="system_tool_type"), ] update_forward_refs(SystemToolConfigOutputParams_RunSubagent) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/telephony_call_config.py000066400000000000000000000020021523660243400306000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TelephonyCallConfig(UncheckedBaseModel): ringing_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ How long to ring the recipient before giving up, in seconds. Note that this will also be limited by the provider's own constraints. """ twilio_call_recording_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to record the call using Twilio call recording. Ignored for non-Twilio providers. Recordings are stored in your Twilio account. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/telephony_direction.py000066400000000000000000000002451523660243400303270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TelephonyDirection = typing.Union[typing.Literal["inbound", "outbound"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/telephony_provider.py000066400000000000000000000002561523660243400302030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TelephonyProvider = typing.Union[typing.Literal["twilio", "sip_trunk", "exotel"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_condition_rationale_common_model.py000066400000000000000000000017121523660243400340730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TestConditionRationaleCommonModel(UncheckedBaseModel): """ Structured rationale for test condition results containing individual failure/success reasons. """ messages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of individual parameter evaluation messages or reasons """ summary: typing.Optional[str] = pydantic.Field(default=None) """ High-level summary of the evaluation result """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_condition_result_common_model.py000066400000000000000000000014631523660243400334360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .evaluation_success_result import EvaluationSuccessResult from .test_condition_rationale_common_model import TestConditionRationaleCommonModel class TestConditionResultCommonModel(UncheckedBaseModel): result: EvaluationSuccessResult rationale: typing.Optional[TestConditionRationaleCommonModel] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_from_conversation_metadata_input.py000066400000000000000000000020121523660243400341250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput class TestFromConversationMetadataInput(UncheckedBaseModel): conversation_id: str agent_id: str branch_id: typing.Optional[str] = None workflow_node_id: typing.Optional[str] = None original_agent_reply: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = 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 update_forward_refs(TestFromConversationMetadataInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_from_conversation_metadata_output.py000066400000000000000000000020171523660243400343330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput class TestFromConversationMetadataOutput(UncheckedBaseModel): conversation_id: str agent_id: str branch_id: typing.Optional[str] = None workflow_node_id: typing.Optional[str] = None original_agent_reply: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = 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 update_forward_refs(TestFromConversationMetadataOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_invocation_summary_response_model.py000066400000000000000000000036061523660243400343470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .resource_access_info import ResourceAccessInfo class TestInvocationSummaryResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the test invocation """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the agent this test invocation belongs to """ branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the branch this test invocation was run on """ created_at_unix_secs: int = pydantic.Field() """ Creation time of the test invocation in unix seconds """ test_run_count: int = pydantic.Field() """ Number of test runs in this invocation """ passed_count: int = pydantic.Field() """ Number of test runs that passed """ failed_count: int = pydantic.Field() """ Number of test runs that failed """ pending_count: int = pydantic.Field() """ Number of test runs that are pending """ title: str = pydantic.Field() """ Title of the test invocation - either the single test name or count of tests """ access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the test invocation """ repeat_count: typing.Optional[int] = pydantic.Field(default=None) """ Number of times each test was repeated in this invocation """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_run_metadata.py000066400000000000000000000013471523660243400277670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .test_run_metadata_test_type import TestRunMetadataTestType class TestRunMetadata(UncheckedBaseModel): workspace_id: str test_name: str ran_by_user_email: str test_type: typing.Optional[TestRunMetadataTestType] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_run_metadata_test_type.py000066400000000000000000000002651523660243400320650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TestRunMetadataTestType = typing.Union[typing.Literal["llm", "tool_call", "simulation"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_run_result_bucket.py000066400000000000000000000015461523660243400310630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .test_run_status import TestRunStatus class TestRunResultBucket(UncheckedBaseModel): test_run_ids: typing.List[str] title: str = pydantic.Field() """ Short one-line title for this bucket """ reason: str = pydantic.Field() """ Short summary of why the test runs in this bucket passed or failed """ status: TestRunStatus 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_run_result_summary.py000066400000000000000000000013441523660243400312770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .test_run_result_bucket import TestRunResultBucket class TestRunResultSummary(UncheckedBaseModel): test_id: str test_name: str workflow_node_id: typing.Optional[str] = None buckets: typing.List[TestRunResultBucket] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_run_status.py000066400000000000000000000002501523660243400275220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TestRunStatus = typing.Union[typing.Literal["pending", "passed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_sharing_mode.py000066400000000000000000000002441523660243400277550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TestSharingMode = typing.Union[typing.Literal["all", "shared_with_me"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_tool_result_model.py000066400000000000000000000012151523660243400310500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TestToolResultModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/test_type.py000066400000000000000000000002531523660243400262770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TestType = typing.Union[typing.Literal["llm", "tool", "simulation", "folder"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tests_feature_usage_common_model.py000066400000000000000000000013311523660243400330460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TestsFeatureUsageCommonModel(UncheckedBaseModel): enabled: typing.Optional[bool] = None tests_ran_after_last_modification: typing.Optional[bool] = None tests_ran_in_last_7_days: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_normalisation_type.py000066400000000000000000000002601523660243400312410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TextNormalisationType = typing.Union[typing.Literal["system_prompt", "elevenlabs"], typing.Any] text_to_dialogue_websocket_apply_text_normalization_enum.py000066400000000000000000000002721523660243400400510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing TextToDialogueWebsocketApplyTextNormalizationEnum = typing.Union[typing.Literal["on", "off"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_dialogue_websocket_audio_chunk.py000066400000000000000000000023361523660243400342410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dialogue_text_alignment import DialogueTextAlignment class TextToDialogueWebsocketAudioChunk(UncheckedBaseModel): """ Server chunk containing encoded audio and optional alignment metadata. """ audio: typing.Optional[str] = pydantic.Field(default=None) """ Base64-encoded audio bytes for the selected `output_format`. """ alignment: typing.Optional[DialogueTextAlignment] = pydantic.Field(default=None) """ Present when `sync_alignment` query parameter is `true` and the model returned timing data for the chunk. """ normalized_alignment: typing.Optional[DialogueTextAlignment] = pydantic.Field(default=None) """ Reserved for future use; currently unused by the server. """ 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 text_to_dialogue_websocket_audio_chunk_multi.py000066400000000000000000000025741523660243400354000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .dialogue_text_alignment import DialogueTextAlignment class TextToDialogueWebsocketAudioChunkMulti(UncheckedBaseModel): """ Server chunk containing encoded audio for a specific context and optional alignment metadata. """ audio: typing.Optional[str] = pydantic.Field(default=None) """ Base64-encoded audio bytes for the selected `output_format`. """ alignment: typing.Optional[DialogueTextAlignment] = pydantic.Field(default=None) """ Present when `sync_alignment` query parameter is `true` and the model returned timing data for the chunk. """ normalized_alignment: typing.Optional[DialogueTextAlignment] = pydantic.Field(default=None) """ Reserved for future use; currently unused by the server. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ The context this audio chunk belongs to. """ 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 text_to_dialogue_websocket_client_message.py000066400000000000000000000057401523660243400346550ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .text_to_dialogue_websocket_voice_input import TextToDialogueWebsocketVoiceInput from .text_to_dialogue_websocket_voice_settings import TextToDialogueWebsocketVoiceSettings class TextToDialogueWebsocketClientMessage(UncheckedBaseModel): """ All fields are optional unless noted for the **first** message. **First message requirements** - `voices`: non-empty array of voice IDs (maximum 10 for `eleven_v3`; exactly 1 for `eleven_v3_conversational`). - Credentials if not supplied via `xi-api-key` / `Authorization` headers or `single_use_token` query parameter. **Subsequent messages** - Do not resend `voices`, `pronunciation_dictionary_locators`, or credential fields. """ inputs: typing.Optional[typing.List[TextToDialogueWebsocketVoiceInput]] = pydantic.Field(default=None) """ Dialogue lines to append for synthesis. """ flush: typing.Optional[bool] = pydantic.Field(default=None) """ Force generation of buffered text without closing the connection. """ close_socket: typing.Optional[bool] = pydantic.Field(default=None) """ Flush buffers, emit remaining audio, send `is_final`, and close the WebSocket. """ keep_alive: typing.Optional[bool] = pydantic.Field(default=None) """ Resets the 20s inactivity timer; performs no synthesis. """ xi_api_key: typing.Optional[str] = pydantic.Field(default=None) """ API key for the first message if not provided via the `xi-api-key` header. """ authorization: typing.Optional[str] = pydantic.Field(default=None) """ Bearer token for the first message if not provided via the `Authorization` header. """ single_use_token: typing.Optional[str] = pydantic.Field(default=None) """ Single-use token for the first message if not provided via the `single_use_token` query parameter. """ voices: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Voice IDs to load for the session (first message only, required on first message). """ voice_settings: typing.Optional[TextToDialogueWebsocketVoiceSettings] = pydantic.Field(default=None) """ Optional voice settings (first message only). """ pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional pronunciation dictionaries (first message only). """ 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 text_to_dialogue_websocket_client_message_multi.py000066400000000000000000000076201523660243400360660ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .text_to_dialogue_websocket_voice_input import TextToDialogueWebsocketVoiceInput from .text_to_dialogue_websocket_voice_settings import TextToDialogueWebsocketVoiceSettings class TextToDialogueWebsocketClientMessageMulti(UncheckedBaseModel): """ All fields are optional unless noted for a context's **first** message. **Every message** - `context_id` is required, except on a message containing only `close_socket`. **First message for a context** - `voices`: non-empty array of voice IDs (maximum 10 per context for `eleven_v3`; exactly 1 for `eleven_v3_conversational`). - Credentials if not supplied via `xi-api-key` / `Authorization` headers or `single_use_token` query parameter (accepted on the first message of the connection only). **Subsequent messages for a context** - Do not resend `voices`, `voice_settings`, `pronunciation_dictionary_locators`, or credential fields. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ Identifier for an independent dialogue stream within the socket. The first message with a new `context_id` creates that context. Required on every message except one containing only `close_socket`. """ inputs: typing.Optional[typing.List[TextToDialogueWebsocketVoiceInput]] = pydantic.Field(default=None) """ Dialogue lines to append to this context for synthesis. Each `voice_id` must be registered for this context. """ flush: typing.Optional[bool] = pydantic.Field(default=None) """ Force generation of this context's buffered text without closing it. """ close_context: typing.Optional[bool] = pydantic.Field(default=None) """ Flush this context's remaining audio, emit its `is_final` message, and close it. Other contexts stay open. """ close_socket: typing.Optional[bool] = pydantic.Field(default=None) """ Flush all contexts, emit their remaining audio and `is_final` messages, and close the WebSocket. """ keep_alive: typing.Optional[bool] = pydantic.Field(default=None) """ Resets this context's 20s inactivity timer; performs no synthesis. """ xi_api_key: typing.Optional[str] = pydantic.Field(default=None) """ API key for the first message of the connection if not provided via the `xi-api-key` header. """ authorization: typing.Optional[str] = pydantic.Field(default=None) """ Bearer token for the first message of the connection if not provided via the `Authorization` header. """ single_use_token: typing.Optional[str] = pydantic.Field(default=None) """ Single-use token for the first message of the connection if not provided via the `single_use_token` query parameter. """ voices: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Voice IDs to load for this context (first message for the context only, required on that message). """ voice_settings: typing.Optional[TextToDialogueWebsocketVoiceSettings] = pydantic.Field(default=None) """ Optional voice settings for this context (first message for the context only). """ pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional pronunciation dictionaries for this context (first message for the context only). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_dialogue_websocket_error.py000066400000000000000000000017741523660243400331060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketError(UncheckedBaseModel): message: str = pydantic.Field() """ Human-readable error description. """ error: str = pydantic.Field() """ Machine-readable error identifier (for example `authentication_required`). """ code: int = pydantic.Field() """ WebSocket close code that will follow this payload. """ param: typing.Optional[str] = pydantic.Field(default=None) """ Field name related to the error, when applicable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_dialogue_websocket_final.py000066400000000000000000000012631523660243400330370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketFinal(UncheckedBaseModel): is_final: typing.Literal[True] = pydantic.Field(default=True) """ Marks the end of the closing flush sequence. """ 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 text_to_dialogue_websocket_final_audio_for_turn.py000066400000000000000000000013411523660243400360540ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketFinalAudioForTurn(UncheckedBaseModel): is_final_audio_for_turn: typing.Optional[bool] = pydantic.Field(default=None) """ Indicates that the final audio for a given turn has been sent. """ 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 text_to_dialogue_websocket_final_audio_for_turn_multi.py000066400000000000000000000015641523660243400372750ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketFinalAudioForTurnMulti(UncheckedBaseModel): is_final_audio_for_turn: typing.Optional[bool] = pydantic.Field(default=None) """ Indicates that the final audio for a given turn of this context has been sent. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ The context whose turn has finished. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_dialogue_websocket_final_multi.py000066400000000000000000000015011523660243400342440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketFinalMulti(UncheckedBaseModel): is_final: typing.Literal[True] = pydantic.Field(default=True) """ Marks the end of this context's closing flush sequence. """ context_id: typing.Optional[str] = pydantic.Field(default=None) """ The context that has been finalized. """ 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 text_to_dialogue_websocket_output_format_enum.py000066400000000000000000000012321523660243400356170ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing TextToDialogueWebsocketOutputFormatEnum = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_dialogue_websocket_voice_input.py000066400000000000000000000020231523660243400342650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketVoiceInput(UncheckedBaseModel): text: str = pydantic.Field() """ Text appended for this voice. Buffered with prior text until the server triggers generation. """ voice_id: str = pydantic.Field() """ Must be one of the IDs from the initial `voices` array. """ new_turn: typing.Optional[bool] = pydantic.Field(default=None) """ When `true`, the server finalizes the current pending segment (as if the speaker finished their turn) before applying this input. """ 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 text_to_dialogue_websocket_voice_settings.py000066400000000000000000000017371523660243400347220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TextToDialogueWebsocketVoiceSettings(UncheckedBaseModel): """ Voice settings for dialogue generation. Only `stability` is supported for `eleven_v3` dialogue models. """ stability: typing.Optional[float] = pydantic.Field(default=None) """ Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion. """ 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 text_to_speech_apply_text_normalization_enum.py000066400000000000000000000002671523660243400354650ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechApplyTextNormalizationEnum = typing.Union[typing.Literal["auto", "on", "off"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_speech_output_format_enum.py000066400000000000000000000011151523660243400333060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechOutputFormatEnum = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "ulaw_8000", "alaw_8000", "opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_speech_request.py000066400000000000000000000001611523660243400310420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_speech_stream_request.py000066400000000000000000000001671523660243400324230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechStreamRequest = typing.Any text_to_speech_stream_with_timestamps_request.py000066400000000000000000000002051523660243400356360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechStreamWithTimestampsRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/text_to_speech_with_timestamps_request.py000066400000000000000000000001771523660243400343520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TextToSpeechWithTimestampsRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/threshold_guardrail.py000066400000000000000000000012001523660243400302760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ThresholdGuardrail(UncheckedBaseModel): is_enabled: typing.Optional[bool] = None threshold: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/time_range.py000066400000000000000000000010771523660243400263760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TimeRange(UncheckedBaseModel): start_ms: int end_ms: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/to_dialogue_settings_response_model.py000066400000000000000000000016101523660243400335660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ToDialogueSettingsResponseModel(UncheckedBaseModel): stability: typing.Optional[float] = pydantic.Field(default=None) """ Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion. """ speed: typing.Optional[float] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/token_response_model.py000066400000000000000000000011161523660243400304740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TokenResponseModel(UncheckedBaseModel): token: str conversation_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool.py000066400000000000000000000030551523660243400252370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .icon import Icon from .tool_annotations import ToolAnnotations from .tool_execution import ToolExecution class Tool(UncheckedBaseModel): """ Definition for a tool the client can call. """ name: str title: typing.Optional[str] = None description: typing.Optional[str] = None input_schema: typing_extensions.Annotated[ typing.Dict[str, typing.Any], FieldMetadata(alias="inputSchema"), pydantic.Field(alias="inputSchema") ] output_schema: typing_extensions.Annotated[ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="outputSchema"), pydantic.Field(alias="outputSchema"), ] = None icons: typing.Optional[typing.List[Icon]] = None annotations: typing.Optional[ToolAnnotations] = None meta: typing_extensions.Annotated[ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="_meta"), pydantic.Field(alias="_meta") ] = None execution: typing.Optional[ToolExecution] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_annotations.py000066400000000000000000000032671523660243400276610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class ToolAnnotations(UncheckedBaseModel): """ Additional properties describing a Tool to clients. NOTE: all properties in ToolAnnotations are **hints**. They are not guaranteed to provide a faithful description of tool behavior (including descriptive properties like `title`). Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers. """ title: typing.Optional[str] = None read_only_hint: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="readOnlyHint"), pydantic.Field(alias="readOnlyHint") ] = None destructive_hint: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="destructiveHint"), pydantic.Field(alias="destructiveHint") ] = None idempotent_hint: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="idempotentHint"), pydantic.Field(alias="idempotentHint") ] = None open_world_hint: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="openWorldHint"), pydantic.Field(alias="openWorldHint") ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_call_sound_behavior.py000066400000000000000000000002431523660243400313150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolCallSoundBehavior = typing.Union[typing.Literal["auto", "always"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_call_sound_type.py000066400000000000000000000003211523660243400304740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolCallSoundType = typing.Union[ typing.Literal["typing", "elevator1", "elevator2", "elevator3", "elevator4"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_call_unit_test_model.py000066400000000000000000000042421523660243400315070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput class ToolCallUnitTestModel(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = pydantic.Field(default=None) """ How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. """ check_any_tool_matches: typing.Optional[bool] = pydantic.Field(default=None) """ If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. """ 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 update_forward_refs(ToolCallUnitTestModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_error_handling_mode.py000066400000000000000000000002761523660243400313220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolErrorHandlingMode = typing.Union[typing.Literal["auto", "summarized", "passthrough", "hide"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_execution.py000066400000000000000000000016611523660243400273230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .tool_execution_task_support import ToolExecutionTaskSupport class ToolExecution(UncheckedBaseModel): """ Execution-related properties for a tool. """ task_support: typing_extensions.Annotated[ typing.Optional[ToolExecutionTaskSupport], FieldMetadata(alias="taskSupport"), pydantic.Field(alias="taskSupport"), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_execution_mode.py000066400000000000000000000002671523660243400303300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolExecutionMode = typing.Union[typing.Literal["immediate", "post_tool_speech", "async"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_execution_response_model.py000066400000000000000000000043231523660243400324170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .tool_execution_response_model_tool_call_details import ToolExecutionResponseModelToolCallDetails class ToolExecutionResponseModel(UncheckedBaseModel): tool_id: str = pydantic.Field() """ The ID of the tool that was executed """ tool_request_id: str = pydantic.Field() """ The request/call ID associated with this tool execution """ conversation_id: str = pydantic.Field() """ The ID of the conversation where the tool was executed """ agent_id: str = pydantic.Field() """ The ID of the agent that ran the tool """ branch_id: typing.Optional[str] = pydantic.Field(default=None) """ The branch ID if the agent has branches """ timestamp: float = pydantic.Field() """ Unix timestamp when the tool was executed """ latency_secs: float = pydantic.Field() """ How long the tool execution took """ is_error: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the tool execution failed """ request_payload: typing.Optional[str] = pydantic.Field(default=None) """ LLM-extracted parameters sent to the tool (JSON string) """ response_payload: typing.Optional[str] = pydantic.Field(default=None) """ Response returned by the tool """ error_message: typing.Optional[str] = pydantic.Field(default=None) """ Error message if the tool execution failed """ error_type: typing.Optional[str] = pydantic.Field(default=None) """ Error category (internal, customer_config, customer_auth, external_server, external_client, client_timeout, unknown) """ id: str tool_call_details: typing.Optional[ToolExecutionResponseModelToolCallDetails] = 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 tool_execution_response_model_tool_call_details.py000066400000000000000000000062741523660243400361040ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversation_history_transcript_tool_call_webhook_details import ( ConversationHistoryTranscriptToolCallWebhookDetails, ) class ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook(UncheckedBaseModel): type: typing.Literal["api_integration_webhook"] = "api_integration_webhook" integration_id: str credential_id: str integration_connection_id: str webhook_details: ConversationHistoryTranscriptToolCallWebhookDetails 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 ToolExecutionResponseModelToolCallDetails_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 ToolExecutionResponseModelToolCallDetails_Mcp(UncheckedBaseModel): type: typing.Literal["mcp"] = "mcp" mcp_server_id: str mcp_server_name: str integration_type: str parameters: typing.Optional[typing.Dict[str, str]] = None approval_policy: str requires_approval: typing.Optional[bool] = None mcp_tool_name: typing.Optional[str] = None mcp_tool_description: 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 class ToolExecutionResponseModelToolCallDetails_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 ToolExecutionResponseModelToolCallDetails = typing_extensions.Annotated[ typing.Union[ ToolExecutionResponseModelToolCallDetails_ApiIntegrationWebhook, ToolExecutionResponseModelToolCallDetails_Client, ToolExecutionResponseModelToolCallDetails_Mcp, ToolExecutionResponseModelToolCallDetails_Webhook, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_execution_task_support.py000066400000000000000000000002711523660243400321350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolExecutionTaskSupport = typing.Union[typing.Literal["forbidden", "optional", "required"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_interruption_mode.py000066400000000000000000000003261523660243400310630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolInterruptionMode = typing.Union[ typing.Literal["allow", "disable_during_tool", "disable_during_tool_and_turn"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_mock_config.py000066400000000000000000000012131523660243400275670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ToolMockConfig(UncheckedBaseModel): default_return_value: typing.Optional[str] = None default_is_error: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_request_model.py000066400000000000000000000021431523660243400301640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .tool_request_model_tool_config import ToolRequestModelToolConfig from .tool_response_mock_config_input import ToolResponseMockConfigInput class ToolRequestModel(UncheckedBaseModel): tool_config: ToolRequestModelToolConfig = pydantic.Field() """ Configuration for the tool """ response_mocks: typing.Optional[typing.List[ToolResponseMockConfigInput]] = pydantic.Field(default=None) """ Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. """ 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 update_forward_refs(ToolRequestModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_request_model_tool_config.py000066400000000000000000000141051523660243400325470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_input_params import SystemToolConfigInputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput class ToolRequestModelToolConfig_Client(UncheckedBaseModel): """ Configuration for the tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class ToolRequestModelToolConfig_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class ToolRequestModelToolConfig_System(UncheckedBaseModel): """ Configuration for the tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None params: SystemToolConfigInputParams 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 ToolRequestModelToolConfig_Webhook(UncheckedBaseModel): """ Configuration for the tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigInput 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 ToolRequestModelToolConfig = typing_extensions.Annotated[ typing.Union[ ToolRequestModelToolConfig_Client, ToolRequestModelToolConfig_Mcp, ToolRequestModelToolConfig_System, ToolRequestModelToolConfig_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( ToolRequestModelToolConfig_Client, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) update_forward_refs(ToolRequestModelToolConfig_System) update_forward_refs(ToolRequestModelToolConfig_Webhook) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_response_mock_config_input.py000066400000000000000000000021341523660243400327270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .unit_test_tool_call_parameter import UnitTestToolCallParameter class ToolResponseMockConfigInput(UncheckedBaseModel): parameter_conditions: typing.Optional[typing.List[UnitTestToolCallParameter]] = pydantic.Field(default=None) """ If the list is empty, the mock will always activate. """ mock_result: str = pydantic.Field() """ The return value the LLM sees when this mock is active. """ is_error: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the mock result is surfaced to the LLM as a tool error rather than a successful result. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_response_mock_config_output.py000066400000000000000000000021351523660243400331310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .unit_test_tool_call_parameter import UnitTestToolCallParameter class ToolResponseMockConfigOutput(UncheckedBaseModel): parameter_conditions: typing.Optional[typing.List[UnitTestToolCallParameter]] = pydantic.Field(default=None) """ If the list is empty, the mock will always activate. """ mock_result: str = pydantic.Field() """ The return value the LLM sees when this mock is active. """ is_error: typing.Optional[bool] = pydantic.Field(default=None) """ If true, the mock result is surfaced to the LLM as a tool error rather than a successful result. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_response_model.py000066400000000000000000000024741523660243400303410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .resource_access_info import ResourceAccessInfo from .tool_response_mock_config_output import ToolResponseMockConfigOutput from .tool_response_model_tool_config import ToolResponseModelToolConfig from .tool_usage_stats_response_model import ToolUsageStatsResponseModel class ToolResponseModel(UncheckedBaseModel): id: str tool_config: ToolResponseModelToolConfig = pydantic.Field() """ The type of tool """ access_info: ResourceAccessInfo usage_stats: ToolUsageStatsResponseModel response_mocks: typing.Optional[typing.List[ToolResponseMockConfigOutput]] = pydantic.Field(default=None) """ Mock responses with optional parameter conditions. Evaluated top-to-bottom; first match wins. """ 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 update_forward_refs(ToolResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_response_model_tool_config.py000066400000000000000000000141121523660243400327130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .system_tool_config_output_params import SystemToolConfigOutputParams from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput class ToolResponseModelToolConfig_Client(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["client"] = "client" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None expects_response: typing.Optional[bool] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = 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 class ToolResponseModelToolConfig_Mcp(UncheckedBaseModel): value: typing.Any type: typing.Literal["mcp"] = "mcp" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 else: class Config: frozen = True smart_union = True class ToolResponseModelToolConfig_System(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["system"] = "system" name: str description: typing.Optional[str] = None response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None 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 class ToolResponseModelToolConfig_Webhook(UncheckedBaseModel): """ The type of tool """ type: typing.Literal["webhook"] = "webhook" name: str description: str response_timeout_secs: typing.Optional[int] = None disable_interruptions: typing.Optional[bool] = None interruption_mode: typing.Optional[ToolInterruptionMode] = None force_pre_tool_speech: typing.Optional[bool] = None pre_tool_speech: typing.Optional[PreToolSpeechMode] = None assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = None tool_call_sound: typing.Optional[ToolCallSoundType] = None tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = None tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None execution_mode: typing.Optional[ToolExecutionMode] = None api_schema: WebhookToolApiSchemaConfigOutput 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 ToolResponseModelToolConfig = typing_extensions.Annotated[ typing.Union[ ToolResponseModelToolConfig_Client, ToolResponseModelToolConfig_Mcp, ToolResponseModelToolConfig_System, ToolResponseModelToolConfig_Webhook, ], UnionMetadata(discriminant="type"), ] from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( ToolResponseModelToolConfig_Client, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) update_forward_refs(ToolResponseModelToolConfig_System) update_forward_refs(ToolResponseModelToolConfig_Webhook) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_sort_by.py000066400000000000000000000002341523660243400267740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolSortBy = typing.Union[typing.Literal["name", "created_at"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_type.py000066400000000000000000000004101523660243400262700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolType = typing.Union[ typing.Literal[ "system", "webhook", "client", "mcp", "workflow", "api_integration_webhook", "api_integration_mcp", "smb" ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_type_filter.py000066400000000000000000000002721523660243400276430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ToolTypeFilter = typing.Union[typing.Literal["webhook", "client", "api_integration_webhook"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tool_usage_stats_response_model.py000066400000000000000000000013131523660243400327320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ToolUsageStatsResponseModel(UncheckedBaseModel): total_calls: typing.Optional[int] = pydantic.Field(default=None) """ The total number of calls to the tool """ avg_latency_secs: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tools_response_model.py000066400000000000000000000014461523660243400305220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .tool_response_model import ToolResponseModel class ToolsResponseModel(UncheckedBaseModel): tools: typing.List[ToolResponseModel] next_cursor: typing.Optional[str] = None has_more: bool 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 update_forward_refs(ToolsResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/topic_discovery_settings.py000066400000000000000000000013241523660243400314040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TopicDiscoverySettings(UncheckedBaseModel): """ Per-agent topic-discovery configuration. Cadence and analysis window are managed internally; this only exposes the customer-facing on/off toggle. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/topic_evaluation_criteria_aggregate.py000066400000000000000000000013261523660243400335160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TopicEvaluationCriteriaAggregate(UncheckedBaseModel): criteria_id: str success_count: typing.Optional[int] = None failure_count: typing.Optional[int] = None unknown_count: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/topic_metrics_aggregate.py000066400000000000000000000016141523660243400311330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .topic_evaluation_criteria_aggregate import TopicEvaluationCriteriaAggregate from .topic_sentiment_aggregate import TopicSentimentAggregate class TopicMetricsAggregate(UncheckedBaseModel): conversation_count: typing.Optional[int] = None sentiment: typing.Optional[TopicSentimentAggregate] = None evaluation_criteria: typing.Optional[typing.List[TopicEvaluationCriteriaAggregate]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/topic_sentiment_aggregate.py000066400000000000000000000016151523660243400314740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .numeric_distribution_aggregate import NumericDistributionAggregate class TopicSentimentAggregate(UncheckedBaseModel): sentiment: typing.Optional[NumericDistributionAggregate] = None frustration: typing.Optional[NumericDistributionAggregate] = None positive_count: typing.Optional[int] = None neutral_count: typing.Optional[int] = None negative_count: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transcript_message.py000066400000000000000000000015361523660243400301610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transcript_message_role import TranscriptMessageRole class TranscriptMessage(UncheckedBaseModel): """ A single turn in the conversation history. """ role: TranscriptMessageRole = pydantic.Field() """ The speaker for this turn. """ content: str = pydantic.Field() """ The transcript text for this turn. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transcript_message_role.py000066400000000000000000000002421523660243400311730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TranscriptMessageRole = typing.Union[typing.Literal["user", "agent"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transcription_order_item_request.py000066400000000000000000000021701523660243400331370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .media_id import MediaId class TranscriptionOrderItemRequest(UncheckedBaseModel): media_ids: typing.List[MediaId] = pydantic.Field() """ The IDs of the uploaded media files to transcribe. """ source_language: str = pydantic.Field() """ The language code of the source media (e.g. 'en', 'es'). """ verbatim: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to transcribe every word exactly, including filler words. """ instructions: typing.Optional[str] = pydantic.Field(default=None) """ Optional free-text instructions for the transcription team. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transcription_word.py000066400000000000000000000027301523660243400302130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transcription_word_type import TranscriptionWordType class TranscriptionWord(UncheckedBaseModel): """ Word-level transcription data with timing information. """ text: typing.Optional[str] = pydantic.Field(default=None) """ The transcribed word. """ start: typing.Optional[float] = pydantic.Field(default=None) """ Start time in seconds. """ end: typing.Optional[float] = pydantic.Field(default=None) """ End time in seconds. """ type: typing.Optional[TranscriptionWordType] = pydantic.Field(default=None) """ The type of word. """ speaker_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the speaker if available. """ logprob: typing.Optional[float] = pydantic.Field(default=None) """ Confidence score for this word. """ characters: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The characters in the word. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transcription_word_type.py000066400000000000000000000002441523660243400312520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TranscriptionWordType = typing.Union[typing.Literal["word", "spacing"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_branch_info_defaulting_to_main.py000066400000000000000000000011111523660243400343350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferBranchInfoDefaultingToMain(UncheckedBaseModel): branch_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_branch_info_traffic_split.py000066400000000000000000000011431523660243400333430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferBranchInfoTrafficSplit(UncheckedBaseModel): branch_id: str traffic_percentage: float 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_to_agent_tool_config_input.py000066400000000000000000000012261523660243400335650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_transfer_input import AgentTransferInput class TransferToAgentToolConfigInput(UncheckedBaseModel): transfers: typing.List[AgentTransferInput] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_to_agent_tool_config_output.py000066400000000000000000000012321523660243400337630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_transfer_output import AgentTransferOutput class TransferToAgentToolConfigOutput(UncheckedBaseModel): transfers: typing.List[AgentTransferOutput] 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 transfer_to_agent_tool_result_error_model.py000066400000000000000000000012261523660243400347310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferToAgentToolResultErrorModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["error"]] = None from_agent: str error: 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 transfer_to_agent_tool_result_success_model_input.py000066400000000000000000000022521523660243400364670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transfer_to_agent_tool_result_success_model_input_branch_info import ( TransferToAgentToolResultSuccessModelInputBranchInfo, ) class TransferToAgentToolResultSuccessModelInput(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None from_agent: str to_agent: str to_node: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None branch_info: typing.Optional[TransferToAgentToolResultSuccessModelInputBranchInfo] = None preserve_client_tts_overrides: typing.Optional[bool] = 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 transfer_to_agent_tool_result_success_model_input_branch_info.py000066400000000000000000000030761523660243400410240ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain(UncheckedBaseModel): branch_reason: typing.Literal["defaulting_to_main"] = "defaulting_to_main" branch_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 class TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit(UncheckedBaseModel): branch_reason: typing.Literal["traffic_split"] = "traffic_split" branch_id: str traffic_percentage: float 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 TransferToAgentToolResultSuccessModelInputBranchInfo = typing_extensions.Annotated[ typing.Union[ TransferToAgentToolResultSuccessModelInputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelInputBranchInfo_TrafficSplit, ], UnionMetadata(discriminant="branch_reason"), ] transfer_to_agent_tool_result_success_model_output.py000066400000000000000000000022561523660243400366740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transfer_to_agent_tool_result_success_model_output_branch_info import ( TransferToAgentToolResultSuccessModelOutputBranchInfo, ) class TransferToAgentToolResultSuccessModelOutput(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None from_agent: str to_agent: str to_node: typing.Optional[str] = None condition: str delay_ms: typing.Optional[int] = None transfer_message: typing.Optional[str] = None enable_transferred_agent_first_message: typing.Optional[bool] = None branch_info: typing.Optional[TransferToAgentToolResultSuccessModelOutputBranchInfo] = None preserve_client_tts_overrides: typing.Optional[bool] = 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 transfer_to_agent_tool_result_success_model_output_branch_info.py000066400000000000000000000031031523660243400412140ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain(UncheckedBaseModel): branch_reason: typing.Literal["defaulting_to_main"] = "defaulting_to_main" branch_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 class TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit(UncheckedBaseModel): branch_reason: typing.Literal["traffic_split"] = "traffic_split" branch_id: str traffic_percentage: float 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 TransferToAgentToolResultSuccessModelOutputBranchInfo = typing_extensions.Annotated[ typing.Union[ TransferToAgentToolResultSuccessModelOutputBranchInfo_DefaultingToMain, TransferToAgentToolResultSuccessModelOutputBranchInfo_TrafficSplit, ], UnionMetadata(discriminant="branch_reason"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_to_number_result_error_model.py000066400000000000000000000012501523660243400341420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferToNumberResultErrorModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["error"]] = None error: str details: 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 transfer_to_number_result_exotel_success_model.py000066400000000000000000000014201523660243400357610ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferToNumberResultExotelSuccessModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None agent_message: typing.Optional[str] = None note: 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 transfer_to_number_result_sip_success_model.py000066400000000000000000000013361523660243400352620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferToNumberResultSipSuccessModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None note: 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 transfer_to_number_result_twilio_success_model.py000066400000000000000000000015631523660243400360000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TransferToNumberResultTwilioSuccessModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None transfer_number: str reason: typing.Optional[str] = None client_message: typing.Optional[str] = None agent_message: str conference_name: str post_dial_digits: typing.Optional[str] = None note: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_to_number_tool_config_input.py000066400000000000000000000015611523660243400337610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .phone_number_transfer import PhoneNumberTransfer class TransferToNumberToolConfigInput(UncheckedBaseModel): transfers: typing.List[PhoneNumberTransfer] enable_client_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to play a message to the client while they wait for transfer. Defaults to true for backward compatibility. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_to_number_tool_config_output.py000066400000000000000000000015621523660243400341630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .phone_number_transfer import PhoneNumberTransfer class TransferToNumberToolConfigOutput(UncheckedBaseModel): transfers: typing.List[PhoneNumberTransfer] enable_client_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to play a message to the client while they wait for transfer. Defaults to true for backward compatibility. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/transfer_type_enum.py000066400000000000000000000002601523660243400301660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TransferTypeEnum = typing.Union[typing.Literal["blind", "conference", "sip_refer"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_audio_output_error.py000066400000000000000000000012121523660243400322620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateAudioOutputError(UncheckedBaseModel): message_type: typing.Literal["audio_output_error"] = "audio_output_error" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_audio_payload.py000066400000000000000000000016301523660243400311460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateAudioPayload(UncheckedBaseModel): """ Base64-encoded audio of the translated speech. """ message_type: typing.Literal["audio"] = pydantic.Field(default="audio") """ The message type identifier. """ data: str = pydantic.Field() """ Base64-encoded audio data. """ sample_rate: int = pydantic.Field() """ Sample rate of the audio in Hz. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_auth_error.py000066400000000000000000000011631523660243400305070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateAuthError(UncheckedBaseModel): message_type: typing.Literal["auth_error"] = "auth_error" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_end_of_stream_payload.py000066400000000000000000000014041523660243400326510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateEndOfStreamPayload(UncheckedBaseModel): """ Signal that the client has finished sending audio. """ message_type: typing.Literal["end_of_stream"] = pydantic.Field(default="end_of_stream") """ The message type identifier. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_error_payload.py000066400000000000000000000014471523660243400312040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateErrorPayload(UncheckedBaseModel): """ Error encountered during translation. """ message_type: typing.Literal["error"] = pydantic.Field(default="error") """ The message type identifier. """ error: str = pydantic.Field() """ Error message. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_final_transcript_payload.py000066400000000000000000000015271523660243400334140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateFinalTranscriptPayload(UncheckedBaseModel): """ Final transcription of a completed segment. """ message_type: typing.Literal["final_transcript"] = pydantic.Field(default="final_transcript") """ The message type identifier. """ text: str = pydantic.Field() """ Final transcription text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_input_audio_chunk_payload.py000066400000000000000000000016141523660243400335570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateInputAudioChunkPayload(UncheckedBaseModel): """ A chunk of audio to be translated. """ message_type: typing.Literal["input_audio_chunk"] = pydantic.Field(default="input_audio_chunk") """ The message type identifier. """ audio_base_64: str = pydantic.Field() """ Base64-encoded audio data. Recommended chunk size is around 100 ms of audio. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_input_error.py000066400000000000000000000011661523660243400307100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateInputError(UncheckedBaseModel): message_type: typing.Literal["input_error"] = "input_error" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_input_format_enum.py000066400000000000000000000003641523660243400320720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TranslateInputFormatEnum = typing.Union[ typing.Literal["pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "pcm_48000", "ulaw_8000"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_output_format_enum.py000066400000000000000000000006421523660243400322720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TranslateOutputFormatEnum = typing.Union[ typing.Literal[ "mp3_22050_32", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "ulaw_8000", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_partial_transcript_payload.py000066400000000000000000000015361523660243400337570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslatePartialTranscriptPayload(UncheckedBaseModel): """ Interim transcription of the source audio. """ message_type: typing.Literal["partial_transcript"] = pydantic.Field(default="partial_transcript") """ The message type identifier. """ text: str = pydantic.Field() """ Partial transcription text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_queue_overflow_error.py000066400000000000000000000012041523660243400326110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateQueueOverflowError(UncheckedBaseModel): message_type: typing.Literal["queue_overflow"] = "queue_overflow" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_rate_limited_error.py000066400000000000000000000011761523660243400322140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateRateLimitedError(UncheckedBaseModel): message_type: typing.Literal["rate_limited"] = "rate_limited" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_session_started_payload.py000066400000000000000000000020051523660243400332530ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateSessionStartedPayload(UncheckedBaseModel): """ Confirms the session has been initialized. """ message_type: typing.Literal["session_started"] = pydantic.Field(default="session_started") """ The message type identifier. """ session_id: str = pydantic.Field() """ Unique identifier for this session. """ client_session_id: typing.Optional[str] = pydantic.Field(default=None) """ Client-defined session identifier, if provided during connection. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_status_payload.py000066400000000000000000000015011523660243400313650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateStatusPayload(UncheckedBaseModel): """ Session lifecycle update. """ message_type: typing.Literal["status"] = pydantic.Field(default="status") """ The message type identifier. """ status: str = pydantic.Field() """ Current session status (`started` or `stopped`). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_transcriber_error.py000066400000000000000000000012101523660243400320550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateTranscriberError(UncheckedBaseModel): message_type: typing.Literal["transcriber_error"] = "transcriber_error" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_translation_error.py000066400000000000000000000012101523660243400320750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateTranslationError(UncheckedBaseModel): message_type: typing.Literal["translation_error"] = "translation_error" error: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translate_translation_payload.py000066400000000000000000000014741523660243400324110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslateTranslationPayload(UncheckedBaseModel): """ Translated text in the target language. """ message_type: typing.Literal["translation"] = pydantic.Field(default="translation") """ The message type identifier. """ text: str = pydantic.Field() """ Translated text. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/translated_string.py000066400000000000000000000010631523660243400300060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TranslatedString(UncheckedBaseModel): value: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/trigger_user_verification_params.py000066400000000000000000000012101523660243400330570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TriggerUserVerificationParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["trigger_user_verification"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/triggered_guardrail_common_model.py000066400000000000000000000012551523660243400330200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .guardrail_type import GuardrailType class TriggeredGuardrailCommonModel(UncheckedBaseModel): guardrail_type: GuardrailType guardrail_name: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_conversational_config_input.py000066400000000000000000000066311523660243400327520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .suggested_audio_tag import SuggestedAudioTag from .supported_voice import SupportedVoice from .text_normalisation_type import TextNormalisationType from .tts_conversational_model import TtsConversationalModel from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency from .tts_output_format import TtsOutputFormat class TtsConversationalConfigInput(UncheckedBaseModel): model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None) """ The model to use for TTS """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID to use for TTS """ supported_voices: typing.Optional[typing.List[SupportedVoice]] = pydantic.Field(default=None) """ Additional supported voices for the agent """ expressive_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, applies expressive audio tags prompt. Automatically disabled for non-v3 models. """ suggested_audio_tags: typing.Optional[typing.List[SuggestedAudioTag]] = pydantic.Field(default=None) """ Suggested audio tags to boost expressive speech (for eleven_v3 and eleven_v3_conversational models). The agent can still use other tags not listed here. """ agent_output_audio_format: typing.Optional[TtsOutputFormat] = pydantic.Field(default=None) """ The audio format to use for TTS """ optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = pydantic.Field(default=None) """ Deprecated: this field is a no-op and is ignored. """ stability: typing.Optional[float] = pydantic.Field(default=None) """ The stability of generated speech """ speed: typing.Optional[float] = pydantic.Field(default=None) """ The speed of generated speech """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ The similarity boost for generated speech """ text_normalisation_type: typing.Optional[TextNormalisationType] = pydantic.Field(default=None) """ Method for converting numbers to words before converting text to speech. If set to SYSTEM_PROMPT, the system prompt will be updated to include normalization instructions. If set to ELEVENLABS, the text will be normalized after generation, incurring slight additional latency. """ pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = ( pydantic.Field(default=None) ) """ The pronunciation dictionary locators """ enable_phoneme_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Opt-in to SSML phoneme tag handling for V3 models. When enabled, phoneme tags (inline and from pronunciation dictionaries) are parsed into inline IPA before being sent to the model. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_conversational_config_output.py000066400000000000000000000066321523660243400331540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .suggested_audio_tag import SuggestedAudioTag from .supported_voice import SupportedVoice from .text_normalisation_type import TextNormalisationType from .tts_conversational_model import TtsConversationalModel from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency from .tts_output_format import TtsOutputFormat class TtsConversationalConfigOutput(UncheckedBaseModel): model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None) """ The model to use for TTS """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID to use for TTS """ supported_voices: typing.Optional[typing.List[SupportedVoice]] = pydantic.Field(default=None) """ Additional supported voices for the agent """ expressive_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, applies expressive audio tags prompt. Automatically disabled for non-v3 models. """ suggested_audio_tags: typing.Optional[typing.List[SuggestedAudioTag]] = pydantic.Field(default=None) """ Suggested audio tags to boost expressive speech (for eleven_v3 and eleven_v3_conversational models). The agent can still use other tags not listed here. """ agent_output_audio_format: typing.Optional[TtsOutputFormat] = pydantic.Field(default=None) """ The audio format to use for TTS """ optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = pydantic.Field(default=None) """ Deprecated: this field is a no-op and is ignored. """ stability: typing.Optional[float] = pydantic.Field(default=None) """ The stability of generated speech """ speed: typing.Optional[float] = pydantic.Field(default=None) """ The speed of generated speech """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ The similarity boost for generated speech """ text_normalisation_type: typing.Optional[TextNormalisationType] = pydantic.Field(default=None) """ Method for converting numbers to words before converting text to speech. If set to SYSTEM_PROMPT, the system prompt will be updated to include normalization instructions. If set to ELEVENLABS, the text will be normalized after generation, incurring slight additional latency. """ pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = ( pydantic.Field(default=None) ) """ The pronunciation dictionary locators """ enable_phoneme_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Opt-in to SSML phoneme tag handling for V3 models. When enabled, phoneme tags (inline and from pronunciation dictionaries) are parsed into inline IPA before being sent to the model. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_conversational_config_override.py000066400000000000000000000030521523660243400334240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .tts_conversational_model import TtsConversationalModel class TtsConversationalConfigOverride(UncheckedBaseModel): model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None) """ The model to use for TTS """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID to use for TTS """ stability: typing.Optional[float] = pydantic.Field(default=None) """ The stability of generated speech """ speed: typing.Optional[float] = pydantic.Field(default=None) """ The speed of generated speech """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ The similarity boost for generated speech """ pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = ( pydantic.Field(default=None) ) """ The pronunciation dictionary locators """ 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 tts_conversational_config_override_config.py000066400000000000000000000026461523660243400347020ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TtsConversationalConfigOverrideConfig(UncheckedBaseModel): model_id: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the model_id field. """ voice_id: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the voice_id field. """ stability: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the stability field. """ speed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the speed field. """ similarity_boost: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the similarity_boost field. """ pronunciation_dictionary_locators: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow overriding the pronunciation_dictionary_locators field. """ 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 tts_conversational_config_workflow_override_input.py000066400000000000000000000066511523660243400365260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .suggested_audio_tag import SuggestedAudioTag from .supported_voice import SupportedVoice from .text_normalisation_type import TextNormalisationType from .tts_conversational_model import TtsConversationalModel from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency from .tts_output_format import TtsOutputFormat class TtsConversationalConfigWorkflowOverrideInput(UncheckedBaseModel): model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None) """ The model to use for TTS """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID to use for TTS """ supported_voices: typing.Optional[typing.List[SupportedVoice]] = pydantic.Field(default=None) """ Additional supported voices for the agent """ expressive_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, applies expressive audio tags prompt. Automatically disabled for non-v3 models. """ suggested_audio_tags: typing.Optional[typing.List[SuggestedAudioTag]] = pydantic.Field(default=None) """ Suggested audio tags to boost expressive speech (for eleven_v3 and eleven_v3_conversational models). The agent can still use other tags not listed here. """ agent_output_audio_format: typing.Optional[TtsOutputFormat] = pydantic.Field(default=None) """ The audio format to use for TTS """ optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = pydantic.Field(default=None) """ Deprecated: this field is a no-op and is ignored. """ stability: typing.Optional[float] = pydantic.Field(default=None) """ The stability of generated speech """ speed: typing.Optional[float] = pydantic.Field(default=None) """ The speed of generated speech """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ The similarity boost for generated speech """ text_normalisation_type: typing.Optional[TextNormalisationType] = pydantic.Field(default=None) """ Method for converting numbers to words before converting text to speech. If set to SYSTEM_PROMPT, the system prompt will be updated to include normalization instructions. If set to ELEVENLABS, the text will be normalized after generation, incurring slight additional latency. """ pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = ( pydantic.Field(default=None) ) """ The pronunciation dictionary locators """ enable_phoneme_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Opt-in to SSML phoneme tag handling for V3 models. When enabled, phoneme tags (inline and from pronunciation dictionaries) are parsed into inline IPA before being sent to the model. """ 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 tts_conversational_config_workflow_override_output.py000066400000000000000000000066521523660243400367300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator from .suggested_audio_tag import SuggestedAudioTag from .supported_voice import SupportedVoice from .text_normalisation_type import TextNormalisationType from .tts_conversational_model import TtsConversationalModel from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency from .tts_output_format import TtsOutputFormat class TtsConversationalConfigWorkflowOverrideOutput(UncheckedBaseModel): model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None) """ The model to use for TTS """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID to use for TTS """ supported_voices: typing.Optional[typing.List[SupportedVoice]] = pydantic.Field(default=None) """ Additional supported voices for the agent """ expressive_mode: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, applies expressive audio tags prompt. Automatically disabled for non-v3 models. """ suggested_audio_tags: typing.Optional[typing.List[SuggestedAudioTag]] = pydantic.Field(default=None) """ Suggested audio tags to boost expressive speech (for eleven_v3 and eleven_v3_conversational models). The agent can still use other tags not listed here. """ agent_output_audio_format: typing.Optional[TtsOutputFormat] = pydantic.Field(default=None) """ The audio format to use for TTS """ optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = pydantic.Field(default=None) """ Deprecated: this field is a no-op and is ignored. """ stability: typing.Optional[float] = pydantic.Field(default=None) """ The stability of generated speech """ speed: typing.Optional[float] = pydantic.Field(default=None) """ The speed of generated speech """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ The similarity boost for generated speech """ text_normalisation_type: typing.Optional[TextNormalisationType] = pydantic.Field(default=None) """ Method for converting numbers to words before converting text to speech. If set to SYSTEM_PROMPT, the system prompt will be updated to include normalization instructions. If set to ELEVENLABS, the text will be normalized after generation, incurring slight additional latency. """ pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = ( pydantic.Field(default=None) ) """ The pronunciation dictionary locators """ enable_phoneme_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Opt-in to SSML phoneme tag handling for V3 models. When enabled, phoneme tags (inline and from pronunciation dictionaries) are parsed into inline IPA before being sent to the model. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_conversational_model.py000066400000000000000000000005321523660243400313600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TtsConversationalModel = typing.Union[ typing.Literal[ "eleven_turbo_v2", "eleven_turbo_v2_5", "eleven_flash_v2", "eleven_flash_v2_5", "eleven_multilingual_v2", "eleven_v3_conversational", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_model_family.py000066400000000000000000000003011523660243400276040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TtsModelFamily = typing.Union[typing.Literal["turbo", "flash", "multilingual", "v3_conversational"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_optimize_streaming_latency.py000066400000000000000000000001431523660243400325770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. TtsOptimizeStreamingLatency = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/tts_output_format.py000066400000000000000000000003531523660243400300620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TtsOutputFormat = typing.Union[ typing.Literal["pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "pcm_48000", "ulaw_8000"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_config.py000066400000000000000000000065151523660243400266030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .soft_timeout_config import SoftTimeoutConfig from .spelling_patience import SpellingPatience from .turn_eagerness import TurnEagerness from .turn_model import TurnModel 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 """ initial_wait_time: typing.Optional[float] = pydantic.Field(default=None) """ How long the agent will wait for the user to start the conversation if the first message is empty. If not set, uses the regular turn_timeout. """ silence_end_call_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Maximum wait time since the user last spoke before terminating the call """ turn_eagerness: typing.Optional[TurnEagerness] = pydantic.Field(default=None) """ Controls how eager the agent is to respond. Low = less eager (waits longer), Standard = default eagerness, High = more eager (responds sooner) """ spelling_patience: typing.Optional[SpellingPatience] = pydantic.Field(default=None) """ Controls if the agent should be more patient when user is spelling numbers and named entities. Auto = model based, Off = never wait extra """ speculative_turn: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, starts generating LLM responses during silence before full turn confidence is reached, reducing perceived latency. May increase LLM costs. """ retranscribe_on_turn_timeout: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, if VAD detects no speech, attempts to re-transcribe accumulated audio at turn timeout. Disables silence discount billing for affected turns. """ turn_model: typing.Optional[TurnModel] = None interruption_ignore_terms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of terms that should not trigger an interruption when spoken by the user (e.g. 'gotcha', 'understood'). Uses case-insensitive exact matching. """ interruption_ignore_term_languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Language codes for which preset ignore-term categories have been activated. Stored explicitly so display is not inferred from term overlap. """ transcribe_on_disabled_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ When interruptions are disabled, still transcribe what the user says so it can carry into the next turn. When off, user speech during a non-interruptible turn is ignored and won't trigger a turn. """ soft_timeout_config: typing.Optional[SoftTimeoutConfig] = pydantic.Field(default=None) """ Configuration for soft timeout functionality. Provides immediate feedback during longer LLM responses. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_config_override.py000066400000000000000000000015101523660243400304700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .soft_timeout_config_override import SoftTimeoutConfigOverride class TurnConfigOverride(UncheckedBaseModel): soft_timeout_config: typing.Optional[SoftTimeoutConfigOverride] = pydantic.Field(default=None) """ Configuration for soft timeout functionality. Provides immediate feedback during longer LLM responses. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_config_override_config.py000066400000000000000000000014421523660243400320210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .soft_timeout_config_override_config import SoftTimeoutConfigOverrideConfig class TurnConfigOverrideConfig(UncheckedBaseModel): soft_timeout_config: typing.Optional[SoftTimeoutConfigOverrideConfig] = pydantic.Field(default=None) """ Configures overrides for nested fields. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_config_workflow_override.py000066400000000000000000000067501523660243400324350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .soft_timeout_config_workflow_override import SoftTimeoutConfigWorkflowOverride from .spelling_patience import SpellingPatience from .turn_eagerness import TurnEagerness from .turn_model import TurnModel class TurnConfigWorkflowOverride(UncheckedBaseModel): turn_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Maximum wait time for the user's reply before re-engaging the user """ initial_wait_time: typing.Optional[float] = pydantic.Field(default=None) """ How long the agent will wait for the user to start the conversation if the first message is empty. If not set, uses the regular turn_timeout. """ silence_end_call_timeout: typing.Optional[float] = pydantic.Field(default=None) """ Maximum wait time since the user last spoke before terminating the call """ turn_eagerness: typing.Optional[TurnEagerness] = pydantic.Field(default=None) """ Controls how eager the agent is to respond. Low = less eager (waits longer), Standard = default eagerness, High = more eager (responds sooner) """ spelling_patience: typing.Optional[SpellingPatience] = pydantic.Field(default=None) """ Controls if the agent should be more patient when user is spelling numbers and named entities. Auto = model based, Off = never wait extra """ speculative_turn: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, starts generating LLM responses during silence before full turn confidence is reached, reducing perceived latency. May increase LLM costs. """ retranscribe_on_turn_timeout: typing.Optional[bool] = pydantic.Field(default=None) """ When enabled, if VAD detects no speech, attempts to re-transcribe accumulated audio at turn timeout. Disables silence discount billing for affected turns. """ turn_model: typing.Optional[TurnModel] = pydantic.Field(default=None) """ Version of the turn detection model to use. """ interruption_ignore_terms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of terms that should not trigger an interruption when spoken by the user (e.g. 'gotcha', 'understood'). Uses case-insensitive exact matching. """ interruption_ignore_term_languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Language codes for which preset ignore-term categories have been activated. Stored explicitly so display is not inferred from term overlap. """ transcribe_on_disabled_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ When interruptions are disabled, still transcribe what the user says so it can carry into the next turn. When off, user speech during a non-interruptible turn is ignored and won't trigger a turn. """ soft_timeout_config: typing.Optional[SoftTimeoutConfigWorkflowOverride] = pydantic.Field(default=None) """ Configuration for soft timeout functionality. Provides immediate feedback during longer LLM responses. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_eagerness.py000066400000000000000000000002471523660243400273060ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TurnEagerness = typing.Union[typing.Literal["patient", "normal", "eager"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_mode.py000066400000000000000000000002271523660243400262540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TurnMode = typing.Union[typing.Literal["silence", "turn"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/turn_model.py000066400000000000000000000002331523660243400264250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TurnModel = typing.Union[typing.Literal["turn_v2", "turn_v3"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/twilio_edge_location.py000066400000000000000000000004151523660243400304420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TwilioEdgeLocation = typing.Union[ typing.Literal[ "ashburn", "dublin", "frankfurt", "sao-paulo", "singapore", "sydney", "tokyo", "umatilla", "roaming" ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/twilio_outbound_call_response.py000066400000000000000000000015401523660243400324160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class TwilioOutboundCallResponse(UncheckedBaseModel): success: bool message: str conversation_id: typing.Optional[str] = None call_sid: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="callSid"), pydantic.Field(alias="callSid") ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/twilio_region_id.py000066400000000000000000000002371523660243400276070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing TwilioRegionId = typing.Union[typing.Literal["us1", "ie1", "au1"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/txt_export_options.py000066400000000000000000000015661523660243400302620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class TxtExportOptions(UncheckedBaseModel): max_characters_per_line: typing.Optional[int] = None 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 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/unit_test_run_response_model.py000066400000000000000000000033621523660243400322630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .test_condition_result_common_model import TestConditionResultCommonModel from .test_run_metadata import TestRunMetadata from .test_run_status import TestRunStatus from .unit_test_run_response_model_test_info import UnitTestRunResponseModelTestInfo class UnitTestRunResponseModel(UncheckedBaseModel): test_run_id: str test_info: typing.Optional[UnitTestRunResponseModelTestInfo] = None test_invocation_id: str agent_id: str branch_id: typing.Optional[str] = None workflow_node_id: typing.Optional[str] = None status: TestRunStatus agent_responses: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None test_id: str test_name: typing.Optional[str] = None condition_result: typing.Optional[TestConditionResultCommonModel] = None last_updated_at_unix: typing.Optional[int] = None metadata: typing.Optional[TestRunMetadata] = None root_folder_id: typing.Optional[str] = None root_folder_name: typing.Optional[str] = None environment: 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 update_forward_refs(UnitTestRunResponseModel) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/unit_test_run_response_model_test_info.py000066400000000000000000000111401523660243400343260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .agent_failure_response_example import AgentFailureResponseExample from .agent_successful_response_example import AgentSuccessfulResponseExample from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput from .conversation_initiation_source import ConversationInitiationSource from .llm import Llm from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput from .tool_response_mock_config_output import ToolResponseMockConfigOutput from .unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput class UnitTestRunResponseModelTestInfo_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = 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 class UnitTestRunResponseModelTestInfo_Simulation(UncheckedBaseModel): type: typing.Literal["simulation"] = "simulation" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None success_condition: typing.Optional[str] = None success_conditions: typing.Optional[typing.List[str]] = None simulation_scenario: typing.Optional[str] = None simulation_max_turns: typing.Optional[int] = None simulation_environment: typing.Optional[str] = None tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = None tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigOutput]]] = None evaluation_model: typing.Optional[Llm] = None simulated_user_model: typing.Optional[Llm] = 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 class UnitTestRunResponseModelTestInfo_Tool(UncheckedBaseModel): type: typing.Literal["tool"] = "tool" from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = None chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = None check_any_tool_matches: typing.Optional[bool] = 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 UnitTestRunResponseModelTestInfo = typing_extensions.Annotated[ typing.Union[ UnitTestRunResponseModelTestInfo_Llm, UnitTestRunResponseModelTestInfo_Simulation, UnitTestRunResponseModelTestInfo_Tool, ], UnionMetadata(discriminant="type"), ] update_forward_refs(UnitTestRunResponseModelTestInfo_Llm) update_forward_refs(UnitTestRunResponseModelTestInfo_Simulation) update_forward_refs(UnitTestRunResponseModelTestInfo_Tool) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/unit_test_summary_response_model.py000066400000000000000000000044011523660243400331470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .agent_test_entity_type import AgentTestEntityType from .agent_test_folder_path_segment_response_model import AgentTestFolderPathSegmentResponseModel from .conversation_initiation_source import ConversationInitiationSource from .resource_access_info import ResourceAccessInfo from .test_type import TestType class UnitTestSummaryResponseModel(UncheckedBaseModel): id: str = pydantic.Field() """ The ID of the test """ name: str = pydantic.Field() """ Name of the test """ access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the test """ created_at_unix_secs: int = pydantic.Field() """ Creation time of the test in unix seconds """ last_updated_at_unix_secs: int = pydantic.Field() """ Last update time of the test in unix seconds """ type: TestType = pydantic.Field() """ Type of the test or entity """ entity_type: typing.Optional[AgentTestEntityType] = pydantic.Field(default=None) """ The type of entity (test or folder) """ folder_parent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder """ folder_path: typing.Optional[typing.List[AgentTestFolderPathSegmentResponseModel]] = pydantic.Field(default=None) """ The folder path segments from root to this entity """ children_count: typing.Optional[int] = pydantic.Field(default=None) """ Number of direct children (tests and subfolders) for folders only """ conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Channel the test simulates the conversation as. Null for folders or default behavior. """ 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 unit_test_tool_call_evaluation_model_input.py000066400000000000000000000031471523660243400351010ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .referenced_tool_common_model import ReferencedToolCommonModel from .unit_test_tool_call_parameter import UnitTestToolCallParameter from .unit_test_workflow_node_transition_evaluation_node_id import UnitTestWorkflowNodeTransitionEvaluationNodeId class UnitTestToolCallEvaluationModelInput(UncheckedBaseModel): parameters: typing.Optional[typing.List[UnitTestToolCallParameter]] = pydantic.Field(default=None) """ Parameters to evaluate for the agent's tool call. If empty, the tool call parameters are not evaluated. """ referenced_tool: typing.Optional[ReferencedToolCommonModel] = pydantic.Field(default=None) """ The tool to evaluate a call against. """ verify_absence: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to verify that the tool was NOT called. """ workflow_node_transition: typing.Optional[UnitTestWorkflowNodeTransitionEvaluationNodeId] = pydantic.Field( default=None ) """ Configuration for testing workflow node transitions. When set, the test will verify the agent transitions to the specified workflow node. """ 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 unit_test_tool_call_evaluation_model_output.py000066400000000000000000000031501523660243400352740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .referenced_tool_common_model import ReferencedToolCommonModel from .unit_test_tool_call_parameter import UnitTestToolCallParameter from .unit_test_workflow_node_transition_evaluation_node_id import UnitTestWorkflowNodeTransitionEvaluationNodeId class UnitTestToolCallEvaluationModelOutput(UncheckedBaseModel): parameters: typing.Optional[typing.List[UnitTestToolCallParameter]] = pydantic.Field(default=None) """ Parameters to evaluate for the agent's tool call. If empty, the tool call parameters are not evaluated. """ referenced_tool: typing.Optional[ReferencedToolCommonModel] = pydantic.Field(default=None) """ The tool to evaluate a call against. """ verify_absence: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to verify that the tool was NOT called. """ workflow_node_transition: typing.Optional[UnitTestWorkflowNodeTransitionEvaluationNodeId] = pydantic.Field( default=None ) """ Configuration for testing workflow node transitions. When set, the test will verify the agent transitions to the specified workflow node. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/unit_test_tool_call_parameter.py000066400000000000000000000012611523660243400323650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .unit_test_tool_call_parameter_eval import UnitTestToolCallParameterEval class UnitTestToolCallParameter(UncheckedBaseModel): eval: UnitTestToolCallParameterEval path: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/unit_test_tool_call_parameter_eval.py000066400000000000000000000043401523660243400333750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class UnitTestToolCallParameterEval_Anything(UncheckedBaseModel): type: typing.Literal["anything"] = "anything" 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 UnitTestToolCallParameterEval_Exact(UncheckedBaseModel): type: typing.Literal["exact"] = "exact" expected_value: 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 UnitTestToolCallParameterEval_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" description: 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 UnitTestToolCallParameterEval_Regex(UncheckedBaseModel): type: typing.Literal["regex"] = "regex" pattern: 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 UnitTestToolCallParameterEval = typing_extensions.Annotated[ typing.Union[ UnitTestToolCallParameterEval_Anything, UnitTestToolCallParameterEval_Exact, UnitTestToolCallParameterEval_Llm, UnitTestToolCallParameterEval_Regex, ], UnionMetadata(discriminant="type"), ] unit_test_workflow_node_transition_evaluation_node_id.py000066400000000000000000000015651523660243400373460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UnitTestWorkflowNodeTransitionEvaluationNodeId(UncheckedBaseModel): type: typing.Optional[typing.Literal["node_id"]] = None agent_id: str = pydantic.Field() """ The ID of the agent whose workflow contains the target node. """ target_node_id: str = pydantic.Field() """ The ID of the workflow node that the agent should transition to. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_agent_procedure_params.py000066400000000000000000000012021523660243400323250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateAgentProcedureParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_agent_procedure"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_agent_rule_params.py000066400000000000000000000011701523660243400313100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateAgentRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_agent_rule"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_asset_params.py000066400000000000000000000011571523660243400303070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateAssetParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_asset"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_audio_native_project_request.py000066400000000000000000000001751523660243400335710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UpdateAudioNativeProjectRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_basic_auth_request.py000066400000000000000000000012501523660243400314710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateBasicAuthRequest(UncheckedBaseModel): provider: typing.Optional[str] = None username: typing.Optional[str] = None password: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_bearer_auth_request.py000066400000000000000000000011741523660243400316550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateBearerAuthRequest(UncheckedBaseModel): provider: typing.Optional[str] = None token: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_booking_page_appearance_params.py000066400000000000000000000012211523660243400337630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateBookingPageAppearanceParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_booking_page_appearance"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_booking_page_settings_params.py000066400000000000000000000012151523660243400335270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateBookingPageSettingsParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_booking_page_settings"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_business_info_params.py000066400000000000000000000011761523660243400320370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateBusinessInfoParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_business_info"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_calendar_event_params.py000066400000000000000000000012001523660243400321270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateCalendarEventParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_calendar_event"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_chapter_request.py000066400000000000000000000001621523660243400310160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UpdateChapterRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_client_params.py000066400000000000000000000012571523660243400304470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateClientParams(UncheckedBaseModel): """ Update an existing client's information. """ smb_tool_type: typing.Optional[typing.Literal["update_client"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_customer_facing_config_params.py000066400000000000000000000012171523660243400336620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateCustomerFacingConfigParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_customer_facing_config"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_group_session_seats_params.py000066400000000000000000000013371523660243400332660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateGroupSessionSeatsParams(UncheckedBaseModel): """ Change the seat count of an existing group session registration. """ smb_tool_type: typing.Optional[typing.Literal["update_group_session_seats"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_holiday_params.py000066400000000000000000000011631523660243400306160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateHolidayParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_holiday"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_location_params.py000066400000000000000000000011651523660243400307770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateLocationParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_location"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_o_auth_2_client_creds_request.py000066400000000000000000000017061523660243400336130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateOAuth2ClientCredsRequest(UncheckedBaseModel): provider: typing.Optional[str] = None client_id: typing.Optional[str] = None scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None basic_auth_in_header: typing.Optional[bool] = None client_secret: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_o_auth_2_jwt_request.py000066400000000000000000000024711523660243400317610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .update_o_auth_2_jwt_request_algorithm import UpdateOAuth2JwtRequestAlgorithm from .update_o_auth_2_jwt_request_token_response_field import UpdateOAuth2JwtRequestTokenResponseField class UpdateOAuth2JwtRequest(UncheckedBaseModel): provider: typing.Optional[str] = None algorithm: typing.Optional[UpdateOAuth2JwtRequestAlgorithm] = None key_id: typing.Optional[str] = None issuer: typing.Optional[str] = None audience: typing.Optional[str] = None subject: typing.Optional[str] = None expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[UpdateOAuth2JwtRequestTokenResponseField] = None secret_key: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_o_auth_2_jwt_request_algorithm.py000066400000000000000000000003271523660243400340250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UpdateOAuth2JwtRequestAlgorithm = typing.Union[ typing.Literal["HS256", "HS384", "HS512", "RS256", "RS384", "RS512"], typing.Any ] update_o_auth_2_jwt_request_token_response_field.py000066400000000000000000000003001523660243400361500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing UpdateOAuth2JwtRequestTokenResponseField = typing.Union[typing.Literal["access_token", "id_token"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_order_request.py000066400000000000000000000011671523660243400305110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateOrderRequest(UncheckedBaseModel): name: str = pydantic.Field() """ The new name for the order. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_order_response.py000066400000000000000000000011641523660243400306540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateOrderResponse(UncheckedBaseModel): name: str = pydantic.Field() """ The updated order name. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_product_params.py000066400000000000000000000011631523660243400306450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateProductParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_product"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_project_request.py000066400000000000000000000001621523660243400310360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UpdateProjectRequest = typing.Any update_pronunciation_dictionaries_request.py000066400000000000000000000002041523660243400347330ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing UpdatePronunciationDictionariesRequest = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_response_unit_test_request.py000066400000000000000000000050321523660243400333250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_failure_response_example import AgentFailureResponseExample from .agent_successful_response_example import AgentSuccessfulResponseExample from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_input import TestFromConversationMetadataInput class UpdateResponseUnitTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ A prompt that evaluates whether the agent's response is successful. Should return True or False. """ success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered successful """ failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = pydantic.Field(default=None) """ Non-empty list of example responses that should be considered failures """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be moved to the root level. """ 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 update_forward_refs(UpdateResponseUnitTestRequest) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_service_params.py000066400000000000000000000012621523660243400306250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateServiceParams(UncheckedBaseModel): """ Update an existing service's information. """ smb_tool_type: typing.Optional[typing.Literal["update_service"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_simulation_test_request.py000066400000000000000000000074751523660243400326310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .llm import Llm from .simulation_tool_mock_behavior_config import SimulationToolMockBehaviorConfig from .test_from_conversation_metadata_input import TestFromConversationMetadataInput from .tool_response_mock_config_input import ToolResponseMockConfigInput class UpdateSimulationTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ success_condition: typing.Optional[str] = pydantic.Field(default=None) """ Deprecated legacy single success criterion. Use success_conditions instead. At least one of success_condition or success_conditions is required. """ success_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ List of prompts that evaluate whether the simulation was successful. If provided, all criteria are evaluated and merged into a final result. Capped at the maximum number of evaluation criteria. """ simulation_scenario: typing.Optional[str] = pydantic.Field(default=None) """ Description of the simulation scenario and user persona for simulation tests. """ simulation_max_turns: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of conversation turns for simulation tests. """ simulation_environment: typing.Optional[str] = pydantic.Field(default=None) """ The environment to use when running this simulation test. If not provided, defaults to 'production'. """ tool_mock_config: typing.Optional[SimulationToolMockBehaviorConfig] = pydantic.Field(default=None) """ Configuration for which tools to mock and fallback behavior. """ tool_mock_overrides: typing.Optional[typing.Dict[str, typing.List[ToolResponseMockConfigInput]]] = pydantic.Field( default=None ) """ Test-specific response mocks, keyed by tool ID. Applied ahead of the tool's shared mocks and only within this test. Only take effect for tools that are mocked (see tool_mock_config). """ evaluation_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model to use for evaluating simulation results. """ simulated_user_model: typing.Optional[Llm] = pydantic.Field(default=None) """ LLM model for the simulated user. """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be moved to the root level. """ 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 update_forward_refs(UpdateSimulationTestRequest) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_staff_params.py000066400000000000000000000012631523660243400302710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateStaffParams(UncheckedBaseModel): """ Update an existing staff member's information. """ smb_tool_type: typing.Optional[typing.Literal["update_staff"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_tool_call_unit_test_request.py000066400000000000000000000045561523660243400334510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput from .conversation_initiation_source import ConversationInitiationSource from .test_from_conversation_metadata_input import TestFromConversationMetadataInput from .unit_test_tool_call_evaluation_model_input import UnitTestToolCallEvaluationModelInput class UpdateToolCallUnitTestRequest(UncheckedBaseModel): from_conversation_metadata: typing.Optional[TestFromConversationMetadataInput] = pydantic.Field(default=None) """ Metadata of a conversation this test was created from (if applicable). """ dynamic_variables: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Dynamic variables to replace in the agent config during testing """ chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = None conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None) """ Simulate the test as if the conversation originated from this channel. """ tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelInput] = pydantic.Field(default=None) """ How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. """ check_any_tool_matches: typing.Optional[bool] = pydantic.Field(default=None) """ If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent. """ name: str parent_folder_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the parent folder. If not provided, the test will be moved to the root level. """ 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 update_forward_refs(UpdateToolCallUnitTestRequest) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_transfer_rule_params.py000066400000000000000000000017451523660243400320460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateTransferRuleParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["update_transfer_rule"]] = None post_dial_digits_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to offer the post_dial_digits parameter, set from the receptionists' enable_play_keypad_touch_tone_tool config. Digits saved while that is off are dropped when the receptionist is built, so the parameter is hidden rather than accepted and ignored. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/update_workspace_member_response_model.py000066400000000000000000000014251523660243400342460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UpdateWorkspaceMemberResponseModel(UncheckedBaseModel): status: str = pydantic.Field() """ The status of the workspace member update 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/upsert_order_item_request.py000066400000000000000000000016041523660243400315630ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .item_id import ItemId from .order_item_request_input import OrderItemRequestInput class UpsertOrderItemRequest(UncheckedBaseModel): item: OrderItemRequestInput = pydantic.Field() """ The order item to add or update. """ item_id: typing.Optional[ItemId] = pydantic.Field(default=None) """ The ID of an existing item to update. Omit to create a new item. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/upsert_order_item_response.py000066400000000000000000000015011523660243400317250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .item_id import ItemId from .quote_info import QuoteInfo class UpsertOrderItemResponse(UncheckedBaseModel): item_id: ItemId = pydantic.Field() """ The ID of the upserted order item. """ quote: typing.Optional[QuoteInfo] = pydantic.Field(default=None) """ The quoted price for this item. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/url_avatar.py000066400000000000000000000012221523660243400264140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UrlAvatar(UncheckedBaseModel): custom_url: typing.Optional[str] = pydantic.Field(default=None) """ The custom URL of the avatar """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/url_model.py000066400000000000000000000023241523660243400262420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UrlModel(UncheckedBaseModel): """ OCSF URL object. Spec: https://schema.ocsf.io/1.6.0/objects/url """ url_string: typing.Optional[str] = pydantic.Field(default=None) """ Full URL string """ scheme: typing.Optional[str] = pydantic.Field(default=None) """ URL scheme (e.g., https) """ hostname: typing.Optional[str] = pydantic.Field(default=None) """ URL hostname """ port: typing.Optional[int] = pydantic.Field(default=None) """ URL port """ path: typing.Optional[str] = pydantic.Field(default=None) """ URL path """ query_string: typing.Optional[str] = pydantic.Field(default=None) """ URL query string """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/url_secret_auth_response.py000066400000000000000000000016561523660243400313750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class UrlSecretAuthResponse(UncheckedBaseModel): name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/usage_aggregation_interval.py000066400000000000000000000003021523660243400316310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UsageAggregationInterval = typing.Union[typing.Literal["hour", "day", "week", "month", "cumulative"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/usage_characters_response_model.py000066400000000000000000000014611523660243400326620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UsageCharactersResponseModel(UncheckedBaseModel): time: typing.List[int] = pydantic.Field() """ The time axis with unix timestamps for each day. """ usage: typing.Dict[str, typing.List[float]] = pydantic.Field() """ The usage of each breakdown type along the time axis. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user.py000066400000000000000000000053041523660243400252370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .seat_type import SeatType from .subscription_response import SubscriptionResponse class User(UncheckedBaseModel): user_id: str = pydantic.Field() """ The unique identifier of the user. """ subscription: SubscriptionResponse = pydantic.Field() """ Details of the user's subscription. """ is_new_user: bool = pydantic.Field() """ Whether the user is new. This field is deprecated and will be removed in the future. Use 'created_at' instead. """ xi_api_key: typing.Optional[str] = pydantic.Field(default=None) """ The API key of the user. """ can_use_delayed_payment_methods: bool = pydantic.Field() """ This field is deprecated and will be removed in a future major version. Instead use subscription.trust_on_invoice_creation. """ is_onboarding_completed: bool = pydantic.Field() """ Whether the user's onboarding is completed. """ is_onboarding_checklist_completed: bool = pydantic.Field() """ Whether the user's onboarding checklist is completed. """ show_compliance_terms: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show compliance terms (ToS, Privacy Policy, biometric consent) during onboarding. Set for users signing up from the marketing site. """ first_name: typing.Optional[str] = pydantic.Field(default=None) """ First name of the user. """ is_api_key_hashed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the user's API key is hashed. """ xi_api_key_preview: typing.Optional[str] = pydantic.Field(default=None) """ The preview of the user's API key. """ referral_link_code: typing.Optional[str] = pydantic.Field(default=None) """ The referral link code of the user. """ partnerstack_partner_default_link: typing.Optional[str] = pydantic.Field(default=None) """ The Partnerstack partner default link of the user. """ created_at: int = pydantic.Field() """ The unix timestamp of the user's creation. 0 if the user was created before the unix timestamp was added. """ seat_type: SeatType = pydantic.Field() """ The seat type of the user. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_access_management_activity_id.py000066400000000000000000000001461523660243400333430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. UserAccessManagementActivityId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_feedback.py000066400000000000000000000012131523660243400270360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .user_feedback_score import UserFeedbackScore class UserFeedback(UncheckedBaseModel): score: UserFeedbackScore time_in_call_secs: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_feedback_score.py000066400000000000000000000002401523660243400302300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UserFeedbackScore = typing.Union[typing.Literal["like", "dislike"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_model.py000066400000000000000000000026001523660243400264130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .user_type_id import UserTypeId class UserModel(UncheckedBaseModel): """ OCSF User object. Spec: https://schema.ocsf.io/1.6.0/objects/user """ name: typing.Optional[str] = pydantic.Field(default=None) """ Username """ uid: typing.Optional[str] = pydantic.Field(default=None) """ Unique user identifier """ type_id: typing.Optional[UserTypeId] = pydantic.Field(default=None) """ Account type identifier """ type: typing.Optional[str] = pydantic.Field(default=None) """ Account type description """ email_addr: typing.Optional[str] = pydantic.Field(default=None) """ User email address """ full_name: typing.Optional[str] = pydantic.Field(default=None) """ Full name of the user """ domain: typing.Optional[str] = pydantic.Field(default=None) """ User's domain """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_transcript_payload.py000066400000000000000000000025731523660243400312260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .transcript_message import TranscriptMessage class UserTranscriptPayload(UncheckedBaseModel): """ Payload containing the full conversation history sent by ElevenLabs each time the user finishes speaking. """ type: typing.Literal["user_transcript"] = pydantic.Field(default="user_transcript") """ The message type identifier. """ user_transcript: typing.List[TranscriptMessage] = pydantic.Field() """ Full conversation history up to and including the latest user turn, ordered chronologically. Contains both `user` and `agent` turns. """ event_id: typing.Optional[int] = pydantic.Field(default=None) """ Monotonically increasing identifier for this transcript event. Pass this value back in every `agent_response` message so ElevenLabs can correlate responses and discard any that belong to an interrupted turn. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/user_type_id.py000066400000000000000000000001221523660243400267450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. UserTypeId = int elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/users_sort_by.py000066400000000000000000000003301523660243400271550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing UsersSortBy = typing.Union[ typing.Literal["last_contact_unix_secs", "conversation_count", "average_sentiment_score"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/utterance_response_model.py000066400000000000000000000013571523660243400313550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class UtteranceResponseModel(UncheckedBaseModel): 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/uui_transfer_config.py000066400000000000000000000037711523660243400303220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .uui_transfer_config_protocol_discriminator_mode import UuiTransferConfigProtocolDiscriminatorMode class UuiTransferConfig(UncheckedBaseModel): """ User-to-User Information envelope for SIP REFER transfers (RFC 7433). Outbound payloads are hex-encoded (the only encoding RFC 7433 defines). The protocol discriminator axis lets per-platform formats (Talkdesk, Genesys, ...) be expressed by configuration rather than scattered transfer flags. Further axes (ASCII encoding, header name, purpose/content parameters) can be added here without touching the transfer model. """ data: str = pydantic.Field() """ UUI payload to send on SIP REFER transfers. Supports inline dynamic variables and is hex-encoded at transfer time. """ protocol_discriminator: typing.Optional[str] = pydantic.Field(default=None) """ Optional one-octet protocol discriminator (two hex digits, e.g. '00'). Required by platforms such as Genesys Cloud, which otherwise strip the first octet of the payload. Leave unset for platforms like Talkdesk that expect a bare hex payload. """ protocol_discriminator_mode: typing.Optional[UuiTransferConfigProtocolDiscriminatorMode] = pydantic.Field( default=None ) """ How to attach protocol_discriminator. 'prefix' prepends the octet to the hex payload (User-to-User=XX;encoding=hex). 'pd_parameter' sends it as a separate parameter (User-to-User=;pd=XX;encoding=hex). Ignored when protocol_discriminator is unset. """ 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 uui_transfer_config_protocol_discriminator_mode.py000066400000000000000000000003001523660243400361000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing UuiTransferConfigProtocolDiscriminatorMode = typing.Union[typing.Literal["prefix", "pd_parameter"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/vad_config.py000066400000000000000000000010341523660243400263540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VadConfig(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/vad_config_workflow_override.py000066400000000000000000000010541523660243400322070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VadConfigWorkflowOverride(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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/validate_user_verification_code_params.py000066400000000000000000000012231523660243400342030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class ValidateUserVerificationCodeParams(UncheckedBaseModel): smb_tool_type: typing.Optional[typing.Literal["validate_user_verification_code"]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/validation_error.py000066400000000000000000000012511523660243400276210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .validation_error_loc_item import ValidationErrorLocItem class ValidationError(UncheckedBaseModel): loc: typing.List[ValidationErrorLocItem] msg: str type: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/validation_error_loc_item.py000066400000000000000000000002001523660243400314650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing ValidationErrorLocItem = typing.Union[str, int] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/verbosity.py000066400000000000000000000002441523660243400263050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing Verbosity = typing.Union[typing.Literal["auto", "concise", "thorough"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/verification_attempt_response.py000066400000000000000000000024151523660243400324170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .recording_response import RecordingResponse class VerificationAttemptResponse(UncheckedBaseModel): text: str = pydantic.Field() """ The text of the verification attempt. """ date_unix: int = pydantic.Field() """ The date of the verification attempt in Unix time. """ accepted: bool = pydantic.Field() """ Whether the verification attempt was accepted. """ similarity: float = pydantic.Field() """ The similarity of the verification attempt. """ levenshtein_distance: float = pydantic.Field() """ The Levenshtein distance of the verification attempt. """ recording: typing.Optional[RecordingResponse] = pydantic.Field(default=None) """ The recording of the verification attempt. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/verified_voice_language_response_model.py000066400000000000000000000021141523660243400342000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VerifiedVoiceLanguageResponseModel(UncheckedBaseModel): language: str = pydantic.Field() """ The language of the voice. """ model_id: str = pydantic.Field() """ The voice's model ID. """ accent: typing.Optional[str] = pydantic.Field(default=None) """ The voice's accent, if applicable. """ locale: typing.Optional[str] = pydantic.Field(default=None) """ The voice's locale, if applicable. """ preview_url: typing.Optional[str] = pydantic.Field(default=None) """ The voice's preview URL, if applicable. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/verify_pvc_voice_captcha_response_model.py000066400000000000000000000014201523660243400343760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_analysis.py000066400000000000000000000014241523660243400272710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .video_analysis_result import VideoAnalysisResult from .video_analysis_status import VideoAnalysisStatus class VideoAnalysis(UncheckedBaseModel): status: VideoAnalysisStatus data: typing.Optional[VideoAnalysisResult] = None updated_at_ms: typing.Optional[int] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_analysis_result.py000066400000000000000000000017531523660243400306740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .video_key_moment import VideoKeyMoment from .video_segment import VideoSegment from .video_subject import VideoSubject class VideoAnalysisResult(UncheckedBaseModel): title: str description: str content_type: typing.Optional[str] = None overall_pacing: typing.Optional[str] = None subjects: typing.Optional[typing.List[VideoSubject]] = None segments: typing.Optional[typing.List[VideoSegment]] = None key_moments: typing.Optional[typing.List[VideoKeyMoment]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_analysis_status.py000066400000000000000000000002641523660243400306750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VideoAnalysisStatus = typing.Union[typing.Literal["processing", "completed", "failed"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_key_moment.py000066400000000000000000000011331523660243400276120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VideoKeyMoment(UncheckedBaseModel): timestamp_ms: int type: str description: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_segment.py000066400000000000000000000016321523660243400271110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VideoSegment(UncheckedBaseModel): start_ms: int end_ms: int description: str subjects: typing.Optional[typing.List[str]] = None shot_type: typing.Optional[str] = None camera_movement: typing.Optional[str] = None transition_in: typing.Optional[str] = None has_speech: typing.Optional[bool] = None has_music: typing.Optional[bool] = None pacing: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/video_subject.py000066400000000000000000000011031523660243400270770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VideoSubject(UncheckedBaseModel): name: str description: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/visited_agent_ref.py000066400000000000000000000013231523660243400277370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VisitedAgentRef(UncheckedBaseModel): """ An agent (and optional branch) that participated in the call, in first-seen transcript order. """ agent_id: str branch_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice.py000066400000000000000000000113121523660243400253620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .fine_tuning_response import FineTuningResponse from .verified_voice_language_response_model import VerifiedVoiceLanguageResponseModel from .voice_category import VoiceCategory from .voice_labelling_status import VoiceLabellingStatus from .voice_recording_quality import VoiceRecordingQuality from .voice_safety_control import VoiceSafetyControl from .voice_sample import VoiceSample from .voice_settings import VoiceSettings from .voice_sharing_response import VoiceSharingResponse from .voice_verification_response import VoiceVerificationResponse class Voice(UncheckedBaseModel): voice_id: str = pydantic.Field() """ The ID of the voice. """ name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the voice. """ samples: typing.Optional[typing.List[VoiceSample]] = pydantic.Field(default=None) """ List of samples associated with the voice. """ category: typing.Optional[VoiceCategory] = pydantic.Field(default=None) """ The category of the voice. """ fine_tuning: typing.Optional[FineTuningResponse] = pydantic.Field(default=None) """ Fine-tuning information for the voice. """ labels: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Labels associated with the voice. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the voice. """ preview_url: typing.Optional[str] = pydantic.Field(default=None) """ The preview URL of the voice. """ available_for_tiers: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The tiers the voice is available for. """ settings: typing.Optional[VoiceSettings] = pydantic.Field(default=None) """ The settings of the voice. """ sharing: typing.Optional[VoiceSharingResponse] = pydantic.Field(default=None) """ The sharing information of the voice. """ high_quality_base_model_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The base model IDs for high-quality voices. """ verified_languages: typing.Optional[typing.List[VerifiedVoiceLanguageResponseModel]] = pydantic.Field(default=None) """ The verified languages of the voice. """ collection_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The IDs of collections this voice belongs to. """ safety_control: typing.Optional[VoiceSafetyControl] = pydantic.Field(default=None) """ The safety controls of the voice. """ voice_verification: typing.Optional[VoiceVerificationResponse] = pydantic.Field(default=None) """ The voice verification of the voice. """ permission_on_resource: typing.Optional[str] = pydantic.Field(default=None) """ The permission on the resource of the voice. """ is_owner: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is owned by the user. """ is_legacy: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is legacy. """ is_mixed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is mixed. """ favorited_at_unix: typing.Optional[int] = pydantic.Field(default=None) """ Timestamp when the voice was marked as favorite in Unix time. """ created_at_unix: typing.Optional[int] = pydantic.Field(default=None) """ The creation time of the voice in Unix time. """ is_bookmarked: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is bookmarked by the current user. Only relevant for community (library-copied) voices. """ recording_quality: typing.Optional[VoiceRecordingQuality] = pydantic.Field(default=None) """ The recording quality of the voice as determined by the review pipeline. """ labelling_status: typing.Optional[VoiceLabellingStatus] = pydantic.Field(default=None) """ The review pipeline status of the voice. """ recording_quality_reason: typing.Optional[str] = pydantic.Field(default=None) """ The reason for the recording quality assessment, as determined by the review pipeline. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_accent_response_model.py000066400000000000000000000020101523660243400317700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceAccentResponseModel(UncheckedBaseModel): accent: str = pydantic.Field() """ The accent value used for filtering shared voices via the `accent` query parameter on `GET /v1/shared-voices`. """ language: str = pydantic.Field() """ The language code this accent belongs to, e.g. `en`. """ code: str = pydantic.Field() """ The full accent code, e.g. `en-american`. """ name: str = pydantic.Field() """ The human-readable accent name, e.g. `American`. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_category.py000066400000000000000000000003331523660243400272600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceCategory = typing.Union[ typing.Literal["generated", "cloned", "premade", "professional", "famous", "high_quality"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_design_preview_response.py000066400000000000000000000015171523660243400324000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .voice_preview_response_model import VoicePreviewResponseModel class VoiceDesignPreviewResponse(UncheckedBaseModel): previews: typing.List[VoicePreviewResponseModel] = pydantic.Field() """ The previews of the generated voices. """ text: str = pydantic.Field() """ The text used to preview the voices. """ 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 voice_generation_parameter_option_response.py000066400000000000000000000002041523660243400350620ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing VoiceGenerationParameterOptionResponse = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_generation_parameter_response.py000066400000000000000000000001761523660243400335610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceGenerationParameterResponse = typing.Any elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_labelling_status.py000066400000000000000000000002601523660243400307760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceLabellingStatus = typing.Union[typing.Literal["in_review", "review_complete"], typing.Any] voice_mail_detection_result_success_model.py000066400000000000000000000013211523660243400346500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceMailDetectionResultSuccessModel(UncheckedBaseModel): status: typing.Optional[typing.Literal["success"]] = None voicemail_message: typing.Optional[str] = None 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_preview_response_model.py000066400000000000000000000021321523660243400322210ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoicePreviewResponseModel(UncheckedBaseModel): audio_base_64: str = pydantic.Field() """ The base64 encoded audio of the preview. """ generated_voice_id: str = pydantic.Field() """ The ID of the generated voice. Use it to create a voice from the preview. """ media_type: str = pydantic.Field() """ The media type of the preview. """ duration_secs: float = pydantic.Field() """ The duration of the preview in seconds. """ language: typing.Optional[str] = pydantic.Field(default=None) """ The language of the preview. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_recording_quality.py000066400000000000000000000002701523660243400311670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceRecordingQuality = typing.Union[typing.Literal["studio", "good", "ok", "poor", "bad"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_safety_control.py000066400000000000000000000003261523660243400305000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceSafetyControl = typing.Union[ typing.Literal["NONE", "BAN", "CAPTCHA", "ENTERPRISE_BAN", "ENTERPRISE_CAPTCHA"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_sample.py000066400000000000000000000030731523660243400267300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .speaker_separation_response_model import SpeakerSeparationResponseModel class VoiceSample(UncheckedBaseModel): sample_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the sample. """ file_name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the sample file. """ mime_type: typing.Optional[str] = pydantic.Field(default=None) """ The MIME type of the sample file. """ size_bytes: typing.Optional[int] = pydantic.Field(default=None) """ The size of the sample file in bytes. """ hash: typing.Optional[str] = pydantic.Field(default=None) """ The hash of the sample file. """ duration_secs: typing.Optional[float] = None remove_background_noise: typing.Optional[bool] = None 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 else: class Config: frozen = True smart_union = True extra = pydantic.Extra.allow elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_sample_preview_response_model.py000066400000000000000000000020101523660243400335550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 voice_sample_visual_waveform_response_model.py000066400000000000000000000014361523660243400352410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_segment.py000066400000000000000000000022501523660243400271050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceSegment(UncheckedBaseModel): voice_id: str = pydantic.Field() """ The voice ID used for this segment """ start_time_seconds: float = pydantic.Field() """ Start time of this voice segment """ end_time_seconds: float = pydantic.Field() """ End time of this voice segment """ character_start_index: int = pydantic.Field() """ Start index in the characters array """ character_end_index: int = pydantic.Field() """ End index in the characters array (exclusive) """ dialogue_input_index: int = pydantic.Field() """ Line of the dialogue (script) that this segment is a part of. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_settings.py000066400000000000000000000034761523660243400273160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceSettings(UncheckedBaseModel): stability: typing.Optional[float] = pydantic.Field(default=None) """ Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion. """ use_speaker_boost: typing.Optional[bool] = pydantic.Field(default=None) """ This setting boosts the similarity to the original speaker. Using this setting requires a slightly higher computational load, which in turn increases latency. """ similarity_boost: typing.Optional[float] = pydantic.Field(default=None) """ Determines how closely the AI should adhere to the original voice when attempting to replicate it. """ style: typing.Optional[float] = pydantic.Field(default=None) """ Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0. """ speed: typing.Optional[float] = pydantic.Field(default=None) """ Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up. """ 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 voice_sharing_moderation_check_response_model.py000066400000000000000000000033441523660243400355000ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceSharingModerationCheckResponseModel(UncheckedBaseModel): date_checked_unix: typing.Optional[int] = pydantic.Field(default=None) """ The date the moderation check was made in Unix time. """ name_value: typing.Optional[str] = pydantic.Field(default=None) """ The name value of the voice. """ name_check: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the name check was successful. """ description_value: typing.Optional[str] = pydantic.Field(default=None) """ The description value of the voice. """ description_check: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the description check was successful. """ sample_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of sample IDs. """ sample_checks: typing.Optional[typing.List[float]] = pydantic.Field(default=None) """ A list of sample checks. """ captcha_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of captcha IDs. """ captcha_checks: typing.Optional[typing.List[float]] = pydantic.Field(default=None) """ A list of CAPTCHA check values. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_sharing_response.py000066400000000000000000000122101523660243400310110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .reader_resource_response_model import ReaderResourceResponseModel from .review_status import ReviewStatus from .voice_sharing_moderation_check_response_model import VoiceSharingModerationCheckResponseModel from .voice_sharing_response_category import VoiceSharingResponseCategory from .voice_sharing_state import VoiceSharingState class VoiceSharingResponse(UncheckedBaseModel): status: typing.Optional[VoiceSharingState] = pydantic.Field(default=None) """ The status of the voice sharing. """ history_item_sample_id: typing.Optional[str] = pydantic.Field(default=None) """ The sample ID of the history item. """ date_unix: typing.Optional[int] = pydantic.Field(default=None) """ The date of the voice sharing in Unix time. """ whitelisted_emails: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ A list of whitelisted emails. """ public_owner_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the public owner. """ original_voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the original voice. """ financial_rewards_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether financial rewards are enabled. """ free_users_allowed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether free users are allowed. """ live_moderation_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether live moderation is enabled. """ rate: typing.Optional[float] = pydantic.Field(default=None) """ The rate of the voice sharing. """ fiat_rate: typing.Optional[float] = pydantic.Field(default=None) """ The rate of the voice sharing in USD per 1000 credits. """ notice_period: typing.Optional[int] = pydantic.Field(default=None) """ The notice period of the voice sharing. """ disable_at_unix: typing.Optional[int] = pydantic.Field(default=None) """ The date of the voice sharing in Unix time. """ voice_mixing_allowed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether voice mixing is allowed. """ featured: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is featured. """ category: typing.Optional[VoiceSharingResponseCategory] = pydantic.Field(default=None) """ The category of the voice. """ reader_app_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the reader app is enabled. """ image_url: typing.Optional[str] = pydantic.Field(default=None) """ The image URL of the voice. """ ban_reason: typing.Optional[str] = pydantic.Field(default=None) """ The ban reason of the voice. """ liked_by_count: typing.Optional[int] = pydantic.Field(default=None) """ The number of likes on the voice. """ cloned_by_count: typing.Optional[int] = pydantic.Field(default=None) """ The number of clones on the voice. """ name: typing.Optional[str] = pydantic.Field(default=None) """ The name of the voice. """ description: typing.Optional[str] = pydantic.Field(default=None) """ The description of the voice. """ labels: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ The labels of the voice. """ review_status: typing.Optional[ReviewStatus] = pydantic.Field(default=None) """ The review status of the voice. """ review_message: typing.Optional[str] = pydantic.Field(default=None) """ The review message of the voice. """ enabled_in_library: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the voice is enabled in the library. """ instagram_username: typing.Optional[str] = pydantic.Field(default=None) """ The Instagram username of the voice. """ twitter_username: typing.Optional[str] = pydantic.Field(default=None) """ The Twitter/X username of the voice. """ youtube_username: typing.Optional[str] = pydantic.Field(default=None) """ The YouTube username of the voice. """ tiktok_username: typing.Optional[str] = pydantic.Field(default=None) """ The TikTok username of the voice. """ moderation_check: typing.Optional[VoiceSharingModerationCheckResponseModel] = pydantic.Field(default=None) """ The moderation check of the voice. """ reader_restricted_on: typing.Optional[typing.List[ReaderResourceResponseModel]] = pydantic.Field(default=None) """ The reader restricted on of the voice. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_sharing_response_category.py000066400000000000000000000003521523660243400327120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceSharingResponseCategory = typing.Union[ typing.Literal["generated", "cloned", "premade", "professional", "famous", "high_quality"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_sharing_state.py000066400000000000000000000003011523660243400302710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoiceSharingState = typing.Union[typing.Literal["enabled", "disabled", "copied", "copied_disabled"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_statistics_response_model.py000066400000000000000000000022441523660243400327360ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoiceStatisticsResponseModel(UncheckedBaseModel): project_voice_ref_id: str = pydantic.Field() """ The project voice reference ID. """ characters_unconverted: int = pydantic.Field() """ The number of unconverted characters for this voice. """ characters_converted: int = pydantic.Field() """ The number of converted characters for this voice. """ credits_needed_to_convert: typing.Optional[int] = pydantic.Field(default=None) """ The number of credits needed to convert the remaining audio for this voice. """ voice_id: typing.Optional[str] = pydantic.Field(default=None) """ The voice ID. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voice_verification_response.py000066400000000000000000000025251523660243400320500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .verification_attempt_response import VerificationAttemptResponse class VoiceVerificationResponse(UncheckedBaseModel): requires_verification: bool = pydantic.Field() """ Whether the voice requires verification. """ is_verified: bool = pydantic.Field() """ Whether the voice has been verified. """ verification_failures: typing.List[str] = pydantic.Field() """ List of verification failures. """ verification_attempts_count: int = pydantic.Field() """ The number of verification attempts. """ language: typing.Optional[str] = pydantic.Field(default=None) """ The language of the voice. """ verification_attempts: typing.Optional[typing.List[VerificationAttemptResponse]] = pydantic.Field(default=None) """ Number of times a verification was attempted. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voicemail_detection_tool_config.py000066400000000000000000000023031523660243400326450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoicemailDetectionToolConfig(UncheckedBaseModel): """ Allows the agent to detect when a voicemail system is encountered. This tool should be invoked by the LLM when it detects that the call has been answered by a voicemail system rather than a human. If a voicemail message is configured, it will be played; otherwise the call will end immediately. """ voicemail_message: typing.Optional[str] = pydantic.Field(default=None) """ Optional message to leave on voicemail when detected. If not provided, the call will end immediately when voicemail is detected. Supports dynamic variables (e.g., {{system__time}}, {{system__call_duration_secs}}, {{custom_variable}}). """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/voices_not_permitted_warning.py000066400000000000000000000021561523660243400322350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class VoicesNotPermittedWarning(UncheckedBaseModel): type: typing.Literal["voices_not_permitted"] = pydantic.Field(default="voices_not_permitted") """ Identifies this warning; branch on it to read the fields below. """ speaker_ids: typing.List[str] = pydantic.Field() """ Speakers whose voices were not permitted for cloning. The dub used a replacement voice for each of them; the rest of the speakers are unaffected. """ message: str = pydantic.Field() """ Human-readable description of the warning, for display. The wording may change at any time; branch on `type` instead. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_auth_method_type.py000066400000000000000000000002531523660243400313370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WebhookAuthMethodType = typing.Union[typing.Literal["hmac", "oauth2", "mtls"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_event_type.py000066400000000000000000000003661523660243400301640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WebhookEventType = typing.Union[ typing.Literal["transcript", "audio", "call_initiation_failure", "unredacted_transcript", "unredacted_audio"], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_hmac_settings.py000066400000000000000000000022321523660243400306240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WebhookHmacSettings(UncheckedBaseModel): """ Settings for creating an HMAC-authenticated webhook """ auth_type: typing.Literal["hmac"] = pydantic.Field(default="hmac") """ The authentication type for this webhook """ name: str = pydantic.Field() """ The display name for this webhook """ webhook_url: str = pydantic.Field() """ The HTTPS callback URL that will be called when this webhook is triggered """ request_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None) """ Optional custom request headers to include with each webhook delivery """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_tool_api_schema_config_input.py000066400000000000000000000106001523660243400336640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .literal_json_schema_property import LiteralJsonSchemaProperty from .query_params_json_schema import QueryParamsJsonSchema from .response_filter import ResponseFilter from .webhook_tool_api_schema_config_input_auth_connection import WebhookToolApiSchemaConfigInputAuthConnection from .webhook_tool_api_schema_config_input_content_type import WebhookToolApiSchemaConfigInputContentType from .webhook_tool_api_schema_config_input_method import WebhookToolApiSchemaConfigInputMethod from .webhook_tool_api_schema_config_input_request_headers_value import ( WebhookToolApiSchemaConfigInputRequestHeadersValue, ) class WebhookToolApiSchemaConfigInput(UncheckedBaseModel): request_headers: typing.Optional[typing.Dict[str, WebhookToolApiSchemaConfigInputRequestHeadersValue]] = ( pydantic.Field(default=None) ) """ Headers that should be included in the request """ url: str = pydantic.Field() """ The URL that the webhook will be sent to. May include path parameters, e.g. https://example.com/agents/{agent_id} """ method: typing.Optional[WebhookToolApiSchemaConfigInputMethod] = pydantic.Field(default=None) """ The HTTP method to use for the webhook """ path_params_schema: typing.Optional[typing.Dict[str, LiteralJsonSchemaProperty]] = pydantic.Field(default=None) """ Schema for path parameters, if any. The keys should match the placeholders in the URL. """ query_params_schema: typing.Optional[QueryParamsJsonSchema] = pydantic.Field(default=None) """ Schema for any query params, if any. These will be added to end of the URL as query params. Note: properties in a query param must all be literal types """ request_body_schema: typing.Optional["ObjectJsonSchemaPropertyInput"] = pydantic.Field(default=None) """ Schema for the body parameters, if any. Used for POST/PATCH/PUT requests. The schema should be an object which will be sent as the json body """ response_body_schema: typing.Optional["ObjectJsonSchemaPropertyInput"] = pydantic.Field(default=None) """ Schema describing the expected response body structure. For documentation only; not surfaced to the LLM. """ response_filter: typing.Optional[ResponseFilter] = pydantic.Field(default=None) """ Optional allow-list filter applied to the response before the LLM sees it, so large responses don't pollute the context. Defaults to the full response. """ content_type: typing.Optional[WebhookToolApiSchemaConfigInputContentType] = pydantic.Field(default=None) """ Content type for the request body. Only applies to POST/PUT/PATCH requests. """ auth_resolved_params: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ URL placeholders resolved from the auth connection (e.g. secrets injected via UrlSecretAuthConnection) rather than from path_params_schema. """ auth_connection: typing.Optional[WebhookToolApiSchemaConfigInputAuthConnection] = pydantic.Field(default=None) """ Optional auth connection to use for authentication with this webhook """ 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 from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, I001 from .array_json_schema_property_input_items import ArrayJsonSchemaPropertyInputItems # noqa: E402, I001 from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, I001 from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue # noqa: E402, I001 update_forward_refs( WebhookToolApiSchemaConfigInput, ArrayJsonSchemaPropertyInput=ArrayJsonSchemaPropertyInput, ArrayJsonSchemaPropertyInputItems=ArrayJsonSchemaPropertyInputItems, ObjectJsonSchemaPropertyInput=ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue=ObjectJsonSchemaPropertyInputPropertiesValue, ) webhook_tool_api_schema_config_input_auth_connection.py000066400000000000000000000005241523660243400370510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .auth_connection_locator import AuthConnectionLocator from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator WebhookToolApiSchemaConfigInputAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] webhook_tool_api_schema_config_input_content_type.py000066400000000000000000000003451523660243400364050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WebhookToolApiSchemaConfigInputContentType = typing.Union[ typing.Literal["application/json", "application/x-www-form-urlencoded"], typing.Any ] webhook_tool_api_schema_config_input_method.py000066400000000000000000000003201523660243400351430ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WebhookToolApiSchemaConfigInputMethod = typing.Union[ typing.Literal["GET", "POST", "PUT", "PATCH", "DELETE"], typing.Any ] webhook_tool_api_schema_config_input_request_headers_value.py000066400000000000000000000006141523660243400402500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator WebhookToolApiSchemaConfigInputRequestHeadersValue = typing.Union[ str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_tool_api_schema_config_output.py000066400000000000000000000106401523660243400340710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .literal_json_schema_property import LiteralJsonSchemaProperty from .query_params_json_schema import QueryParamsJsonSchema from .response_filter import ResponseFilter from .webhook_tool_api_schema_config_output_auth_connection import WebhookToolApiSchemaConfigOutputAuthConnection from .webhook_tool_api_schema_config_output_content_type import WebhookToolApiSchemaConfigOutputContentType from .webhook_tool_api_schema_config_output_method import WebhookToolApiSchemaConfigOutputMethod from .webhook_tool_api_schema_config_output_request_headers_value import ( WebhookToolApiSchemaConfigOutputRequestHeadersValue, ) class WebhookToolApiSchemaConfigOutput(UncheckedBaseModel): request_headers: typing.Optional[typing.Dict[str, WebhookToolApiSchemaConfigOutputRequestHeadersValue]] = ( pydantic.Field(default=None) ) """ Headers that should be included in the request """ url: str = pydantic.Field() """ The URL that the webhook will be sent to. May include path parameters, e.g. https://example.com/agents/{agent_id} """ method: typing.Optional[WebhookToolApiSchemaConfigOutputMethod] = pydantic.Field(default=None) """ The HTTP method to use for the webhook """ path_params_schema: typing.Optional[typing.Dict[str, LiteralJsonSchemaProperty]] = pydantic.Field(default=None) """ Schema for path parameters, if any. The keys should match the placeholders in the URL. """ query_params_schema: typing.Optional[QueryParamsJsonSchema] = pydantic.Field(default=None) """ Schema for any query params, if any. These will be added to end of the URL as query params. Note: properties in a query param must all be literal types """ request_body_schema: typing.Optional["ObjectJsonSchemaPropertyOutput"] = pydantic.Field(default=None) """ Schema for the body parameters, if any. Used for POST/PATCH/PUT requests. The schema should be an object which will be sent as the json body """ response_body_schema: typing.Optional["ObjectJsonSchemaPropertyOutput"] = pydantic.Field(default=None) """ Schema describing the expected response body structure. For documentation only; not surfaced to the LLM. """ response_filter: typing.Optional[ResponseFilter] = pydantic.Field(default=None) """ Optional allow-list filter applied to the response before the LLM sees it, so large responses don't pollute the context. Defaults to the full response. """ content_type: typing.Optional[WebhookToolApiSchemaConfigOutputContentType] = pydantic.Field(default=None) """ Content type for the request body. Only applies to POST/PUT/PATCH requests. """ auth_resolved_params: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ URL placeholders resolved from the auth connection (e.g. secrets injected via UrlSecretAuthConnection) rather than from path_params_schema. """ auth_connection: typing.Optional[WebhookToolApiSchemaConfigOutputAuthConnection] = pydantic.Field(default=None) """ Optional auth connection to use for authentication with this webhook """ 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 from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, I001 from .array_json_schema_property_output_items import ArrayJsonSchemaPropertyOutputItems # noqa: E402, I001 from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, I001 from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue # noqa: E402, I001 update_forward_refs( WebhookToolApiSchemaConfigOutput, ArrayJsonSchemaPropertyOutput=ArrayJsonSchemaPropertyOutput, ArrayJsonSchemaPropertyOutputItems=ArrayJsonSchemaPropertyOutputItems, ObjectJsonSchemaPropertyOutput=ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue=ObjectJsonSchemaPropertyOutputPropertiesValue, ) webhook_tool_api_schema_config_output_auth_connection.py000066400000000000000000000005251523660243400372530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .auth_connection_locator import AuthConnectionLocator from .environment_auth_connection_locator import EnvironmentAuthConnectionLocator WebhookToolApiSchemaConfigOutputAuthConnection = typing.Union[AuthConnectionLocator, EnvironmentAuthConnectionLocator] webhook_tool_api_schema_config_output_content_type.py000066400000000000000000000003461523660243400366070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WebhookToolApiSchemaConfigOutputContentType = typing.Union[ typing.Literal["application/json", "application/x-www-form-urlencoded"], typing.Any ] webhook_tool_api_schema_config_output_method.py000066400000000000000000000003211523660243400353450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WebhookToolApiSchemaConfigOutputMethod = typing.Union[ typing.Literal["GET", "POST", "PUT", "PATCH", "DELETE"], typing.Any ] webhook_tool_api_schema_config_output_request_headers_value.py000066400000000000000000000006151523660243400404520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .conv_ai_dynamic_variable import ConvAiDynamicVariable from .conv_ai_env_var_locator import ConvAiEnvVarLocator from .conv_ai_secret_locator import ConvAiSecretLocator WebhookToolApiSchemaConfigOutputRequestHeadersValue = typing.Union[ str, ConvAiSecretLocator, ConvAiDynamicVariable, ConvAiEnvVarLocator ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_tool_config_input.py000066400000000000000000000110521523660243400315150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput class WebhookToolConfigInput(UncheckedBaseModel): """ A webhook tool is a tool that calls an external webhook from our server """ name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 300 seconds (inclusive). """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ api_schema: WebhookToolApiSchemaConfigInput = pydantic.Field() """ The schema for the outgoing webhoook, including parameters and URL specification """ 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 update_forward_refs(WebhookToolConfigInput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_tool_config_output.py000066400000000000000000000110571523660243400317230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .dynamic_variable_assignment import DynamicVariableAssignment from .dynamic_variables_config import DynamicVariablesConfig from .pre_tool_speech_mode import PreToolSpeechMode from .tool_call_sound_behavior import ToolCallSoundBehavior from .tool_call_sound_type import ToolCallSoundType from .tool_error_handling_mode import ToolErrorHandlingMode from .tool_execution_mode import ToolExecutionMode from .tool_interruption_mode import ToolInterruptionMode from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput class WebhookToolConfigOutput(UncheckedBaseModel): """ A webhook tool is a tool that calls an external webhook from our server """ name: str description: str = pydantic.Field() """ Description of when the tool should be used and what it does. """ response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) """ The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 300 seconds (inclusive). """ disable_interruptions: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `interruption_mode` instead. If true, the user will not be able to interrupt the agent while this tool is running. """ interruption_mode: typing.Optional[ToolInterruptionMode] = pydantic.Field(default=None) """ Controls whether the user can interrupt the agent around this tool call. 'allow' (default) lets the user interrupt at any time, 'disable_during_tool' suppresses interruptions only while the tool is running, 'disable_during_tool_and_turn' suppresses interruptions while the tool runs and for the agent response that follows it. """ force_pre_tool_speech: typing.Optional[bool] = pydantic.Field(default=None) """ DEPRECATED: use `pre_tool_speech` instead. If true, the agent will speak before the tool call. """ pre_tool_speech: typing.Optional[PreToolSpeechMode] = pydantic.Field(default=None) """ Controls whether the agent speaks before this tool is called. 'auto' (default) decides based on recent tool latency, 'force' always asks the agent to speak, 'off' fully opts out regardless of latency. """ assignments: typing.Optional[typing.List[DynamicVariableAssignment]] = pydantic.Field(default=None) """ Configuration for extracting values from tool responses and assigning them to dynamic variables """ tool_call_sound: typing.Optional[ToolCallSoundType] = pydantic.Field(default=None) """ Predefined tool call sound type to play during tool execution. If not specified, no tool call sound will be played. """ tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = pydantic.Field(default=None) """ Determines when the tool call sound should play. 'auto' only plays when there's pre-tool speech, 'always' plays for every tool call. """ tool_error_handling_mode: typing.Optional[ToolErrorHandlingMode] = pydantic.Field(default=None) """ Controls how tool errors are processed before being shared with the agent. 'auto' determines handling based on tool type (summarized for native integrations, hide for others), 'summarized' sends an LLM-generated summary, 'passthrough' sends the raw error, 'hide' does not share the error with the agent. """ dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables """ execution_mode: typing.Optional[ToolExecutionMode] = pydantic.Field(default=None) """ Determines when and how the tool executes: 'immediate' executes the tool right away when requested by the LLM, 'post_tool_speech' waits for the agent to finish speaking before executing, 'async' runs the tool in the background without blocking - best for long-running operations. """ api_schema: WebhookToolApiSchemaConfigOutput = pydantic.Field() """ The schema for the outgoing webhoook, including parameters and URL specification """ 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 update_forward_refs(WebhookToolConfigOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_transcript_format.py000066400000000000000000000002541523660243400315370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WebhookTranscriptFormat = typing.Union[typing.Literal["json", "opentelemetry"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/webhook_usage_type.py000066400000000000000000000005741523660243400301500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WebhookUsageType = typing.Union[ typing.Literal[ "ConvAI Agent Settings", "ConvAI Settings", "Voice Library Removal Notices", "Speech to Text", "Agent QA Evaluations", "ConvAI Alerting", "Flows", "Dubbing", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/websocket_tts_client_message_multi.py000066400000000000000000000073211523660243400334160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .generation_config import GenerationConfig from .pronunciation_dictionary_locator import PronunciationDictionaryLocator from .realtime_voice_settings import RealtimeVoiceSettings class WebsocketTtsClientMessageMulti(UncheckedBaseModel): """ Message sent from the client to the multi-context TTS WebSocket. """ text: typing.Optional[str] = pydantic.Field(default=None) """ Text to be synthesized. For the first message establishing a new context (identified by `context_id`, or a default context if `context_id` is absent), this should be a single space character (' '). For subsequent messages to an active context, this is the text to synthesize. This field can be null or an empty string if the message is primarily for control (e.g., using `flush`, `close_context`, or `close_socket`). """ voice_settings: typing.Optional[RealtimeVoiceSettings] = pydantic.Field(default=None) """ Voice settings. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). """ generation_config: typing.Optional[GenerationConfig] = pydantic.Field(default=None) """ Generation config. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). """ xi_api_key: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="xi-api-key"), pydantic.Field( alias="xi-api-key", description="Your ElevenLabs API key. Can only be provided in the first message for a given context_id if not present in the header.", ), ] = None authorization: typing.Optional[str] = pydantic.Field(default=None) """ Your authorization bearer token. Can only be provided in the first message for a given context_id if not present in the header. """ flush: typing.Optional[bool] = pydantic.Field(default=None) """ If true, flushes the audio buffer and returns the remaining audio for the specified `context_id`. """ pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( default=None ) """ Optional list of pronunciation dictionary locators. Can only be provided in the first message for a given context_id. """ context_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="contextId"), pydantic.Field( alias="contextId", description="An identifier for the text-to-speech context. Allows managing multiple independent audio generation streams over a single WebSocket connection. If omitted, a default context is used.", ), ] = None close_context: typing.Optional[bool] = pydantic.Field(default=None) """ If true, closes the specified `contextId`. No further audio will be generated for this context. The `text` field is ignored. """ close_socket: typing.Optional[bool] = pydantic.Field(default=None) """ If true, flushes all contexts and closes the entire WebSocket connection. The `text` and `contextId` fields are ignored. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/websocket_tts_server_message_multi.py000066400000000000000000000033401523660243400334430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .alignment import Alignment from .normalized_alignment import NormalizedAlignment class WebsocketTtsServerMessageMulti(UncheckedBaseModel): """ Message sent from the server to the client for the multi-context TTS WebSocket. """ audio: typing.Optional[str] = pydantic.Field(default=None) """ A generated partial audio chunk, encoded using the selected output_format (e.g., MP3 as a base64 string). """ is_final: typing.Optional[bool] = pydantic.Field(default=None) """ If true, indicates that this is the final message for the specified contextId. This is sent when a context is closed. `audio` will be null or empty. """ normalized_alignment: typing_extensions.Annotated[ typing.Optional[NormalizedAlignment], FieldMetadata(alias="normalizedAlignment"), pydantic.Field(alias="normalizedAlignment"), ] = None alignment: typing.Optional[Alignment] = None context_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="contextId"), pydantic.Field(alias="contextId", description="The context identifier to which this message pertains."), ] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_auth_response.py000066400000000000000000000017651523660243400312150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .auth_connection_dependencies import AuthConnectionDependencies from .auth_connection_status import AuthConnectionStatus class WhatsAppAuthResponse(UncheckedBaseModel): name: str provider: typing.Optional[typing.Literal["whatsapp"]] = None phone_number_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_conversation_info.py000066400000000000000000000015341523660243400320550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_conversation_info_direction import WhatsAppConversationInfoDirection class WhatsAppConversationInfo(UncheckedBaseModel): direction: typing.Optional[WhatsAppConversationInfoDirection] = None whatsapp_phone_number_id: typing.Optional[str] = None whatsapp_user_id: str awaiting_first_user_message: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_conversation_info_direction.py000066400000000000000000000002771523660243400341200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WhatsAppConversationInfoDirection = typing.Union[typing.Literal["inbound", "outbound", "unknown"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_outbound_call_response.py000066400000000000000000000012041523660243400330720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppOutboundCallResponse(UncheckedBaseModel): success: bool message: str conversation_id: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_outbound_message_response.py000066400000000000000000000011141523660243400336030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppOutboundMessageResponse(UncheckedBaseModel): conversation_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 whats_app_template_body_component_params.py000066400000000000000000000012631523660243400345250ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_text_param import WhatsAppTemplateTextParam class WhatsAppTemplateBodyComponentParams(UncheckedBaseModel): parameters: typing.List[WhatsAppTemplateTextParam] 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 whats_app_template_button_component_params.py000066400000000000000000000013261523660243400351030ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_text_param import WhatsAppTemplateTextParam class WhatsAppTemplateButtonComponentParams(UncheckedBaseModel): parameters: typing.List[WhatsAppTemplateTextParam] index: int sub_type: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_template_document_param.py000066400000000000000000000013001523660243400332100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_document_param_details import WhatsAppTemplateDocumentParamDetails class WhatsAppTemplateDocumentParam(UncheckedBaseModel): document: WhatsAppTemplateDocumentParamDetails 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 whats_app_template_document_param_details.py000066400000000000000000000011601523660243400346420ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppTemplateDocumentParamDetails(UncheckedBaseModel): link: str filename: 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 whats_app_template_header_component_params.py000066400000000000000000000014171523660243400350210ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_header_component_params_parameters_item import ( WhatsAppTemplateHeaderComponentParamsParametersItem, ) class WhatsAppTemplateHeaderComponentParams(UncheckedBaseModel): parameters: typing.List[WhatsAppTemplateHeaderComponentParamsParametersItem] 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 whats_app_template_header_component_params_parameters_item.py000066400000000000000000000055271523660243400402700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .whats_app_template_document_param_details import WhatsAppTemplateDocumentParamDetails from .whats_app_template_image_param_details import WhatsAppTemplateImageParamDetails from .whats_app_template_location_param_details import WhatsAppTemplateLocationParamDetails class WhatsAppTemplateHeaderComponentParamsParametersItem_Document(UncheckedBaseModel): type: typing.Literal["document"] = "document" document: WhatsAppTemplateDocumentParamDetails 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 WhatsAppTemplateHeaderComponentParamsParametersItem_Image(UncheckedBaseModel): type: typing.Literal["image"] = "image" image: WhatsAppTemplateImageParamDetails 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 WhatsAppTemplateHeaderComponentParamsParametersItem_Location(UncheckedBaseModel): type: typing.Literal["location"] = "location" location: WhatsAppTemplateLocationParamDetails 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 WhatsAppTemplateHeaderComponentParamsParametersItem_Text(UncheckedBaseModel): type: typing.Literal["text"] = "text" parameter_name: typing.Optional[str] = None text: 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 WhatsAppTemplateHeaderComponentParamsParametersItem = typing_extensions.Annotated[ typing.Union[ WhatsAppTemplateHeaderComponentParamsParametersItem_Document, WhatsAppTemplateHeaderComponentParamsParametersItem_Image, WhatsAppTemplateHeaderComponentParamsParametersItem_Location, WhatsAppTemplateHeaderComponentParamsParametersItem_Text, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_template_image_param.py000066400000000000000000000012611523660243400324620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_image_param_details import WhatsAppTemplateImageParamDetails class WhatsAppTemplateImageParam(UncheckedBaseModel): image: WhatsAppTemplateImageParamDetails 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_template_image_param_details.py000066400000000000000000000011031523660243400341620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppTemplateImageParamDetails(UncheckedBaseModel): link: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_template_location_param.py000066400000000000000000000013001523660243400332020ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .whats_app_template_location_param_details import WhatsAppTemplateLocationParamDetails class WhatsAppTemplateLocationParam(UncheckedBaseModel): location: WhatsAppTemplateLocationParamDetails 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 whats_app_template_location_param_details.py000066400000000000000000000011741523660243400346410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppTemplateLocationParamDetails(UncheckedBaseModel): latitude: str longitude: str name: str address: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/whats_app_template_text_param.py000066400000000000000000000012441523660243400323650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WhatsAppTemplateTextParam(UncheckedBaseModel): parameter_name: typing.Optional[str] = None type: typing.Optional[typing.Literal["text"]] = None text: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_config.py000066400000000000000000000176411523660243400271000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .allowlist_item import AllowlistItem from .embed_variant import EmbedVariant from .widget_config_avatar import WidgetConfigAvatar from .widget_config_syntax_highlight_theme import WidgetConfigSyntaxHighlightTheme from .widget_end_feedback_config import WidgetEndFeedbackConfig from .widget_expandable import WidgetExpandable from .widget_feedback_mode import WidgetFeedbackMode from .widget_language_preset import WidgetLanguagePreset from .widget_placement import WidgetPlacement from .widget_styles import WidgetStyles from .widget_text_contents import WidgetTextContents class WidgetConfig(UncheckedBaseModel): variant: typing.Optional[EmbedVariant] = pydantic.Field(default=None) """ The variant of the widget """ placement: typing.Optional[WidgetPlacement] = pydantic.Field(default=None) """ The placement of the widget on the screen """ expandable: typing.Optional[WidgetExpandable] = pydantic.Field(default=None) """ Whether the widget is expandable """ avatar: typing.Optional[WidgetConfigAvatar] = pydantic.Field(default=None) """ The avatar of the widget """ feedback_mode: typing.Optional[WidgetFeedbackMode] = pydantic.Field(default=None) """ The feedback mode of the widget """ end_feedback: typing.Optional[WidgetEndFeedbackConfig] = pydantic.Field(default=None) """ Configuration for feedback collected at the end of the conversation """ bg_color: typing.Optional[str] = pydantic.Field(default=None) """ The background color of the widget """ text_color: typing.Optional[str] = pydantic.Field(default=None) """ The text color of the widget """ btn_color: typing.Optional[str] = pydantic.Field(default=None) """ The button color of the widget """ btn_text_color: typing.Optional[str] = pydantic.Field(default=None) """ The button text color of the widget """ border_color: typing.Optional[str] = pydantic.Field(default=None) """ The border color of the widget """ focus_color: typing.Optional[str] = pydantic.Field(default=None) """ The focus color of the widget """ border_radius: typing.Optional[int] = pydantic.Field(default=None) """ The border radius of the widget """ btn_radius: typing.Optional[int] = pydantic.Field(default=None) """ The button radius of the widget """ action_text: typing.Optional[str] = pydantic.Field(default=None) """ The action text of the widget """ start_call_text: typing.Optional[str] = pydantic.Field(default=None) """ The start call text of the widget """ end_call_text: typing.Optional[str] = pydantic.Field(default=None) """ The end call text of the widget """ expand_text: typing.Optional[str] = pydantic.Field(default=None) """ The expand text of the widget """ listening_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when the agent is listening """ speaking_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when the agent is speaking """ shareable_page_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when sharing """ shareable_page_show_terms: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show terms and conditions on the shareable page """ terms_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display for terms and conditions """ terms_html: typing.Optional[str] = pydantic.Field(default=None) """ The HTML to display for terms and conditions """ terms_key: typing.Optional[str] = pydantic.Field(default=None) """ The key to display for terms and conditions """ show_avatar_when_collapsed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the avatar when the widget is collapsed """ disable_banner: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to disable the banner """ override_link: typing.Optional[str] = pydantic.Field(default=None) """ The override link for the widget """ markdown_link_allowed_hosts: typing.Optional[typing.List[AllowlistItem]] = pydantic.Field(default=None) """ List of allowed hostnames for clickable markdown links. Use { hostname: '*' } to allow any domain. Empty means no links are allowed. """ markdown_link_include_www: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to automatically include www. variants of allowed hosts """ markdown_link_allow_http: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow http:// in addition to https:// for allowed hosts """ mic_muting_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable mic muting """ transcript_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should show the conversation transcript as it goes on """ text_input_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the user should be able to send text messages """ conversation_mode_toggle_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable the conversation mode toggle in the widget """ default_expanded: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should be expanded by default """ always_expanded: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should always be expanded """ dismissible: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget can be dismissed by the user """ show_agent_status: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show agent working/done/error status during tool use """ show_conversation_id: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the conversation ID after disconnection. """ strip_audio_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to strip audio markup from messages. """ syntax_highlight_theme: typing.Optional[WidgetConfigSyntaxHighlightTheme] = pydantic.Field(default=None) """ Theme for code block syntax highlighting. Defaults to auto-detection by the widget when not set. """ text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None) """ Text contents of the widget """ styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None) """ Styles for the widget """ show_resize_button: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the resize button """ language_selector: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the language selector """ supports_text_only: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget can switch to text only mode """ custom_avatar_path: typing.Optional[str] = pydantic.Field(default=None) """ The custom avatar path """ language_presets: typing.Optional[typing.Dict[str, WidgetLanguagePreset]] = pydantic.Field(default=None) """ Language presets for the widget """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_config_avatar.py000066400000000000000000000036171523660243400304340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WidgetConfigAvatar_Orb(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["orb"] = "orb" color_1: typing.Optional[str] = None color_2: 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 class WidgetConfigAvatar_Url(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["url"] = "url" custom_url: 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 class WidgetConfigAvatar_Image(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["image"] = "image" url: 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 WidgetConfigAvatar = typing_extensions.Annotated[ typing.Union[WidgetConfigAvatar_Orb, WidgetConfigAvatar_Url, WidgetConfigAvatar_Image], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_config_response.py000066400000000000000000000205251523660243400310110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .allowlist_item import AllowlistItem from .embed_variant import EmbedVariant from .file_input_config import FileInputConfig from .widget_config_response_avatar import WidgetConfigResponseAvatar from .widget_config_response_syntax_highlight_theme import WidgetConfigResponseSyntaxHighlightTheme from .widget_end_feedback_config import WidgetEndFeedbackConfig from .widget_expandable import WidgetExpandable from .widget_feedback_mode import WidgetFeedbackMode from .widget_language_preset_response import WidgetLanguagePresetResponse from .widget_placement import WidgetPlacement from .widget_styles import WidgetStyles from .widget_text_contents import WidgetTextContents class WidgetConfigResponse(UncheckedBaseModel): variant: typing.Optional[EmbedVariant] = pydantic.Field(default=None) """ The variant of the widget """ placement: typing.Optional[WidgetPlacement] = pydantic.Field(default=None) """ The placement of the widget on the screen """ expandable: typing.Optional[WidgetExpandable] = pydantic.Field(default=None) """ Whether the widget is expandable """ avatar: typing.Optional[WidgetConfigResponseAvatar] = pydantic.Field(default=None) """ The avatar of the widget """ feedback_mode: typing.Optional[WidgetFeedbackMode] = pydantic.Field(default=None) """ The feedback mode of the widget """ end_feedback: typing.Optional[WidgetEndFeedbackConfig] = pydantic.Field(default=None) """ Configuration for feedback collected at the end of the conversation """ bg_color: typing.Optional[str] = pydantic.Field(default=None) """ The background color of the widget """ text_color: typing.Optional[str] = pydantic.Field(default=None) """ The text color of the widget """ btn_color: typing.Optional[str] = pydantic.Field(default=None) """ The button color of the widget """ btn_text_color: typing.Optional[str] = pydantic.Field(default=None) """ The button text color of the widget """ border_color: typing.Optional[str] = pydantic.Field(default=None) """ The border color of the widget """ focus_color: typing.Optional[str] = pydantic.Field(default=None) """ The focus color of the widget """ border_radius: typing.Optional[int] = pydantic.Field(default=None) """ The border radius of the widget """ btn_radius: typing.Optional[int] = pydantic.Field(default=None) """ The button radius of the widget """ action_text: typing.Optional[str] = pydantic.Field(default=None) """ The action text of the widget """ start_call_text: typing.Optional[str] = pydantic.Field(default=None) """ The start call text of the widget """ end_call_text: typing.Optional[str] = pydantic.Field(default=None) """ The end call text of the widget """ expand_text: typing.Optional[str] = pydantic.Field(default=None) """ The expand text of the widget """ listening_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when the agent is listening """ speaking_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when the agent is speaking """ shareable_page_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display when sharing """ shareable_page_show_terms: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show terms and conditions on the shareable page """ terms_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display for terms and conditions """ terms_html: typing.Optional[str] = pydantic.Field(default=None) """ The HTML to display for terms and conditions """ terms_key: typing.Optional[str] = pydantic.Field(default=None) """ The key to display for terms and conditions """ show_avatar_when_collapsed: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the avatar when the widget is collapsed """ disable_banner: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to disable the banner """ override_link: typing.Optional[str] = pydantic.Field(default=None) """ The override link for the widget """ markdown_link_allowed_hosts: typing.Optional[typing.List[AllowlistItem]] = pydantic.Field(default=None) """ List of allowed hostnames for clickable markdown links. Use { hostname: '*' } to allow any domain. Empty means no links are allowed. """ markdown_link_include_www: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to automatically include www. variants of allowed hosts """ markdown_link_allow_http: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to allow http:// in addition to https:// for allowed hosts """ mic_muting_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable mic muting """ transcript_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should show the conversation transcript as it goes on """ text_input_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the user should be able to send text messages """ conversation_mode_toggle_enabled: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable the conversation mode toggle in the widget """ default_expanded: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should be expanded by default """ always_expanded: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget should always be expanded """ dismissible: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the widget can be dismissed by the user """ show_agent_status: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show agent working/done/error status during tool use """ show_conversation_id: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the conversation ID after disconnection. """ strip_audio_tags: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to strip audio markup from messages. """ syntax_highlight_theme: typing.Optional[WidgetConfigResponseSyntaxHighlightTheme] = pydantic.Field(default=None) """ Theme for code block syntax highlighting. Defaults to auto-detection by the widget when not set. """ text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None) """ Text contents of the widget """ styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None) """ Styles for the widget """ show_resize_button: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the resize button """ language: str supported_language_overrides: typing.Optional[typing.List[str]] = None language_presets: typing.Optional[typing.Dict[str, WidgetLanguagePresetResponse]] = pydantic.Field(default=None) """ Language presets for the widget """ text_only: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the agent uses text-only mode """ supports_text_only: typing.Optional[bool] = pydantic.Field(default=None) """ Whether the agent can be switched to text-only mode """ first_message: typing.Optional[str] = None use_rtc: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to use WebRTC for conversation connections """ file_input_config: typing.Optional[FileInputConfig] = pydantic.Field(default=None) """ Configuration for file upload in the widget """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_config_response_avatar.py000066400000000000000000000037071523660243400323520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WidgetConfigResponseAvatar_Orb(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["orb"] = "orb" color_1: typing.Optional[str] = None color_2: 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 class WidgetConfigResponseAvatar_Url(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["url"] = "url" custom_url: 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 class WidgetConfigResponseAvatar_Image(UncheckedBaseModel): """ The avatar of the widget """ type: typing.Literal["image"] = "image" url: 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 WidgetConfigResponseAvatar = typing_extensions.Annotated[ typing.Union[WidgetConfigResponseAvatar_Orb, WidgetConfigResponseAvatar_Url, WidgetConfigResponseAvatar_Image], UnionMetadata(discriminant="type"), ] widget_config_response_syntax_highlight_theme.py000066400000000000000000000002651523660243400355500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WidgetConfigResponseSyntaxHighlightTheme = typing.Union[typing.Literal["light", "dark"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_config_syntax_highlight_theme.py000066400000000000000000000002551523660243400337100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WidgetConfigSyntaxHighlightTheme = typing.Union[typing.Literal["light", "dark"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_end_feedback_config.py000066400000000000000000000014121523660243400315170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .widget_end_feedback_type import WidgetEndFeedbackType class WidgetEndFeedbackConfig(UncheckedBaseModel): type: typing.Optional[WidgetEndFeedbackType] = pydantic.Field(default=None) """ The type of feedback to collect at the end of the conversation """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_end_feedback_type.py000066400000000000000000000002011523660243400312260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WidgetEndFeedbackType = typing.Literal["rating"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_expandable.py000066400000000000000000000002641523660243400277270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WidgetExpandable = typing.Union[typing.Literal["never", "mobile", "desktop", "always"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_feedback_mode.py000066400000000000000000000002471523660243400303550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WidgetFeedbackMode = typing.Union[typing.Literal["none", "during", "end"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_language_preset.py000066400000000000000000000032041523660243400307660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .widget_terms_translation import WidgetTermsTranslation from .widget_text_contents import WidgetTextContents from .widget_text_contents_translation import WidgetTextContentsTranslation class WidgetLanguagePreset(UncheckedBaseModel): text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None) """ The text contents for the selected language """ text_contents_translation: typing.Optional[WidgetTextContentsTranslation] = pydantic.Field(default=None) """ The translation cache for the text contents """ terms_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display for terms and conditions in this language """ terms_html: typing.Optional[str] = pydantic.Field(default=None) """ The HTML to display for terms and conditions in this language """ terms_key: typing.Optional[str] = pydantic.Field(default=None) """ The key to display for terms and conditions in this language """ terms_translation: typing.Optional[WidgetTermsTranslation] = pydantic.Field(default=None) """ The translation cache for the terms """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_language_preset_response.py000066400000000000000000000023551523660243400327120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .widget_text_contents import WidgetTextContents class WidgetLanguagePresetResponse(UncheckedBaseModel): first_message: typing.Optional[str] = None text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None) """ The text contents for the selected language """ terms_text: typing.Optional[str] = pydantic.Field(default=None) """ The text to display for terms and conditions in this language """ terms_html: typing.Optional[str] = pydantic.Field(default=None) """ The HTML to display for terms and conditions in this language """ terms_key: typing.Optional[str] = pydantic.Field(default=None) """ The key to display for terms and conditions in this language """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_placement.py000066400000000000000000000003321523660243400275700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WidgetPlacement = typing.Union[ typing.Literal["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_styles.py000066400000000000000000000063121523660243400271470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WidgetStyles(UncheckedBaseModel): base: typing.Optional[str] = pydantic.Field(default=None) """ The base background color. """ base_hover: typing.Optional[str] = pydantic.Field(default=None) """ The color of the base background when hovered. """ base_active: typing.Optional[str] = pydantic.Field(default=None) """ The color of the base background when active (clicked). """ base_border: typing.Optional[str] = pydantic.Field(default=None) """ The color of the border against the base background. """ base_subtle: typing.Optional[str] = pydantic.Field(default=None) """ The color of subtle text against the base background. """ base_primary: typing.Optional[str] = pydantic.Field(default=None) """ The color of primary text against the base background. """ base_error: typing.Optional[str] = pydantic.Field(default=None) """ The color of error text against the base background. """ accent: typing.Optional[str] = pydantic.Field(default=None) """ The accent background color. """ accent_hover: typing.Optional[str] = pydantic.Field(default=None) """ The color of the accent background when hovered. """ accent_active: typing.Optional[str] = pydantic.Field(default=None) """ The color of the accent background when active (clicked). """ accent_border: typing.Optional[str] = pydantic.Field(default=None) """ The color of the border against the accent background. """ accent_subtle: typing.Optional[str] = pydantic.Field(default=None) """ The color of subtle text against the accent background. """ accent_primary: typing.Optional[str] = pydantic.Field(default=None) """ The color of primary text against the accent background. """ overlay_padding: typing.Optional[float] = pydantic.Field(default=None) """ The padding around the edges of the viewport. """ button_radius: typing.Optional[float] = pydantic.Field(default=None) """ The radius of the buttons. """ input_radius: typing.Optional[float] = pydantic.Field(default=None) """ The radius of the input fields. """ bubble_radius: typing.Optional[float] = pydantic.Field(default=None) """ The radius of the chat bubbles. """ sheet_radius: typing.Optional[float] = pydantic.Field(default=None) """ The default radius of sheets. """ compact_sheet_radius: typing.Optional[float] = pydantic.Field(default=None) """ The radius of the sheet in compact mode. """ dropdown_sheet_radius: typing.Optional[float] = pydantic.Field(default=None) """ The radius of the dropdown sheet. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_terms_translation.py000066400000000000000000000011151523660243400313700ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WidgetTermsTranslation(UncheckedBaseModel): source_hash: str text: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_text_contents.py000066400000000000000000000177761523660243400305450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class WidgetTextContents(UncheckedBaseModel): main_label: typing.Optional[str] = pydantic.Field(default=None) """ Call to action displayed inside the compact and full variants. """ start_call: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the start call button. """ start_chat: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the start chat button (text only) """ new_call: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the new call button. Displayed when the caller already finished at least one call in order ot start the next one. """ end_call: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the end call button. """ mute_microphone: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the mute microphone button. """ change_language: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the change language dropdown. """ collapse: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the collapse button. """ expand: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the expand button. """ copied: typing.Optional[str] = pydantic.Field(default=None) """ Text displayed when the user copies a value using the copy button. """ accept_terms: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the accept terms button. """ dismiss_terms: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the cancel terms button. """ listening_status: typing.Optional[str] = pydantic.Field(default=None) """ Status displayed when the agent is listening. """ speaking_status: typing.Optional[str] = pydantic.Field(default=None) """ Status displayed when the agent is speaking. """ connecting_status: typing.Optional[str] = pydantic.Field(default=None) """ Status displayed when the agent is connecting. """ chatting_status: typing.Optional[str] = pydantic.Field(default=None) """ Status displayed when the agent is chatting (text only) """ input_label: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the text message input. """ input_placeholder: typing.Optional[str] = pydantic.Field(default=None) """ Placeholder text for the text message input. """ input_placeholder_text_only: typing.Optional[str] = pydantic.Field(default=None) """ Placeholder text for the text message input (text only) """ input_placeholder_new_conversation: typing.Optional[str] = pydantic.Field(default=None) """ Placeholder text for the text message input when starting a new conversation (text only) """ user_ended_conversation: typing.Optional[str] = pydantic.Field(default=None) """ Information message displayed when the user ends the conversation. """ agent_ended_conversation: typing.Optional[str] = pydantic.Field(default=None) """ Information message displayed when the agent ends the conversation. """ conversation_id: typing.Optional[str] = pydantic.Field(default=None) """ Text label used next to the conversation ID. """ error_occurred: typing.Optional[str] = pydantic.Field(default=None) """ Text label used when an error occurs. """ copy_id: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label used for the copy ID button. """ initiate_feedback: typing.Optional[str] = pydantic.Field(default=None) """ Text displayed to prompt the user for feedback. """ request_follow_up_feedback: typing.Optional[str] = pydantic.Field(default=None) """ Text displayed to request additional feedback details. """ thanks_for_feedback: typing.Optional[str] = pydantic.Field(default=None) """ Text displayed to thank the user for providing feedback. """ thanks_for_feedback_details: typing.Optional[str] = pydantic.Field(default=None) """ Additional text displayed explaining the value of user feedback. """ follow_up_feedback_placeholder: typing.Optional[str] = pydantic.Field(default=None) """ Placeholder text for the follow-up feedback input field. """ submit: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the submit button. """ go_back: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the go back button. """ send_message: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the send message button. """ text_mode: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the switch to text mode button. """ voice_mode: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the switch to voice mode button. """ switched_to_text_mode: typing.Optional[str] = pydantic.Field(default=None) """ Toast notification displayed when switching to text mode. """ switched_to_voice_mode: typing.Optional[str] = pydantic.Field(default=None) """ Toast notification displayed when switching to voice mode. """ copy_: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="copy"), pydantic.Field(alias="copy", description="Text and ARIA label for the copy button."), ] = None download: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the download button. """ wrap: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the wrap toggle button. """ agent_working: typing.Optional[str] = pydantic.Field(default=None) """ Status text displayed when the agent is processing a tool call. """ agent_done: typing.Optional[str] = pydantic.Field(default=None) """ Status text displayed when the agent finishes processing a tool call. """ agent_error: typing.Optional[str] = pydantic.Field(default=None) """ Status text displayed when the agent encounters an error during a tool call. """ attach_file: typing.Optional[str] = pydantic.Field(default=None) """ Text and ARIA label for the attach file button. """ remove_file: typing.Optional[str] = pydantic.Field(default=None) """ ARIA label for the remove file button. """ file_upload_error: typing.Optional[str] = pydantic.Field(default=None) """ Error message displayed when a file fails to upload. """ file_type_unsupported: typing.Optional[str] = pydantic.Field(default=None) """ Error message displayed when an unsupported file type is selected. Followed by the list of accepted types. """ file_too_large: typing.Optional[str] = pydantic.Field(default=None) """ Error message displayed when a file exceeds the maximum size limit. """ file_limit_reached: typing.Optional[str] = pydantic.Field(default=None) """ Error message displayed when the maximum number of files for a conversation is reached. """ typing_indicator: typing.Optional[str] = pydantic.Field(default=None) """ Status text displayed while the agent is typing. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/widget_text_contents_translation.py000066400000000000000000000015551523660243400331470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WidgetTextContentsTranslation(UncheckedBaseModel): source: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ The source text each translated field was derived from """ text: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ The last auto-translated output for each translated field """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/word_timestamp.py000066400000000000000000000011211523660243400273100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WordTimestamp(UncheckedBaseModel): word: str start_ms: int end_ms: int 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_edge_model_input.py000066400000000000000000000027031523660243400315160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .workflow_edge_model_input_backward_condition import WorkflowEdgeModelInputBackwardCondition from .workflow_edge_model_input_forward_condition import WorkflowEdgeModelInputForwardCondition class WorkflowEdgeModelInput(UncheckedBaseModel): source: str = pydantic.Field() """ ID of the source node. """ target: str = pydantic.Field() """ ID of the target node. """ forward_condition: typing.Optional[WorkflowEdgeModelInputForwardCondition] = pydantic.Field(default=None) """ Condition that must be met for the edge to be traversed in the forward direction (source to target). """ backward_condition: typing.Optional[WorkflowEdgeModelInputBackwardCondition] = pydantic.Field(default=None) """ Condition that must be met for the edge to be traversed in the backward direction (target to source). """ 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 update_forward_refs(WorkflowEdgeModelInput) workflow_edge_model_input_backward_condition.py000066400000000000000000000114631523660243400353460ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowEdgeModelInputBackwardCondition_Expression(UncheckedBaseModel): type: typing.Literal["expression"] = "expression" label: typing.Optional[str] = None expression: "AstNodeInput" 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 WorkflowEdgeModelInputBackwardCondition_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" label: typing.Optional[str] = None 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 class WorkflowEdgeModelInputBackwardCondition_Result(UncheckedBaseModel): type: typing.Literal["result"] = "result" label: typing.Optional[str] = None successful: bool 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 WorkflowEdgeModelInputBackwardCondition_Unconditional(UncheckedBaseModel): type: typing.Literal["unconditional"] = "unconditional" label: 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 WorkflowEdgeModelInputBackwardCondition = typing_extensions.Annotated[ typing.Union[ WorkflowEdgeModelInputBackwardCondition_Expression, WorkflowEdgeModelInputBackwardCondition_Llm, WorkflowEdgeModelInputBackwardCondition_Result, WorkflowEdgeModelInputBackwardCondition_Unconditional, ], UnionMetadata(discriminant="type"), ] from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( WorkflowEdgeModelInputBackwardCondition_Expression, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) workflow_edge_model_input_forward_condition.py000066400000000000000000000114511523660243400352310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowEdgeModelInputForwardCondition_Expression(UncheckedBaseModel): type: typing.Literal["expression"] = "expression" label: typing.Optional[str] = None expression: "AstNodeInput" 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 WorkflowEdgeModelInputForwardCondition_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" label: typing.Optional[str] = None 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 class WorkflowEdgeModelInputForwardCondition_Result(UncheckedBaseModel): type: typing.Literal["result"] = "result" label: typing.Optional[str] = None successful: bool 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 WorkflowEdgeModelInputForwardCondition_Unconditional(UncheckedBaseModel): type: typing.Literal["unconditional"] = "unconditional" label: 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 WorkflowEdgeModelInputForwardCondition = typing_extensions.Annotated[ typing.Union[ WorkflowEdgeModelInputForwardCondition_Expression, WorkflowEdgeModelInputForwardCondition_Llm, WorkflowEdgeModelInputForwardCondition_Result, WorkflowEdgeModelInputForwardCondition_Unconditional, ], UnionMetadata(discriminant="type"), ] from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( WorkflowEdgeModelInputForwardCondition_Expression, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_edge_model_output.py000066400000000000000000000027131523660243400317200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .workflow_edge_model_output_backward_condition import WorkflowEdgeModelOutputBackwardCondition from .workflow_edge_model_output_forward_condition import WorkflowEdgeModelOutputForwardCondition class WorkflowEdgeModelOutput(UncheckedBaseModel): source: str = pydantic.Field() """ ID of the source node. """ target: str = pydantic.Field() """ ID of the target node. """ forward_condition: typing.Optional[WorkflowEdgeModelOutputForwardCondition] = pydantic.Field(default=None) """ Condition that must be met for the edge to be traversed in the forward direction (source to target). """ backward_condition: typing.Optional[WorkflowEdgeModelOutputBackwardCondition] = pydantic.Field(default=None) """ Condition that must be met for the edge to be traversed in the backward direction (target to source). """ 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 update_forward_refs(WorkflowEdgeModelOutput) workflow_edge_model_output_backward_condition.py000066400000000000000000000115661523660243400355530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowEdgeModelOutputBackwardCondition_Expression(UncheckedBaseModel): type: typing.Literal["expression"] = "expression" label: typing.Optional[str] = None expression: "AstNodeOutput" 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 WorkflowEdgeModelOutputBackwardCondition_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" label: typing.Optional[str] = None 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 class WorkflowEdgeModelOutputBackwardCondition_Result(UncheckedBaseModel): type: typing.Literal["result"] = "result" label: typing.Optional[str] = None successful: bool 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 WorkflowEdgeModelOutputBackwardCondition_Unconditional(UncheckedBaseModel): type: typing.Literal["unconditional"] = "unconditional" label: 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 WorkflowEdgeModelOutputBackwardCondition = typing_extensions.Annotated[ typing.Union[ WorkflowEdgeModelOutputBackwardCondition_Expression, WorkflowEdgeModelOutputBackwardCondition_Llm, WorkflowEdgeModelOutputBackwardCondition_Result, WorkflowEdgeModelOutputBackwardCondition_Unconditional, ], UnionMetadata(discriminant="type"), ] from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( WorkflowEdgeModelOutputBackwardCondition_Expression, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) workflow_edge_model_output_forward_condition.py000066400000000000000000000115541523660243400354360ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowEdgeModelOutputForwardCondition_Expression(UncheckedBaseModel): type: typing.Literal["expression"] = "expression" label: typing.Optional[str] = None expression: "AstNodeOutput" 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 WorkflowEdgeModelOutputForwardCondition_Llm(UncheckedBaseModel): type: typing.Literal["llm"] = "llm" label: typing.Optional[str] = None 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 class WorkflowEdgeModelOutputForwardCondition_Result(UncheckedBaseModel): type: typing.Literal["result"] = "result" label: typing.Optional[str] = None successful: bool 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 WorkflowEdgeModelOutputForwardCondition_Unconditional(UncheckedBaseModel): type: typing.Literal["unconditional"] = "unconditional" label: 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 WorkflowEdgeModelOutputForwardCondition = typing_extensions.Annotated[ typing.Union[ WorkflowEdgeModelOutputForwardCondition_Expression, WorkflowEdgeModelOutputForwardCondition_Llm, WorkflowEdgeModelOutputForwardCondition_Result, WorkflowEdgeModelOutputForwardCondition_Unconditional, ], UnionMetadata(discriminant="type"), ] from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( WorkflowEdgeModelOutputForwardCondition_Expression, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_end_node_model_input.py000066400000000000000000000016041523660243400323640ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_input import PositionInput class WorkflowEndNodeModelInput(UncheckedBaseModel): position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_end_node_model_output.py000066400000000000000000000015161523660243400325670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_output import PositionOutput class WorkflowEndNodeModelOutput(UncheckedBaseModel): position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ 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 workflow_expression_condition_model_input.py000066400000000000000000000061641523660243400350050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowExpressionConditionModelInput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ expression: "AstNodeInput" = pydantic.Field() """ Expression to evaluate. """ 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 from .ast_addition_operator_node_input import AstAdditionOperatorNodeInput # noqa: E402, I001 from .ast_and_operator_node_input import AstAndOperatorNodeInput # noqa: E402, I001 from .ast_conditional_operator_node_input import AstConditionalOperatorNodeInput # noqa: E402, I001 from .ast_division_operator_node_input import AstDivisionOperatorNodeInput # noqa: E402, I001 from .ast_equals_operator_node_input import AstEqualsOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_operator_node_input import AstGreaterThanOperatorNodeInput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_input import AstGreaterThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_less_than_operator_node_input import AstLessThanOperatorNodeInput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_input import AstLessThanOrEqualsOperatorNodeInput # noqa: E402, I001 from .ast_multiplication_operator_node_input import AstMultiplicationOperatorNodeInput # noqa: E402, I001 from .ast_node_input import AstNodeInput # noqa: E402, I001 from .ast_not_equals_operator_node_input import AstNotEqualsOperatorNodeInput # noqa: E402, I001 from .ast_or_operator_node_input import AstOrOperatorNodeInput # noqa: E402, I001 from .ast_subtraction_operator_node_input import AstSubtractionOperatorNodeInput # noqa: E402, I001 update_forward_refs( WorkflowExpressionConditionModelInput, AstAdditionOperatorNodeInput=AstAdditionOperatorNodeInput, AstAndOperatorNodeInput=AstAndOperatorNodeInput, AstConditionalOperatorNodeInput=AstConditionalOperatorNodeInput, AstDivisionOperatorNodeInput=AstDivisionOperatorNodeInput, AstEqualsOperatorNodeInput=AstEqualsOperatorNodeInput, AstGreaterThanOperatorNodeInput=AstGreaterThanOperatorNodeInput, AstGreaterThanOrEqualsOperatorNodeInput=AstGreaterThanOrEqualsOperatorNodeInput, AstLessThanOperatorNodeInput=AstLessThanOperatorNodeInput, AstLessThanOrEqualsOperatorNodeInput=AstLessThanOrEqualsOperatorNodeInput, AstMultiplicationOperatorNodeInput=AstMultiplicationOperatorNodeInput, AstNodeInput=AstNodeInput, AstNotEqualsOperatorNodeInput=AstNotEqualsOperatorNodeInput, AstOrOperatorNodeInput=AstOrOperatorNodeInput, AstSubtractionOperatorNodeInput=AstSubtractionOperatorNodeInput, ) workflow_expression_condition_model_output.py000066400000000000000000000062571523660243400352110ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowExpressionConditionModelOutput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ expression: "AstNodeOutput" = pydantic.Field() """ Expression to evaluate. """ 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 from .ast_addition_operator_node_output import AstAdditionOperatorNodeOutput # noqa: E402, I001 from .ast_and_operator_node_output import AstAndOperatorNodeOutput # noqa: E402, I001 from .ast_conditional_operator_node_output import AstConditionalOperatorNodeOutput # noqa: E402, I001 from .ast_division_operator_node_output import AstDivisionOperatorNodeOutput # noqa: E402, I001 from .ast_equals_operator_node_output import AstEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_operator_node_output import AstGreaterThanOperatorNodeOutput # noqa: E402, I001 from .ast_greater_than_or_equals_operator_node_output import AstGreaterThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_operator_node_output import AstLessThanOperatorNodeOutput # noqa: E402, I001 from .ast_less_than_or_equals_operator_node_output import AstLessThanOrEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_multiplication_operator_node_output import AstMultiplicationOperatorNodeOutput # noqa: E402, I001 from .ast_node_output import AstNodeOutput # noqa: E402, I001 from .ast_not_equals_operator_node_output import AstNotEqualsOperatorNodeOutput # noqa: E402, I001 from .ast_or_operator_node_output import AstOrOperatorNodeOutput # noqa: E402, I001 from .ast_subtraction_operator_node_output import AstSubtractionOperatorNodeOutput # noqa: E402, I001 update_forward_refs( WorkflowExpressionConditionModelOutput, AstAdditionOperatorNodeOutput=AstAdditionOperatorNodeOutput, AstAndOperatorNodeOutput=AstAndOperatorNodeOutput, AstConditionalOperatorNodeOutput=AstConditionalOperatorNodeOutput, AstDivisionOperatorNodeOutput=AstDivisionOperatorNodeOutput, AstEqualsOperatorNodeOutput=AstEqualsOperatorNodeOutput, AstGreaterThanOperatorNodeOutput=AstGreaterThanOperatorNodeOutput, AstGreaterThanOrEqualsOperatorNodeOutput=AstGreaterThanOrEqualsOperatorNodeOutput, AstLessThanOperatorNodeOutput=AstLessThanOperatorNodeOutput, AstLessThanOrEqualsOperatorNodeOutput=AstLessThanOrEqualsOperatorNodeOutput, AstMultiplicationOperatorNodeOutput=AstMultiplicationOperatorNodeOutput, AstNodeOutput=AstNodeOutput, AstNotEqualsOperatorNodeOutput=AstNotEqualsOperatorNodeOutput, AstOrOperatorNodeOutput=AstOrOperatorNodeOutput, AstSubtractionOperatorNodeOutput=AstSubtractionOperatorNodeOutput, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_features_usage_common_model.py000066400000000000000000000016631523660243400337510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .feature_status_common_model import FeatureStatusCommonModel class WorkflowFeaturesUsageCommonModel(UncheckedBaseModel): enabled: typing.Optional[bool] = None tool_node: typing.Optional[FeatureStatusCommonModel] = None standalone_agent_node: typing.Optional[FeatureStatusCommonModel] = None phone_number_node: typing.Optional[FeatureStatusCommonModel] = None end_node: typing.Optional[FeatureStatusCommonModel] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_llm_condition_model_input.py000066400000000000000000000014361523660243400334460ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowLlmConditionModelInput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ condition: str = pydantic.Field() """ Condition to evaluate """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_llm_condition_model_output.py000066400000000000000000000014371523660243400336500ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowLlmConditionModelOutput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ condition: str = pydantic.Field() """ Condition to evaluate """ 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 workflow_override_agent_node_model_input.py000066400000000000000000000052431523660243400345370ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversational_config_api_model_workflow_override_input import ConversationalConfigApiModelWorkflowOverrideInput from .entry_behavior import EntryBehavior from .knowledge_base_locator import KnowledgeBaseLocator from .position_input import PositionInput class WorkflowOverrideAgentNodeModelInput(UncheckedBaseModel): position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ conversation_config: typing.Optional[ConversationalConfigApiModelWorkflowOverrideInput] = pydantic.Field( default=None ) """ Configuration overrides applied while the subagent is conducting the conversation. """ additional_prompt: typing.Optional[str] = pydantic.Field(default=None) """ Specific goal for this subagent. It will be added to the system prompt and can be used to further refine the agent's behavior in this specific context. """ additional_knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) """ Additional knowledge base documents that the subagent has access to. These will be used in addition to the main agent's documents. """ additional_tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ IDs of additional tools that the subagent has access to. These will be used in addition to the main agent's tools. """ label: str = pydantic.Field() """ Human-readable label for the node used throughout the UI. """ entry_behavior: typing.Optional[EntryBehavior] = pydantic.Field(default=None) """ Dictates whether this node should immediately generate a response upon entry or wait for the user input. When set to "auto", the behavior will be decided based on the type of the preceding node: "wait_for_user" after the "say" and "start" nodes and "generate_immediately" otherwise. """ 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 update_forward_refs(WorkflowOverrideAgentNodeModelInput) workflow_override_agent_node_model_output.py000066400000000000000000000047221523660243400347410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversational_config_api_model_workflow_override_output import ConversationalConfigApiModelWorkflowOverrideOutput from .entry_behavior import EntryBehavior from .knowledge_base_locator import KnowledgeBaseLocator from .position_output import PositionOutput class WorkflowOverrideAgentNodeModelOutput(UncheckedBaseModel): position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ conversation_config: ConversationalConfigApiModelWorkflowOverrideOutput = pydantic.Field() """ Configuration overrides applied while the subagent is conducting the conversation. """ additional_prompt: str = pydantic.Field() """ Specific goal for this subagent. It will be added to the system prompt and can be used to further refine the agent's behavior in this specific context. """ additional_knowledge_base: typing.List[KnowledgeBaseLocator] = pydantic.Field() """ Additional knowledge base documents that the subagent has access to. These will be used in addition to the main agent's documents. """ additional_tool_ids: typing.List[str] = pydantic.Field() """ IDs of additional tools that the subagent has access to. These will be used in addition to the main agent's tools. """ label: str = pydantic.Field() """ Human-readable label for the node used throughout the UI. """ entry_behavior: EntryBehavior = pydantic.Field() """ Dictates whether this node should immediately generate a response upon entry or wait for the user input. When set to "auto", the behavior will be decided based on the type of the preceding node: "wait_for_user" after the "say" and "start" nodes and "generate_immediately" otherwise. """ 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 update_forward_refs(WorkflowOverrideAgentNodeModelOutput) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_phone_number_node_model_input.py000066400000000000000000000046121523660243400343010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_input import PositionInput from .transfer_type_enum import TransferTypeEnum from .uui_transfer_config import UuiTransferConfig from .workflow_phone_number_node_model_input_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem, ) from .workflow_phone_number_node_model_input_post_dial_digits import WorkflowPhoneNumberNodeModelInputPostDialDigits from .workflow_phone_number_node_model_input_transfer_destination import ( WorkflowPhoneNumberNodeModelInputTransferDestination, ) class WorkflowPhoneNumberNodeModelInput(UncheckedBaseModel): custom_sip_headers: typing.Optional[typing.List[WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem]] = ( pydantic.Field(default=None) ) """ Custom SIP headers to include when transferring the call. Each header can be either a static value or a dynamic variable reference. """ transfer_destination: WorkflowPhoneNumberNodeModelInputTransferDestination transfer_type: typing.Optional[TransferTypeEnum] = None uui: typing.Optional[UuiTransferConfig] = pydantic.Field(default=None) """ User-to-User Information (RFC 7433) to attach to SIP REFER transfers. Carries call context such as CRM identifiers or escalation reason across the transfer boundary. """ post_dial_digits: typing.Optional[WorkflowPhoneNumberNodeModelInputPostDialDigits] = pydantic.Field(default=None) """ DTMF digits to send after call connects (e.g., 'ww1234' for extension). Can be either a static value or a dynamic variable reference. Use 'w' for 0.5s pause. Only supported for Twilio transfers. """ position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ 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 workflow_phone_number_node_model_input_custom_sip_headers_item.py000066400000000000000000000027321523660243400412010ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" key: str value: 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 WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" key: str value: 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 WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelInputCustomSipHeadersItem_Static, ], UnionMetadata(discriminant="type"), ] workflow_phone_number_node_model_input_post_dial_digits.py000066400000000000000000000026311523660243400376220ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" value: 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 WorkflowPhoneNumberNodeModelInputPostDialDigits_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" value: 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 WorkflowPhoneNumberNodeModelInputPostDialDigits = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelInputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelInputPostDialDigits_Static ], UnionMetadata(discriminant="type"), ] workflow_phone_number_node_model_input_transfer_destination.py000066400000000000000000000051071523660243400405270ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelInputTransferDestination_Phone(UncheckedBaseModel): type: typing.Literal["phone"] = "phone" phone_number: 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 WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable(UncheckedBaseModel): type: typing.Literal["phone_dynamic_variable"] = "phone_dynamic_variable" phone_number: 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 WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri(UncheckedBaseModel): type: typing.Literal["sip_uri"] = "sip_uri" sip_uri: 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 WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable(UncheckedBaseModel): type: typing.Literal["sip_uri_dynamic_variable"] = "sip_uri_dynamic_variable" sip_uri: 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 WorkflowPhoneNumberNodeModelInputTransferDestination = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelInputTransferDestination_Phone, WorkflowPhoneNumberNodeModelInputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelInputTransferDestination_SipUriDynamicVariable, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_phone_number_node_model_output.py000066400000000000000000000044301523660243400345000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_output import PositionOutput from .transfer_type_enum import TransferTypeEnum from .uui_transfer_config import UuiTransferConfig from .workflow_phone_number_node_model_output_custom_sip_headers_item import ( WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem, ) from .workflow_phone_number_node_model_output_post_dial_digits import WorkflowPhoneNumberNodeModelOutputPostDialDigits from .workflow_phone_number_node_model_output_transfer_destination import ( WorkflowPhoneNumberNodeModelOutputTransferDestination, ) class WorkflowPhoneNumberNodeModelOutput(UncheckedBaseModel): custom_sip_headers: typing.List[WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem] = pydantic.Field() """ Custom SIP headers to include when transferring the call. Each header can be either a static value or a dynamic variable reference. """ transfer_destination: WorkflowPhoneNumberNodeModelOutputTransferDestination transfer_type: TransferTypeEnum uui: typing.Optional[UuiTransferConfig] = pydantic.Field(default=None) """ User-to-User Information (RFC 7433) to attach to SIP REFER transfers. Carries call context such as CRM identifiers or escalation reason across the transfer boundary. """ post_dial_digits: typing.Optional[WorkflowPhoneNumberNodeModelOutputPostDialDigits] = pydantic.Field(default=None) """ DTMF digits to send after call connects (e.g., 'ww1234' for extension). Can be either a static value or a dynamic variable reference. Use 'w' for 0.5s pause. Only supported for Twilio transfers. """ position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ 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 workflow_phone_number_node_model_output_custom_sip_headers_item.py000066400000000000000000000027371523660243400414070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" key: str value: 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 WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" key: str value: 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 WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Dynamic, WorkflowPhoneNumberNodeModelOutputCustomSipHeadersItem_Static, ], UnionMetadata(discriminant="type"), ] workflow_phone_number_node_model_output_post_dial_digits.py000066400000000000000000000026471523660243400400320ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic(UncheckedBaseModel): type: typing.Literal["dynamic"] = "dynamic" value: 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 WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static(UncheckedBaseModel): type: typing.Literal["static"] = "static" value: 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 WorkflowPhoneNumberNodeModelOutputPostDialDigits = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelOutputPostDialDigits_Dynamic, WorkflowPhoneNumberNodeModelOutputPostDialDigits_Static, ], UnionMetadata(discriminant="type"), ] workflow_phone_number_node_model_output_transfer_destination.py000066400000000000000000000051201523660243400407230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata class WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone(UncheckedBaseModel): type: typing.Literal["phone"] = "phone" phone_number: 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 WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable(UncheckedBaseModel): type: typing.Literal["phone_dynamic_variable"] = "phone_dynamic_variable" phone_number: 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 WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri(UncheckedBaseModel): type: typing.Literal["sip_uri"] = "sip_uri" sip_uri: 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 WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable(UncheckedBaseModel): type: typing.Literal["sip_uri_dynamic_variable"] = "sip_uri_dynamic_variable" sip_uri: 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 WorkflowPhoneNumberNodeModelOutputTransferDestination = typing_extensions.Annotated[ typing.Union[ WorkflowPhoneNumberNodeModelOutputTransferDestination_Phone, WorkflowPhoneNumberNodeModelOutputTransferDestination_PhoneDynamicVariable, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUri, WorkflowPhoneNumberNodeModelOutputTransferDestination_SipUriDynamicVariable, ], UnionMetadata(discriminant="type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_result_condition_model_input.py000066400000000000000000000015401523660243400341740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowResultConditionModelInput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ successful: bool = pydantic.Field() """ Whether all tools in the previously executed tool node were executed successfully. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_result_condition_model_output.py000066400000000000000000000015411523660243400343760ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowResultConditionModelOutput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ successful: bool = pydantic.Field() """ Whether all tools in the previously executed tool node were executed successfully. """ 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 workflow_standalone_agent_node_model_input.py000066400000000000000000000040161523660243400350450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_input import PositionInput class WorkflowStandaloneAgentNodeModelInput(UncheckedBaseModel): position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the agent to transfer the conversation to. None means transfer within the current agent. """ node_id: typing.Optional[str] = pydantic.Field(default=None) """ Optional target node ID in the destination agent's workflow. When set, the transfer starts at this node instead of the default entry node. """ delay_ms: typing.Optional[int] = pydantic.Field(default=None) """ Artificial delay in milliseconds applied before transferring the conversation. """ transfer_message: typing.Optional[str] = pydantic.Field(default=None) """ Optional message sent to the user before the transfer is initiated. """ enable_transferred_agent_first_message: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to enable the transferred agent to send its configured first message after the transfer. """ preserve_client_tts_overrides: typing.Optional[bool] = pydantic.Field(default=None) """ Defines whether TTS client overrides should be carried over to the transferred agent. """ 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 workflow_standalone_agent_node_model_output.py000066400000000000000000000036011523660243400352450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_output import PositionOutput class WorkflowStandaloneAgentNodeModelOutput(UncheckedBaseModel): position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ agent_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID of the agent to transfer the conversation to. None means transfer within the current agent. """ node_id: typing.Optional[str] = pydantic.Field(default=None) """ Optional target node ID in the destination agent's workflow. When set, the transfer starts at this node instead of the default entry node. """ delay_ms: int = pydantic.Field() """ Artificial delay in milliseconds applied before transferring the conversation. """ transfer_message: typing.Optional[str] = pydantic.Field(default=None) """ Optional message sent to the user before the transfer is initiated. """ enable_transferred_agent_first_message: bool = pydantic.Field() """ Whether to enable the transferred agent to send its configured first message after the transfer. """ preserve_client_tts_overrides: bool = pydantic.Field() """ Defines whether TTS client overrides should be carried over to the transferred agent. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_start_node_model_input.py000066400000000000000000000016061523660243400327550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_input import PositionInput class WorkflowStartNodeModelInput(UncheckedBaseModel): position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_start_node_model_output.py000066400000000000000000000015201523660243400331510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_output import PositionOutput class WorkflowStartNodeModelOutput(UncheckedBaseModel): position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_edge_step_model.py000066400000000000000000000011631523660243400323660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowToolEdgeStepModel(UncheckedBaseModel): step_latency_secs: float edge_id: str target_node_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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_locator.py000066400000000000000000000021241523660243400307100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .workflow_tool_locator_schema_overrides_value import WorkflowToolLocatorSchemaOverridesValue class WorkflowToolLocator(UncheckedBaseModel): tool_id: str schema_overrides: typing.Optional[typing.Dict[str, typing.Optional[WorkflowToolLocatorSchemaOverridesValue]]] = ( pydantic.Field(default=None) ) """ Per-node parameter overrides applied on top of the tool's own configuration. Keys are dotted parameter paths (webhook tools prefix keys with path_params./query_params./request_body.). These take precedence over any overrides already defined on the tool itself. """ 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 workflow_tool_locator_schema_overrides_value.py000066400000000000000000000047771523660243400354470ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .constant_schema_override_constant_value import ConstantSchemaOverrideConstantValue class WorkflowToolLocatorSchemaOverridesValue_Constant(UncheckedBaseModel): source: typing.Literal["constant"] = "constant" constant_value: ConstantSchemaOverrideConstantValue 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 WorkflowToolLocatorSchemaOverridesValue_DynamicVariable(UncheckedBaseModel): source: typing.Literal["dynamic_variable"] = "dynamic_variable" dynamic_variable: 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 WorkflowToolLocatorSchemaOverridesValue_Llm(UncheckedBaseModel): source: typing.Literal["llm"] = "llm" prompt: 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 class WorkflowToolLocatorSchemaOverridesValue_Omit(UncheckedBaseModel): source: typing.Literal["omit"] = "omit" 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 WorkflowToolLocatorSchemaOverridesValue = typing_extensions.Annotated[ typing.Union[ WorkflowToolLocatorSchemaOverridesValue_Constant, WorkflowToolLocatorSchemaOverridesValue_DynamicVariable, WorkflowToolLocatorSchemaOverridesValue_Llm, WorkflowToolLocatorSchemaOverridesValue_Omit, ], UnionMetadata(discriminant="source"), ] workflow_tool_max_iterations_exceeded_step_model.py000066400000000000000000000011631523660243400362570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowToolMaxIterationsExceededStepModel(UncheckedBaseModel): step_latency_secs: float max_iterations: int 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 workflow_tool_nested_tools_step_model_input.py000066400000000000000000000037031523660243400353260ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_common_model_input import ( ConversationHistoryTranscriptToolCallCommonModelInput, ) class WorkflowToolNestedToolsStepModelInput(UncheckedBaseModel): step_latency_secs: float node_id: str requests: typing.List[ConversationHistoryTranscriptToolCallCommonModelInput] results: typing.List["WorkflowToolNestedToolsStepModelInputResultsItem"] is_successful: bool 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 from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_input_results_item import WorkflowToolNestedToolsStepModelInputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_input import WorkflowToolResponseModelInput # noqa: E402, I001 from .workflow_tool_response_model_input_steps_item import WorkflowToolResponseModelInputStepsItem # noqa: E402, I001 update_forward_refs( WorkflowToolNestedToolsStepModelInput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, WorkflowToolNestedToolsStepModelInputResultsItem=WorkflowToolNestedToolsStepModelInputResultsItem, WorkflowToolResponseModelInput=WorkflowToolResponseModelInput, WorkflowToolResponseModelInputStepsItem=WorkflowToolResponseModelInputStepsItem, ) workflow_tool_nested_tools_step_model_input_results_item.py000066400000000000000000000021761523660243400401300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_input import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_system_tool_result_common_model_input import ( ConversationHistoryTranscriptSystemToolResultCommonModelInput, ) if typing.TYPE_CHECKING: from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) WorkflowToolNestedToolsStepModelInputResultsItem = typing.Union[ ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptSystemToolResultCommonModelInput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelInput, "ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput", ] workflow_tool_nested_tools_step_model_output.py000066400000000000000000000037311523660243400355300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_history_transcript_tool_call_common_model_output import ( ConversationHistoryTranscriptToolCallCommonModelOutput, ) class WorkflowToolNestedToolsStepModelOutput(UncheckedBaseModel): step_latency_secs: float node_id: str requests: typing.List[ConversationHistoryTranscriptToolCallCommonModelOutput] results: typing.List["WorkflowToolNestedToolsStepModelOutputResultsItem"] is_successful: bool 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 from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_output_results_item import WorkflowToolNestedToolsStepModelOutputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_output import WorkflowToolResponseModelOutput # noqa: E402, I001 from .workflow_tool_response_model_output_steps_item import WorkflowToolResponseModelOutputStepsItem # noqa: E402, I001 update_forward_refs( WorkflowToolNestedToolsStepModelOutput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, WorkflowToolNestedToolsStepModelOutputResultsItem=WorkflowToolNestedToolsStepModelOutputResultsItem, WorkflowToolResponseModelOutput=WorkflowToolResponseModelOutput, WorkflowToolResponseModelOutputStepsItem=WorkflowToolResponseModelOutputStepsItem, ) workflow_tool_nested_tools_step_model_output_results_item.py000066400000000000000000000022101523660243400403160ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .conversation_history_transcript_api_integration_webhook_tools_result_common_model_output import ( ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, ) from .conversation_history_transcript_other_tools_result_common_model import ( ConversationHistoryTranscriptOtherToolsResultCommonModel, ) from .conversation_history_transcript_system_tool_result_common_model_output import ( ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ) if typing.TYPE_CHECKING: from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) WorkflowToolNestedToolsStepModelOutputResultsItem = typing.Union[ ConversationHistoryTranscriptOtherToolsResultCommonModel, ConversationHistoryTranscriptSystemToolResultCommonModelOutput, ConversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, "ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_node_model_input.py000066400000000000000000000022441523660243400325740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_input import PositionInput from .workflow_tool_locator import WorkflowToolLocator class WorkflowToolNodeModelInput(UncheckedBaseModel): position: typing.Optional[PositionInput] = pydantic.Field(default=None) """ Position of the node in the workflow. """ edge_order: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ The ids of outgoing edges in the order they should be evaluated. """ tools: typing.Optional[typing.List[WorkflowToolLocator]] = pydantic.Field(default=None) """ List of tools to execute in parallel. The entire node is considered successful if all tools are executed successfully. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_node_model_output.py000066400000000000000000000021211523660243400327670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .position_output import PositionOutput from .workflow_tool_locator import WorkflowToolLocator class WorkflowToolNodeModelOutput(UncheckedBaseModel): position: PositionOutput = pydantic.Field() """ Position of the node in the workflow. """ edge_order: typing.List[str] = pydantic.Field() """ The ids of outgoing edges in the order they should be evaluated. """ tools: typing.List[WorkflowToolLocator] = pydantic.Field() """ List of tools to execute in parallel. The entire node is considered successful if all tools are executed successfully. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_response_model_input.py000066400000000000000000000034011523660243400335010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowToolResponseModelInput(UncheckedBaseModel): """ A common model for workflow tool responses. """ steps: typing.Optional[typing.List["WorkflowToolResponseModelInputStepsItem"]] = 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 from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_input import WorkflowToolNestedToolsStepModelInput # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_input_results_item import WorkflowToolNestedToolsStepModelInputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_input_steps_item import WorkflowToolResponseModelInputStepsItem # noqa: E402, I001 update_forward_refs( WorkflowToolResponseModelInput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, WorkflowToolNestedToolsStepModelInput=WorkflowToolNestedToolsStepModelInput, WorkflowToolNestedToolsStepModelInputResultsItem=WorkflowToolNestedToolsStepModelInputResultsItem, WorkflowToolResponseModelInputStepsItem=WorkflowToolResponseModelInputStepsItem, ) workflow_tool_response_model_input_steps_item.py000066400000000000000000000063641523660243400356710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversation_history_transcript_tool_call_common_model_input import ( ConversationHistoryTranscriptToolCallCommonModelInput, ) class WorkflowToolResponseModelInputStepsItem_Edge(UncheckedBaseModel): type: typing.Literal["edge"] = "edge" step_latency_secs: float edge_id: str target_node_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 class WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded(UncheckedBaseModel): type: typing.Literal["max_iterations_exceeded"] = "max_iterations_exceeded" step_latency_secs: float max_iterations: int 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 WorkflowToolResponseModelInputStepsItem_NestedTools(UncheckedBaseModel): type: typing.Literal["nested_tools"] = "nested_tools" step_latency_secs: float node_id: str requests: typing.List[ConversationHistoryTranscriptToolCallCommonModelInput] results: typing.List["WorkflowToolNestedToolsStepModelInputResultsItem"] is_successful: bool 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 WorkflowToolResponseModelInputStepsItem = typing_extensions.Annotated[ typing.Union[ WorkflowToolResponseModelInputStepsItem_Edge, WorkflowToolResponseModelInputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelInputStepsItem_NestedTools, ], UnionMetadata(discriminant="type"), ] from .conversation_history_transcript_workflow_tools_result_common_model_input import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_input_results_item import WorkflowToolNestedToolsStepModelInputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_input import WorkflowToolResponseModelInput # noqa: E402, I001 update_forward_refs( WorkflowToolResponseModelInputStepsItem_NestedTools, ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelInput, WorkflowToolNestedToolsStepModelInputResultsItem=WorkflowToolNestedToolsStepModelInputResultsItem, WorkflowToolResponseModelInput=WorkflowToolResponseModelInput, WorkflowToolResponseModelInputStepsItem=WorkflowToolResponseModelInputStepsItem, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_tool_response_model_output.py000066400000000000000000000034241523660243400337070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowToolResponseModelOutput(UncheckedBaseModel): """ A common model for workflow tool responses. """ steps: typing.Optional[typing.List["WorkflowToolResponseModelOutputStepsItem"]] = 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 from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_output import WorkflowToolNestedToolsStepModelOutput # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_output_results_item import WorkflowToolNestedToolsStepModelOutputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_output_steps_item import WorkflowToolResponseModelOutputStepsItem # noqa: E402, I001 update_forward_refs( WorkflowToolResponseModelOutput, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, WorkflowToolNestedToolsStepModelOutput=WorkflowToolNestedToolsStepModelOutput, WorkflowToolNestedToolsStepModelOutputResultsItem=WorkflowToolNestedToolsStepModelOutputResultsItem, WorkflowToolResponseModelOutputStepsItem=WorkflowToolResponseModelOutputStepsItem, ) workflow_tool_response_model_output_steps_item.py000066400000000000000000000064161523660243400360700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .conversation_history_transcript_tool_call_common_model_output import ( ConversationHistoryTranscriptToolCallCommonModelOutput, ) class WorkflowToolResponseModelOutputStepsItem_Edge(UncheckedBaseModel): type: typing.Literal["edge"] = "edge" step_latency_secs: float edge_id: str target_node_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 class WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded(UncheckedBaseModel): type: typing.Literal["max_iterations_exceeded"] = "max_iterations_exceeded" step_latency_secs: float max_iterations: int 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 WorkflowToolResponseModelOutputStepsItem_NestedTools(UncheckedBaseModel): type: typing.Literal["nested_tools"] = "nested_tools" step_latency_secs: float node_id: str requests: typing.List[ConversationHistoryTranscriptToolCallCommonModelOutput] results: typing.List["WorkflowToolNestedToolsStepModelOutputResultsItem"] is_successful: bool 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 WorkflowToolResponseModelOutputStepsItem = typing_extensions.Annotated[ typing.Union[ WorkflowToolResponseModelOutputStepsItem_Edge, WorkflowToolResponseModelOutputStepsItem_MaxIterationsExceeded, WorkflowToolResponseModelOutputStepsItem_NestedTools, ], UnionMetadata(discriminant="type"), ] from .conversation_history_transcript_workflow_tools_result_common_model_output import ( ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, ) # noqa: E402, I001 from .workflow_tool_nested_tools_step_model_output_results_item import WorkflowToolNestedToolsStepModelOutputResultsItem # noqa: E402, I001 from .workflow_tool_response_model_output import WorkflowToolResponseModelOutput # noqa: E402, I001 update_forward_refs( WorkflowToolResponseModelOutputStepsItem_NestedTools, ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput=ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput, WorkflowToolNestedToolsStepModelOutputResultsItem=WorkflowToolNestedToolsStepModelOutputResultsItem, WorkflowToolResponseModelOutput=WorkflowToolResponseModelOutput, WorkflowToolResponseModelOutputStepsItem=WorkflowToolResponseModelOutputStepsItem, ) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_unconditional_model_input.py000066400000000000000000000013161523660243400334570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowUnconditionalModelInput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workflow_unconditional_model_output.py000066400000000000000000000013171523660243400336610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkflowUnconditionalModelOutput(UncheckedBaseModel): label: typing.Optional[str] = pydantic.Field(default=None) """ Optional human-readable label for the condition used throughout the UI. """ 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 workspace_analytics_query_response_model.py000066400000000000000000000021511523660243400345670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .column_unit import ColumnUnit from .workspace_analytics_query_response_model_column_types_item import ( WorkspaceAnalyticsQueryResponseModelColumnTypesItem, ) from .workspace_analytics_query_response_model_rows_item_item import WorkspaceAnalyticsQueryResponseModelRowsItemItem class WorkspaceAnalyticsQueryResponseModel(UncheckedBaseModel): columns: typing.List[str] column_types: typing.List[WorkspaceAnalyticsQueryResponseModelColumnTypesItem] rows: typing.List[typing.List[typing.Optional[WorkspaceAnalyticsQueryResponseModelRowsItemItem]]] column_units: typing.List[typing.Optional[ColumnUnit]] 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 workspace_analytics_query_response_model_column_types_item.py000066400000000000000000000003731523660243400404120ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WorkspaceAnalyticsQueryResponseModelColumnTypesItem = typing.Union[ typing.Literal["String", "Float", "DateTime", "Int", "Bool", "JSON", "Map", "Array"], typing.Any ] workspace_analytics_query_response_model_rows_item_item.py000066400000000000000000000003121523660243400376720ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import datetime as dt import typing WorkspaceAnalyticsQueryResponseModelRowsItemItem = typing.Union[str, int, float, bool, dt.datetime] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_api_key_list_response_model.py000066400000000000000000000015551523660243400341150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .workspace_api_key_response_model import WorkspaceApiKeyResponseModel class WorkspaceApiKeyListResponseModel(UncheckedBaseModel): api_keys: typing_extensions.Annotated[ typing.List[WorkspaceApiKeyResponseModel], FieldMetadata(alias="api-keys"), pydantic.Field(alias="api-keys") ] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_api_key_response_model.py000066400000000000000000000025541523660243400330620ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .lock_reason import LockReason from .permission_type import PermissionType class WorkspaceApiKeyResponseModel(UncheckedBaseModel): name: str hint: str key_id: str service_account_user_id: str created_at_unix: typing.Optional[int] = None is_disabled: typing.Optional[bool] = None permissions: typing.Optional[typing.List[PermissionType]] = None disable_reason: typing.Optional[LockReason] = None character_limit: typing.Optional[int] = pydantic.Field(default=None) """ Maximum number of credits allowed in the current billing period. """ character_count: typing.Optional[int] = pydantic.Field(default=None) """ Credits already used in the current billing period. """ hashed_xi_api_key: str allowed_ips: typing.Optional[typing.List[str]] = None third_party_disable_allowed: typing.Optional[bool] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_audit_log_entry_response.py000066400000000000000000000057651523660243400334600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .actor_model import ActorModel from .device_model import DeviceModel from .http_request_model import HttpRequestModel from .severity_id import SeverityId from .status_id import StatusId from .workspace_audit_log_entry_response_activity_id import WorkspaceAuditLogEntryResponseActivityId class WorkspaceAuditLogEntryResponse(UncheckedBaseModel): """ Audit log entry with Firestore document ID for API responses. """ metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Event metadata """ time: typing.Optional[int] = pydantic.Field(default=None) """ Event time in milliseconds since epoch """ activity_id: WorkspaceAuditLogEntryResponseActivityId = pydantic.Field() """ Activity ID """ activity_name: str = pydantic.Field() """ Activity name """ category_name: typing.Optional[str] = pydantic.Field(default=None) """ Event category """ category_uid: typing.Optional[int] = pydantic.Field(default=None) """ Category UID for IAM """ class_name: typing.Optional[str] = pydantic.Field(default=None) """ Event class name """ class_uid: typing.Optional[int] = pydantic.Field(default=None) """ Event class UID """ severity_id: typing.Optional[SeverityId] = pydantic.Field(default=None) """ Severity level """ status_id: StatusId = pydantic.Field() """ Status of the action """ actor: ActorModel = pydantic.Field() """ Actor performing the action """ device: typing.Optional[DeviceModel] = pydantic.Field(default=None) """ Device information """ http_request: typing.Optional[HttpRequestModel] = pydantic.Field(default=None) """ HTTP request details """ message: str = pydantic.Field() """ Human-readable event description """ unmapped: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ Attributes not mapped to OCSF """ id: str = pydantic.Field() """ Firestore document ID """ time_dt: typing.Optional[str] = pydantic.Field(default=None) """ Event time in human-readable RFC 3339 format, derived from 'time'. """ type_uid: typing.Optional[int] = pydantic.Field(default=None) """ OCSF type_uid is class_uid * 100 + activity_id. """ type_name: typing.Optional[str] = pydantic.Field(default=None) """ OCSF type_name combines class_name and activity_name. """ 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 workspace_audit_log_entry_response_activity_id.py000066400000000000000000000012041523660243400357510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing from .account_change_activity_id import AccountChangeActivityId from .authentication_activity_id import AuthenticationActivityId from .entity_management_activity_id import EntityManagementActivityId from .group_management_activity_id import GroupManagementActivityId from .user_access_management_activity_id import UserAccessManagementActivityId WorkspaceAuditLogEntryResponseActivityId = typing.Union[ AccountChangeActivityId, AuthenticationActivityId, EntityManagementActivityId, UserAccessManagementActivityId, GroupManagementActivityId, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_audit_logs_page_response.py000066400000000000000000000014671523660243400334110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .workspace_audit_log_entry_response import WorkspaceAuditLogEntryResponse class WorkspaceAuditLogsPageResponse(UncheckedBaseModel): """ Paginated workspace audit log response. """ entries: typing.List[WorkspaceAuditLogEntryResponse] has_more: bool next_cursor: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_batch_calls_response.py000066400000000000000000000016631523660243400325200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .batch_call_response import BatchCallResponse class WorkspaceBatchCallsResponse(UncheckedBaseModel): batch_calls: typing.List[BatchCallResponse] next_doc: typing.Optional[str] = pydantic.Field(default=None) """ The next document, used to paginate through the batch calls """ has_more: typing.Optional[bool] = pydantic.Field(default=None) """ Whether there are more batch calls to paginate through """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_create_api_key_response_model.py000066400000000000000000000014061523660243400344000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class WorkspaceCreateApiKeyResponseModel(UncheckedBaseModel): xi_api_key: typing_extensions.Annotated[str, FieldMetadata(alias="xi-api-key"), pydantic.Field(alias="xi-api-key")] key_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 workspace_create_service_account_response_model.py000066400000000000000000000014631523660243400360570ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel class WorkspaceCreateServiceAccountResponseModel(UncheckedBaseModel): service_account_user_id: typing_extensions.Annotated[ str, FieldMetadata(alias="service-account-user-id"), pydantic.Field(alias="service-account-user-id") ] 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_create_webhook_response_model.py000066400000000000000000000011731523660243400344160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkspaceCreateWebhookResponseModel(UncheckedBaseModel): webhook_id: str webhook_secret: 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_group_by_name_response_model.py000066400000000000000000000015351523660243400342650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel class WorkspaceGroupByNameResponseModel(UncheckedBaseModel): name: str = pydantic.Field() """ The name of the workspace group. """ id: str = pydantic.Field() """ The ID of the workspace group. """ members_emails: typing.List[str] = pydantic.Field() """ The emails of the members of the workspace group. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_group_permission.py000066400000000000000000000024051523660243400317420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WorkspaceGroupPermission = typing.Union[ typing.Literal[ "text_to_speech", "speech_to_speech", "speech_to_text", "voice_lab", "sound_effects", "projects", "voiceover_studio", "dubbing", "audio_native", "conversational_ai", "conversational_ai_read", "voice_isolator", "ai_speech_classifier", "synthid_detector", "add_voice_from_voice_library", "create_instant_voice_clone", "create_professional_voice_clone", "create_user_api_key", "publish_studio_project", "music", "image_video_generation", "flows", "templates", "share_voice_externally", "publish_voice_to_voice_library", "view_fiat_balance", "workspace_analytics_full_read", "service_accounts_manage", "webhooks_manage", "group_members_manage", "workspace_members_invite", "workspace_members_remove", "terms_of_service_accept", "audit_log_read", "conversation_privacy_manage", "copy_resources_cross_workspace", "voice_design", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_group_response_model.py000066400000000000000000000026641523660243400325770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .scim_group_response_model import ScimGroupResponseModel from .workspace_group_permission import WorkspaceGroupPermission from .workspace_group_response_model_group_pvc_limit import WorkspaceGroupResponseModelGroupPvcLimit from .workspace_group_response_model_group_usage_limit import WorkspaceGroupResponseModelGroupUsageLimit class WorkspaceGroupResponseModel(UncheckedBaseModel): name: str id: str members: typing.List[str] permissions: typing.Optional[typing.List[WorkspaceGroupPermission]] = None group_usage_limit: typing.Optional[WorkspaceGroupResponseModelGroupUsageLimit] = None group_pvc_limit: typing.Optional[WorkspaceGroupResponseModelGroupPvcLimit] = None character_count: typing.Optional[int] = None scim_external_id: typing.Optional[str] = None is_scim_synced: typing.Optional[bool] = None scim_group: typing.Optional[ScimGroupResponseModel] = None scim_frozen: typing.Optional[bool] = 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 workspace_group_response_model_group_pvc_limit.py000066400000000000000000000002521523660243400357710ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WorkspaceGroupResponseModelGroupPvcLimit = typing.Union[int, typing.Literal["unlimited"]] workspace_group_response_model_group_usage_limit.py000066400000000000000000000002541523660243400363070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing WorkspaceGroupResponseModelGroupUsageLimit = typing.Union[int, typing.Literal["unlimited"]] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_member_response_model.py000066400000000000000000000025401523660243400327030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .seat_type import SeatType class WorkspaceMemberResponseModel(UncheckedBaseModel): """ Public workspace member fields exposed via GET /v1/workspace/members. """ user_id: str = pydantic.Field() """ The user ID of the workspace member. """ email: str = pydantic.Field() """ The email address of the workspace member. """ first_name: typing.Optional[str] = pydantic.Field(default=None) """ The first name of the workspace member, if available. """ seat_type: typing.Optional[SeatType] = pydantic.Field(default=None) """ The seat type (role) of the workspace member. """ is_owner: bool = pydantic.Field() """ Whether the member is the workspace owner. """ is_locked: bool = pydantic.Field() """ Whether the member's account is locked in this workspace. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_resource_type.py000066400000000000000000000026751523660243400312370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WorkspaceResourceType = typing.Union[ typing.Literal[ "voice", "voice_collection", "pronunciation_dictionary", "dubbing", "project", "convai_agents", "convai_knowledge_base_documents", "convai_tools", "convai_settings", "convai_secrets", "workspace_auth_connections", "convai_phone_numbers", "convai_mcp_servers", "convai_api_integration_connections", "convai_api_integration_trigger_connections", "convai_batch_calls", "convai_agent_response_tests", "convai_test_suite_invocations", "convai_crawl_jobs", "convai_crawl_tasks", "convai_kb_external_sync_jobs", "convai_whatsapp_accounts", "convai_agent_versions", "convai_agent_branches", "convai_agent_versions_deployments", "convai_memory_entries", "convai_coaching_proposals", "convai_templates", "dashboard", "dashboard_configuration", "convai_agent_drafts", "resource_locators", "assets", "content_generations", "content_templates", "songs", "transcription_tasks", "avatars", "avatar_video_generations", "resource_collection", "studio_projects", "convai_analysis_items", ], typing.Any, ] workspace_service_account_list_response_model.py000066400000000000000000000016661523660243400355740ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .workspace_service_account_response_model import WorkspaceServiceAccountResponseModel class WorkspaceServiceAccountListResponseModel(UncheckedBaseModel): service_accounts: typing_extensions.Annotated[ typing.List[WorkspaceServiceAccountResponseModel], FieldMetadata(alias="service-accounts"), pydantic.Field(alias="service-accounts"), ] 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 workspace_service_account_response_model.py000066400000000000000000000022061523660243400345300ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types# This file was auto-generated by Fern from our API Definition. import typing import pydantic import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .default_sharing_group_response_model import DefaultSharingGroupResponseModel from .workspace_api_key_response_model import WorkspaceApiKeyResponseModel class WorkspaceServiceAccountResponseModel(UncheckedBaseModel): service_account_user_id: str name: str created_at_unix: typing.Optional[int] = None api_keys: typing_extensions.Annotated[ typing.List[WorkspaceApiKeyResponseModel], FieldMetadata(alias="api-keys"), pydantic.Field(alias="api-keys") ] default_sharing_groups: typing.Optional[typing.List[DefaultSharingGroupResponseModel]] = 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_webhook_event_type.py000066400000000000000000000003311523660243400322320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing WorkspaceWebhookEventType = typing.Union[ typing.Literal["voice_library_removal_notice", "speech_to_text", "agent_qa"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_webhook_list_response_model.py000066400000000000000000000014311523660243400341230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .workspace_webhook_response_model import WorkspaceWebhookResponseModel class WorkspaceWebhookListResponseModel(UncheckedBaseModel): webhooks: typing.List[WorkspaceWebhookResponseModel] = pydantic.Field() """ List of webhooks currently configured for the workspace """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_webhook_response_model.py000066400000000000000000000046241523660243400330770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .webhook_auth_method_type import WebhookAuthMethodType from .workspace_webhook_event_type import WorkspaceWebhookEventType from .workspace_webhook_usage_response_model import WorkspaceWebhookUsageResponseModel class WorkspaceWebhookResponseModel(UncheckedBaseModel): name: str = pydantic.Field() """ The display name for this webhook. """ webhook_id: str = pydantic.Field() """ The unique ID for this webhook. """ webhook_url: str = pydantic.Field() """ The HTTPS callback URL that is called when this webhook is triggered in the platform. """ is_disabled: bool = pydantic.Field() """ Whether the webhook has been manually disabled by a user. """ is_auto_disabled: bool = pydantic.Field() """ Whether the webhook has been automatically disabled due to repeated consecutive failures over a long period of time. """ created_at_unix: int = pydantic.Field() """ Original creation time of the webhook. """ auth_type: WebhookAuthMethodType = pydantic.Field() """ The authentication mode used to secure the webhook. """ usage: typing.Optional[typing.List[WorkspaceWebhookUsageResponseModel]] = pydantic.Field(default=None) """ The list of products that are currently configured to trigger this webhook. """ events: typing.Optional[typing.List[WorkspaceWebhookEventType]] = pydantic.Field(default=None) """ The workspace-level events this webhook is currently subscribed to. Only populated when usages are requested. """ most_recent_failure_error_code: typing.Optional[int] = pydantic.Field(default=None) """ The most recent error code returned from the callback URL. """ most_recent_failure_timestamp: typing.Optional[int] = pydantic.Field(default=None) """ The most recent time the webhook failed, failures are any non-200 codes returned by the callback URL. """ 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/types/workspace_webhook_usage_response_model.py000066400000000000000000000012101523660243400342470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .webhook_usage_type import WebhookUsageType class WorkspaceWebhookUsageResponseModel(UncheckedBaseModel): usage_type: WebhookUsageType 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 elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/url_utils.py000066400000000000000000000015431523660243400251400ustar00rootroot00000000000000import urllib.parse from typing import Any, Sequence, Tuple, Union _WS_SCHEME = {"https": "wss", "http": "ws"} def build_ws_url( base_url: str, path_segments: Sequence[Any], params: Union[Sequence[Tuple[str, str]], dict], ) -> str: """Build a WebSocket URL with proper percent-encoding. Converts http(s) schemes to ws(s), appends percent-encoded *path_segments* beneath the existing base path, and encodes *params* as the query string. """ parsed = urllib.parse.urlparse(base_url) path = "/".join(urllib.parse.quote(str(seg), safe="") for seg in path_segments) return urllib.parse.urlunparse(( _WS_SCHEME.get(parsed.scheme, parsed.scheme), parsed.netloc, parsed.path.rstrip("/") + "/" + path, "", urllib.parse.urlencode(params, quote_via=urllib.parse.quote), "", )) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/usage/000077500000000000000000000000001523660243400236455ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/usage/__init__.py000066400000000000000000000001251523660243400257540ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/usage/client.py000066400000000000000000000201241523660243400254740ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.breakdown_types import BreakdownTypes from ..types.metric_type import MetricType from ..types.usage_aggregation_interval import UsageAggregationInterval from ..types.usage_characters_response_model import UsageCharactersResponseModel from .raw_client import AsyncRawUsageClient, RawUsageClient class UsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawUsageClient """ return self._raw_client def get( self, *, start_unix: int, end_unix: int, include_workspace_metrics: typing.Optional[bool] = None, breakdown_type: typing.Optional[BreakdownTypes] = None, aggregation_interval: typing.Optional[UsageAggregationInterval] = None, aggregation_bucket_size: typing.Optional[int] = None, metric: typing.Optional[MetricType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> UsageCharactersResponseModel: """ (Deprecated) This endpoint is deprecated. Use /v1/workspace/analytics/query/usage-by-product-over-time instead, which exposes the bucket size as `interval_seconds` (an integer in seconds) rather than `aggregation_interval`. Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- start_unix : int UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. end_unix : int UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. include_workspace_metrics : typing.Optional[bool] Whether or not to include the statistics of the entire workspace. breakdown_type : typing.Optional[BreakdownTypes] How to break down the information. Cannot be "user" if include_workspace_metrics is False. aggregation_interval : typing.Optional[UsageAggregationInterval] How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative". aggregation_bucket_size : typing.Optional[int] Aggregation bucket size in seconds. Overrides the aggregation interval. metric : typing.Optional[MetricType] Which metric to aggregate. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UsageCharactersResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.usage.get( start_unix=1, end_unix=1, include_workspace_metrics=True, breakdown_type="none", aggregation_interval="hour", aggregation_bucket_size=1, metric="credits", ) """ _response = self._raw_client.get( start_unix=start_unix, end_unix=end_unix, include_workspace_metrics=include_workspace_metrics, breakdown_type=breakdown_type, aggregation_interval=aggregation_interval, aggregation_bucket_size=aggregation_bucket_size, metric=metric, request_options=request_options, ) return _response.data class AsyncUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawUsageClient """ return self._raw_client async def get( self, *, start_unix: int, end_unix: int, include_workspace_metrics: typing.Optional[bool] = None, breakdown_type: typing.Optional[BreakdownTypes] = None, aggregation_interval: typing.Optional[UsageAggregationInterval] = None, aggregation_bucket_size: typing.Optional[int] = None, metric: typing.Optional[MetricType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> UsageCharactersResponseModel: """ (Deprecated) This endpoint is deprecated. Use /v1/workspace/analytics/query/usage-by-product-over-time instead, which exposes the bucket size as `interval_seconds` (an integer in seconds) rather than `aggregation_interval`. Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- start_unix : int UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. end_unix : int UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. include_workspace_metrics : typing.Optional[bool] Whether or not to include the statistics of the entire workspace. breakdown_type : typing.Optional[BreakdownTypes] How to break down the information. Cannot be "user" if include_workspace_metrics is False. aggregation_interval : typing.Optional[UsageAggregationInterval] How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative". aggregation_bucket_size : typing.Optional[int] Aggregation bucket size in seconds. Overrides the aggregation interval. metric : typing.Optional[MetricType] Which metric to aggregate. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UsageCharactersResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.usage.get( start_unix=1, end_unix=1, include_workspace_metrics=True, breakdown_type="none", aggregation_interval="hour", aggregation_bucket_size=1, metric="credits", ) asyncio.run(main()) """ _response = await self._raw_client.get( start_unix=start_unix, end_unix=end_unix, include_workspace_metrics=include_workspace_metrics, breakdown_type=breakdown_type, aggregation_interval=aggregation_interval, aggregation_bucket_size=aggregation_bucket_size, metric=metric, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/usage/raw_client.py000066400000000000000000000235431523660243400263550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.breakdown_types import BreakdownTypes from ..types.metric_type import MetricType from ..types.usage_aggregation_interval import UsageAggregationInterval from ..types.usage_characters_response_model import UsageCharactersResponseModel from pydantic import ValidationError class RawUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, start_unix: int, end_unix: int, include_workspace_metrics: typing.Optional[bool] = None, breakdown_type: typing.Optional[BreakdownTypes] = None, aggregation_interval: typing.Optional[UsageAggregationInterval] = None, aggregation_bucket_size: typing.Optional[int] = None, metric: typing.Optional[MetricType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UsageCharactersResponseModel]: """ (Deprecated) This endpoint is deprecated. Use /v1/workspace/analytics/query/usage-by-product-over-time instead, which exposes the bucket size as `interval_seconds` (an integer in seconds) rather than `aggregation_interval`. Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- start_unix : int UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. end_unix : int UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. include_workspace_metrics : typing.Optional[bool] Whether or not to include the statistics of the entire workspace. breakdown_type : typing.Optional[BreakdownTypes] How to break down the information. Cannot be "user" if include_workspace_metrics is False. aggregation_interval : typing.Optional[UsageAggregationInterval] How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative". aggregation_bucket_size : typing.Optional[int] Aggregation bucket size in seconds. Overrides the aggregation interval. metric : typing.Optional[MetricType] Which metric to aggregate. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[UsageCharactersResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/usage/character-stats", method="GET", params={ "start_unix": start_unix, "end_unix": end_unix, "include_workspace_metrics": include_workspace_metrics, "breakdown_type": breakdown_type, "aggregation_interval": aggregation_interval, "aggregation_bucket_size": aggregation_bucket_size, "metric": metric, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UsageCharactersResponseModel, construct_type( type_=UsageCharactersResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, start_unix: int, end_unix: int, include_workspace_metrics: typing.Optional[bool] = None, breakdown_type: typing.Optional[BreakdownTypes] = None, aggregation_interval: typing.Optional[UsageAggregationInterval] = None, aggregation_bucket_size: typing.Optional[int] = None, metric: typing.Optional[MetricType] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UsageCharactersResponseModel]: """ (Deprecated) This endpoint is deprecated. Use /v1/workspace/analytics/query/usage-by-product-over-time instead, which exposes the bucket size as `interval_seconds` (an integer in seconds) rather than `aggregation_interval`. Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- start_unix : int UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. end_unix : int UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. include_workspace_metrics : typing.Optional[bool] Whether or not to include the statistics of the entire workspace. breakdown_type : typing.Optional[BreakdownTypes] How to break down the information. Cannot be "user" if include_workspace_metrics is False. aggregation_interval : typing.Optional[UsageAggregationInterval] How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative". aggregation_bucket_size : typing.Optional[int] Aggregation bucket size in seconds. Overrides the aggregation interval. metric : typing.Optional[MetricType] Which metric to aggregate. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[UsageCharactersResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/usage/character-stats", method="GET", params={ "start_unix": start_unix, "end_unix": end_unix, "include_workspace_metrics": include_workspace_metrics, "breakdown_type": breakdown_type, "aggregation_interval": aggregation_interval, "aggregation_bucket_size": aggregation_bucket_size, "metric": metric, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UsageCharactersResponseModel, construct_type( type_=UsageCharactersResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/000077500000000000000000000000001523660243400235175ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/__init__.py000066400000000000000000000020421523660243400256260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import subscription _dynamic_imports: typing.Dict[str, str] = {"subscription": ".subscription"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["subscription"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/client.py000066400000000000000000000067051523660243400253570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.user import User from .raw_client import AsyncRawUserClient, RawUserClient if typing.TYPE_CHECKING: from .subscription.client import AsyncSubscriptionClient, SubscriptionClient class UserClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawUserClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._subscription: typing.Optional[SubscriptionClient] = None @property def with_raw_response(self) -> RawUserClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawUserClient """ return self._raw_client def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User: """ Gets information about the user Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- User Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.user.get() """ _response = self._raw_client.get(request_options=request_options) return _response.data @property def subscription(self): if self._subscription is None: from .subscription.client import SubscriptionClient # noqa: E402 self._subscription = SubscriptionClient(client_wrapper=self._client_wrapper) return self._subscription class AsyncUserClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawUserClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._subscription: typing.Optional[AsyncSubscriptionClient] = None @property def with_raw_response(self) -> AsyncRawUserClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawUserClient """ return self._raw_client async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User: """ Gets information about the user Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- User Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.user.get() asyncio.run(main()) """ _response = await self._raw_client.get(request_options=request_options) return _response.data @property def subscription(self): if self._subscription is None: from .subscription.client import AsyncSubscriptionClient # noqa: E402 self._subscription = AsyncSubscriptionClient(client_wrapper=self._client_wrapper) return self._subscription elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/raw_client.py000066400000000000000000000110601523660243400262160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.user import User from pydantic import ValidationError class RawUserClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[User]: """ Gets information about the user Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[User] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/user", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( User, construct_type( type_=User, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawUserClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[User]: """ Gets information about the user Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[User] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/user", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( User, construct_type( type_=User, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/subscription/000077500000000000000000000000001523660243400262435ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/subscription/__init__.py000066400000000000000000000001251523660243400303520ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/subscription/client.py000066400000000000000000000053201523660243400300730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.subscription import Subscription from .raw_client import AsyncRawSubscriptionClient, RawSubscriptionClient class SubscriptionClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSubscriptionClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSubscriptionClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSubscriptionClient """ return self._raw_client def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> Subscription: """ Gets extended information about the users subscription Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Subscription Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.user.subscription.get() """ _response = self._raw_client.get(request_options=request_options) return _response.data class AsyncSubscriptionClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSubscriptionClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSubscriptionClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSubscriptionClient """ return self._raw_client async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> Subscription: """ Gets extended information about the users subscription Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Subscription Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.user.subscription.get() asyncio.run(main()) """ _response = await self._raw_client.get(request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/user/subscription/raw_client.py000066400000000000000000000113401523660243400307430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.subscription import Subscription from pydantic import ValidationError class RawSubscriptionClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Subscription]: """ Gets extended information about the users subscription Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[Subscription] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/user/subscription", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Subscription, construct_type( type_=Subscription, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSubscriptionClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[Subscription]: """ Gets extended information about the users subscription Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[Subscription] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/user/subscription", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Subscription, construct_type( type_=Subscription, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_speech_to_text_realtime/000077500000000000000000000000001523660243400302055ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_speech_to_text_realtime/__init__.py000066400000000000000000000020701523660243400323150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveTranscription _dynamic_imports: typing.Dict[str, str] = {"ReceiveTranscription": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTranscription"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_speech_to_text_realtime/types/000077500000000000000000000000001523660243400313515ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_speech_to_text_realtime/types/__init__.py000066400000000000000000000021301523660243400334560ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_transcription import ReceiveTranscription _dynamic_imports: typing.Dict[str, str] = {"ReceiveTranscription": ".receive_transcription"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTranscription"] receive_transcription.py000066400000000000000000000051131523660243400362450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_speech_to_text_realtime/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.committed_transcript_entities_payload import CommittedTranscriptEntitiesPayload from ...types.committed_transcript_payload import CommittedTranscriptPayload from ...types.committed_transcript_with_timestamps_payload import CommittedTranscriptWithTimestampsPayload from ...types.final_transcript import FinalTranscript from ...types.final_transcript_with_timestamps import FinalTranscriptWithTimestamps from ...types.partial_transcript_payload import PartialTranscriptPayload from ...types.scribe_auth_error_payload import ScribeAuthErrorPayload from ...types.scribe_chunk_size_exceeded_error_payload import ScribeChunkSizeExceededErrorPayload from ...types.scribe_error_payload import ScribeErrorPayload from ...types.scribe_input_error_payload import ScribeInputErrorPayload from ...types.scribe_insufficient_audio_activity_error_payload import ScribeInsufficientAudioActivityErrorPayload from ...types.scribe_invalid_request_error import ScribeInvalidRequestError from ...types.scribe_queue_overflow_error_payload import ScribeQueueOverflowErrorPayload from ...types.scribe_quota_exceeded_error_payload import ScribeQuotaExceededErrorPayload from ...types.scribe_rate_limited_error_payload import ScribeRateLimitedErrorPayload from ...types.scribe_resource_exhausted_error_payload import ScribeResourceExhaustedErrorPayload from ...types.scribe_session_time_limit_exceeded_error_payload import ScribeSessionTimeLimitExceededErrorPayload from ...types.scribe_throttled_error_payload import ScribeThrottledErrorPayload from ...types.scribe_transcriber_error_payload import ScribeTranscriberErrorPayload from ...types.scribe_unaccepted_terms_error_payload import ScribeUnacceptedTermsErrorPayload from ...types.session_started_payload import SessionStartedPayload ReceiveTranscription = typing.Union[ SessionStartedPayload, PartialTranscriptPayload, FinalTranscript, FinalTranscriptWithTimestamps, CommittedTranscriptPayload, CommittedTranscriptWithTimestampsPayload, CommittedTranscriptEntitiesPayload, ScribeErrorPayload, ScribeAuthErrorPayload, ScribeQuotaExceededErrorPayload, ScribeThrottledErrorPayload, ScribeUnacceptedTermsErrorPayload, ScribeRateLimitedErrorPayload, ScribeQueueOverflowErrorPayload, ScribeResourceExhaustedErrorPayload, ScribeSessionTimeLimitExceededErrorPayload, ScribeInputErrorPayload, ScribeInvalidRequestError, ScribeChunkSizeExceededErrorPayload, ScribeInsufficientAudioActivityErrorPayload, ScribeTranscriberErrorPayload, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_multi_stream_input/000077500000000000000000000000001523660243400326515ustar00rootroot00000000000000__init__.py000066400000000000000000000021721523660243400347050ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_multi_stream_input# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveTextToDialogueWebsocketMessageMulti _dynamic_imports: typing.Dict[str, str] = {"ReceiveTextToDialogueWebsocketMessageMulti": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTextToDialogueWebsocketMessageMulti"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_multi_stream_input/types/000077500000000000000000000000001523660243400340155ustar00rootroot00000000000000__init__.py000066400000000000000000000023261523660243400360520ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_multi_stream_input/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_text_to_dialogue_websocket_message_multi import ReceiveTextToDialogueWebsocketMessageMulti _dynamic_imports: typing.Dict[str, str] = { "ReceiveTextToDialogueWebsocketMessageMulti": ".receive_text_to_dialogue_websocket_message_multi" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTextToDialogueWebsocketMessageMulti"] receive_text_to_dialogue_websocket_message_multi.py000066400000000000000000000013111523660243400463310ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_multi_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.text_to_dialogue_websocket_audio_chunk_multi import TextToDialogueWebsocketAudioChunkMulti from ...types.text_to_dialogue_websocket_error import TextToDialogueWebsocketError from ...types.text_to_dialogue_websocket_final_audio_for_turn_multi import TextToDialogueWebsocketFinalAudioForTurnMulti from ...types.text_to_dialogue_websocket_final_multi import TextToDialogueWebsocketFinalMulti ReceiveTextToDialogueWebsocketMessageMulti = typing.Union[ TextToDialogueWebsocketAudioChunkMulti, TextToDialogueWebsocketFinalAudioForTurnMulti, TextToDialogueWebsocketFinalMulti, TextToDialogueWebsocketError, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_stream_input/000077500000000000000000000000001523660243400314375ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_stream_input/__init__.py000066400000000000000000000021531523660243400335510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveTextToDialogueWebsocketMessage _dynamic_imports: typing.Dict[str, str] = {"ReceiveTextToDialogueWebsocketMessage": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTextToDialogueWebsocketMessage"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_stream_input/types/000077500000000000000000000000001523660243400326035ustar00rootroot00000000000000__init__.py000066400000000000000000000022731523660243400346410ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_stream_input/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_text_to_dialogue_websocket_message import ReceiveTextToDialogueWebsocketMessage _dynamic_imports: typing.Dict[str, str] = { "ReceiveTextToDialogueWebsocketMessage": ".receive_text_to_dialogue_websocket_message" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTextToDialogueWebsocketMessage"] receive_text_to_dialogue_websocket_message.py000066400000000000000000000012241523660243400437100ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_dialogue_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.text_to_dialogue_websocket_audio_chunk import TextToDialogueWebsocketAudioChunk from ...types.text_to_dialogue_websocket_error import TextToDialogueWebsocketError from ...types.text_to_dialogue_websocket_final import TextToDialogueWebsocketFinal from ...types.text_to_dialogue_websocket_final_audio_for_turn import TextToDialogueWebsocketFinalAudioForTurn ReceiveTextToDialogueWebsocketMessage = typing.Union[ TextToDialogueWebsocketAudioChunk, TextToDialogueWebsocketFinalAudioForTurn, TextToDialogueWebsocketFinal, TextToDialogueWebsocketError, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/000077500000000000000000000000001523660243400341705ustar00rootroot00000000000000__init__.py000066400000000000000000000021711523660243400362230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveMessageMulti, SendMessageMulti _dynamic_imports: typing.Dict[str, str] = {"ReceiveMessageMulti": ".types", "SendMessageMulti": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveMessageMulti", "SendMessageMulti"] types/000077500000000000000000000000001523660243400352555ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input__init__.py000066400000000000000000000023241523660243400373670ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_message_multi import ReceiveMessageMulti from .send_message_multi import SendMessageMulti _dynamic_imports: typing.Dict[str, str] = { "ReceiveMessageMulti": ".receive_message_multi", "SendMessageMulti": ".send_message_multi", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveMessageMulti", "SendMessageMulti"] receive_message_multi.py000066400000000000000000000004121523660243400421640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.audio_output_multi import AudioOutputMulti from ...types.final_output_multi import FinalOutputMulti ReceiveMessageMulti = typing.Union[AudioOutputMulti, FinalOutputMulti] send_message_multi.py000066400000000000000000000012071523660243400414760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.close_context import CloseContext from ...types.close_socket import CloseSocket from ...types.flush_context import FlushContext from ...types.initialise_context import InitialiseContext from ...types.initialize_connection_multi import InitializeConnectionMulti from ...types.keep_context_alive import KeepContextAlive from ...types.send_text_multi import SendTextMulti SendMessageMulti = typing.Union[ InitializeConnectionMulti, InitialiseContext, SendTextMulti, FlushContext, CloseContext, CloseSocket, KeepContextAlive, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/000077500000000000000000000000001523660243400327565ustar00rootroot00000000000000__init__.py000066400000000000000000000021331523660243400350070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveMessage, SendMessage _dynamic_imports: typing.Dict[str, str] = {"ReceiveMessage": ".types", "SendMessage": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveMessage", "SendMessage"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/000077500000000000000000000000001523660243400341225ustar00rootroot00000000000000__init__.py000066400000000000000000000022231523660243400361530ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_message import ReceiveMessage from .send_message import SendMessage _dynamic_imports: typing.Dict[str, str] = {"ReceiveMessage": ".receive_message", "SendMessage": ".send_message"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveMessage", "SendMessage"] receive_message.py000066400000000000000000000003451523660243400375450ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.audio_output import AudioOutput from ...types.final_output import FinalOutput ReceiveMessage = typing.Union[AudioOutput, FinalOutput] send_message.py000066400000000000000000000004731523660243400370560ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.close_connection import CloseConnection from ...types.initialize_connection import InitializeConnection from ...types.send_text import SendText SendMessage = typing.Union[InitializeConnection, SendText, CloseConnection] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/000077500000000000000000000000001523660243400271655ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/__init__.py000066400000000000000000000023001523660243400312710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ReceiveTranslateStreamMessage, SendTranslateStreamMessage _dynamic_imports: typing.Dict[str, str] = { "ReceiveTranslateStreamMessage": ".types", "SendTranslateStreamMessage": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTranslateStreamMessage", "SendTranslateStreamMessage"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/types/000077500000000000000000000000001523660243400303315ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/types/__init__.py000066400000000000000000000024741523660243400324510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .receive_translate_stream_message import ReceiveTranslateStreamMessage from .send_translate_stream_message import SendTranslateStreamMessage _dynamic_imports: typing.Dict[str, str] = { "ReceiveTranslateStreamMessage": ".receive_translate_stream_message", "SendTranslateStreamMessage": ".send_translate_stream_message", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["ReceiveTranslateStreamMessage", "SendTranslateStreamMessage"] receive_translate_stream_message.py000066400000000000000000000031201523660243400373760ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.translate_audio_output_error import TranslateAudioOutputError from ...types.translate_audio_payload import TranslateAudioPayload from ...types.translate_auth_error import TranslateAuthError from ...types.translate_error_payload import TranslateErrorPayload from ...types.translate_final_transcript_payload import TranslateFinalTranscriptPayload from ...types.translate_input_error import TranslateInputError from ...types.translate_partial_transcript_payload import TranslatePartialTranscriptPayload from ...types.translate_queue_overflow_error import TranslateQueueOverflowError from ...types.translate_rate_limited_error import TranslateRateLimitedError from ...types.translate_session_started_payload import TranslateSessionStartedPayload from ...types.translate_status_payload import TranslateStatusPayload from ...types.translate_transcriber_error import TranslateTranscriberError from ...types.translate_translation_error import TranslateTranslationError from ...types.translate_translation_payload import TranslateTranslationPayload ReceiveTranslateStreamMessage = typing.Union[ TranslateSessionStartedPayload, TranslateStatusPayload, TranslatePartialTranscriptPayload, TranslateFinalTranscriptPayload, TranslateTranslationPayload, TranslateAudioPayload, TranslateErrorPayload, TranslateAuthError, TranslateRateLimitedError, TranslateQueueOverflowError, TranslateInputError, TranslateTranscriberError, TranslateTranslationError, TranslateAudioOutputError, ] send_translate_stream_message.py000066400000000000000000000005431523660243400367130ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/v_1_translate_realtime/types# This file was auto-generated by Fern from our API Definition. import typing from ...types.translate_end_of_stream_payload import TranslateEndOfStreamPayload from ...types.translate_input_audio_chunk_payload import TranslateInputAudioChunkPayload SendTranslateStreamMessage = typing.Union[TranslateInputAudioChunkPayload, TranslateEndOfStreamPayload] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/version.py000066400000000000000000000001151523660243400245750ustar00rootroot00000000000000from importlib import metadata __version__ = metadata.version("elevenlabs") elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/000077500000000000000000000000001523660243400240315ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/__init__.py000066400000000000000000000032151523660243400261430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import EditVoiceRequestLabels, VoicesGetSharedRequestCategory, VoicesGetSharedRequestSort from . import accents, ivc, pvc, samples, settings from .ivc import AddVoiceRequestLabels _dynamic_imports: typing.Dict[str, str] = { "AddVoiceRequestLabels": ".ivc", "EditVoiceRequestLabels": ".types", "VoicesGetSharedRequestCategory": ".types", "VoicesGetSharedRequestSort": ".types", "accents": ".accents", "ivc": ".ivc", "pvc": ".pvc", "samples": ".samples", "settings": ".settings", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AddVoiceRequestLabels", "EditVoiceRequestLabels", "VoicesGetSharedRequestCategory", "VoicesGetSharedRequestSort", "accents", "ivc", "pvc", "samples", "settings", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/accents/000077500000000000000000000000001523660243400254515ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/accents/__init__.py000066400000000000000000000001251523660243400275600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/accents/client.py000066400000000000000000000074561523660243400273150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.get_voice_accents_response_model import GetVoiceAccentsResponseModel from .raw_client import AsyncRawAccentsClient, RawAccentsClient class AccentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAccentsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAccentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAccentsClient """ return self._raw_client def get( self, *, language: typing.Optional[str] = None, model_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoiceAccentsResponseModel: """ Gets the list of available accents in the shared voice library. Parameters ---------- language : typing.Optional[str] If provided, only accents for this language code are returned. model_id : typing.Optional[str] If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoiceAccentsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.accents.get( language="language", model_id="model_id", ) """ _response = self._raw_client.get(language=language, model_id=model_id, request_options=request_options) return _response.data class AsyncAccentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAccentsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAccentsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAccentsClient """ return self._raw_client async def get( self, *, language: typing.Optional[str] = None, model_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoiceAccentsResponseModel: """ Gets the list of available accents in the shared voice library. Parameters ---------- language : typing.Optional[str] If provided, only accents for this language code are returned. model_id : typing.Optional[str] If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoiceAccentsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.accents.get( language="language", model_id="model_id", ) asyncio.run(main()) """ _response = await self._raw_client.get(language=language, model_id=model_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/accents/raw_client.py000066400000000000000000000136301523660243400301550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.get_voice_accents_response_model import GetVoiceAccentsResponseModel from pydantic import ValidationError class RawAccentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, language: typing.Optional[str] = None, model_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetVoiceAccentsResponseModel]: """ Gets the list of available accents in the shared voice library. Parameters ---------- language : typing.Optional[str] If provided, only accents for this language code are returned. model_id : typing.Optional[str] If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetVoiceAccentsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/voices/accents", method="GET", params={ "language": language, "model_id": model_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoiceAccentsResponseModel, construct_type( type_=GetVoiceAccentsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAccentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, language: typing.Optional[str] = None, model_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetVoiceAccentsResponseModel]: """ Gets the list of available accents in the shared voice library. Parameters ---------- language : typing.Optional[str] If provided, only accents for this language code are returned. model_id : typing.Optional[str] If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetVoiceAccentsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/voices/accents", method="GET", params={ "language": language, "model_id": model_id, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoiceAccentsResponseModel, construct_type( type_=GetVoiceAccentsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/client.py000066400000000000000000001475701523660243400256770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .. import core from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.add_voice_response_model import AddVoiceResponseModel from ..types.delete_voice_response_model import DeleteVoiceResponseModel from ..types.edit_voice_response_model import EditVoiceResponseModel from ..types.get_library_voices_response import GetLibraryVoicesResponse from ..types.get_voices_response import GetVoicesResponse from ..types.get_voices_v_2_response import GetVoicesV2Response from ..types.replicate_voice_to_isolated_environment_response_model import ( ReplicateVoiceToIsolatedEnvironmentResponseModel, ) from ..types.voice import Voice from .raw_client import AsyncRawVoicesClient, RawVoicesClient from .types.edit_voice_request_labels import EditVoiceRequestLabels from .types.voices_get_shared_request_category import VoicesGetSharedRequestCategory from .types.voices_get_shared_request_sort import VoicesGetSharedRequestSort if typing.TYPE_CHECKING: from .accents.client import AccentsClient, AsyncAccentsClient from .ivc.client import AsyncIvcClient, IvcClient from .pvc.client import AsyncPvcClient, PvcClient from .samples.client import AsyncSamplesClient, SamplesClient from .settings.client import AsyncSettingsClient, SettingsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class VoicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawVoicesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._settings: typing.Optional[SettingsClient] = None self._accents: typing.Optional[AccentsClient] = None self._ivc: typing.Optional[IvcClient] = None self._pvc: typing.Optional[PvcClient] = None self._samples: typing.Optional[SamplesClient] = None @property def with_raw_response(self) -> RawVoicesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawVoicesClient """ return self._raw_client def get_all( self, *, show_legacy: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetVoicesResponse: """ Returns a list of all available voices for a user. Stops working once the user's workspace exceeds 500 voices. Parameters ---------- show_legacy : typing.Optional[bool] If set to true, legacy premade voices will be included in responses from /v1/voices request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoicesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.get_all( show_legacy=True, ) """ _response = self._raw_client.get_all(show_legacy=show_legacy, request_options=request_options) return _response.data def get( self, voice_id: str, *, with_settings: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> Voice: """ Returns metadata about a specific voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. with_settings : typing.Optional[bool] This parameter is now deprecated. It is ignored and will be removed in a future version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Voice Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.get( voice_id="21m00Tcm4TlvDq8ikWAM", with_settings=True, ) """ _response = self._raw_client.get(voice_id, with_settings=with_settings, request_options=request_options) return _response.data def delete( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteVoiceResponseModel: """ Deletes a voice by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteVoiceResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.delete( voice_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.delete(voice_id, request_options=request_options) return _response.data def update( self, voice_id: str, *, name: str, files: typing.Optional[typing.List[core.File]] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[EditVoiceRequestLabels] = OMIT, moderate_metadata: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditVoiceResponseModel: """ Edit a voice created by you. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. name : str The name that identifies this voice. This will be displayed in the dropdown of the website. files : typing.Optional[typing.List[core.File]] See core.File for more documentation remove_background_noise : typing.Optional[bool] If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. description : typing.Optional[str] A description of the voice. labels : typing.Optional[EditVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. moderate_metadata : typing.Optional[bool] Run synchronous LLM moderation over the voice name and description when they change. Has no effect unless the voice_library_metadata_moderation feature flag is enabled for the user. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditVoiceResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.update( voice_id="21m00Tcm4TlvDq8ikWAM", name="name", ) """ _response = self._raw_client.update( voice_id, name=name, files=files, remove_background_noise=remove_background_noise, description=description, labels=labels, moderate_metadata=moderate_metadata, request_options=request_options, ) return _response.data def search( self, *, next_page_token: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort: typing.Optional[str] = None, sort_direction: typing.Optional[str] = None, voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, collection_id: typing.Optional[str] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, language: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, accent: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, high_quality: typing.Optional[bool] = None, include_total_count: typing.Optional[bool] = None, voice_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoicesV2Response: """ Gets a list of all available voices for a user with search, filtering and pagination. Parameters ---------- next_page_token : typing.Optional[str] The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination. page_size : typing.Optional[int] How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included. search : typing.Optional[str] Search term to filter voices by. Searches in name, description, labels, category. sort : typing.Optional[str] Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default', 'non-community', 'saved'. 'non-default' is equal to all but 'default'. 'non-community' is equal to 'personal' and 'workspace' combined (excludes library copies). 'saved' is equal to non-default, but includes default voices if they have been added to a collection. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' 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. gender : typing.Optional[str] Gender used for filtering, based on the voice's 'gender' label. age : typing.Optional[str] Age used for filtering, based on the voice's 'age' label. language : typing.Optional[typing.Union[str, typing.Sequence[str]]] Languages used for filtering, based on the voice's 'language' label. Voices matching any of the given languages are returned. accent : typing.Optional[str] Accent used for filtering, based on the voice's 'accent' label. use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use cases used for filtering, based on the voice's 'use_case' label. Voices matching any of the given use cases are returned. min_notice_period_days : typing.Optional[int] Filter to voices whose sharing notice period is at least the given number of days. include_custom_rates : typing.Optional[bool] Whether to include voices that have a custom sharing rate. Defaults to including them. include_live_moderated : typing.Optional[bool] Whether to include voices that have live moderation enabled. Defaults to including them. high_quality : typing.Optional[bool] When true, only return studio-quality voices (those whose category is 'high_quality'). include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost. voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Voice IDs to lookup by. Maximum 100 voice IDs. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoicesV2Response Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.search( next_page_token="next_page_token", page_size=1, search="search", sort="sort", sort_direction="sort_direction", voice_type="voice_type", category="category", fine_tuning_state="fine_tuning_state", collection_id="collection_id", gender="gender", age="age", language=["language"], accent="accent", use_cases=["use_cases"], min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, high_quality=True, include_total_count=True, voice_ids=["voice_ids"], ) """ _response = self._raw_client.search( next_page_token=next_page_token, page_size=page_size, search=search, sort=sort, sort_direction=sort_direction, voice_type=voice_type, category=category, fine_tuning_state=fine_tuning_state, collection_id=collection_id, gender=gender, age=age, language=language, accent=accent, use_cases=use_cases, min_notice_period_days=min_notice_period_days, include_custom_rates=include_custom_rates, include_live_moderated=include_live_moderated, high_quality=high_quality, include_total_count=include_total_count, voice_ids=voice_ids, request_options=request_options, ) return _response.data def replicate_to_isolated_environment( self, voice_id: str, *, target_workspace_id: str, preserve_voice_id: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReplicateVoiceToIsolatedEnvironmentResponseModel: """ Replicates an Instant Voice Clone or Voice Design voice to a workspace in a different data residency. The target workspace must belong to the same consolidated billing group. The user must have VOICES_WRITE in the source workspace, and be an admin on the source voice. Human users (i.e. not service accounts) must also have VOICES_WRITE in the target workspace. This endpoint is available on the central environment only. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. target_workspace_id : str ID of the workspace to replicate the voice into. It must belong to the same consolidated billing group as the calling workspace; the target's data residency is derived from that link. preserve_voice_id : typing.Optional[bool] When true (default) the replicated voice keeps the same voice ID in the target residency; set to false to assign a new voice ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ReplicateVoiceToIsolatedEnvironmentResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.replicate_to_isolated_environment( voice_id="21m00Tcm4TlvDq8ikWAM", target_workspace_id="target_workspace_id", ) """ _response = self._raw_client.replicate_to_isolated_environment( voice_id, target_workspace_id=target_workspace_id, preserve_voice_id=preserve_voice_id, request_options=request_options, ) return _response.data def share( self, public_user_id: str, voice_id: str, *, new_name: str, bookmarked: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceResponseModel: """ Add a shared voice to your collection of Voices Parameters ---------- public_user_id : str Public user ID used to publicly identify ElevenLabs users. voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. new_name : str The name that identifies this voice. This will be displayed in the dropdown of the website. bookmarked : typing.Optional[bool] 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.share( public_user_id="63e06b7e7cafdc46be4d2e0b3f045940231ae058d508589653d74d1265a574ca", voice_id="21m00Tcm4TlvDq8ikWAM", new_name="John Smith", ) """ _response = self._raw_client.share( public_user_id, voice_id, new_name=new_name, bookmarked=bookmarked, request_options=request_options ) return _response.data def get_shared( self, *, page_size: typing.Optional[int] = None, category: typing.Optional[VoicesGetSharedRequestCategory] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, accent: typing.Optional[str] = None, language: typing.Optional[str] = None, locale: typing.Optional[str] = None, search: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[VoicesGetSharedRequestSort] = None, page: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetLibraryVoicesResponse: """ Retrieves a list of shared voices. Parameters ---------- page_size : typing.Optional[int] How many shared voices to return at maximum. Can not exceed 100, defaults to 30. category : typing.Optional[VoicesGetSharedRequestCategory] Voice category used for filtering gender : typing.Optional[str] Gender used for filtering age : typing.Optional[str] Age used for filtering accent : typing.Optional[str] Accent used for filtering language : typing.Optional[str] Language used for filtering locale : typing.Optional[str] Locale used for filtering search : typing.Optional[str] Search term used for filtering use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use-case used for filtering descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]] Search term used for filtering featured : typing.Optional[bool] Filter featured voices min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. include_custom_rates : typing.Optional[bool] Include/exclude voices with custom rates include_live_moderated : typing.Optional[bool] Include/exclude voices that are live moderated reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app owner_id : typing.Optional[str] Filter voices by public owner ID sort : typing.Optional[VoicesGetSharedRequestSort] Sort criteria. Must be one of: created_date, usage_character_count_1y, trending, cloned_by_count. page : typing.Optional[int] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLibraryVoicesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.get_shared( page_size=1, category="professional", gender="gender", age="age", accent="accent", language="language", locale="locale", search="search", use_cases=["use_cases"], descriptives=["descriptives"], featured=True, min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, reader_app_enabled=True, owner_id="owner_id", sort="created_date", page=1, ) """ _response = self._raw_client.get_shared( page_size=page_size, category=category, gender=gender, age=age, accent=accent, language=language, locale=locale, search=search, use_cases=use_cases, descriptives=descriptives, featured=featured, min_notice_period_days=min_notice_period_days, include_custom_rates=include_custom_rates, include_live_moderated=include_live_moderated, reader_app_enabled=reader_app_enabled, owner_id=owner_id, sort=sort, page=page, request_options=request_options, ) return _response.data def find_similar_voices( self, *, audio_file: typing.Optional[core.File] = OMIT, similarity_threshold: typing.Optional[float] = OMIT, top_k: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetLibraryVoicesResponse: """ Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. Parameters ---------- audio_file : typing.Optional[core.File] See core.File for more documentation similarity_threshold : typing.Optional[float] Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. top_k : typing.Optional[int] Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLibraryVoicesResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.find_similar_voices() """ _response = self._raw_client.find_similar_voices( audio_file=audio_file, similarity_threshold=similarity_threshold, top_k=top_k, request_options=request_options, ) return _response.data @property def settings(self): if self._settings is None: from .settings.client import SettingsClient # noqa: E402 self._settings = SettingsClient(client_wrapper=self._client_wrapper) return self._settings @property def accents(self): if self._accents is None: from .accents.client import AccentsClient # noqa: E402 self._accents = AccentsClient(client_wrapper=self._client_wrapper) return self._accents @property def ivc(self): if self._ivc is None: from .ivc.client import IvcClient # noqa: E402 self._ivc = IvcClient(client_wrapper=self._client_wrapper) return self._ivc @property def pvc(self): if self._pvc is None: from .pvc.client import PvcClient # noqa: E402 self._pvc = PvcClient(client_wrapper=self._client_wrapper) return self._pvc @property def samples(self): if self._samples is None: from .samples.client import SamplesClient # noqa: E402 self._samples = SamplesClient(client_wrapper=self._client_wrapper) return self._samples class AsyncVoicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawVoicesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._settings: typing.Optional[AsyncSettingsClient] = None self._accents: typing.Optional[AsyncAccentsClient] = None self._ivc: typing.Optional[AsyncIvcClient] = None self._pvc: typing.Optional[AsyncPvcClient] = None self._samples: typing.Optional[AsyncSamplesClient] = None @property def with_raw_response(self) -> AsyncRawVoicesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawVoicesClient """ return self._raw_client async def get_all( self, *, show_legacy: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetVoicesResponse: """ Returns a list of all available voices for a user. Stops working once the user's workspace exceeds 500 voices. Parameters ---------- show_legacy : typing.Optional[bool] If set to true, legacy premade voices will be included in responses from /v1/voices request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoicesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.get_all( show_legacy=True, ) asyncio.run(main()) """ _response = await self._raw_client.get_all(show_legacy=show_legacy, request_options=request_options) return _response.data async def get( self, voice_id: str, *, with_settings: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> Voice: """ Returns metadata about a specific voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. with_settings : typing.Optional[bool] This parameter is now deprecated. It is ignored and will be removed in a future version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- Voice Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.get( voice_id="21m00Tcm4TlvDq8ikWAM", with_settings=True, ) asyncio.run(main()) """ _response = await self._raw_client.get(voice_id, with_settings=with_settings, request_options=request_options) return _response.data async def delete( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteVoiceResponseModel: """ Deletes a voice by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteVoiceResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.delete( voice_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.delete(voice_id, request_options=request_options) return _response.data async def update( self, voice_id: str, *, name: str, files: typing.Optional[typing.List[core.File]] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[EditVoiceRequestLabels] = OMIT, moderate_metadata: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> EditVoiceResponseModel: """ Edit a voice created by you. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. name : str The name that identifies this voice. This will be displayed in the dropdown of the website. files : typing.Optional[typing.List[core.File]] See core.File for more documentation remove_background_noise : typing.Optional[bool] If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. description : typing.Optional[str] A description of the voice. labels : typing.Optional[EditVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. moderate_metadata : typing.Optional[bool] Run synchronous LLM moderation over the voice name and description when they change. Has no effect unless the voice_library_metadata_moderation feature flag is enabled for the user. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditVoiceResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.update( voice_id="21m00Tcm4TlvDq8ikWAM", name="name", ) asyncio.run(main()) """ _response = await self._raw_client.update( voice_id, name=name, files=files, remove_background_noise=remove_background_noise, description=description, labels=labels, moderate_metadata=moderate_metadata, request_options=request_options, ) return _response.data async def search( self, *, next_page_token: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort: typing.Optional[str] = None, sort_direction: typing.Optional[str] = None, voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, collection_id: typing.Optional[str] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, language: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, accent: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, high_quality: typing.Optional[bool] = None, include_total_count: typing.Optional[bool] = None, voice_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetVoicesV2Response: """ Gets a list of all available voices for a user with search, filtering and pagination. Parameters ---------- next_page_token : typing.Optional[str] The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination. page_size : typing.Optional[int] How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included. search : typing.Optional[str] Search term to filter voices by. Searches in name, description, labels, category. sort : typing.Optional[str] Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default', 'non-community', 'saved'. 'non-default' is equal to all but 'default'. 'non-community' is equal to 'personal' and 'workspace' combined (excludes library copies). 'saved' is equal to non-default, but includes default voices if they have been added to a collection. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' 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. gender : typing.Optional[str] Gender used for filtering, based on the voice's 'gender' label. age : typing.Optional[str] Age used for filtering, based on the voice's 'age' label. language : typing.Optional[typing.Union[str, typing.Sequence[str]]] Languages used for filtering, based on the voice's 'language' label. Voices matching any of the given languages are returned. accent : typing.Optional[str] Accent used for filtering, based on the voice's 'accent' label. use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use cases used for filtering, based on the voice's 'use_case' label. Voices matching any of the given use cases are returned. min_notice_period_days : typing.Optional[int] Filter to voices whose sharing notice period is at least the given number of days. include_custom_rates : typing.Optional[bool] Whether to include voices that have a custom sharing rate. Defaults to including them. include_live_moderated : typing.Optional[bool] Whether to include voices that have live moderation enabled. Defaults to including them. high_quality : typing.Optional[bool] When true, only return studio-quality voices (those whose category is 'high_quality'). include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost. voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Voice IDs to lookup by. Maximum 100 voice IDs. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetVoicesV2Response Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.search( next_page_token="next_page_token", page_size=1, search="search", sort="sort", sort_direction="sort_direction", voice_type="voice_type", category="category", fine_tuning_state="fine_tuning_state", collection_id="collection_id", gender="gender", age="age", language=["language"], accent="accent", use_cases=["use_cases"], min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, high_quality=True, include_total_count=True, voice_ids=["voice_ids"], ) asyncio.run(main()) """ _response = await self._raw_client.search( next_page_token=next_page_token, page_size=page_size, search=search, sort=sort, sort_direction=sort_direction, voice_type=voice_type, category=category, fine_tuning_state=fine_tuning_state, collection_id=collection_id, gender=gender, age=age, language=language, accent=accent, use_cases=use_cases, min_notice_period_days=min_notice_period_days, include_custom_rates=include_custom_rates, include_live_moderated=include_live_moderated, high_quality=high_quality, include_total_count=include_total_count, voice_ids=voice_ids, request_options=request_options, ) return _response.data async def replicate_to_isolated_environment( self, voice_id: str, *, target_workspace_id: str, preserve_voice_id: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReplicateVoiceToIsolatedEnvironmentResponseModel: """ Replicates an Instant Voice Clone or Voice Design voice to a workspace in a different data residency. The target workspace must belong to the same consolidated billing group. The user must have VOICES_WRITE in the source workspace, and be an admin on the source voice. Human users (i.e. not service accounts) must also have VOICES_WRITE in the target workspace. This endpoint is available on the central environment only. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. target_workspace_id : str ID of the workspace to replicate the voice into. It must belong to the same consolidated billing group as the calling workspace; the target's data residency is derived from that link. preserve_voice_id : typing.Optional[bool] When true (default) the replicated voice keeps the same voice ID in the target residency; set to false to assign a new voice ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ReplicateVoiceToIsolatedEnvironmentResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.replicate_to_isolated_environment( voice_id="21m00Tcm4TlvDq8ikWAM", target_workspace_id="target_workspace_id", ) asyncio.run(main()) """ _response = await self._raw_client.replicate_to_isolated_environment( voice_id, target_workspace_id=target_workspace_id, preserve_voice_id=preserve_voice_id, request_options=request_options, ) return _response.data async def share( self, public_user_id: str, voice_id: str, *, new_name: str, bookmarked: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceResponseModel: """ Add a shared voice to your collection of Voices Parameters ---------- public_user_id : str Public user ID used to publicly identify ElevenLabs users. voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. new_name : str The name that identifies this voice. This will be displayed in the dropdown of the website. bookmarked : typing.Optional[bool] 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.share( public_user_id="63e06b7e7cafdc46be4d2e0b3f045940231ae058d508589653d74d1265a574ca", voice_id="21m00Tcm4TlvDq8ikWAM", new_name="John Smith", ) asyncio.run(main()) """ _response = await self._raw_client.share( public_user_id, voice_id, new_name=new_name, bookmarked=bookmarked, request_options=request_options ) return _response.data async def get_shared( self, *, page_size: typing.Optional[int] = None, category: typing.Optional[VoicesGetSharedRequestCategory] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, accent: typing.Optional[str] = None, language: typing.Optional[str] = None, locale: typing.Optional[str] = None, search: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[VoicesGetSharedRequestSort] = None, page: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetLibraryVoicesResponse: """ Retrieves a list of shared voices. Parameters ---------- page_size : typing.Optional[int] How many shared voices to return at maximum. Can not exceed 100, defaults to 30. category : typing.Optional[VoicesGetSharedRequestCategory] Voice category used for filtering gender : typing.Optional[str] Gender used for filtering age : typing.Optional[str] Age used for filtering accent : typing.Optional[str] Accent used for filtering language : typing.Optional[str] Language used for filtering locale : typing.Optional[str] Locale used for filtering search : typing.Optional[str] Search term used for filtering use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use-case used for filtering descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]] Search term used for filtering featured : typing.Optional[bool] Filter featured voices min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. include_custom_rates : typing.Optional[bool] Include/exclude voices with custom rates include_live_moderated : typing.Optional[bool] Include/exclude voices that are live moderated reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app owner_id : typing.Optional[str] Filter voices by public owner ID sort : typing.Optional[VoicesGetSharedRequestSort] Sort criteria. Must be one of: created_date, usage_character_count_1y, trending, cloned_by_count. page : typing.Optional[int] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLibraryVoicesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.get_shared( page_size=1, category="professional", gender="gender", age="age", accent="accent", language="language", locale="locale", search="search", use_cases=["use_cases"], descriptives=["descriptives"], featured=True, min_notice_period_days=1, include_custom_rates=True, include_live_moderated=True, reader_app_enabled=True, owner_id="owner_id", sort="created_date", page=1, ) asyncio.run(main()) """ _response = await self._raw_client.get_shared( page_size=page_size, category=category, gender=gender, age=age, accent=accent, language=language, locale=locale, search=search, use_cases=use_cases, descriptives=descriptives, featured=featured, min_notice_period_days=min_notice_period_days, include_custom_rates=include_custom_rates, include_live_moderated=include_live_moderated, reader_app_enabled=reader_app_enabled, owner_id=owner_id, sort=sort, page=page, request_options=request_options, ) return _response.data async def find_similar_voices( self, *, audio_file: typing.Optional[core.File] = OMIT, similarity_threshold: typing.Optional[float] = OMIT, top_k: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetLibraryVoicesResponse: """ Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. Parameters ---------- audio_file : typing.Optional[core.File] See core.File for more documentation similarity_threshold : typing.Optional[float] Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. top_k : typing.Optional[int] Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetLibraryVoicesResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.find_similar_voices() asyncio.run(main()) """ _response = await self._raw_client.find_similar_voices( audio_file=audio_file, similarity_threshold=similarity_threshold, top_k=top_k, request_options=request_options, ) return _response.data @property def settings(self): if self._settings is None: from .settings.client import AsyncSettingsClient # noqa: E402 self._settings = AsyncSettingsClient(client_wrapper=self._client_wrapper) return self._settings @property def accents(self): if self._accents is None: from .accents.client import AsyncAccentsClient # noqa: E402 self._accents = AsyncAccentsClient(client_wrapper=self._client_wrapper) return self._accents @property def ivc(self): if self._ivc is None: from .ivc.client import AsyncIvcClient # noqa: E402 self._ivc = AsyncIvcClient(client_wrapper=self._client_wrapper) return self._ivc @property def pvc(self): if self._pvc is None: from .pvc.client import AsyncPvcClient # noqa: E402 self._pvc = AsyncPvcClient(client_wrapper=self._client_wrapper) return self._pvc @property def samples(self): if self._samples is None: from .samples.client import AsyncSamplesClient # noqa: E402 self._samples = AsyncSamplesClient(client_wrapper=self._client_wrapper) return self._samples elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/000077500000000000000000000000001523660243400246125ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/__init__.py000066400000000000000000000020731523660243400267250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import AddVoiceRequestLabels _dynamic_imports: typing.Dict[str, str] = {"AddVoiceRequestLabels": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AddVoiceRequestLabels"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/client.py000066400000000000000000000122161523660243400264440ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ... import core from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.add_voice_ivc_response_model import AddVoiceIvcResponseModel from .raw_client import AsyncRawIvcClient, RawIvcClient from .types.add_voice_request_labels import AddVoiceRequestLabels # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class IvcClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawIvcClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawIvcClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawIvcClient """ return self._raw_client def create( self, *, name: str, files: typing.List[core.File], remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[AddVoiceRequestLabels] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceIvcResponseModel: """ Create a voice clone and add it to your Voices Parameters ---------- name : str The name that identifies this voice. This will be displayed in the dropdown of the website. 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. description : typing.Optional[str] A description of the voice. labels : typing.Optional[AddVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddVoiceIvcResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.ivc.create( name="name", ) """ _response = self._raw_client.create( name=name, files=files, remove_background_noise=remove_background_noise, description=description, labels=labels, request_options=request_options, ) return _response.data class AsyncIvcClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawIvcClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawIvcClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawIvcClient """ return self._raw_client async def create( self, *, name: str, files: typing.List[core.File], remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[AddVoiceRequestLabels] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceIvcResponseModel: """ Create a voice clone and add it to your Voices Parameters ---------- name : str The name that identifies this voice. This will be displayed in the dropdown of the website. 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. description : typing.Optional[str] A description of the voice. labels : typing.Optional[AddVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddVoiceIvcResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.ivc.create( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.create( name=name, files=files, remove_background_noise=remove_background_noise, description=description, labels=labels, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/raw_client.py000066400000000000000000000171221523660243400273160ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import json import typing from json.decoder import JSONDecodeError from ... import core from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.add_voice_ivc_response_model import AddVoiceIvcResponseModel from .types.add_voice_request_labels import AddVoiceRequestLabels from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawIvcClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, name: str, files: typing.List[core.File], remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[AddVoiceRequestLabels] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddVoiceIvcResponseModel]: """ Create a voice clone and add it to your Voices Parameters ---------- name : str The name that identifies this voice. This will be displayed in the dropdown of the website. 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. description : typing.Optional[str] A description of the voice. labels : typing.Optional[AddVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddVoiceIvcResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/voices/add", method="POST", data={ "name": name, "remove_background_noise": remove_background_noise, "description": description, "labels": json.dumps(jsonable_encoder(labels)), }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceIvcResponseModel, construct_type( type_=AddVoiceIvcResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawIvcClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, name: str, files: typing.List[core.File], remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[AddVoiceRequestLabels] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddVoiceIvcResponseModel]: """ Create a voice clone and add it to your Voices Parameters ---------- name : str The name that identifies this voice. This will be displayed in the dropdown of the website. 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. description : typing.Optional[str] A description of the voice. labels : typing.Optional[AddVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddVoiceIvcResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/voices/add", method="POST", data={ "name": name, "remove_background_noise": remove_background_noise, "description": description, "labels": json.dumps(jsonable_encoder(labels)), }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceIvcResponseModel, construct_type( type_=AddVoiceIvcResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/types/000077500000000000000000000000001523660243400257565ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/types/__init__.py000066400000000000000000000021411523660243400300650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .add_voice_request_labels import AddVoiceRequestLabels _dynamic_imports: typing.Dict[str, str] = {"AddVoiceRequestLabels": ".add_voice_request_labels"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["AddVoiceRequestLabels"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/ivc/types/add_voice_request_labels.py000066400000000000000000000002211523660243400333320ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing AddVoiceRequestLabels = typing.Union[typing.Dict[str, str], str] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/000077500000000000000000000000001523660243400246215ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/__init__.py000066400000000000000000000021151523660243400267310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import samples, verification _dynamic_imports: typing.Dict[str, str] = {"samples": ".samples", "verification": ".verification"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["samples", "verification"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/client.py000066400000000000000000000301221523660243400264470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.add_voice_response_model import AddVoiceResponseModel from ...types.start_pvc_voice_training_response_model import StartPvcVoiceTrainingResponseModel from .raw_client import AsyncRawPvcClient, RawPvcClient if typing.TYPE_CHECKING: from .samples.client import AsyncSamplesClient, SamplesClient from .verification.client import AsyncVerificationClient, VerificationClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class PvcClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawPvcClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._samples: typing.Optional[SamplesClient] = None self._verification: typing.Optional[VerificationClient] = None @property def with_raw_response(self) -> RawPvcClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawPvcClient """ return self._raw_client 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]]] Labels for the voice. Keys can be language, accent, gender, or age. 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._raw_client.create( name=name, language=language, description=description, labels=labels, request_options=request_options ) return _response.data 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]]] Labels for the voice. Keys can be language, accent, gender, or age. 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._raw_client.update( voice_id, name=name, language=language, description=description, labels=labels, request_options=request_options, ) return _response.data 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._raw_client.train(voice_id, model_id=model_id, request_options=request_options) return _response.data @property def samples(self): if self._samples is None: from .samples.client import SamplesClient # noqa: E402 self._samples = SamplesClient(client_wrapper=self._client_wrapper) return self._samples @property def verification(self): if self._verification is None: from .verification.client import VerificationClient # noqa: E402 self._verification = VerificationClient(client_wrapper=self._client_wrapper) return self._verification class AsyncPvcClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawPvcClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._samples: typing.Optional[AsyncSamplesClient] = None self._verification: typing.Optional[AsyncVerificationClient] = None @property def with_raw_response(self) -> AsyncRawPvcClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawPvcClient """ return self._raw_client 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]]] Labels for the voice. Keys can be language, accent, gender, or age. 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._raw_client.create( name=name, language=language, description=description, labels=labels, request_options=request_options ) return _response.data 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]]] Labels for the voice. Keys can be language, accent, gender, or age. 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._raw_client.update( voice_id, name=name, language=language, description=description, labels=labels, request_options=request_options, ) return _response.data 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._raw_client.train(voice_id, model_id=model_id, request_options=request_options) return _response.data @property def samples(self): if self._samples is None: from .samples.client import AsyncSamplesClient # noqa: E402 self._samples = AsyncSamplesClient(client_wrapper=self._client_wrapper) return self._samples @property def verification(self): if self._verification is None: from .verification.client import AsyncVerificationClient # noqa: E402 self._verification = AsyncVerificationClient(client_wrapper=self._client_wrapper) return self._verification elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/raw_client.py000066400000000000000000000442061523660243400273300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.add_voice_response_model import AddVoiceResponseModel from ...types.start_pvc_voice_training_response_model import StartPvcVoiceTrainingResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawPvcClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = 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, ) -> HttpResponse[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]]] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/voices/pvc", 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: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), 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, ) -> HttpResponse[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]]] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}", 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: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def train( self, voice_id: str, *, model_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[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 ------- HttpResponse[StartPvcVoiceTrainingResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/train", 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: _data = typing.cast( StartPvcVoiceTrainingResponseModel, construct_type( type_=StartPvcVoiceTrainingResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawPvcClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = 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, ) -> AsyncHttpResponse[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]]] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/voices/pvc", 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: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), 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, ) -> AsyncHttpResponse[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]]] Labels for the voice. Keys can be language, accent, gender, or age. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}", 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: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def train( self, voice_id: str, *, model_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[StartPvcVoiceTrainingResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/train", 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: _data = typing.cast( StartPvcVoiceTrainingResponseModel, construct_type( type_=StartPvcVoiceTrainingResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/000077500000000000000000000000001523660243400262655ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/__init__.py000066400000000000000000000021441523660243400303770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import audio, speakers, waveform _dynamic_imports: typing.Dict[str, str] = {"audio": ".audio", "speakers": ".speakers", "waveform": ".waveform"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["audio", "speakers", "waveform"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/audio/000077500000000000000000000000001523660243400273665ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/audio/__init__.py000066400000000000000000000001251523660243400314750ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/audio/client.py000066400000000000000000000106521523660243400312220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.voice_sample_preview_response_model import VoiceSamplePreviewResponseModel from .raw_client import AsyncRawAudioClient, RawAudioClient class AudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioClient """ return self._raw_client def get( self, voice_id: str, sample_id: str, *, remove_background_noise: typing.Optional[bool] = None, 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 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 ------- 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", remove_background_noise=True, ) """ _response = self._raw_client.get( voice_id, sample_id, remove_background_noise=remove_background_noise, request_options=request_options ) return _response.data class AsyncAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioClient """ return self._raw_client async def get( self, voice_id: str, sample_id: str, *, remove_background_noise: typing.Optional[bool] = None, 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 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 ------- 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", remove_background_noise=True, ) asyncio.run(main()) """ _response = await self._raw_client.get( voice_id, sample_id, remove_background_noise=remove_background_noise, request_options=request_options ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/audio/raw_client.py000066400000000000000000000147441523660243400321010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.voice_sample_preview_response_model import VoiceSamplePreviewResponseModel from pydantic import ValidationError class RawAudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, voice_id: str, sample_id: str, *, remove_background_noise: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[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 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 ------- HttpResponse[VoiceSamplePreviewResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", method="GET", params={ "remove_background_noise": remove_background_noise, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSamplePreviewResponseModel, construct_type( type_=VoiceSamplePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, voice_id: str, sample_id: str, *, remove_background_noise: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[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 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 ------- AsyncHttpResponse[VoiceSamplePreviewResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", method="GET", params={ "remove_background_noise": remove_background_noise, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSamplePreviewResponseModel, construct_type( type_=VoiceSamplePreviewResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/client.py000066400000000000000000000343621523660243400301250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.add_voice_response_model import AddVoiceResponseModel from ....types.delete_voice_sample_response_model import DeleteVoiceSampleResponseModel from ....types.voice_sample import VoiceSample from .raw_client import AsyncRawSamplesClient, RawSamplesClient if typing.TYPE_CHECKING: from .audio.client import AsyncAudioClient, AudioClient from .speakers.client import AsyncSpeakersClient, SpeakersClient from .waveform.client import AsyncWaveformClient, WaveformClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSamplesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AudioClient] = None self._waveform: typing.Optional[WaveformClient] = None self._speakers: typing.Optional[SpeakersClient] = None @property def with_raw_response(self) -> RawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSamplesClient """ return self._raw_client 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._raw_client.create( voice_id, files=files, remove_background_noise=remove_background_noise, request_options=request_options ) return _response.data 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, file_name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceResponseModel: """ Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name. 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 file_name : typing.Optional[str] The name of the audio file to be used for PVC training. 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._raw_client.update( voice_id, sample_id, remove_background_noise=remove_background_noise, selected_speaker_ids=selected_speaker_ids, trim_start_time=trim_start_time, trim_end_time=trim_end_time, file_name=file_name, request_options=request_options, ) return _response.data 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._raw_client.delete(voice_id, sample_id, request_options=request_options) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AudioClient # noqa: E402 self._audio = AudioClient(client_wrapper=self._client_wrapper) return self._audio @property def waveform(self): if self._waveform is None: from .waveform.client import WaveformClient # noqa: E402 self._waveform = WaveformClient(client_wrapper=self._client_wrapper) return self._waveform @property def speakers(self): if self._speakers is None: from .speakers.client import SpeakersClient # noqa: E402 self._speakers = SpeakersClient(client_wrapper=self._client_wrapper) return self._speakers class AsyncSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSamplesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AsyncAudioClient] = None self._waveform: typing.Optional[AsyncWaveformClient] = None self._speakers: typing.Optional[AsyncSpeakersClient] = None @property def with_raw_response(self) -> AsyncRawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSamplesClient """ return self._raw_client 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._raw_client.create( voice_id, files=files, remove_background_noise=remove_background_noise, request_options=request_options ) return _response.data 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, file_name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddVoiceResponseModel: """ Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name. 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 file_name : typing.Optional[str] The name of the audio file to be used for PVC training. 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._raw_client.update( voice_id, sample_id, remove_background_noise=remove_background_noise, selected_speaker_ids=selected_speaker_ids, trim_start_time=trim_start_time, trim_end_time=trim_end_time, file_name=file_name, request_options=request_options, ) return _response.data 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._raw_client.delete(voice_id, sample_id, request_options=request_options) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AsyncAudioClient # noqa: E402 self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper) return self._audio @property def waveform(self): if self._waveform is None: from .waveform.client import AsyncWaveformClient # noqa: E402 self._waveform = AsyncWaveformClient(client_wrapper=self._client_wrapper) return self._waveform @property def speakers(self): if self._speakers is None: from .speakers.client import AsyncSpeakersClient # noqa: E402 self._speakers = AsyncSpeakersClient(client_wrapper=self._client_wrapper) return self._speakers elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/raw_client.py000066400000000000000000000462621523660243400310000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.add_voice_response_model import AddVoiceResponseModel from ....types.delete_voice_sample_response_model import DeleteVoiceSampleResponseModel from ....types.voice_sample import VoiceSample from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = 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, ) -> HttpResponse[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 ------- HttpResponse[typing.List[VoiceSample]] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples", method="POST", data={ "remove_background_noise": remove_background_noise, }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[VoiceSample], construct_type( type_=typing.List[VoiceSample], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), 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, file_name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddVoiceResponseModel]: """ Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name. 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 file_name : typing.Optional[str] The name of the audio file to be used for PVC training. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", 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, "file_name": file_name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[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 ------- HttpResponse[DeleteVoiceSampleResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteVoiceSampleResponseModel, construct_type( type_=DeleteVoiceSampleResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = 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, ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[typing.List[VoiceSample]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples", method="POST", data={ "remove_background_noise": remove_background_noise, }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[VoiceSample], construct_type( type_=typing.List[VoiceSample], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), 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, file_name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddVoiceResponseModel]: """ Update a PVC voice sample - apply noise removal, select speaker, change trim times or file name. 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 file_name : typing.Optional[str] The name of the audio file to be used for PVC training. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", 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, "file_name": file_name, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[DeleteVoiceSampleResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteVoiceSampleResponseModel, construct_type( type_=DeleteVoiceSampleResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/000077500000000000000000000000001523660243400301025ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/__init__.py000066400000000000000000000020061523660243400322110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import audio _dynamic_imports: typing.Dict[str, str] = {"audio": ".audio"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["audio"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/audio/000077500000000000000000000000001523660243400312035ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/audio/__init__.py000066400000000000000000000001251523660243400333120ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py000066400000000000000000000100221523660243400330260ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ......core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ......core.request_options import RequestOptions from ......types.speaker_audio_response_model import SpeakerAudioResponseModel from .raw_client import AsyncRawAudioClient, RawAudioClient class AudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, speaker_id, request_options=request_options) return _response.data class AsyncAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, speaker_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/audio/raw_client.py000066400000000000000000000140241523660243400337050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ......core.api_error import ApiError from ......core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ......core.http_response import AsyncHttpResponse, HttpResponse from ......core.jsonable_encoder import jsonable_encoder from ......core.parse_error import ParsingError from ......core.request_options import RequestOptions from ......core.unchecked_base_model import construct_type from ......errors.unprocessable_entity_error import UnprocessableEntityError from ......types.speaker_audio_response_model import SpeakerAudioResponseModel from pydantic import ValidationError class RawAudioClient: 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 ) -> HttpResponse[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 ------- HttpResponse[SpeakerAudioResponseModel] Successful Response """ _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", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerAudioResponseModel, construct_type( type_=SpeakerAudioResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAudioClient: 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 ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[SpeakerAudioResponseModel] Successful Response """ _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", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerAudioResponseModel, construct_type( type_=SpeakerAudioResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/client.py000066400000000000000000000155331523660243400317410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.speaker_separation_response_model import SpeakerSeparationResponseModel from .....types.start_speaker_separation_response_model import StartSpeakerSeparationResponseModel from .raw_client import AsyncRawSpeakersClient, RawSpeakersClient if typing.TYPE_CHECKING: from .audio.client import AsyncAudioClient, AudioClient class SpeakersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSpeakersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AudioClient] = None @property def with_raw_response(self) -> RawSpeakersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSpeakersClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, request_options=request_options) return _response.data 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._raw_client.separate(voice_id, sample_id, request_options=request_options) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AudioClient # noqa: E402 self._audio = AudioClient(client_wrapper=self._client_wrapper) return self._audio class AsyncSpeakersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSpeakersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AsyncAudioClient] = None @property def with_raw_response(self) -> AsyncRawSpeakersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSpeakersClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, request_options=request_options) return _response.data 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._raw_client.separate(voice_id, sample_id, request_options=request_options) return _response.data @property def audio(self): if self._audio is None: from .audio.client import AsyncAudioClient # noqa: E402 self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper) return self._audio elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/speakers/raw_client.py000066400000000000000000000246351523660243400326150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.speaker_separation_response_model import SpeakerSeparationResponseModel from .....types.start_speaker_separation_response_model import StartSpeakerSeparationResponseModel from pydantic import ValidationError class RawSpeakersClient: 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 ) -> HttpResponse[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 ------- HttpResponse[SpeakerSeparationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerSeparationResponseModel, construct_type( type_=SpeakerSeparationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def separate( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[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 ------- HttpResponse[StartSpeakerSeparationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( StartSpeakerSeparationResponseModel, construct_type( type_=StartSpeakerSeparationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSpeakersClient: 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 ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[SpeakerSeparationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( SpeakerSeparationResponseModel, construct_type( type_=SpeakerSeparationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def separate( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[StartSpeakerSeparationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers", method="POST", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( StartSpeakerSeparationResponseModel, construct_type( type_=StartSpeakerSeparationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/waveform/000077500000000000000000000000001523660243400301135ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/waveform/__init__.py000066400000000000000000000001251523660243400322220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/waveform/client.py000066400000000000000000000070671523660243400317550ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.voice_sample_visual_waveform_response_model import VoiceSampleVisualWaveformResponseModel from .raw_client import AsyncRawWaveformClient, RawWaveformClient class WaveformClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWaveformClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawWaveformClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWaveformClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, request_options=request_options) return _response.data class AsyncWaveformClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWaveformClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawWaveformClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWaveformClient """ return self._raw_client 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._raw_client.get(voice_id, sample_id, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/samples/waveform/raw_client.py000066400000000000000000000132131523660243400326140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.voice_sample_visual_waveform_response_model import VoiceSampleVisualWaveformResponseModel from pydantic import ValidationError class RawWaveformClient: 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 ) -> HttpResponse[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 ------- HttpResponse[VoiceSampleVisualWaveformResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSampleVisualWaveformResponseModel, construct_type( type_=VoiceSampleVisualWaveformResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWaveformClient: 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 ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[VoiceSampleVisualWaveformResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSampleVisualWaveformResponseModel, construct_type( type_=VoiceSampleVisualWaveformResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/000077500000000000000000000000001523660243400273035ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/__init__.py000066400000000000000000000020161523660243400314130ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import captcha _dynamic_imports: typing.Dict[str, str] = {"captcha": ".captcha"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["captcha"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/captcha/000077500000000000000000000000001523660243400307065ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/captcha/__init__.py000066400000000000000000000001251523660243400330150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/captcha/client.py000066400000000000000000000127411523660243400325430ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..... import core from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions from .....types.verify_pvc_voice_captcha_response_model import VerifyPvcVoiceCaptchaResponseModel from .raw_client import AsyncRawCaptchaClient, RawCaptchaClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class CaptchaClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCaptchaClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCaptchaClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawCaptchaClient """ return self._raw_client 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._raw_client.get(voice_id, request_options=request_options) return _response.data 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._raw_client.verify(voice_id, recording=recording, request_options=request_options) return _response.data class AsyncCaptchaClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCaptchaClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCaptchaClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawCaptchaClient """ return self._raw_client 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._raw_client.get(voice_id, request_options=request_options) return _response.data 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._raw_client.verify(voice_id, recording=recording, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/captcha/raw_client.py000066400000000000000000000231221523660243400334070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..... import core from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.unprocessable_entity_error import UnprocessableEntityError from .....types.verify_pvc_voice_captcha_response_model import VerifyPvcVoiceCaptchaResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawCaptchaClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[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 ------- HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return HttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def verify( self, voice_id: str, *, recording: core.File, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[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 ------- HttpResponse[VerifyPvcVoiceCaptchaResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", method="POST", data={}, files={ "recording": recording, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VerifyPvcVoiceCaptchaResponseModel, construct_type( type_=VerifyPvcVoiceCaptchaResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawCaptchaClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return AsyncHttpResponse(response=_response, data=None) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def verify( self, voice_id: str, *, recording: core.File, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[VerifyPvcVoiceCaptchaResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha", method="POST", data={}, files={ "recording": recording, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VerifyPvcVoiceCaptchaResponseModel, construct_type( type_=VerifyPvcVoiceCaptchaResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/client.py000066400000000000000000000120451523660243400311350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from .... import core from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.request_pvc_manual_verification_response_model import RequestPvcManualVerificationResponseModel from .raw_client import AsyncRawVerificationClient, RawVerificationClient if typing.TYPE_CHECKING: from .captcha.client import AsyncCaptchaClient, CaptchaClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class VerificationClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawVerificationClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._captcha: typing.Optional[CaptchaClient] = None @property def with_raw_response(self) -> RawVerificationClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawVerificationClient """ return self._raw_client 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._raw_client.request( voice_id, files=files, extra_text=extra_text, request_options=request_options ) return _response.data @property def captcha(self): if self._captcha is None: from .captcha.client import CaptchaClient # noqa: E402 self._captcha = CaptchaClient(client_wrapper=self._client_wrapper) return self._captcha class AsyncVerificationClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawVerificationClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._captcha: typing.Optional[AsyncCaptchaClient] = None @property def with_raw_response(self) -> AsyncRawVerificationClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawVerificationClient """ return self._raw_client 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._raw_client.request( voice_id, files=files, extra_text=extra_text, request_options=request_options ) return _response.data @property def captcha(self): if self._captcha is None: from .captcha.client import AsyncCaptchaClient # noqa: E402 self._captcha = AsyncCaptchaClient(client_wrapper=self._client_wrapper) return self._captcha elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/pvc/verification/raw_client.py000066400000000000000000000151211523660243400320040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from .... import core from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.request_pvc_manual_verification_response_model import RequestPvcManualVerificationResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawVerificationClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = 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, ) -> HttpResponse[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 ------- HttpResponse[RequestPvcManualVerificationResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification", method="POST", data={ "extra_text": extra_text, }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RequestPvcManualVerificationResponseModel, construct_type( type_=RequestPvcManualVerificationResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawVerificationClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = 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, ) -> AsyncHttpResponse[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 ------- AsyncHttpResponse[RequestPvcManualVerificationResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification", method="POST", data={ "extra_text": extra_text, }, files={ "files": files, }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( RequestPvcManualVerificationResponseModel, construct_type( type_=RequestPvcManualVerificationResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/raw_client.py000066400000000000000000002100111523660243400265250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import json import typing from json.decoder import JSONDecodeError from .. import core from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.add_voice_response_model import AddVoiceResponseModel from ..types.delete_voice_response_model import DeleteVoiceResponseModel from ..types.edit_voice_response_model import EditVoiceResponseModel from ..types.get_library_voices_response import GetLibraryVoicesResponse from ..types.get_voices_response import GetVoicesResponse from ..types.get_voices_v_2_response import GetVoicesV2Response from ..types.replicate_voice_to_isolated_environment_response_model import ( ReplicateVoiceToIsolatedEnvironmentResponseModel, ) from ..types.voice import Voice from .types.edit_voice_request_labels import EditVoiceRequestLabels from .types.voices_get_shared_request_category import VoicesGetSharedRequestCategory from .types.voices_get_shared_request_sort import VoicesGetSharedRequestSort from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawVoicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_all( self, *, show_legacy: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetVoicesResponse]: """ Returns a list of all available voices for a user. Stops working once the user's workspace exceeds 500 voices. Parameters ---------- show_legacy : typing.Optional[bool] If set to true, legacy premade voices will be included in responses from /v1/voices request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetVoicesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/voices", method="GET", params={ "show_legacy": show_legacy, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoicesResponse, construct_type( type_=GetVoicesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, voice_id: str, *, with_settings: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Voice]: """ Returns metadata about a specific voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. with_settings : typing.Optional[bool] This parameter is now deprecated. It is ignored and will be removed in a future version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[Voice] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}", method="GET", params={ "with_settings": with_settings, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Voice, construct_type( type_=Voice, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteVoiceResponseModel]: """ Deletes a voice by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteVoiceResponseModel, construct_type( type_=DeleteVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, voice_id: str, *, name: str, files: typing.Optional[typing.List[core.File]] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[EditVoiceRequestLabels] = OMIT, moderate_metadata: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[EditVoiceResponseModel]: """ Edit a voice created by you. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. name : str The name that identifies this voice. This will be displayed in the dropdown of the website. files : typing.Optional[typing.List[core.File]] See core.File for more documentation remove_background_noise : typing.Optional[bool] If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. description : typing.Optional[str] A description of the voice. labels : typing.Optional[EditVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. moderate_metadata : typing.Optional[bool] Run synchronous LLM moderation over the voice name and description when they change. Has no effect unless the voice_library_metadata_moderation feature flag is enabled for the user. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/edit", method="POST", data={ "name": name, "remove_background_noise": remove_background_noise, "description": description, "labels": json.dumps(jsonable_encoder(labels)), "moderate_metadata": moderate_metadata, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditVoiceResponseModel, construct_type( type_=EditVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def search( self, *, next_page_token: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort: typing.Optional[str] = None, sort_direction: typing.Optional[str] = None, voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, collection_id: typing.Optional[str] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, language: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, accent: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, high_quality: typing.Optional[bool] = None, include_total_count: typing.Optional[bool] = None, voice_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetVoicesV2Response]: """ Gets a list of all available voices for a user with search, filtering and pagination. Parameters ---------- next_page_token : typing.Optional[str] The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination. page_size : typing.Optional[int] How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included. search : typing.Optional[str] Search term to filter voices by. Searches in name, description, labels, category. sort : typing.Optional[str] Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default', 'non-community', 'saved'. 'non-default' is equal to all but 'default'. 'non-community' is equal to 'personal' and 'workspace' combined (excludes library copies). 'saved' is equal to non-default, but includes default voices if they have been added to a collection. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' 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. gender : typing.Optional[str] Gender used for filtering, based on the voice's 'gender' label. age : typing.Optional[str] Age used for filtering, based on the voice's 'age' label. language : typing.Optional[typing.Union[str, typing.Sequence[str]]] Languages used for filtering, based on the voice's 'language' label. Voices matching any of the given languages are returned. accent : typing.Optional[str] Accent used for filtering, based on the voice's 'accent' label. use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use cases used for filtering, based on the voice's 'use_case' label. Voices matching any of the given use cases are returned. min_notice_period_days : typing.Optional[int] Filter to voices whose sharing notice period is at least the given number of days. include_custom_rates : typing.Optional[bool] Whether to include voices that have a custom sharing rate. Defaults to including them. include_live_moderated : typing.Optional[bool] Whether to include voices that have live moderation enabled. Defaults to including them. high_quality : typing.Optional[bool] When true, only return studio-quality voices (those whose category is 'high_quality'). include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost. voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Voice IDs to lookup by. Maximum 100 voice IDs. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetVoicesV2Response] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v2/voices", method="GET", params={ "next_page_token": next_page_token, "page_size": page_size, "search": search, "sort": sort, "sort_direction": sort_direction, "voice_type": voice_type, "category": category, "fine_tuning_state": fine_tuning_state, "collection_id": collection_id, "gender": gender, "age": age, "language": language, "accent": accent, "use_cases": use_cases, "min_notice_period_days": min_notice_period_days, "include_custom_rates": include_custom_rates, "include_live_moderated": include_live_moderated, "high_quality": high_quality, "include_total_count": include_total_count, "voice_ids": voice_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoicesV2Response, construct_type( type_=GetVoicesV2Response, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def replicate_to_isolated_environment( self, voice_id: str, *, target_workspace_id: str, preserve_voice_id: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ReplicateVoiceToIsolatedEnvironmentResponseModel]: """ Replicates an Instant Voice Clone or Voice Design voice to a workspace in a different data residency. The target workspace must belong to the same consolidated billing group. The user must have VOICES_WRITE in the source workspace, and be an admin on the source voice. Human users (i.e. not service accounts) must also have VOICES_WRITE in the target workspace. This endpoint is available on the central environment only. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. target_workspace_id : str ID of the workspace to replicate the voice into. It must belong to the same consolidated billing group as the calling workspace; the target's data residency is derived from that link. preserve_voice_id : typing.Optional[bool] When true (default) the replicated voice keeps the same voice ID in the target residency; set to false to assign a new voice ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ReplicateVoiceToIsolatedEnvironmentResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/replicate-to-isolated-environment", method="POST", json={ "target_workspace_id": target_workspace_id, "preserve_voice_id": preserve_voice_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ReplicateVoiceToIsolatedEnvironmentResponseModel, construct_type( type_=ReplicateVoiceToIsolatedEnvironmentResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def share( self, public_user_id: str, voice_id: str, *, new_name: str, bookmarked: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddVoiceResponseModel]: """ Add a shared voice to your collection of Voices Parameters ---------- public_user_id : str Public user ID used to publicly identify ElevenLabs users. voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. new_name : str The name that identifies this voice. This will be displayed in the dropdown of the website. bookmarked : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddVoiceResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/add/{jsonable_encoder(public_user_id)}/{jsonable_encoder(voice_id)}", method="POST", json={ "new_name": new_name, "bookmarked": bookmarked, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get_shared( self, *, page_size: typing.Optional[int] = None, category: typing.Optional[VoicesGetSharedRequestCategory] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, accent: typing.Optional[str] = None, language: typing.Optional[str] = None, locale: typing.Optional[str] = None, search: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[VoicesGetSharedRequestSort] = None, page: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetLibraryVoicesResponse]: """ Retrieves a list of shared voices. Parameters ---------- page_size : typing.Optional[int] How many shared voices to return at maximum. Can not exceed 100, defaults to 30. category : typing.Optional[VoicesGetSharedRequestCategory] Voice category used for filtering gender : typing.Optional[str] Gender used for filtering age : typing.Optional[str] Age used for filtering accent : typing.Optional[str] Accent used for filtering language : typing.Optional[str] Language used for filtering locale : typing.Optional[str] Locale used for filtering search : typing.Optional[str] Search term used for filtering use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use-case used for filtering descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]] Search term used for filtering featured : typing.Optional[bool] Filter featured voices min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. include_custom_rates : typing.Optional[bool] Include/exclude voices with custom rates include_live_moderated : typing.Optional[bool] Include/exclude voices that are live moderated reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app owner_id : typing.Optional[str] Filter voices by public owner ID sort : typing.Optional[VoicesGetSharedRequestSort] Sort criteria. Must be one of: created_date, usage_character_count_1y, trending, cloned_by_count. page : typing.Optional[int] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetLibraryVoicesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/shared-voices", method="GET", params={ "page_size": page_size, "category": category, "gender": gender, "age": age, "accent": accent, "language": language, "locale": locale, "search": search, "use_cases": use_cases, "descriptives": descriptives, "featured": featured, "min_notice_period_days": min_notice_period_days, "include_custom_rates": include_custom_rates, "include_live_moderated": include_live_moderated, "reader_app_enabled": reader_app_enabled, "owner_id": owner_id, "sort": sort, "page": page, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLibraryVoicesResponse, construct_type( type_=GetLibraryVoicesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def find_similar_voices( self, *, audio_file: typing.Optional[core.File] = OMIT, similarity_threshold: typing.Optional[float] = OMIT, top_k: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetLibraryVoicesResponse]: """ Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. Parameters ---------- audio_file : typing.Optional[core.File] See core.File for more documentation similarity_threshold : typing.Optional[float] Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. top_k : typing.Optional[int] Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[GetLibraryVoicesResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/similar-voices", method="POST", data={ "similarity_threshold": similarity_threshold, "top_k": top_k, }, files={ **({"audio_file": audio_file} if audio_file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLibraryVoicesResponse, construct_type( type_=GetLibraryVoicesResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawVoicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_all( self, *, show_legacy: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetVoicesResponse]: """ Returns a list of all available voices for a user. Stops working once the user's workspace exceeds 500 voices. Parameters ---------- show_legacy : typing.Optional[bool] If set to true, legacy premade voices will be included in responses from /v1/voices request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetVoicesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/voices", method="GET", params={ "show_legacy": show_legacy, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoicesResponse, construct_type( type_=GetVoicesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, voice_id: str, *, with_settings: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Voice]: """ Returns metadata about a specific voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. with_settings : typing.Optional[bool] This parameter is now deprecated. It is ignored and will be removed in a future version. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[Voice] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}", method="GET", params={ "with_settings": with_settings, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( Voice, construct_type( type_=Voice, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteVoiceResponseModel]: """ Deletes a voice by its ID. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteVoiceResponseModel, construct_type( type_=DeleteVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, voice_id: str, *, name: str, files: typing.Optional[typing.List[core.File]] = OMIT, remove_background_noise: typing.Optional[bool] = OMIT, description: typing.Optional[str] = OMIT, labels: typing.Optional[EditVoiceRequestLabels] = OMIT, moderate_metadata: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[EditVoiceResponseModel]: """ Edit a voice created by you. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. name : str The name that identifies this voice. This will be displayed in the dropdown of the website. files : typing.Optional[typing.List[core.File]] See core.File for more documentation remove_background_noise : typing.Optional[bool] If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. description : typing.Optional[str] A description of the voice. labels : typing.Optional[EditVoiceRequestLabels] Labels for the voice. Keys can be language, accent, gender, or age. moderate_metadata : typing.Optional[bool] Run synchronous LLM moderation over the voice name and description when they change. Has no effect unless the voice_library_metadata_moderation feature flag is enabled for the user. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/edit", method="POST", data={ "name": name, "remove_background_noise": remove_background_noise, "description": description, "labels": json.dumps(jsonable_encoder(labels)), "moderate_metadata": moderate_metadata, }, files={ **({"files": files} if files is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditVoiceResponseModel, construct_type( type_=EditVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def search( self, *, next_page_token: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, sort: typing.Optional[str] = None, sort_direction: typing.Optional[str] = None, voice_type: typing.Optional[str] = None, category: typing.Optional[str] = None, fine_tuning_state: typing.Optional[str] = None, collection_id: typing.Optional[str] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, language: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, accent: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, high_quality: typing.Optional[bool] = None, include_total_count: typing.Optional[bool] = None, voice_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetVoicesV2Response]: """ Gets a list of all available voices for a user with search, filtering and pagination. Parameters ---------- next_page_token : typing.Optional[str] The next page token to use for pagination. Returned from the previous request. Use this in combination with the has_more flag for reliable pagination. page_size : typing.Optional[int] How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included. search : typing.Optional[str] Search term to filter voices by. Searches in name, description, labels, category. sort : typing.Optional[str] Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices. sort_direction : typing.Optional[str] Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default', 'non-community', 'saved'. 'non-default' is equal to all but 'default'. 'non-community' is equal to 'personal' and 'workspace' combined (excludes library copies). 'saved' is equal to non-default, but includes default voices if they have been added to a collection. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' 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. gender : typing.Optional[str] Gender used for filtering, based on the voice's 'gender' label. age : typing.Optional[str] Age used for filtering, based on the voice's 'age' label. language : typing.Optional[typing.Union[str, typing.Sequence[str]]] Languages used for filtering, based on the voice's 'language' label. Voices matching any of the given languages are returned. accent : typing.Optional[str] Accent used for filtering, based on the voice's 'accent' label. use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use cases used for filtering, based on the voice's 'use_case' label. Voices matching any of the given use cases are returned. min_notice_period_days : typing.Optional[int] Filter to voices whose sharing notice period is at least the given number of days. include_custom_rates : typing.Optional[bool] Whether to include voices that have a custom sharing rate. Defaults to including them. include_live_moderated : typing.Optional[bool] Whether to include voices that have live moderation enabled. Defaults to including them. high_quality : typing.Optional[bool] When true, only return studio-quality voices (those whose category is 'high_quality'). include_total_count : typing.Optional[bool] Whether to include the total count of voices found in the response. NOTE: The total_count value is a live snapshot and may change between requests as users create, modify, or delete voices. For pagination, rely on the has_more flag instead. Only enable this when you actually need the total count (e.g., for display purposes), as it incurs a performance cost. voice_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Voice IDs to lookup by. Maximum 100 voice IDs. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetVoicesV2Response] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v2/voices", method="GET", params={ "next_page_token": next_page_token, "page_size": page_size, "search": search, "sort": sort, "sort_direction": sort_direction, "voice_type": voice_type, "category": category, "fine_tuning_state": fine_tuning_state, "collection_id": collection_id, "gender": gender, "age": age, "language": language, "accent": accent, "use_cases": use_cases, "min_notice_period_days": min_notice_period_days, "include_custom_rates": include_custom_rates, "include_live_moderated": include_live_moderated, "high_quality": high_quality, "include_total_count": include_total_count, "voice_ids": voice_ids, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetVoicesV2Response, construct_type( type_=GetVoicesV2Response, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def replicate_to_isolated_environment( self, voice_id: str, *, target_workspace_id: str, preserve_voice_id: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ReplicateVoiceToIsolatedEnvironmentResponseModel]: """ Replicates an Instant Voice Clone or Voice Design voice to a workspace in a different data residency. The target workspace must belong to the same consolidated billing group. The user must have VOICES_WRITE in the source workspace, and be an admin on the source voice. Human users (i.e. not service accounts) must also have VOICES_WRITE in the target workspace. This endpoint is available on the central environment only. Parameters ---------- voice_id : str Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. target_workspace_id : str ID of the workspace to replicate the voice into. It must belong to the same consolidated billing group as the calling workspace; the target's data residency is derived from that link. preserve_voice_id : typing.Optional[bool] When true (default) the replicated voice keeps the same voice ID in the target residency; set to false to assign a new voice ID. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ReplicateVoiceToIsolatedEnvironmentResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/replicate-to-isolated-environment", method="POST", json={ "target_workspace_id": target_workspace_id, "preserve_voice_id": preserve_voice_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ReplicateVoiceToIsolatedEnvironmentResponseModel, construct_type( type_=ReplicateVoiceToIsolatedEnvironmentResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def share( self, public_user_id: str, voice_id: str, *, new_name: str, bookmarked: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddVoiceResponseModel]: """ Add a shared voice to your collection of Voices Parameters ---------- public_user_id : str Public user ID used to publicly identify ElevenLabs users. voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. new_name : str The name that identifies this voice. This will be displayed in the dropdown of the website. bookmarked : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddVoiceResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/add/{jsonable_encoder(public_user_id)}/{jsonable_encoder(voice_id)}", method="POST", json={ "new_name": new_name, "bookmarked": bookmarked, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddVoiceResponseModel, construct_type( type_=AddVoiceResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get_shared( self, *, page_size: typing.Optional[int] = None, category: typing.Optional[VoicesGetSharedRequestCategory] = None, gender: typing.Optional[str] = None, age: typing.Optional[str] = None, accent: typing.Optional[str] = None, language: typing.Optional[str] = None, locale: typing.Optional[str] = None, search: typing.Optional[str] = None, use_cases: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, include_custom_rates: typing.Optional[bool] = None, include_live_moderated: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[VoicesGetSharedRequestSort] = None, page: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetLibraryVoicesResponse]: """ Retrieves a list of shared voices. Parameters ---------- page_size : typing.Optional[int] How many shared voices to return at maximum. Can not exceed 100, defaults to 30. category : typing.Optional[VoicesGetSharedRequestCategory] Voice category used for filtering gender : typing.Optional[str] Gender used for filtering age : typing.Optional[str] Age used for filtering accent : typing.Optional[str] Accent used for filtering language : typing.Optional[str] Language used for filtering locale : typing.Optional[str] Locale used for filtering search : typing.Optional[str] Search term used for filtering use_cases : typing.Optional[typing.Union[str, typing.Sequence[str]]] Use-case used for filtering descriptives : typing.Optional[typing.Union[str, typing.Sequence[str]]] Search term used for filtering featured : typing.Optional[bool] Filter featured voices min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. include_custom_rates : typing.Optional[bool] Include/exclude voices with custom rates include_live_moderated : typing.Optional[bool] Include/exclude voices that are live moderated reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app owner_id : typing.Optional[str] Filter voices by public owner ID sort : typing.Optional[VoicesGetSharedRequestSort] Sort criteria. Must be one of: created_date, usage_character_count_1y, trending, cloned_by_count. page : typing.Optional[int] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetLibraryVoicesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/shared-voices", method="GET", params={ "page_size": page_size, "category": category, "gender": gender, "age": age, "accent": accent, "language": language, "locale": locale, "search": search, "use_cases": use_cases, "descriptives": descriptives, "featured": featured, "min_notice_period_days": min_notice_period_days, "include_custom_rates": include_custom_rates, "include_live_moderated": include_live_moderated, "reader_app_enabled": reader_app_enabled, "owner_id": owner_id, "sort": sort, "page": page, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLibraryVoicesResponse, construct_type( type_=GetLibraryVoicesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def find_similar_voices( self, *, audio_file: typing.Optional[core.File] = OMIT, similarity_threshold: typing.Optional[float] = OMIT, top_k: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetLibraryVoicesResponse]: """ Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. Parameters ---------- audio_file : typing.Optional[core.File] See core.File for more documentation similarity_threshold : typing.Optional[float] Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. top_k : typing.Optional[int] Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[GetLibraryVoicesResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/similar-voices", method="POST", data={ "similarity_threshold": similarity_threshold, "top_k": top_k, }, files={ **({"audio_file": audio_file} if audio_file is not None else {}), }, request_options=request_options, omit=OMIT, force_multipart=True, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( GetLibraryVoicesResponse, construct_type( type_=GetLibraryVoicesResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/000077500000000000000000000000001523660243400254755ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/__init__.py000066400000000000000000000020061523660243400276040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import audio _dynamic_imports: typing.Dict[str, str] = {"audio": ".audio"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["audio"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/audio/000077500000000000000000000000001523660243400265765ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/audio/__init__.py000066400000000000000000000001251523660243400307050ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/audio/client.py000066400000000000000000000075701523660243400304370ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from .raw_client import AsyncRawAudioClient, RawAudioClient class AudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAudioClient """ return self._raw_client def get( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[bytes]: """ Returns the audio corresponding to a sample attached to a voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. 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. Returns ------- typing.Iterator[bytes] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.samples.audio.get( voice_id="voice_id", sample_id="sample_id", ) """ with self._raw_client.get(voice_id, sample_id, request_options=request_options) as r: yield from r.data class AsyncAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAudioClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAudioClient """ return self._raw_client async def get( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[bytes]: """ Returns the audio corresponding to a sample attached to a voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. 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. Returns ------- typing.AsyncIterator[bytes] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.samples.audio.get( voice_id="voice_id", sample_id="sample_id", ) asyncio.run(main()) """ async with self._raw_client.get(voice_id, sample_id, request_options=request_options) as r: async for _chunk in r.data: yield _chunk elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/audio/raw_client.py000066400000000000000000000156331523660243400313070ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import contextlib import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError class RawAudioClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.contextmanager def get( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Returns the audio corresponding to a sample attached to a voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. 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. Returns ------- typing.Iterator[HttpResponse[typing.Iterator[bytes]]] Successful Response """ with self._client_wrapper.httpx_client.stream( f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", method="GET", request_options=request_options, ) as _response: def _stream() -> HttpResponse[typing.Iterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return HttpResponse( response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) ) _response.read() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield _stream() class AsyncRawAudioClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper @contextlib.asynccontextmanager async def get( self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Returns the audio corresponding to a sample attached to a voice. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. sample_id : str ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. 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. Returns ------- typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] Successful Response """ async with self._client_wrapper.httpx_client.stream( f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio", method="GET", request_options=request_options, ) as _response: async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: try: if 200 <= _response.status_code < 300: _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024 return AsyncHttpResponse( response=_response, data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), ) await _response.aread() if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.text ) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e, ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) yield await _stream() elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/client.py000066400000000000000000000035531523660243400273330ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawSamplesClient, RawSamplesClient if typing.TYPE_CHECKING: from .audio.client import AsyncAudioClient, AudioClient class SamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSamplesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AudioClient] = None @property def with_raw_response(self) -> RawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSamplesClient """ return self._raw_client @property def audio(self): if self._audio is None: from .audio.client import AudioClient # noqa: E402 self._audio = AudioClient(client_wrapper=self._client_wrapper) return self._audio class AsyncSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSamplesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audio: typing.Optional[AsyncAudioClient] = None @property def with_raw_response(self) -> AsyncRawSamplesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSamplesClient """ return self._raw_client @property def audio(self): if self._audio is None: from .audio.client import AsyncAudioClient # noqa: E402 self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper) return self._audio elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/samples/raw_client.py000066400000000000000000000006341523660243400302010ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawSamplesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawSamplesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/settings/000077500000000000000000000000001523660243400256715ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/settings/__init__.py000066400000000000000000000001251523660243400300000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/settings/client.py000066400000000000000000000205251523660243400275250ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.edit_voice_settings_response_model import EditVoiceSettingsResponseModel from ...types.voice_settings import VoiceSettings from .raw_client import AsyncRawSettingsClient, RawSettingsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class SettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawSettingsClient """ return self._raw_client def get_default(self, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings: """ Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceSettings Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.settings.get_default() """ _response = self._raw_client.get_default(request_options=request_options) return _response.data def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings: """ Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. 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 ------- VoiceSettings Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.settings.get( voice_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._raw_client.get(voice_id, request_options=request_options) return _response.data def update( self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None ) -> EditVoiceSettingsResponseModel: """ Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request : VoiceSettings request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditVoiceSettingsResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs, VoiceSettings client = ElevenLabs( api_key="YOUR_API_KEY", ) client.voices.settings.update( voice_id="21m00Tcm4TlvDq8ikWAM", request=VoiceSettings( stability=1.0, use_speaker_boost=True, similarity_boost=1.0, style=0.0, speed=1.0, ), ) """ _response = self._raw_client.update(voice_id, request=request, request_options=request_options) return _response.data class AsyncSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSettingsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawSettingsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawSettingsClient """ return self._raw_client async def get_default(self, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings: """ Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- VoiceSettings Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.settings.get_default() asyncio.run(main()) """ _response = await self._raw_client.get_default(request_options=request_options) return _response.data async def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings: """ Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. 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 ------- VoiceSettings Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.settings.get( voice_id="21m00Tcm4TlvDq8ikWAM", ) asyncio.run(main()) """ _response = await self._raw_client.get(voice_id, request_options=request_options) return _response.data async def update( self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None ) -> EditVoiceSettingsResponseModel: """ Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request : VoiceSettings request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- EditVoiceSettingsResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, VoiceSettings client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.voices.settings.update( voice_id="21m00Tcm4TlvDq8ikWAM", request=VoiceSettings( stability=1.0, use_speaker_boost=True, similarity_boost=1.0, style=0.0, speed=1.0, ), ) asyncio.run(main()) """ _response = await self._raw_client.update(voice_id, request=request, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/settings/raw_client.py000066400000000000000000000343631523660243400304030ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.edit_voice_settings_response_model import EditVoiceSettingsResponseModel from ...types.voice_settings import VoiceSettings from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawSettingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_default(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[VoiceSettings]: """ Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[VoiceSettings] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/voices/settings/default", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSettings, construct_type( type_=VoiceSettings, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def get( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[VoiceSettings]: """ Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. 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 ------- HttpResponse[VoiceSettings] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSettings, construct_type( type_=VoiceSettings, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[EditVoiceSettingsResponseModel]: """ Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request : VoiceSettings request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[EditVoiceSettingsResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/settings/edit", method="POST", json=convert_and_respect_annotation_metadata(object_=request, annotation=VoiceSettings, direction="write"), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditVoiceSettingsResponseModel, construct_type( type_=EditVoiceSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawSettingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_default( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[VoiceSettings]: """ Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[VoiceSettings] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/voices/settings/default", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSettings, construct_type( type_=VoiceSettings, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[VoiceSettings]: """ Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. 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 ------- AsyncHttpResponse[VoiceSettings] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/settings", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( VoiceSettings, construct_type( type_=VoiceSettings, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[EditVoiceSettingsResponseModel]: """ Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. Parameters ---------- voice_id : str ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. request : VoiceSettings request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[EditVoiceSettingsResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/voices/{jsonable_encoder(voice_id)}/settings/edit", method="POST", json=convert_and_respect_annotation_metadata(object_=request, annotation=VoiceSettings, direction="write"), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( EditVoiceSettingsResponseModel, construct_type( type_=EditVoiceSettingsResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/types/000077500000000000000000000000001523660243400251755ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/types/__init__.py000066400000000000000000000027351523660243400273150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .edit_voice_request_labels import EditVoiceRequestLabels from .voices_get_shared_request_category import VoicesGetSharedRequestCategory from .voices_get_shared_request_sort import VoicesGetSharedRequestSort _dynamic_imports: typing.Dict[str, str] = { "EditVoiceRequestLabels": ".edit_voice_request_labels", "VoicesGetSharedRequestCategory": ".voices_get_shared_request_category", "VoicesGetSharedRequestSort": ".voices_get_shared_request_sort", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["EditVoiceRequestLabels", "VoicesGetSharedRequestCategory", "VoicesGetSharedRequestSort"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/types/edit_voice_request_labels.py000066400000000000000000000002221523660243400327470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing EditVoiceRequestLabels = typing.Union[typing.Dict[str, str], str] voices_get_shared_request_category.py000066400000000000000000000003041523660243400346070ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/types# This file was auto-generated by Fern from our API Definition. import typing VoicesGetSharedRequestCategory = typing.Union[typing.Literal["professional", "famous", "high_quality"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/voices/types/voices_get_shared_request_sort.py000066400000000000000000000003471523660243400340470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing VoicesGetSharedRequestSort = typing.Union[ typing.Literal["created_date", "usage_character_count_1y", "trending", "cloned_by_count"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/webhooks/000077500000000000000000000000001523660243400243625ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/webhooks/__init__.py000066400000000000000000000001251523660243400264710ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/webhooks/client.py000066400000000000000000000311611523660243400262140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.delete_workspace_webhook_response_model import DeleteWorkspaceWebhookResponseModel from ..types.patch_workspace_webhook_response_model import PatchWorkspaceWebhookResponseModel from ..types.webhook_hmac_settings import WebhookHmacSettings from ..types.workspace_create_webhook_response_model import WorkspaceCreateWebhookResponseModel from ..types.workspace_webhook_event_type import WorkspaceWebhookEventType from ..types.workspace_webhook_list_response_model import WorkspaceWebhookListResponseModel from .raw_client import AsyncRawWebhooksClient, RawWebhooksClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class WebhooksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWebhooksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawWebhooksClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWebhooksClient """ return self._raw_client def list( self, *, include_usages: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceWebhookListResponseModel: """ List all webhooks for a workspace Parameters ---------- include_usages : typing.Optional[bool] Whether to include active usages of the webhook, only usable by admins request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceWebhookListResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.webhooks.list( include_usages=False, ) """ _response = self._raw_client.list(include_usages=include_usages, request_options=request_options) return _response.data def create( self, *, settings: WebhookHmacSettings, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceCreateWebhookResponseModel: """ Create a new webhook for the workspace with the specified authentication type. Parameters ---------- settings : WebhookHmacSettings Webhook settings object containing auth_type and corresponding configuration request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateWebhookResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs, WebhookHmacSettings client = ElevenLabs( api_key="YOUR_API_KEY", ) client.webhooks.create( settings=WebhookHmacSettings( name="name", webhook_url="webhook_url", ), ) """ _response = self._raw_client.create(settings=settings, request_options=request_options) return _response.data def delete( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceWebhookResponseModel: """ Delete the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceWebhookResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.webhooks.delete( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", ) """ _response = self._raw_client.delete(webhook_id, request_options=request_options) return _response.data def update( self, webhook_id: str, *, is_disabled: bool, name: str, retry_enabled: typing.Optional[bool] = OMIT, request_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, events: typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PatchWorkspaceWebhookResponseModel: """ Update the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook is_disabled : bool Whether to disable or enable the webhook name : str The display name of the webhook (used for display purposes only). retry_enabled : typing.Optional[bool] Whether to enable automatic retries for transient failures (5xx, 429, timeout) request_headers : typing.Optional[typing.Dict[str, typing.Optional[str]]] A list of request headers to include with the webhook delivery (optional) events : typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] The complete set of workspace-level events this webhook should be subscribed to. The webhook is added to the events in the list and removed from any not in the list. Omit to leave the current event subscriptions unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PatchWorkspaceWebhookResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.webhooks.update( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", is_disabled=True, name="My Callback Webhook", ) """ _response = self._raw_client.update( webhook_id, is_disabled=is_disabled, name=name, retry_enabled=retry_enabled, request_headers=request_headers, events=events, request_options=request_options, ) return _response.data class AsyncWebhooksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWebhooksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawWebhooksClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWebhooksClient """ return self._raw_client async def list( self, *, include_usages: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceWebhookListResponseModel: """ List all webhooks for a workspace Parameters ---------- include_usages : typing.Optional[bool] Whether to include active usages of the webhook, only usable by admins request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceWebhookListResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.webhooks.list( include_usages=False, ) asyncio.run(main()) """ _response = await self._raw_client.list(include_usages=include_usages, request_options=request_options) return _response.data async def create( self, *, settings: WebhookHmacSettings, request_options: typing.Optional[RequestOptions] = None ) -> WorkspaceCreateWebhookResponseModel: """ Create a new webhook for the workspace with the specified authentication type. Parameters ---------- settings : WebhookHmacSettings Webhook settings object containing auth_type and corresponding configuration request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceCreateWebhookResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs, WebhookHmacSettings client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.webhooks.create( settings=WebhookHmacSettings( name="name", webhook_url="webhook_url", ), ) asyncio.run(main()) """ _response = await self._raw_client.create(settings=settings, request_options=request_options) return _response.data async def delete( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceWebhookResponseModel: """ Delete the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceWebhookResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.webhooks.delete( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", ) asyncio.run(main()) """ _response = await self._raw_client.delete(webhook_id, request_options=request_options) return _response.data async def update( self, webhook_id: str, *, is_disabled: bool, name: str, retry_enabled: typing.Optional[bool] = OMIT, request_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, events: typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> PatchWorkspaceWebhookResponseModel: """ Update the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook is_disabled : bool Whether to disable or enable the webhook name : str The display name of the webhook (used for display purposes only). retry_enabled : typing.Optional[bool] Whether to enable automatic retries for transient failures (5xx, 429, timeout) request_headers : typing.Optional[typing.Dict[str, typing.Optional[str]]] A list of request headers to include with the webhook delivery (optional) events : typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] The complete set of workspace-level events this webhook should be subscribed to. The webhook is added to the events in the list and removed from any not in the list. Omit to leave the current event subscriptions unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PatchWorkspaceWebhookResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.webhooks.update( webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K", is_disabled=True, name="My Callback Webhook", ) asyncio.run(main()) """ _response = await self._raw_client.update( webhook_id, is_disabled=is_disabled, name=name, retry_enabled=retry_enabled, request_headers=request_headers, events=events, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/webhooks/raw_client.py000066400000000000000000000547151523660243400270770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.delete_workspace_webhook_response_model import DeleteWorkspaceWebhookResponseModel from ..types.patch_workspace_webhook_response_model import PatchWorkspaceWebhookResponseModel from ..types.webhook_hmac_settings import WebhookHmacSettings from ..types.workspace_create_webhook_response_model import WorkspaceCreateWebhookResponseModel from ..types.workspace_webhook_event_type import WorkspaceWebhookEventType from ..types.workspace_webhook_list_response_model import WorkspaceWebhookListResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawWebhooksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, include_usages: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[WorkspaceWebhookListResponseModel]: """ List all webhooks for a workspace Parameters ---------- include_usages : typing.Optional[bool] Whether to include active usages of the webhook, only usable by admins request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceWebhookListResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/webhooks", method="GET", params={ "include_usages": include_usages, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceWebhookListResponseModel, construct_type( type_=WorkspaceWebhookListResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, settings: WebhookHmacSettings, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[WorkspaceCreateWebhookResponseModel]: """ Create a new webhook for the workspace with the specified authentication type. Parameters ---------- settings : WebhookHmacSettings Webhook settings object containing auth_type and corresponding configuration request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceCreateWebhookResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/webhooks", method="POST", json={ "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=WebhookHmacSettings, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateWebhookResponseModel, construct_type( type_=WorkspaceCreateWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteWorkspaceWebhookResponseModel]: """ Delete the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteWorkspaceWebhookResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/webhooks/{jsonable_encoder(webhook_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceWebhookResponseModel, construct_type( type_=DeleteWorkspaceWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, webhook_id: str, *, is_disabled: bool, name: str, retry_enabled: typing.Optional[bool] = OMIT, request_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, events: typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PatchWorkspaceWebhookResponseModel]: """ Update the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook is_disabled : bool Whether to disable or enable the webhook name : str The display name of the webhook (used for display purposes only). retry_enabled : typing.Optional[bool] Whether to enable automatic retries for transient failures (5xx, 429, timeout) request_headers : typing.Optional[typing.Dict[str, typing.Optional[str]]] A list of request headers to include with the webhook delivery (optional) events : typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] The complete set of workspace-level events this webhook should be subscribed to. The webhook is added to the events in the list and removed from any not in the list. Omit to leave the current event subscriptions unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PatchWorkspaceWebhookResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/webhooks/{jsonable_encoder(webhook_id)}", method="PATCH", json={ "is_disabled": is_disabled, "name": name, "retry_enabled": retry_enabled, "request_headers": request_headers, "events": events, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PatchWorkspaceWebhookResponseModel, construct_type( type_=PatchWorkspaceWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWebhooksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, include_usages: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[WorkspaceWebhookListResponseModel]: """ List all webhooks for a workspace Parameters ---------- include_usages : typing.Optional[bool] Whether to include active usages of the webhook, only usable by admins request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceWebhookListResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/webhooks", method="GET", params={ "include_usages": include_usages, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceWebhookListResponseModel, construct_type( type_=WorkspaceWebhookListResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, settings: WebhookHmacSettings, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[WorkspaceCreateWebhookResponseModel]: """ Create a new webhook for the workspace with the specified authentication type. Parameters ---------- settings : WebhookHmacSettings Webhook settings object containing auth_type and corresponding configuration request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceCreateWebhookResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/webhooks", method="POST", json={ "settings": convert_and_respect_annotation_metadata( object_=settings, annotation=WebhookHmacSettings, direction="write" ), }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceCreateWebhookResponseModel, construct_type( type_=WorkspaceCreateWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteWorkspaceWebhookResponseModel]: """ Delete the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteWorkspaceWebhookResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/webhooks/{jsonable_encoder(webhook_id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceWebhookResponseModel, construct_type( type_=DeleteWorkspaceWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, webhook_id: str, *, is_disabled: bool, name: str, retry_enabled: typing.Optional[bool] = OMIT, request_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, events: typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PatchWorkspaceWebhookResponseModel]: """ Update the specified workspace webhook Parameters ---------- webhook_id : str The unique ID for the webhook is_disabled : bool Whether to disable or enable the webhook name : str The display name of the webhook (used for display purposes only). retry_enabled : typing.Optional[bool] Whether to enable automatic retries for transient failures (5xx, 429, timeout) request_headers : typing.Optional[typing.Dict[str, typing.Optional[str]]] A list of request headers to include with the webhook delivery (optional) events : typing.Optional[typing.Sequence[WorkspaceWebhookEventType]] The complete set of workspace-level events this webhook should be subscribed to. The webhook is added to the events in the list and removed from any not in the list. Omit to leave the current event subscriptions unchanged. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[PatchWorkspaceWebhookResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/webhooks/{jsonable_encoder(webhook_id)}", method="PATCH", json={ "is_disabled": is_disabled, "name": name, "retry_enabled": retry_enabled, "request_headers": request_headers, "events": events, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( PatchWorkspaceWebhookResponseModel, construct_type( type_=PatchWorkspaceWebhookResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/webhooks_custom.py000066400000000000000000000112151523660243400263260ustar00rootroot00000000000000import json import hmac import hashlib import time from typing import Any, Dict from .types.bad_request_error_body import BadRequestErrorBody from .errors import BadRequestError from .webhooks.client import WebhooksClient as AutogeneratedWebhooksClient, AsyncWebhooksClient as AutogeneratedAsyncWebhooksClient class WebhooksClient(AutogeneratedWebhooksClient): """ A client to handle ElevenLabs webhook-related functionality Extends the autogenerated client to include custom webhook methods """ def construct_event(self, rawBody: str, sig_header: str, secret: str) -> Dict: """ Constructs a webhook event object from a payload and signature. Verifies the webhook signature to ensure the event came from ElevenLabs. Args: rawBody: The webhook request body. Must be the raw body, not a JSON object sig_header: The signature header from the request secret: Your webhook secret Returns: The verified webhook event Raises: BadRequestError: If the signature is invalid or missing """ if not sig_header: raise BadRequestError(body=BadRequestErrorBody(error="Missing signature header")) if not secret: raise BadRequestError(body=BadRequestErrorBody(error="Webhook secret not configured")) headers = sig_header.split(',') timestamp = None signature = None for header in headers: if header.startswith('t='): timestamp = header[2:] elif header.startswith('v0='): signature = header if not timestamp or not signature: raise BadRequestError(body=BadRequestErrorBody(error="No signature hash found with expected scheme v0")) # Validate timestamp req_timestamp = int(timestamp) * 1000 tolerance = int(time.time() * 1000) - 30 * 60 * 1000 if req_timestamp < tolerance: raise BadRequestError(body=BadRequestErrorBody(error="Timestamp outside the tolerance zone")) # Validate hash message = f"{timestamp}.{rawBody}" digest = "v0=" + hmac.new( secret.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).hexdigest() if signature != digest: raise BadRequestError( body=BadRequestErrorBody(error="Signature hash does not match the expected signature hash for payload") ) return json.loads(rawBody) class AsyncWebhooksClient(AutogeneratedAsyncWebhooksClient): """ Async version of WebhooksClient that extends the autogenerated async client """ def construct_event(self, rawBody: str, sig_header: str, secret: str) -> Dict: """ Constructs a webhook event object from a payload and signature. Verifies the webhook signature to ensure the event came from ElevenLabs. Args: rawBody: The webhook request body. Must be the raw body, not a JSON object sig_header: The signature header from the request secret: Your webhook secret Returns: The verified webhook event Raises: BadRequestError: If the signature is invalid or missing """ if not sig_header: raise BadRequestError(body=BadRequestErrorBody(error="Missing signature header")) if not secret: raise BadRequestError(body=BadRequestErrorBody(error="Webhook secret not configured")) headers = sig_header.split(',') timestamp = None signature = None for header in headers: if header.startswith('t='): timestamp = header[2:] elif header.startswith('v0='): signature = header if not timestamp or not signature: raise BadRequestError(body=BadRequestErrorBody(error="No signature hash found with expected scheme v0")) # Validate timestamp req_timestamp = int(timestamp) * 1000 tolerance = int(time.time() * 1000) - 30 * 60 * 1000 if req_timestamp < tolerance: raise BadRequestError(body=BadRequestErrorBody(error="Timestamp outside the tolerance zone")) # Validate hash message = f"{timestamp}.{rawBody}" digest = "v0=" + hmac.new( secret.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).hexdigest() if signature != digest: raise BadRequestError( body=BadRequestErrorBody(error="Signature hash does not match the expected signature hash for payload") ) return json.loads(rawBody) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/000077500000000000000000000000001523660243400245375ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/__init__.py000066400000000000000000000221661523660243400266570ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .resources import BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole from . import analytics, audit_logs, auth_connections, groups, invites, members, resources, usage from .auth_connections import ( AuthConnectionsCreateRequestBody, AuthConnectionsCreateRequestBody_BasicAuth, AuthConnectionsCreateRequestBody_BearerAuth, AuthConnectionsCreateRequestBody_CustomHeaderAuth, AuthConnectionsCreateRequestBody_Mtls, AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, AuthConnectionsCreateRequestBody_Oauth2Jwt, AuthConnectionsCreateRequestBody_PrivateKeyJwt, AuthConnectionsCreateResponse, AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsCreateResponse_BasicAuth, AuthConnectionsCreateResponse_BearerAuth, AuthConnectionsCreateResponse_CustomHeaderAuth, AuthConnectionsCreateResponse_Mtls, AuthConnectionsCreateResponse_Oauth2ClientCredentials, AuthConnectionsCreateResponse_Oauth2Jwt, AuthConnectionsCreateResponse_PrivateKeyJwt, AuthConnectionsCreateResponse_RefreshTokenAuth, AuthConnectionsCreateResponse_SlackBotAuth, AuthConnectionsCreateResponse_UrlSecret, AuthConnectionsCreateResponse_WhatsappAuth, AuthConnectionsUpdateRequestBody, AuthConnectionsUpdateRequestBody_BasicAuth, AuthConnectionsUpdateRequestBody_BearerAuth, AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, AuthConnectionsUpdateRequestBody_Oauth2Jwt, AuthConnectionsUpdateResponse, AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsUpdateResponse_BasicAuth, AuthConnectionsUpdateResponse_BearerAuth, AuthConnectionsUpdateResponse_CustomHeaderAuth, AuthConnectionsUpdateResponse_Mtls, AuthConnectionsUpdateResponse_Oauth2ClientCredentials, AuthConnectionsUpdateResponse_Oauth2Jwt, AuthConnectionsUpdateResponse_PrivateKeyJwt, AuthConnectionsUpdateResponse_RefreshTokenAuth, AuthConnectionsUpdateResponse_SlackBotAuth, AuthConnectionsUpdateResponse_UrlSecret, AuthConnectionsUpdateResponse_WhatsappAuth, ) from .usage import BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem _dynamic_imports: typing.Dict[str, str] = { "AuthConnectionsCreateRequestBody": ".auth_connections", "AuthConnectionsCreateRequestBody_BasicAuth": ".auth_connections", "AuthConnectionsCreateRequestBody_BearerAuth": ".auth_connections", "AuthConnectionsCreateRequestBody_CustomHeaderAuth": ".auth_connections", "AuthConnectionsCreateRequestBody_Mtls": ".auth_connections", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials": ".auth_connections", "AuthConnectionsCreateRequestBody_Oauth2Jwt": ".auth_connections", "AuthConnectionsCreateRequestBody_PrivateKeyJwt": ".auth_connections", "AuthConnectionsCreateResponse": ".auth_connections", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode": ".auth_connections", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp": ".auth_connections", "AuthConnectionsCreateResponse_BasicAuth": ".auth_connections", "AuthConnectionsCreateResponse_BearerAuth": ".auth_connections", "AuthConnectionsCreateResponse_CustomHeaderAuth": ".auth_connections", "AuthConnectionsCreateResponse_Mtls": ".auth_connections", "AuthConnectionsCreateResponse_Oauth2ClientCredentials": ".auth_connections", "AuthConnectionsCreateResponse_Oauth2Jwt": ".auth_connections", "AuthConnectionsCreateResponse_PrivateKeyJwt": ".auth_connections", "AuthConnectionsCreateResponse_RefreshTokenAuth": ".auth_connections", "AuthConnectionsCreateResponse_SlackBotAuth": ".auth_connections", "AuthConnectionsCreateResponse_UrlSecret": ".auth_connections", "AuthConnectionsCreateResponse_WhatsappAuth": ".auth_connections", "AuthConnectionsUpdateRequestBody": ".auth_connections", "AuthConnectionsUpdateRequestBody_BasicAuth": ".auth_connections", "AuthConnectionsUpdateRequestBody_BearerAuth": ".auth_connections", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials": ".auth_connections", "AuthConnectionsUpdateRequestBody_Oauth2Jwt": ".auth_connections", "AuthConnectionsUpdateResponse": ".auth_connections", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode": ".auth_connections", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp": ".auth_connections", "AuthConnectionsUpdateResponse_BasicAuth": ".auth_connections", "AuthConnectionsUpdateResponse_BearerAuth": ".auth_connections", "AuthConnectionsUpdateResponse_CustomHeaderAuth": ".auth_connections", "AuthConnectionsUpdateResponse_Mtls": ".auth_connections", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials": ".auth_connections", "AuthConnectionsUpdateResponse_Oauth2Jwt": ".auth_connections", "AuthConnectionsUpdateResponse_PrivateKeyJwt": ".auth_connections", "AuthConnectionsUpdateResponse_RefreshTokenAuth": ".auth_connections", "AuthConnectionsUpdateResponse_SlackBotAuth": ".auth_connections", "AuthConnectionsUpdateResponse_UrlSecret": ".auth_connections", "AuthConnectionsUpdateResponse_WhatsappAuth": ".auth_connections", "BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem": ".usage", "BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole": ".resources", "analytics": ".analytics", "audit_logs": ".audit_logs", "auth_connections": ".auth_connections", "groups": ".groups", "invites": ".invites", "members": ".members", "resources": ".resources", "usage": ".usage", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AuthConnectionsCreateRequestBody", "AuthConnectionsCreateRequestBody_BasicAuth", "AuthConnectionsCreateRequestBody_BearerAuth", "AuthConnectionsCreateRequestBody_CustomHeaderAuth", "AuthConnectionsCreateRequestBody_Mtls", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials", "AuthConnectionsCreateRequestBody_Oauth2Jwt", "AuthConnectionsCreateRequestBody_PrivateKeyJwt", "AuthConnectionsCreateResponse", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsCreateResponse_BasicAuth", "AuthConnectionsCreateResponse_BearerAuth", "AuthConnectionsCreateResponse_CustomHeaderAuth", "AuthConnectionsCreateResponse_Mtls", "AuthConnectionsCreateResponse_Oauth2ClientCredentials", "AuthConnectionsCreateResponse_Oauth2Jwt", "AuthConnectionsCreateResponse_PrivateKeyJwt", "AuthConnectionsCreateResponse_RefreshTokenAuth", "AuthConnectionsCreateResponse_SlackBotAuth", "AuthConnectionsCreateResponse_UrlSecret", "AuthConnectionsCreateResponse_WhatsappAuth", "AuthConnectionsUpdateRequestBody", "AuthConnectionsUpdateRequestBody_BasicAuth", "AuthConnectionsUpdateRequestBody_BearerAuth", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials", "AuthConnectionsUpdateRequestBody_Oauth2Jwt", "AuthConnectionsUpdateResponse", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsUpdateResponse_BasicAuth", "AuthConnectionsUpdateResponse_BearerAuth", "AuthConnectionsUpdateResponse_CustomHeaderAuth", "AuthConnectionsUpdateResponse_Mtls", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials", "AuthConnectionsUpdateResponse_Oauth2Jwt", "AuthConnectionsUpdateResponse_PrivateKeyJwt", "AuthConnectionsUpdateResponse_RefreshTokenAuth", "AuthConnectionsUpdateResponse_SlackBotAuth", "AuthConnectionsUpdateResponse_UrlSecret", "AuthConnectionsUpdateResponse_WhatsappAuth", "BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem", "BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole", "analytics", "audit_logs", "auth_connections", "groups", "invites", "members", "resources", "usage", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/000077500000000000000000000000001523660243400265265ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/__init__.py000066400000000000000000000023621523660243400306420ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import requests from .requests import BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort _dynamic_imports: typing.Dict[str, str] = { "BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort": ".requests", "requests": ".requests", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort", "requests"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/client.py000066400000000000000000000036761523660243400303720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawAnalyticsClient, RawAnalyticsClient if typing.TYPE_CHECKING: from .requests.client import AsyncRequestsClient, RequestsClient class AnalyticsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAnalyticsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._requests: typing.Optional[RequestsClient] = None @property def with_raw_response(self) -> RawAnalyticsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAnalyticsClient """ return self._raw_client @property def requests(self): if self._requests is None: from .requests.client import RequestsClient # noqa: E402 self._requests = RequestsClient(client_wrapper=self._client_wrapper) return self._requests class AsyncAnalyticsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAnalyticsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._requests: typing.Optional[AsyncRequestsClient] = None @property def with_raw_response(self) -> AsyncRawAnalyticsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAnalyticsClient """ return self._raw_client @property def requests(self): if self._requests is None: from .requests.client import AsyncRequestsClient # noqa: E402 self._requests = AsyncRequestsClient(client_wrapper=self._client_wrapper) return self._requests elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/raw_client.py000066400000000000000000000006401523660243400312270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawAnalyticsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawAnalyticsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/000077500000000000000000000000001523660243400304015ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/__init__.py000066400000000000000000000022411523660243400325110ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort _dynamic_imports: typing.Dict[str, str] = {"BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort": ".types"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/client.py000066400000000000000000000140631523660243400322350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.column_filter import ColumnFilter from ....types.workspace_analytics_query_response_model import WorkspaceAnalyticsQueryResponseModel from .raw_client import AsyncRawRequestsClient, RawRequestsClient from .types.body_list_api_requests_v_1_workspace_analytics_requests_post_sort import ( BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RequestsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawRequestsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawRequestsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawRequestsClient """ return self._raw_client def get( self, *, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, limit: typing.Optional[int] = OMIT, sort: typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, search: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAnalyticsQueryResponseModel: """ Returns a list of API requests. Supports filtering by time range, column filters, and search terms. At least one of start_time or end_time must be provided. An optional sort parameter controls timestamp ordering. Results are ordered by timestamp. Descending if end_time is used, ascending if start_time is used. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : typing.Optional[int] Start of the time range as a Unix timestamp in milliseconds. end_time : typing.Optional[int] End of the time range as a Unix timestamp in milliseconds. limit : typing.Optional[int] sort : typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] Optional timestamp sort direction. If omitted, defaults to desc when end_time is provided, otherwise asc. filters : typing.Optional[typing.Sequence[ColumnFilter]] search : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAnalyticsQueryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.analytics.requests.get() """ _response = self._raw_client.get( start_time=start_time, end_time=end_time, limit=limit, sort=sort, filters=filters, search=search, request_options=request_options, ) return _response.data class AsyncRequestsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawRequestsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawRequestsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawRequestsClient """ return self._raw_client async def get( self, *, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, limit: typing.Optional[int] = OMIT, sort: typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, search: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAnalyticsQueryResponseModel: """ Returns a list of API requests. Supports filtering by time range, column filters, and search terms. At least one of start_time or end_time must be provided. An optional sort parameter controls timestamp ordering. Results are ordered by timestamp. Descending if end_time is used, ascending if start_time is used. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : typing.Optional[int] Start of the time range as a Unix timestamp in milliseconds. end_time : typing.Optional[int] End of the time range as a Unix timestamp in milliseconds. limit : typing.Optional[int] sort : typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] Optional timestamp sort direction. If omitted, defaults to desc when end_time is provided, otherwise asc. filters : typing.Optional[typing.Sequence[ColumnFilter]] search : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAnalyticsQueryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.analytics.requests.get() asyncio.run(main()) """ _response = await self._raw_client.get( start_time=start_time, end_time=end_time, limit=limit, sort=sort, filters=filters, search=search, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/raw_client.py000066400000000000000000000216071523660243400331100ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.column_filter import ColumnFilter from ....types.workspace_analytics_query_response_model import WorkspaceAnalyticsQueryResponseModel from .types.body_list_api_requests_v_1_workspace_analytics_requests_post_sort import ( BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawRequestsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, *, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, limit: typing.Optional[int] = OMIT, sort: typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, search: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceAnalyticsQueryResponseModel]: """ Returns a list of API requests. Supports filtering by time range, column filters, and search terms. At least one of start_time or end_time must be provided. An optional sort parameter controls timestamp ordering. Results are ordered by timestamp. Descending if end_time is used, ascending if start_time is used. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : typing.Optional[int] Start of the time range as a Unix timestamp in milliseconds. end_time : typing.Optional[int] End of the time range as a Unix timestamp in milliseconds. limit : typing.Optional[int] sort : typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] Optional timestamp sort direction. If omitted, defaults to desc when end_time is provided, otherwise asc. filters : typing.Optional[typing.Sequence[ColumnFilter]] search : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceAnalyticsQueryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/analytics/requests", method="POST", json={ "start_time": start_time, "end_time": end_time, "limit": limit, "sort": sort, "filters": convert_and_respect_annotation_metadata( object_=filters, annotation=typing.Sequence[ColumnFilter], direction="write" ), "search": search, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAnalyticsQueryResponseModel, construct_type( type_=WorkspaceAnalyticsQueryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawRequestsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, *, start_time: typing.Optional[int] = OMIT, end_time: typing.Optional[int] = OMIT, limit: typing.Optional[int] = OMIT, sort: typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, search: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceAnalyticsQueryResponseModel]: """ Returns a list of API requests. Supports filtering by time range, column filters, and search terms. At least one of start_time or end_time must be provided. An optional sort parameter controls timestamp ordering. Results are ordered by timestamp. Descending if end_time is used, ascending if start_time is used. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : typing.Optional[int] Start of the time range as a Unix timestamp in milliseconds. end_time : typing.Optional[int] End of the time range as a Unix timestamp in milliseconds. limit : typing.Optional[int] sort : typing.Optional[BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort] Optional timestamp sort direction. If omitted, defaults to desc when end_time is provided, otherwise asc. filters : typing.Optional[typing.Sequence[ColumnFilter]] search : typing.Optional[str] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceAnalyticsQueryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/analytics/requests", method="POST", json={ "start_time": start_time, "end_time": end_time, "limit": limit, "sort": sort, "filters": convert_and_respect_annotation_metadata( object_=filters, annotation=typing.Sequence[ColumnFilter], direction="write" ), "search": search, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAnalyticsQueryResponseModel, construct_type( type_=WorkspaceAnalyticsQueryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/types/000077500000000000000000000000001523660243400315455ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/types/__init__.py000066400000000000000000000024601523660243400336600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_list_api_requests_v_1_workspace_analytics_requests_post_sort import ( BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort, ) _dynamic_imports: typing.Dict[str, str] = { "BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort": ".body_list_api_requests_v_1_workspace_analytics_requests_post_sort" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort"] body_list_api_requests_v_1_workspace_analytics_requests_post_sort.py000066400000000000000000000003021523660243400475500ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/analytics/requests/types# This file was auto-generated by Fern from our API Definition. import typing BodyListApiRequestsV1WorkspaceAnalyticsRequestsPostSort = typing.Union[typing.Literal["asc", "desc"], typing.Any] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/audit_logs/000077500000000000000000000000001523660243400266715ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/audit_logs/__init__.py000066400000000000000000000001251523660243400310000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/audit_logs/client.py000066400000000000000000000141421523660243400305230ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.workspace_audit_logs_page_response import WorkspaceAuditLogsPageResponse from .raw_client import AsyncRawAuditLogsClient, RawAuditLogsClient class AuditLogsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAuditLogsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAuditLogsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAuditLogsClient """ return self._raw_client def list( self, *, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, time_from_unix_ms: typing.Optional[int] = None, time_to_unix_ms: typing.Optional[int] = None, actor_uid: typing.Optional[str] = None, class_name: typing.Optional[str] = None, activity_name: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAuditLogsPageResponse: """ Returns the audit log for the workspace. Requires enterprise tier and the audit_log_read permission. Parameters ---------- limit : typing.Optional[int] Maximum number of entries per page cursor : typing.Optional[str] Cursor for the next page (from previous response) time_from_unix_ms : typing.Optional[int] Only include entries at or after this time (ms since epoch) time_to_unix_ms : typing.Optional[int] Only include entries at or before this time (ms since epoch) actor_uid : typing.Optional[str] Filter by actor user ID class_name : typing.Optional[str] Filter by OCSF event class name (e.g. Account Change) activity_name : typing.Optional[str] Filter by audit activity name (e.g. Subscription Creation) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAuditLogsPageResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.audit_logs.list( limit=1, cursor="cursor", time_from_unix_ms=1, time_to_unix_ms=1, actor_uid="actor_uid", class_name="class_name", activity_name="activity_name", ) """ _response = self._raw_client.list( limit=limit, cursor=cursor, time_from_unix_ms=time_from_unix_ms, time_to_unix_ms=time_to_unix_ms, actor_uid=actor_uid, class_name=class_name, activity_name=activity_name, request_options=request_options, ) return _response.data class AsyncAuditLogsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAuditLogsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAuditLogsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAuditLogsClient """ return self._raw_client async def list( self, *, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, time_from_unix_ms: typing.Optional[int] = None, time_to_unix_ms: typing.Optional[int] = None, actor_uid: typing.Optional[str] = None, class_name: typing.Optional[str] = None, activity_name: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAuditLogsPageResponse: """ Returns the audit log for the workspace. Requires enterprise tier and the audit_log_read permission. Parameters ---------- limit : typing.Optional[int] Maximum number of entries per page cursor : typing.Optional[str] Cursor for the next page (from previous response) time_from_unix_ms : typing.Optional[int] Only include entries at or after this time (ms since epoch) time_to_unix_ms : typing.Optional[int] Only include entries at or before this time (ms since epoch) actor_uid : typing.Optional[str] Filter by actor user ID class_name : typing.Optional[str] Filter by OCSF event class name (e.g. Account Change) activity_name : typing.Optional[str] Filter by audit activity name (e.g. Subscription Creation) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAuditLogsPageResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.audit_logs.list( limit=1, cursor="cursor", time_from_unix_ms=1, time_to_unix_ms=1, actor_uid="actor_uid", class_name="class_name", activity_name="activity_name", ) asyncio.run(main()) """ _response = await self._raw_client.list( limit=limit, cursor=cursor, time_from_unix_ms=time_from_unix_ms, time_to_unix_ms=time_to_unix_ms, actor_uid=actor_uid, class_name=class_name, activity_name=activity_name, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/audit_logs/raw_client.py000066400000000000000000000175161523660243400314040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.workspace_audit_logs_page_response import WorkspaceAuditLogsPageResponse from pydantic import ValidationError class RawAuditLogsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, time_from_unix_ms: typing.Optional[int] = None, time_to_unix_ms: typing.Optional[int] = None, actor_uid: typing.Optional[str] = None, class_name: typing.Optional[str] = None, activity_name: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceAuditLogsPageResponse]: """ Returns the audit log for the workspace. Requires enterprise tier and the audit_log_read permission. Parameters ---------- limit : typing.Optional[int] Maximum number of entries per page cursor : typing.Optional[str] Cursor for the next page (from previous response) time_from_unix_ms : typing.Optional[int] Only include entries at or after this time (ms since epoch) time_to_unix_ms : typing.Optional[int] Only include entries at or before this time (ms since epoch) actor_uid : typing.Optional[str] Filter by actor user ID class_name : typing.Optional[str] Filter by OCSF event class name (e.g. Account Change) activity_name : typing.Optional[str] Filter by audit activity name (e.g. Subscription Creation) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceAuditLogsPageResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/audit-logs", method="GET", params={ "limit": limit, "cursor": cursor, "time_from_unix_ms": time_from_unix_ms, "time_to_unix_ms": time_to_unix_ms, "actor_uid": actor_uid, "class_name": class_name, "activity_name": activity_name, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAuditLogsPageResponse, construct_type( type_=WorkspaceAuditLogsPageResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAuditLogsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, time_from_unix_ms: typing.Optional[int] = None, time_to_unix_ms: typing.Optional[int] = None, actor_uid: typing.Optional[str] = None, class_name: typing.Optional[str] = None, activity_name: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceAuditLogsPageResponse]: """ Returns the audit log for the workspace. Requires enterprise tier and the audit_log_read permission. Parameters ---------- limit : typing.Optional[int] Maximum number of entries per page cursor : typing.Optional[str] Cursor for the next page (from previous response) time_from_unix_ms : typing.Optional[int] Only include entries at or after this time (ms since epoch) time_to_unix_ms : typing.Optional[int] Only include entries at or before this time (ms since epoch) actor_uid : typing.Optional[str] Filter by actor user ID class_name : typing.Optional[str] Filter by OCSF event class name (e.g. Account Change) activity_name : typing.Optional[str] Filter by audit activity name (e.g. Subscription Creation) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceAuditLogsPageResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/audit-logs", method="GET", params={ "limit": limit, "cursor": cursor, "time_from_unix_ms": time_from_unix_ms, "time_to_unix_ms": time_to_unix_ms, "actor_uid": actor_uid, "class_name": class_name, "activity_name": activity_name, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAuditLogsPageResponse, construct_type( type_=WorkspaceAuditLogsPageResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/000077500000000000000000000000001523660243400301025ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/__init__.py000066400000000000000000000172271523660243400322240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import ( AuthConnectionsCreateRequestBody, AuthConnectionsCreateRequestBody_BasicAuth, AuthConnectionsCreateRequestBody_BearerAuth, AuthConnectionsCreateRequestBody_CustomHeaderAuth, AuthConnectionsCreateRequestBody_Mtls, AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, AuthConnectionsCreateRequestBody_Oauth2Jwt, AuthConnectionsCreateRequestBody_PrivateKeyJwt, AuthConnectionsCreateResponse, AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsCreateResponse_BasicAuth, AuthConnectionsCreateResponse_BearerAuth, AuthConnectionsCreateResponse_CustomHeaderAuth, AuthConnectionsCreateResponse_Mtls, AuthConnectionsCreateResponse_Oauth2ClientCredentials, AuthConnectionsCreateResponse_Oauth2Jwt, AuthConnectionsCreateResponse_PrivateKeyJwt, AuthConnectionsCreateResponse_RefreshTokenAuth, AuthConnectionsCreateResponse_SlackBotAuth, AuthConnectionsCreateResponse_UrlSecret, AuthConnectionsCreateResponse_WhatsappAuth, AuthConnectionsUpdateRequestBody, AuthConnectionsUpdateRequestBody_BasicAuth, AuthConnectionsUpdateRequestBody_BearerAuth, AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, AuthConnectionsUpdateRequestBody_Oauth2Jwt, AuthConnectionsUpdateResponse, AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsUpdateResponse_BasicAuth, AuthConnectionsUpdateResponse_BearerAuth, AuthConnectionsUpdateResponse_CustomHeaderAuth, AuthConnectionsUpdateResponse_Mtls, AuthConnectionsUpdateResponse_Oauth2ClientCredentials, AuthConnectionsUpdateResponse_Oauth2Jwt, AuthConnectionsUpdateResponse_PrivateKeyJwt, AuthConnectionsUpdateResponse_RefreshTokenAuth, AuthConnectionsUpdateResponse_SlackBotAuth, AuthConnectionsUpdateResponse_UrlSecret, AuthConnectionsUpdateResponse_WhatsappAuth, ) _dynamic_imports: typing.Dict[str, str] = { "AuthConnectionsCreateRequestBody": ".types", "AuthConnectionsCreateRequestBody_BasicAuth": ".types", "AuthConnectionsCreateRequestBody_BearerAuth": ".types", "AuthConnectionsCreateRequestBody_CustomHeaderAuth": ".types", "AuthConnectionsCreateRequestBody_Mtls": ".types", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials": ".types", "AuthConnectionsCreateRequestBody_Oauth2Jwt": ".types", "AuthConnectionsCreateRequestBody_PrivateKeyJwt": ".types", "AuthConnectionsCreateResponse": ".types", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode": ".types", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp": ".types", "AuthConnectionsCreateResponse_BasicAuth": ".types", "AuthConnectionsCreateResponse_BearerAuth": ".types", "AuthConnectionsCreateResponse_CustomHeaderAuth": ".types", "AuthConnectionsCreateResponse_Mtls": ".types", "AuthConnectionsCreateResponse_Oauth2ClientCredentials": ".types", "AuthConnectionsCreateResponse_Oauth2Jwt": ".types", "AuthConnectionsCreateResponse_PrivateKeyJwt": ".types", "AuthConnectionsCreateResponse_RefreshTokenAuth": ".types", "AuthConnectionsCreateResponse_SlackBotAuth": ".types", "AuthConnectionsCreateResponse_UrlSecret": ".types", "AuthConnectionsCreateResponse_WhatsappAuth": ".types", "AuthConnectionsUpdateRequestBody": ".types", "AuthConnectionsUpdateRequestBody_BasicAuth": ".types", "AuthConnectionsUpdateRequestBody_BearerAuth": ".types", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials": ".types", "AuthConnectionsUpdateRequestBody_Oauth2Jwt": ".types", "AuthConnectionsUpdateResponse": ".types", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode": ".types", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp": ".types", "AuthConnectionsUpdateResponse_BasicAuth": ".types", "AuthConnectionsUpdateResponse_BearerAuth": ".types", "AuthConnectionsUpdateResponse_CustomHeaderAuth": ".types", "AuthConnectionsUpdateResponse_Mtls": ".types", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials": ".types", "AuthConnectionsUpdateResponse_Oauth2Jwt": ".types", "AuthConnectionsUpdateResponse_PrivateKeyJwt": ".types", "AuthConnectionsUpdateResponse_RefreshTokenAuth": ".types", "AuthConnectionsUpdateResponse_SlackBotAuth": ".types", "AuthConnectionsUpdateResponse_UrlSecret": ".types", "AuthConnectionsUpdateResponse_WhatsappAuth": ".types", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AuthConnectionsCreateRequestBody", "AuthConnectionsCreateRequestBody_BasicAuth", "AuthConnectionsCreateRequestBody_BearerAuth", "AuthConnectionsCreateRequestBody_CustomHeaderAuth", "AuthConnectionsCreateRequestBody_Mtls", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials", "AuthConnectionsCreateRequestBody_Oauth2Jwt", "AuthConnectionsCreateRequestBody_PrivateKeyJwt", "AuthConnectionsCreateResponse", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsCreateResponse_BasicAuth", "AuthConnectionsCreateResponse_BearerAuth", "AuthConnectionsCreateResponse_CustomHeaderAuth", "AuthConnectionsCreateResponse_Mtls", "AuthConnectionsCreateResponse_Oauth2ClientCredentials", "AuthConnectionsCreateResponse_Oauth2Jwt", "AuthConnectionsCreateResponse_PrivateKeyJwt", "AuthConnectionsCreateResponse_RefreshTokenAuth", "AuthConnectionsCreateResponse_SlackBotAuth", "AuthConnectionsCreateResponse_UrlSecret", "AuthConnectionsCreateResponse_WhatsappAuth", "AuthConnectionsUpdateRequestBody", "AuthConnectionsUpdateRequestBody_BasicAuth", "AuthConnectionsUpdateRequestBody_BearerAuth", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials", "AuthConnectionsUpdateRequestBody_Oauth2Jwt", "AuthConnectionsUpdateResponse", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsUpdateResponse_BasicAuth", "AuthConnectionsUpdateResponse_BearerAuth", "AuthConnectionsUpdateResponse_CustomHeaderAuth", "AuthConnectionsUpdateResponse_Mtls", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials", "AuthConnectionsUpdateResponse_Oauth2Jwt", "AuthConnectionsUpdateResponse_PrivateKeyJwt", "AuthConnectionsUpdateResponse_RefreshTokenAuth", "AuthConnectionsUpdateResponse_SlackBotAuth", "AuthConnectionsUpdateResponse_UrlSecret", "AuthConnectionsUpdateResponse_WhatsappAuth", ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/client.py000066400000000000000000000244741523660243400317450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.list_auth_connections_response import ListAuthConnectionsResponse from .raw_client import AsyncRawAuthConnectionsClient, RawAuthConnectionsClient from .types.auth_connections_create_request_body import AuthConnectionsCreateRequestBody from .types.auth_connections_create_response import AuthConnectionsCreateResponse from .types.auth_connections_update_request_body import AuthConnectionsUpdateRequestBody from .types.auth_connections_update_response import AuthConnectionsUpdateResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class AuthConnectionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawAuthConnectionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawAuthConnectionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawAuthConnectionsClient """ return self._raw_client def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListAuthConnectionsResponse: """ Get all auth connections for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListAuthConnectionsResponse Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.auth_connections.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def create( self, *, request: AuthConnectionsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AuthConnectionsCreateResponse: """ Create a new OAuth2 auth connection for the workspace Parameters ---------- request : AuthConnectionsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AuthConnectionsCreateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.workspace.auth_connections import ( AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.auth_connections.create( request=AuthConnectionsCreateRequestBody_Oauth2ClientCredentials( name="name", provider="provider", client_id="client_id", token_url="token_url", client_secret="client_secret", ), ) """ _response = self._raw_client.create(request=request, request_options=request_options) return _response.data def delete(self, auth_connection_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete an auth connection Parameters ---------- auth_connection_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.auth_connections.delete( auth_connection_id="auth_connection_id", ) """ _response = self._raw_client.delete(auth_connection_id, request_options=request_options) return _response.data def update( self, auth_connection_id: str, *, request: AuthConnectionsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None, ) -> AuthConnectionsUpdateResponse: """ Update an auth connection Parameters ---------- auth_connection_id : str request : AuthConnectionsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AuthConnectionsUpdateResponse Successful Response Examples -------- from elevenlabs import ElevenLabs from elevenlabs.workspace.auth_connections import ( AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.auth_connections.update( auth_connection_id="auth_connection_id", request=AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials(), ) """ _response = self._raw_client.update(auth_connection_id, request=request, request_options=request_options) return _response.data class AsyncAuthConnectionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawAuthConnectionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawAuthConnectionsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawAuthConnectionsClient """ return self._raw_client async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListAuthConnectionsResponse: """ Get all auth connections for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ListAuthConnectionsResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.auth_connections.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def create( self, *, request: AuthConnectionsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AuthConnectionsCreateResponse: """ Create a new OAuth2 auth connection for the workspace Parameters ---------- request : AuthConnectionsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AuthConnectionsCreateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.workspace.auth_connections import ( AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.auth_connections.create( request=AuthConnectionsCreateRequestBody_Oauth2ClientCredentials( name="name", provider="provider", client_id="client_id", token_url="token_url", client_secret="client_secret", ), ) asyncio.run(main()) """ _response = await self._raw_client.create(request=request, request_options=request_options) return _response.data async def delete( self, auth_connection_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Delete an auth connection Parameters ---------- auth_connection_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.auth_connections.delete( auth_connection_id="auth_connection_id", ) asyncio.run(main()) """ _response = await self._raw_client.delete(auth_connection_id, request_options=request_options) return _response.data async def update( self, auth_connection_id: str, *, request: AuthConnectionsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None, ) -> AuthConnectionsUpdateResponse: """ Update an auth connection Parameters ---------- auth_connection_id : str request : AuthConnectionsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AuthConnectionsUpdateResponse Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs from elevenlabs.workspace.auth_connections import ( AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.auth_connections.update( auth_connection_id="auth_connection_id", request=AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials(), ) asyncio.run(main()) """ _response = await self._raw_client.update(auth_connection_id, request=request, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/raw_client.py000066400000000000000000000467421523660243400326200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.list_auth_connections_response import ListAuthConnectionsResponse from .types.auth_connections_create_request_body import AuthConnectionsCreateRequestBody from .types.auth_connections_create_response import AuthConnectionsCreateResponse from .types.auth_connections_update_request_body import AuthConnectionsUpdateRequestBody from .types.auth_connections_update_response import AuthConnectionsUpdateResponse from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawAuthConnectionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ListAuthConnectionsResponse]: """ Get all auth connections for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ListAuthConnectionsResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/auth-connections", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListAuthConnectionsResponse, construct_type( type_=ListAuthConnectionsResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( self, *, request: AuthConnectionsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[AuthConnectionsCreateResponse]: """ Create a new OAuth2 auth connection for the workspace Parameters ---------- request : AuthConnectionsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AuthConnectionsCreateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/auth-connections", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=AuthConnectionsCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AuthConnectionsCreateResponse, construct_type( type_=AuthConnectionsCreateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, auth_connection_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Delete an auth connection Parameters ---------- auth_connection_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/auth-connections/{jsonable_encoder(auth_connection_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, auth_connection_id: str, *, request: AuthConnectionsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AuthConnectionsUpdateResponse]: """ Update an auth connection Parameters ---------- auth_connection_id : str request : AuthConnectionsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AuthConnectionsUpdateResponse] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/auth-connections/{jsonable_encoder(auth_connection_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=AuthConnectionsUpdateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AuthConnectionsUpdateResponse, construct_type( type_=AuthConnectionsUpdateResponse, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawAuthConnectionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ListAuthConnectionsResponse]: """ Get all auth connections for the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ListAuthConnectionsResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/auth-connections", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ListAuthConnectionsResponse, construct_type( type_=ListAuthConnectionsResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( self, *, request: AuthConnectionsCreateRequestBody, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[AuthConnectionsCreateResponse]: """ Create a new OAuth2 auth connection for the workspace Parameters ---------- request : AuthConnectionsCreateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AuthConnectionsCreateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/auth-connections", method="POST", json=convert_and_respect_annotation_metadata( object_=request, annotation=AuthConnectionsCreateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AuthConnectionsCreateResponse, construct_type( type_=AuthConnectionsCreateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, auth_connection_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Delete an auth connection Parameters ---------- auth_connection_id : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/auth-connections/{jsonable_encoder(auth_connection_id)}", method="DELETE", request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, auth_connection_id: str, *, request: AuthConnectionsUpdateRequestBody, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AuthConnectionsUpdateResponse]: """ Update an auth connection Parameters ---------- auth_connection_id : str request : AuthConnectionsUpdateRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AuthConnectionsUpdateResponse] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/auth-connections/{jsonable_encoder(auth_connection_id)}", method="PATCH", json=convert_and_respect_annotation_metadata( object_=request, annotation=AuthConnectionsUpdateRequestBody, direction="write" ), headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AuthConnectionsUpdateResponse, construct_type( type_=AuthConnectionsUpdateResponse, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types/000077500000000000000000000000001523660243400312465ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types/__init__.py000066400000000000000000000217571523660243400333730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .auth_connections_create_request_body import ( AuthConnectionsCreateRequestBody, AuthConnectionsCreateRequestBody_BasicAuth, AuthConnectionsCreateRequestBody_BearerAuth, AuthConnectionsCreateRequestBody_CustomHeaderAuth, AuthConnectionsCreateRequestBody_Mtls, AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, AuthConnectionsCreateRequestBody_Oauth2Jwt, AuthConnectionsCreateRequestBody_PrivateKeyJwt, ) from .auth_connections_create_response import ( AuthConnectionsCreateResponse, AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsCreateResponse_BasicAuth, AuthConnectionsCreateResponse_BearerAuth, AuthConnectionsCreateResponse_CustomHeaderAuth, AuthConnectionsCreateResponse_Mtls, AuthConnectionsCreateResponse_Oauth2ClientCredentials, AuthConnectionsCreateResponse_Oauth2Jwt, AuthConnectionsCreateResponse_PrivateKeyJwt, AuthConnectionsCreateResponse_RefreshTokenAuth, AuthConnectionsCreateResponse_SlackBotAuth, AuthConnectionsCreateResponse_UrlSecret, AuthConnectionsCreateResponse_WhatsappAuth, ) from .auth_connections_update_request_body import ( AuthConnectionsUpdateRequestBody, AuthConnectionsUpdateRequestBody_BasicAuth, AuthConnectionsUpdateRequestBody_BearerAuth, AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, AuthConnectionsUpdateRequestBody_Oauth2Jwt, ) from .auth_connections_update_response import ( AuthConnectionsUpdateResponse, AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsUpdateResponse_BasicAuth, AuthConnectionsUpdateResponse_BearerAuth, AuthConnectionsUpdateResponse_CustomHeaderAuth, AuthConnectionsUpdateResponse_Mtls, AuthConnectionsUpdateResponse_Oauth2ClientCredentials, AuthConnectionsUpdateResponse_Oauth2Jwt, AuthConnectionsUpdateResponse_PrivateKeyJwt, AuthConnectionsUpdateResponse_RefreshTokenAuth, AuthConnectionsUpdateResponse_SlackBotAuth, AuthConnectionsUpdateResponse_UrlSecret, AuthConnectionsUpdateResponse_WhatsappAuth, ) _dynamic_imports: typing.Dict[str, str] = { "AuthConnectionsCreateRequestBody": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_BasicAuth": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_BearerAuth": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_CustomHeaderAuth": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_Mtls": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_Oauth2Jwt": ".auth_connections_create_request_body", "AuthConnectionsCreateRequestBody_PrivateKeyJwt": ".auth_connections_create_request_body", "AuthConnectionsCreateResponse": ".auth_connections_create_response", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode": ".auth_connections_create_response", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp": ".auth_connections_create_response", "AuthConnectionsCreateResponse_BasicAuth": ".auth_connections_create_response", "AuthConnectionsCreateResponse_BearerAuth": ".auth_connections_create_response", "AuthConnectionsCreateResponse_CustomHeaderAuth": ".auth_connections_create_response", "AuthConnectionsCreateResponse_Mtls": ".auth_connections_create_response", "AuthConnectionsCreateResponse_Oauth2ClientCredentials": ".auth_connections_create_response", "AuthConnectionsCreateResponse_Oauth2Jwt": ".auth_connections_create_response", "AuthConnectionsCreateResponse_PrivateKeyJwt": ".auth_connections_create_response", "AuthConnectionsCreateResponse_RefreshTokenAuth": ".auth_connections_create_response", "AuthConnectionsCreateResponse_SlackBotAuth": ".auth_connections_create_response", "AuthConnectionsCreateResponse_UrlSecret": ".auth_connections_create_response", "AuthConnectionsCreateResponse_WhatsappAuth": ".auth_connections_create_response", "AuthConnectionsUpdateRequestBody": ".auth_connections_update_request_body", "AuthConnectionsUpdateRequestBody_BasicAuth": ".auth_connections_update_request_body", "AuthConnectionsUpdateRequestBody_BearerAuth": ".auth_connections_update_request_body", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials": ".auth_connections_update_request_body", "AuthConnectionsUpdateRequestBody_Oauth2Jwt": ".auth_connections_update_request_body", "AuthConnectionsUpdateResponse": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_BasicAuth": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_BearerAuth": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_CustomHeaderAuth": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_Mtls": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_Oauth2Jwt": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_PrivateKeyJwt": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_RefreshTokenAuth": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_SlackBotAuth": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_UrlSecret": ".auth_connections_update_response", "AuthConnectionsUpdateResponse_WhatsappAuth": ".auth_connections_update_response", } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = [ "AuthConnectionsCreateRequestBody", "AuthConnectionsCreateRequestBody_BasicAuth", "AuthConnectionsCreateRequestBody_BearerAuth", "AuthConnectionsCreateRequestBody_CustomHeaderAuth", "AuthConnectionsCreateRequestBody_Mtls", "AuthConnectionsCreateRequestBody_Oauth2ClientCredentials", "AuthConnectionsCreateRequestBody_Oauth2Jwt", "AuthConnectionsCreateRequestBody_PrivateKeyJwt", "AuthConnectionsCreateResponse", "AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsCreateResponse_BasicAuth", "AuthConnectionsCreateResponse_BearerAuth", "AuthConnectionsCreateResponse_CustomHeaderAuth", "AuthConnectionsCreateResponse_Mtls", "AuthConnectionsCreateResponse_Oauth2ClientCredentials", "AuthConnectionsCreateResponse_Oauth2Jwt", "AuthConnectionsCreateResponse_PrivateKeyJwt", "AuthConnectionsCreateResponse_RefreshTokenAuth", "AuthConnectionsCreateResponse_SlackBotAuth", "AuthConnectionsCreateResponse_UrlSecret", "AuthConnectionsCreateResponse_WhatsappAuth", "AuthConnectionsUpdateRequestBody", "AuthConnectionsUpdateRequestBody_BasicAuth", "AuthConnectionsUpdateRequestBody_BearerAuth", "AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials", "AuthConnectionsUpdateRequestBody_Oauth2Jwt", "AuthConnectionsUpdateResponse", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode", "AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp", "AuthConnectionsUpdateResponse_BasicAuth", "AuthConnectionsUpdateResponse_BearerAuth", "AuthConnectionsUpdateResponse_CustomHeaderAuth", "AuthConnectionsUpdateResponse_Mtls", "AuthConnectionsUpdateResponse_Oauth2ClientCredentials", "AuthConnectionsUpdateResponse_Oauth2Jwt", "AuthConnectionsUpdateResponse_PrivateKeyJwt", "AuthConnectionsUpdateResponse_RefreshTokenAuth", "AuthConnectionsUpdateResponse_SlackBotAuth", "AuthConnectionsUpdateResponse_UrlSecret", "AuthConnectionsUpdateResponse_WhatsappAuth", ] auth_connections_create_request_body.py000066400000000000000000000135621523660243400412230ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.create_o_auth_2_jwt_request_algorithm import CreateOAuth2JwtRequestAlgorithm from ....types.create_o_auth_2_jwt_request_token_response_field import CreateOAuth2JwtRequestTokenResponseField from ....types.create_private_key_jwt_request_algorithm import CreatePrivateKeyJwtRequestAlgorithm class AuthConnectionsCreateRequestBody_Oauth2ClientCredentials(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["oauth2_client_credentials"] = "oauth2_client_credentials" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = None client_secret: str custom_headers: typing.Optional[typing.Dict[str, 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 class AuthConnectionsCreateRequestBody_CustomHeaderAuth(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["custom_header_auth"] = "custom_header_auth" name: str provider: str header_name: str token: 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 AuthConnectionsCreateRequestBody_BasicAuth(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["basic_auth"] = "basic_auth" name: str provider: str username: str password: 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 AuthConnectionsCreateRequestBody_BearerAuth(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["bearer_auth"] = "bearer_auth" name: str provider: str token: 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 AuthConnectionsCreateRequestBody_Oauth2Jwt(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["oauth2_jwt"] = "oauth2_jwt" name: str provider: str algorithm: typing.Optional[CreateOAuth2JwtRequestAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None token_url: str scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[CreateOAuth2JwtRequestTokenResponseField] = None secret_key: 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 AuthConnectionsCreateRequestBody_PrivateKeyJwt(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["private_key_jwt"] = "private_key_jwt" name: str provider: str algorithm: typing.Optional[CreatePrivateKeyJwtRequestAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None secret_key: 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 AuthConnectionsCreateRequestBody_Mtls(UncheckedBaseModel): """ Auth connection to create """ auth_type: typing.Literal["mtls"] = "mtls" name: str provider: str client_certificate: str client_key: str ca_certificate: typing.Optional[str] = None key_passphrase: 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 AuthConnectionsCreateRequestBody = typing_extensions.Annotated[ typing.Union[ AuthConnectionsCreateRequestBody_Oauth2ClientCredentials, AuthConnectionsCreateRequestBody_CustomHeaderAuth, AuthConnectionsCreateRequestBody_BasicAuth, AuthConnectionsCreateRequestBody_BearerAuth, AuthConnectionsCreateRequestBody_Oauth2Jwt, AuthConnectionsCreateRequestBody_PrivateKeyJwt, AuthConnectionsCreateRequestBody_Mtls, ], UnionMetadata(discriminant="auth_type"), ] auth_connections_create_response.py000066400000000000000000000322611523660243400403510ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.api_integration_o_auth_2_auth_code_response_scope_separator import ( ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ) from ....types.api_integration_o_auth_2_custom_app_response_scope_separator import ( ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ) from ....types.auth_connection_dependencies import AuthConnectionDependencies from ....types.auth_connection_status import AuthConnectionStatus from ....types.o_auth_2_jwt_response_algorithm import OAuth2JwtResponseAlgorithm from ....types.o_auth_2_jwt_response_token_response_field import OAuth2JwtResponseTokenResponseField from ....types.private_key_jwt_response_algorithm import PrivateKeyJwtResponseAlgorithm class AuthConnectionsCreateResponse_Oauth2ClientCredentials(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_client_credentials"] = "oauth2_client_credentials" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, 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 class AuthConnectionsCreateResponse_RefreshTokenAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["refresh_token_auth"] = "refresh_token_auth" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_BasicAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["basic_auth"] = "basic_auth" name: str provider: str username: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_BearerAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["bearer_auth"] = "bearer_auth" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_Oauth2Jwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_jwt"] = "oauth2_jwt" name: str provider: str algorithm: typing.Optional[OAuth2JwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None token_url: str scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[OAuth2JwtResponseTokenResponseField] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_PrivateKeyJwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["private_key_jwt"] = "private_key_jwt" name: str provider: str algorithm: typing.Optional[PrivateKeyJwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_Mtls(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["mtls"] = "mtls" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_CustomHeaderAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["custom_header_auth"] = "custom_header_auth" name: str provider: str header_name: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_auth_code"] = "api_integration_oauth2_auth_code" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2AuthCodeResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_custom_app"] = "api_integration_oauth2_custom_app" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2CustomAppResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str client_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_WhatsappAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["whatsapp_auth"] = "whatsapp_auth" name: str provider: typing.Optional[typing.Literal["whatsapp"]] = None phone_number_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_SlackBotAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["slack_bot_auth"] = "slack_bot_auth" name: str provider: typing.Optional[typing.Literal["Slack"]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsCreateResponse_UrlSecret(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["url_secret"] = "url_secret" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 AuthConnectionsCreateResponse = typing_extensions.Annotated[ typing.Union[ AuthConnectionsCreateResponse_Oauth2ClientCredentials, AuthConnectionsCreateResponse_RefreshTokenAuth, AuthConnectionsCreateResponse_BasicAuth, AuthConnectionsCreateResponse_BearerAuth, AuthConnectionsCreateResponse_Oauth2Jwt, AuthConnectionsCreateResponse_PrivateKeyJwt, AuthConnectionsCreateResponse_Mtls, AuthConnectionsCreateResponse_CustomHeaderAuth, AuthConnectionsCreateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsCreateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsCreateResponse_WhatsappAuth, AuthConnectionsCreateResponse_SlackBotAuth, AuthConnectionsCreateResponse_UrlSecret, ], UnionMetadata(discriminant="auth_type"), ] auth_connections_update_request_body.py000066400000000000000000000076601523660243400412440ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.update_o_auth_2_jwt_request_algorithm import UpdateOAuth2JwtRequestAlgorithm from ....types.update_o_auth_2_jwt_request_token_response_field import UpdateOAuth2JwtRequestTokenResponseField class AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials(UncheckedBaseModel): """ Updated auth connection fields """ auth_type: typing.Literal["oauth2_client_credentials"] = "oauth2_client_credentials" provider: typing.Optional[str] = None client_id: typing.Optional[str] = None scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None basic_auth_in_header: typing.Optional[bool] = None client_secret: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, 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 class AuthConnectionsUpdateRequestBody_BasicAuth(UncheckedBaseModel): """ Updated auth connection fields """ auth_type: typing.Literal["basic_auth"] = "basic_auth" provider: typing.Optional[str] = None username: typing.Optional[str] = None password: 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 class AuthConnectionsUpdateRequestBody_BearerAuth(UncheckedBaseModel): """ Updated auth connection fields """ auth_type: typing.Literal["bearer_auth"] = "bearer_auth" provider: typing.Optional[str] = None token: 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 class AuthConnectionsUpdateRequestBody_Oauth2Jwt(UncheckedBaseModel): """ Updated auth connection fields """ auth_type: typing.Literal["oauth2_jwt"] = "oauth2_jwt" provider: typing.Optional[str] = None algorithm: typing.Optional[UpdateOAuth2JwtRequestAlgorithm] = None key_id: typing.Optional[str] = None issuer: typing.Optional[str] = None audience: typing.Optional[str] = None subject: typing.Optional[str] = None expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[UpdateOAuth2JwtRequestTokenResponseField] = None secret_key: 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 AuthConnectionsUpdateRequestBody = typing_extensions.Annotated[ typing.Union[ AuthConnectionsUpdateRequestBody_Oauth2ClientCredentials, AuthConnectionsUpdateRequestBody_BasicAuth, AuthConnectionsUpdateRequestBody_BearerAuth, AuthConnectionsUpdateRequestBody_Oauth2Jwt, ], UnionMetadata(discriminant="auth_type"), ] auth_connections_update_response.py000066400000000000000000000322611523660243400403700ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/auth_connections/types# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing import pydantic import typing_extensions from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from ....types.api_integration_o_auth_2_auth_code_response_scope_separator import ( ApiIntegrationOAuth2AuthCodeResponseScopeSeparator, ) from ....types.api_integration_o_auth_2_custom_app_response_scope_separator import ( ApiIntegrationOAuth2CustomAppResponseScopeSeparator, ) from ....types.auth_connection_dependencies import AuthConnectionDependencies from ....types.auth_connection_status import AuthConnectionStatus from ....types.o_auth_2_jwt_response_algorithm import OAuth2JwtResponseAlgorithm from ....types.o_auth_2_jwt_response_token_response_field import OAuth2JwtResponseTokenResponseField from ....types.private_key_jwt_response_algorithm import PrivateKeyJwtResponseAlgorithm class AuthConnectionsUpdateResponse_Oauth2ClientCredentials(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_client_credentials"] = "oauth2_client_credentials" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None basic_auth_in_header: typing.Optional[bool] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: typing.Optional[str] = None custom_headers: typing.Optional[typing.Dict[str, 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 class AuthConnectionsUpdateResponse_RefreshTokenAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["refresh_token_auth"] = "refresh_token_auth" name: str provider: str client_id: str token_url: str scopes: typing.Optional[typing.List[str]] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_BasicAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["basic_auth"] = "basic_auth" name: str provider: str username: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_BearerAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["bearer_auth"] = "bearer_auth" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_Oauth2Jwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["oauth2_jwt"] = "oauth2_jwt" name: str provider: str algorithm: typing.Optional[OAuth2JwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None token_url: str scopes: typing.Optional[typing.List[str]] = None token_response_field: typing.Optional[OAuth2JwtResponseTokenResponseField] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_PrivateKeyJwt(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["private_key_jwt"] = "private_key_jwt" name: str provider: str algorithm: typing.Optional[PrivateKeyJwtResponseAlgorithm] = None key_id: typing.Optional[str] = None issuer: str audience: str subject: str expiration_seconds: typing.Optional[int] = None extra_params: typing.Optional[typing.Dict[str, str]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_Mtls(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["mtls"] = "mtls" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_CustomHeaderAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["custom_header_auth"] = "custom_header_auth" name: str provider: str header_name: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_auth_code"] = "api_integration_oauth2_auth_code" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2AuthCodeResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["api_integration_oauth2_custom_app"] = "api_integration_oauth2_custom_app" name: str provider: str token_url: str scopes: typing.Optional[typing.List[str]] = None scope_separator: typing.Optional[ApiIntegrationOAuth2CustomAppResponseScopeSeparator] = None expires_at: str integration_id: str credential_id: str client_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_WhatsappAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["whatsapp_auth"] = "whatsapp_auth" name: str provider: typing.Optional[typing.Literal["whatsapp"]] = None phone_number_id: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_SlackBotAuth(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["slack_bot_auth"] = "slack_bot_auth" name: str provider: typing.Optional[typing.Literal["Slack"]] = None id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 class AuthConnectionsUpdateResponse_UrlSecret(UncheckedBaseModel): """ The type of auth connection config """ auth_type: typing.Literal["url_secret"] = "url_secret" name: str provider: str id: str used_by: typing.Optional[AuthConnectionDependencies] = None status: typing.Optional[AuthConnectionStatus] = None status_detail: typing.Optional[str] = None status_updated_at: 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 AuthConnectionsUpdateResponse = typing_extensions.Annotated[ typing.Union[ AuthConnectionsUpdateResponse_Oauth2ClientCredentials, AuthConnectionsUpdateResponse_RefreshTokenAuth, AuthConnectionsUpdateResponse_BasicAuth, AuthConnectionsUpdateResponse_BearerAuth, AuthConnectionsUpdateResponse_Oauth2Jwt, AuthConnectionsUpdateResponse_PrivateKeyJwt, AuthConnectionsUpdateResponse_Mtls, AuthConnectionsUpdateResponse_CustomHeaderAuth, AuthConnectionsUpdateResponse_ApiIntegrationOauth2AuthCode, AuthConnectionsUpdateResponse_ApiIntegrationOauth2CustomApp, AuthConnectionsUpdateResponse_WhatsappAuth, AuthConnectionsUpdateResponse_SlackBotAuth, AuthConnectionsUpdateResponse_UrlSecret, ], UnionMetadata(discriminant="auth_type"), ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/client.py000066400000000000000000000246241523660243400263770ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from .raw_client import AsyncRawWorkspaceClient, RawWorkspaceClient if typing.TYPE_CHECKING: from .analytics.client import AnalyticsClient, AsyncAnalyticsClient from .audit_logs.client import AsyncAuditLogsClient, AuditLogsClient from .auth_connections.client import AsyncAuthConnectionsClient, AuthConnectionsClient from .groups.client import AsyncGroupsClient, GroupsClient from .invites.client import AsyncInvitesClient, InvitesClient from .members.client import AsyncMembersClient, MembersClient from .resources.client import AsyncResourcesClient, ResourcesClient from .usage.client import AsyncUsageClient, UsageClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class WorkspaceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWorkspaceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audit_logs: typing.Optional[AuditLogsClient] = None self._auth_connections: typing.Optional[AuthConnectionsClient] = None self._groups: typing.Optional[GroupsClient] = None self._invites: typing.Optional[InvitesClient] = None self._members: typing.Optional[MembersClient] = None self._resources: typing.Optional[ResourcesClient] = None self._usage: typing.Optional[UsageClient] = None self._analytics: typing.Optional[AnalyticsClient] = None @property def with_raw_response(self) -> RawWorkspaceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWorkspaceClient """ return self._raw_client def set_third_party_disabling_policy( self, *, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Set the workspace-wide Third-Party Disabling policy. When set, it forces, for every API key in the workspace, whether the holder of a key (potentially a third party who found it) may disable it via the self-disable endpoint or when it leaks publicly — overriding each key's own setting. Pass `true` to allow it for all keys, `false` to forbid it for all keys, or `null` to clear the override so per-key values and the plan default apply again. Workspace admins only. Parameters ---------- third_party_disable_allowed : typing.Optional[bool] `true` forces every key in the workspace to be disable-able by its holder; `false` forbids it for every key; `null` clears the override (per-key values and the plan default apply). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.set_third_party_disabling_policy() """ _response = self._raw_client.set_third_party_disabling_policy( third_party_disable_allowed=third_party_disable_allowed, request_options=request_options ) return _response.data @property def audit_logs(self): if self._audit_logs is None: from .audit_logs.client import AuditLogsClient # noqa: E402 self._audit_logs = AuditLogsClient(client_wrapper=self._client_wrapper) return self._audit_logs @property def auth_connections(self): if self._auth_connections is None: from .auth_connections.client import AuthConnectionsClient # noqa: E402 self._auth_connections = AuthConnectionsClient(client_wrapper=self._client_wrapper) return self._auth_connections @property def groups(self): if self._groups is None: from .groups.client import GroupsClient # noqa: E402 self._groups = GroupsClient(client_wrapper=self._client_wrapper) return self._groups @property def invites(self): if self._invites is None: from .invites.client import InvitesClient # noqa: E402 self._invites = InvitesClient(client_wrapper=self._client_wrapper) return self._invites @property def members(self): if self._members is None: from .members.client import MembersClient # noqa: E402 self._members = MembersClient(client_wrapper=self._client_wrapper) return self._members @property def resources(self): if self._resources is None: from .resources.client import ResourcesClient # noqa: E402 self._resources = ResourcesClient(client_wrapper=self._client_wrapper) return self._resources @property def usage(self): if self._usage is None: from .usage.client import UsageClient # noqa: E402 self._usage = UsageClient(client_wrapper=self._client_wrapper) return self._usage @property def analytics(self): if self._analytics is None: from .analytics.client import AnalyticsClient # noqa: E402 self._analytics = AnalyticsClient(client_wrapper=self._client_wrapper) return self._analytics class AsyncWorkspaceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWorkspaceClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._audit_logs: typing.Optional[AsyncAuditLogsClient] = None self._auth_connections: typing.Optional[AsyncAuthConnectionsClient] = None self._groups: typing.Optional[AsyncGroupsClient] = None self._invites: typing.Optional[AsyncInvitesClient] = None self._members: typing.Optional[AsyncMembersClient] = None self._resources: typing.Optional[AsyncResourcesClient] = None self._usage: typing.Optional[AsyncUsageClient] = None self._analytics: typing.Optional[AsyncAnalyticsClient] = None @property def with_raw_response(self) -> AsyncRawWorkspaceClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWorkspaceClient """ return self._raw_client async def set_third_party_disabling_policy( self, *, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Set the workspace-wide Third-Party Disabling policy. When set, it forces, for every API key in the workspace, whether the holder of a key (potentially a third party who found it) may disable it via the self-disable endpoint or when it leaks publicly — overriding each key's own setting. Pass `true` to allow it for all keys, `false` to forbid it for all keys, or `null` to clear the override so per-key values and the plan default apply again. Workspace admins only. Parameters ---------- third_party_disable_allowed : typing.Optional[bool] `true` forces every key in the workspace to be disable-able by its holder; `false` forbids it for every key; `null` clears the override (per-key values and the plan default apply). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.set_third_party_disabling_policy() asyncio.run(main()) """ _response = await self._raw_client.set_third_party_disabling_policy( third_party_disable_allowed=third_party_disable_allowed, request_options=request_options ) return _response.data @property def audit_logs(self): if self._audit_logs is None: from .audit_logs.client import AsyncAuditLogsClient # noqa: E402 self._audit_logs = AsyncAuditLogsClient(client_wrapper=self._client_wrapper) return self._audit_logs @property def auth_connections(self): if self._auth_connections is None: from .auth_connections.client import AsyncAuthConnectionsClient # noqa: E402 self._auth_connections = AsyncAuthConnectionsClient(client_wrapper=self._client_wrapper) return self._auth_connections @property def groups(self): if self._groups is None: from .groups.client import AsyncGroupsClient # noqa: E402 self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) return self._groups @property def invites(self): if self._invites is None: from .invites.client import AsyncInvitesClient # noqa: E402 self._invites = AsyncInvitesClient(client_wrapper=self._client_wrapper) return self._invites @property def members(self): if self._members is None: from .members.client import AsyncMembersClient # noqa: E402 self._members = AsyncMembersClient(client_wrapper=self._client_wrapper) return self._members @property def resources(self): if self._resources is None: from .resources.client import AsyncResourcesClient # noqa: E402 self._resources = AsyncResourcesClient(client_wrapper=self._client_wrapper) return self._resources @property def usage(self): if self._usage is None: from .usage.client import AsyncUsageClient # noqa: E402 self._usage = AsyncUsageClient(client_wrapper=self._client_wrapper) return self._usage @property def analytics(self): if self._analytics is None: from .analytics.client import AsyncAnalyticsClient # noqa: E402 self._analytics = AsyncAnalyticsClient(client_wrapper=self._client_wrapper) return self._analytics elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/000077500000000000000000000000001523660243400260565ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/__init__.py000066400000000000000000000020161523660243400301660ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import members _dynamic_imports: typing.Dict[str, str] = {"members": ".members"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["members"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/client.py000066400000000000000000000132641523660243400277140ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.workspace_group_by_name_response_model import WorkspaceGroupByNameResponseModel from ...types.workspace_group_response_model import WorkspaceGroupResponseModel from .raw_client import AsyncRawGroupsClient, RawGroupsClient if typing.TYPE_CHECKING: from .members.client import AsyncMembersClient, MembersClient class GroupsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._members: typing.Optional[MembersClient] = None @property def with_raw_response(self) -> RawGroupsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawGroupsClient """ return self._raw_client def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, WorkspaceGroupResponseModel]: """ Get all groups in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, WorkspaceGroupResponseModel] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.groups.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def search( self, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[WorkspaceGroupByNameResponseModel]: """ Searches for user groups in the workspace. Multiple or no groups may be returned. Parameters ---------- name : str Name of the target group. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[WorkspaceGroupByNameResponseModel] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.groups.search( name="name", ) """ _response = self._raw_client.search(name=name, request_options=request_options) return _response.data @property def members(self): if self._members is None: from .members.client import MembersClient # noqa: E402 self._members = MembersClient(client_wrapper=self._client_wrapper) return self._members class AsyncGroupsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._members: typing.Optional[AsyncMembersClient] = None @property def with_raw_response(self) -> AsyncRawGroupsClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawGroupsClient """ return self._raw_client async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.Dict[str, WorkspaceGroupResponseModel]: """ Get all groups in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Dict[str, WorkspaceGroupResponseModel] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.groups.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def search( self, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[WorkspaceGroupByNameResponseModel]: """ Searches for user groups in the workspace. Multiple or no groups may be returned. Parameters ---------- name : str Name of the target group. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[WorkspaceGroupByNameResponseModel] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.groups.search( name="name", ) asyncio.run(main()) """ _response = await self._raw_client.search(name=name, request_options=request_options) return _response.data @property def members(self): if self._members is None: from .members.client import AsyncMembersClient # noqa: E402 self._members = AsyncMembersClient(client_wrapper=self._client_wrapper) return self._members elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/members/000077500000000000000000000000001523660243400275105ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/members/__init__.py000066400000000000000000000001251523660243400316170ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/members/client.py000066400000000000000000000136141523660243400313450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.request_options import RequestOptions from ....types.add_workspace_group_member_response_model import AddWorkspaceGroupMemberResponseModel from ....types.delete_workspace_group_member_response_model import DeleteWorkspaceGroupMemberResponseModel from .raw_client import AsyncRawMembersClient, RawMembersClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class MembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMembersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawMembersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMembersClient """ return self._raw_client def remove( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceGroupMemberResponseModel: """ Removes a member from the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceGroupMemberResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.groups.members.remove( group_id="group_id", email="email", ) """ _response = self._raw_client.remove(group_id, email=email, request_options=request_options) return _response.data def add( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> AddWorkspaceGroupMemberResponseModel: """ Adds a member of your workspace to the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceGroupMemberResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.groups.members.add( group_id="group_id", email="email", ) """ _response = self._raw_client.add(group_id, email=email, request_options=request_options) return _response.data class AsyncMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMembersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawMembersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMembersClient """ return self._raw_client async def remove( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceGroupMemberResponseModel: """ Removes a member from the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceGroupMemberResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.groups.members.remove( group_id="group_id", email="email", ) asyncio.run(main()) """ _response = await self._raw_client.remove(group_id, email=email, request_options=request_options) return _response.data async def add( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> AddWorkspaceGroupMemberResponseModel: """ Adds a member of your workspace to the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceGroupMemberResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.groups.members.add( group_id="group_id", email="email", ) asyncio.run(main()) """ _response = await self._raw_client.add(group_id, email=email, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/members/raw_client.py000066400000000000000000000257571523660243400322310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ....core.api_error import ApiError from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ....core.http_response import AsyncHttpResponse, HttpResponse from ....core.jsonable_encoder import jsonable_encoder from ....core.parse_error import ParsingError from ....core.request_options import RequestOptions from ....core.unchecked_base_model import construct_type from ....errors.unprocessable_entity_error import UnprocessableEntityError from ....types.add_workspace_group_member_response_model import AddWorkspaceGroupMemberResponseModel from ....types.delete_workspace_group_member_response_model import DeleteWorkspaceGroupMemberResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def remove( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteWorkspaceGroupMemberResponseModel]: """ Removes a member from the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteWorkspaceGroupMemberResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/groups/{jsonable_encoder(group_id)}/members/remove", method="POST", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceGroupMemberResponseModel, construct_type( type_=DeleteWorkspaceGroupMemberResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def add( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[AddWorkspaceGroupMemberResponseModel]: """ Adds a member of your workspace to the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddWorkspaceGroupMemberResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/groups/{jsonable_encoder(group_id)}/members", method="POST", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceGroupMemberResponseModel, construct_type( type_=AddWorkspaceGroupMemberResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def remove( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteWorkspaceGroupMemberResponseModel]: """ Removes a member from the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteWorkspaceGroupMemberResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/groups/{jsonable_encoder(group_id)}/members/remove", method="POST", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceGroupMemberResponseModel, construct_type( type_=DeleteWorkspaceGroupMemberResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def add( self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[AddWorkspaceGroupMemberResponseModel]: """ Adds a member of your workspace to the specified group. Requires `group_members_manage` permission. Parameters ---------- group_id : str The ID of the target group. email : str The email of the target workspace member. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddWorkspaceGroupMemberResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/groups/{jsonable_encoder(group_id)}/members", method="POST", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceGroupMemberResponseModel, construct_type( type_=AddWorkspaceGroupMemberResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/groups/raw_client.py000066400000000000000000000230561523660243400305650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.workspace_group_by_name_response_model import WorkspaceGroupByNameResponseModel from ...types.workspace_group_response_model import WorkspaceGroupResponseModel from pydantic import ValidationError class RawGroupsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Dict[str, WorkspaceGroupResponseModel]]: """ Get all groups in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Dict[str, WorkspaceGroupResponseModel]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/groups", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, WorkspaceGroupResponseModel], construct_type( type_=typing.Dict[str, WorkspaceGroupResponseModel], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def search( self, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]: """ Searches for user groups in the workspace. Multiple or no groups may be returned. Parameters ---------- name : str Name of the target group. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.List[WorkspaceGroupByNameResponseModel]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/groups/search", method="GET", params={ "name": name, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[WorkspaceGroupByNameResponseModel], construct_type( type_=typing.List[WorkspaceGroupByNameResponseModel], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawGroupsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Dict[str, WorkspaceGroupResponseModel]]: """ Get all groups in the workspace Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Dict[str, WorkspaceGroupResponseModel]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/groups", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.Dict[str, WorkspaceGroupResponseModel], construct_type( type_=typing.Dict[str, WorkspaceGroupResponseModel], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def search( self, *, name: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]: """ Searches for user groups in the workspace. Multiple or no groups may be returned. Parameters ---------- name : str Name of the target group. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.List[WorkspaceGroupByNameResponseModel]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/groups/search", method="GET", params={ "name": name, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[WorkspaceGroupByNameResponseModel], construct_type( type_=typing.List[WorkspaceGroupByNameResponseModel], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/invites/000077500000000000000000000000001523660243400262205ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/invites/__init__.py000066400000000000000000000001251523660243400303270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/invites/client.py000066400000000000000000000302401523660243400300470ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.add_workspace_invite_response_model import AddWorkspaceInviteResponseModel from ...types.delete_workspace_invite_response_model import DeleteWorkspaceInviteResponseModel from ...types.seat_type import SeatType from .raw_client import AsyncRawInvitesClient, RawInvitesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class InvitesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawInvitesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawInvitesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawInvitesClient """ return self._raw_client def create( self, *, email: str, workspace_permission: typing.Optional[str] = OMIT, seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddWorkspaceInviteResponseModel: """ Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned. Parameters ---------- email : str The email of the customer workspace_permission : typing.Optional[str] The workspace permission of the user. This is deprecated, use `seat_type` instead. seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceInviteResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.invites.create( email="john.doe@testmail.com", ) """ _response = self._raw_client.create( email=email, workspace_permission=workspace_permission, seat_type=seat_type, group_ids=group_ids, usage_limit=usage_limit, request_options=request_options, ) return _response.data def create_batch( self, *, emails: typing.Sequence[str], seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddWorkspaceInviteResponseModel: """ Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- emails : typing.Sequence[str] The email of the customer seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceInviteResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.invites.create_batch( emails=["emails"], ) """ _response = self._raw_client.create_batch( emails=emails, seat_type=seat_type, group_ids=group_ids, usage_limit=usage_limit, request_options=request_options, ) return _response.data def delete( self, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceInviteResponseModel: """ Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- email : str The email of the customer request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceInviteResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.invites.delete( email="john.doe@testmail.com", ) """ _response = self._raw_client.delete(email=email, request_options=request_options) return _response.data class AsyncInvitesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawInvitesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawInvitesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawInvitesClient """ return self._raw_client async def create( self, *, email: str, workspace_permission: typing.Optional[str] = OMIT, seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddWorkspaceInviteResponseModel: """ Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned. Parameters ---------- email : str The email of the customer workspace_permission : typing.Optional[str] The workspace permission of the user. This is deprecated, use `seat_type` instead. seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceInviteResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.invites.create( email="john.doe@testmail.com", ) asyncio.run(main()) """ _response = await self._raw_client.create( email=email, workspace_permission=workspace_permission, seat_type=seat_type, group_ids=group_ids, usage_limit=usage_limit, request_options=request_options, ) return _response.data async def create_batch( self, *, emails: typing.Sequence[str], seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddWorkspaceInviteResponseModel: """ Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- emails : typing.Sequence[str] The email of the customer seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AddWorkspaceInviteResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.invites.create_batch( emails=["emails"], ) asyncio.run(main()) """ _response = await self._raw_client.create_batch( emails=emails, seat_type=seat_type, group_ids=group_ids, usage_limit=usage_limit, request_options=request_options, ) return _response.data async def delete( self, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> DeleteWorkspaceInviteResponseModel: """ Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- email : str The email of the customer request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- DeleteWorkspaceInviteResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.invites.delete( email="john.doe@testmail.com", ) asyncio.run(main()) """ _response = await self._raw_client.delete(email=email, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/invites/raw_client.py000066400000000000000000000473661523660243400307410ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.add_workspace_invite_response_model import AddWorkspaceInviteResponseModel from ...types.delete_workspace_invite_response_model import DeleteWorkspaceInviteResponseModel from ...types.seat_type import SeatType from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawInvitesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def create( self, *, email: str, workspace_permission: typing.Optional[str] = OMIT, seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddWorkspaceInviteResponseModel]: """ Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned. Parameters ---------- email : str The email of the customer workspace_permission : typing.Optional[str] The workspace permission of the user. This is deprecated, use `seat_type` instead. seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddWorkspaceInviteResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/invites/add", method="POST", json={ "email": email, "workspace_permission": workspace_permission, "seat_type": seat_type, "group_ids": group_ids, "usage_limit": usage_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceInviteResponseModel, construct_type( type_=AddWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create_batch( self, *, emails: typing.Sequence[str], seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddWorkspaceInviteResponseModel]: """ Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- emails : typing.Sequence[str] The email of the customer seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[AddWorkspaceInviteResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/invites/add-bulk", method="POST", json={ "emails": emails, "seat_type": seat_type, "group_ids": group_ids, "usage_limit": usage_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceInviteResponseModel, construct_type( type_=AddWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def delete( self, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[DeleteWorkspaceInviteResponseModel]: """ Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- email : str The email of the customer request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[DeleteWorkspaceInviteResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/invites", method="DELETE", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceInviteResponseModel, construct_type( type_=DeleteWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawInvitesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def create( self, *, email: str, workspace_permission: typing.Optional[str] = OMIT, seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddWorkspaceInviteResponseModel]: """ Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. If the user is already in the workspace a 400 error will be returned. Parameters ---------- email : str The email of the customer workspace_permission : typing.Optional[str] The workspace permission of the user. This is deprecated, use `seat_type` instead. seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddWorkspaceInviteResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/invites/add", method="POST", json={ "email": email, "workspace_permission": workspace_permission, "seat_type": seat_type, "group_ids": group_ids, "usage_limit": usage_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceInviteResponseModel, construct_type( type_=AddWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create_batch( self, *, emails: typing.Sequence[str], seat_type: typing.Optional[SeatType] = OMIT, group_ids: typing.Optional[typing.Sequence[str]] = OMIT, usage_limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddWorkspaceInviteResponseModel]: """ Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- emails : typing.Sequence[str] The email of the customer seat_type : typing.Optional[SeatType] The seat type of the user group_ids : typing.Optional[typing.Sequence[str]] The group ids of the user usage_limit : typing.Optional[int] Monthly credit usage limit for the invitee. Omit or set to null for no custom cap. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[AddWorkspaceInviteResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/invites/add-bulk", method="POST", json={ "emails": emails, "seat_type": seat_type, "group_ids": group_ids, "usage_limit": usage_limit, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( AddWorkspaceInviteResponseModel, construct_type( type_=AddWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def delete( self, *, email: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[DeleteWorkspaceInviteResponseModel]: """ Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace members with the WORKSPACE_MEMBERS_INVITE permission. Parameters ---------- email : str The email of the customer request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[DeleteWorkspaceInviteResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/invites", method="DELETE", json={ "email": email, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( DeleteWorkspaceInviteResponseModel, construct_type( type_=DeleteWorkspaceInviteResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/members/000077500000000000000000000000001523660243400261715ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/members/__init__.py000066400000000000000000000001251523660243400303000ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/members/client.py000066400000000000000000000154071523660243400300300ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.seat_type import SeatType from ...types.update_workspace_member_response_model import UpdateWorkspaceMemberResponseModel from ...types.workspace_member_response_model import WorkspaceMemberResponseModel from .raw_client import AsyncRawMembersClient, RawMembersClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class MembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMembersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawMembersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawMembersClient """ return self._raw_client def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[WorkspaceMemberResponseModel]: """ Gets a list of all members of the workspace, including locked members. Service accounts are excluded. Requires the workspace_members_read permission. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[WorkspaceMemberResponseModel] Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.members.list() """ _response = self._raw_client.list(request_options=request_options) return _response.data def update( self, *, email: str, is_locked: typing.Optional[bool] = OMIT, workspace_role: typing.Optional[SeatType] = OMIT, workspace_seat_type: typing.Optional[SeatType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdateWorkspaceMemberResponseModel: """ Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. Parameters ---------- email : str Email of the target user. is_locked : typing.Optional[bool] Whether to lock or unlock the user account. workspace_role : typing.Optional[SeatType] The workspace role of the user. This is deprecated, use `workspace_seat_type` instead. workspace_seat_type : typing.Optional[SeatType] The workspace seat type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpdateWorkspaceMemberResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.members.update( email="email", ) """ _response = self._raw_client.update( email=email, is_locked=is_locked, workspace_role=workspace_role, workspace_seat_type=workspace_seat_type, request_options=request_options, ) return _response.data class AsyncMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMembersClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawMembersClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawMembersClient """ return self._raw_client async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[WorkspaceMemberResponseModel]: """ Gets a list of all members of the workspace, including locked members. Service accounts are excluded. Requires the workspace_members_read permission. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.List[WorkspaceMemberResponseModel] Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.members.list() asyncio.run(main()) """ _response = await self._raw_client.list(request_options=request_options) return _response.data async def update( self, *, email: str, is_locked: typing.Optional[bool] = OMIT, workspace_role: typing.Optional[SeatType] = OMIT, workspace_seat_type: typing.Optional[SeatType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdateWorkspaceMemberResponseModel: """ Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. Parameters ---------- email : str Email of the target user. is_locked : typing.Optional[bool] Whether to lock or unlock the user account. workspace_role : typing.Optional[SeatType] The workspace role of the user. This is deprecated, use `workspace_seat_type` instead. workspace_seat_type : typing.Optional[SeatType] The workspace seat type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- UpdateWorkspaceMemberResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.members.update( email="email", ) asyncio.run(main()) """ _response = await self._raw_client.update( email=email, is_locked=is_locked, workspace_role=workspace_role, workspace_seat_type=workspace_seat_type, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/members/raw_client.py000066400000000000000000000271001523660243400306720ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.seat_type import SeatType from ...types.update_workspace_member_response_model import UpdateWorkspaceMemberResponseModel from ...types.workspace_member_response_model import WorkspaceMemberResponseModel from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawMembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.List[WorkspaceMemberResponseModel]]: """ Gets a list of all members of the workspace, including locked members. Service accounts are excluded. Requires the workspace_members_read permission. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.List[WorkspaceMemberResponseModel]] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/members", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[WorkspaceMemberResponseModel], construct_type( type_=typing.List[WorkspaceMemberResponseModel], # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def update( self, *, email: str, is_locked: typing.Optional[bool] = OMIT, workspace_role: typing.Optional[SeatType] = OMIT, workspace_seat_type: typing.Optional[SeatType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateWorkspaceMemberResponseModel]: """ Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. Parameters ---------- email : str Email of the target user. is_locked : typing.Optional[bool] Whether to lock or unlock the user account. workspace_role : typing.Optional[SeatType] The workspace role of the user. This is deprecated, use `workspace_seat_type` instead. workspace_seat_type : typing.Optional[SeatType] The workspace seat type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[UpdateWorkspaceMemberResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/members", method="POST", json={ "email": email, "is_locked": is_locked, "workspace_role": workspace_role, "workspace_seat_type": workspace_seat_type, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpdateWorkspaceMemberResponseModel, construct_type( type_=UpdateWorkspaceMemberResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.List[WorkspaceMemberResponseModel]]: """ Gets a list of all members of the workspace, including locked members. Service accounts are excluded. Requires the workspace_members_read permission. Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.List[WorkspaceMemberResponseModel]] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/members", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( typing.List[WorkspaceMemberResponseModel], construct_type( type_=typing.List[WorkspaceMemberResponseModel], # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update( self, *, email: str, is_locked: typing.Optional[bool] = OMIT, workspace_role: typing.Optional[SeatType] = OMIT, workspace_seat_type: typing.Optional[SeatType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateWorkspaceMemberResponseModel]: """ Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. Parameters ---------- email : str Email of the target user. is_locked : typing.Optional[bool] Whether to lock or unlock the user account. workspace_role : typing.Optional[SeatType] The workspace role of the user. This is deprecated, use `workspace_seat_type` instead. workspace_seat_type : typing.Optional[SeatType] The workspace seat type request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[UpdateWorkspaceMemberResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/members", method="POST", json={ "email": email, "is_locked": is_locked, "workspace_role": workspace_role, "workspace_seat_type": workspace_seat_type, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( UpdateWorkspaceMemberResponseModel, construct_type( type_=UpdateWorkspaceMemberResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/raw_client.py000066400000000000000000000160441523660243400272450ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.request_options import RequestOptions from ..core.unchecked_base_model import construct_type from ..errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawWorkspaceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def set_third_party_disabling_policy( self, *, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Set the workspace-wide Third-Party Disabling policy. When set, it forces, for every API key in the workspace, whether the holder of a key (potentially a third party who found it) may disable it via the self-disable endpoint or when it leaks publicly — overriding each key's own setting. Pass `true` to allow it for all keys, `false` to forbid it for all keys, or `null` to clear the override so per-key values and the plan default apply again. Workspace admins only. Parameters ---------- third_party_disable_allowed : typing.Optional[bool] `true` forces every key in the workspace to be disable-able by its holder; `false` forbids it for every key; `null` clears the override (per-key values and the plan default apply). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspaces/api-keys/third-party-disabling", method="POST", json={ "third_party_disable_allowed": third_party_disable_allowed, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawWorkspaceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def set_third_party_disabling_policy( self, *, third_party_disable_allowed: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Set the workspace-wide Third-Party Disabling policy. When set, it forces, for every API key in the workspace, whether the holder of a key (potentially a third party who found it) may disable it via the self-disable endpoint or when it leaks publicly — overriding each key's own setting. Pass `true` to allow it for all keys, `false` to forbid it for all keys, or `null` to clear the override so per-key values and the plan default apply again. Workspace admins only. Parameters ---------- third_party_disable_allowed : typing.Optional[bool] `true` forces every key in the workspace to be disable-able by its holder; `false` forbids it for every key; `null` clears the override (per-key values and the plan default apply). request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspaces/api-keys/third-party-disabling", method="POST", json={ "third_party_disable_allowed": third_party_disable_allowed, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/000077500000000000000000000000001523660243400265515ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/__init__.py000066400000000000000000000023211523660243400306600ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole _dynamic_imports: typing.Dict[str, str] = { "BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole": ".types" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/client.py000066400000000000000000000357611523660243400304150ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.resource_metadata_response_model import ResourceMetadataResponseModel from ...types.workspace_resource_type import WorkspaceResourceType from .raw_client import AsyncRawResourcesClient, RawResourcesClient from .types.body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role import ( BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class ResourcesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawResourcesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawResourcesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawResourcesClient """ return self._raw_client def get( self, resource_id: str, *, resource_type: WorkspaceResourceType, request_options: typing.Optional[RequestOptions] = None, ) -> ResourceMetadataResponseModel: """ Gets the metadata of a resource by ID. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ResourceMetadataResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.resources.get( resource_id="resource_id", resource_type="voice", ) """ _response = self._raw_client.get(resource_id, resource_type=resource_type, request_options=request_options) return _response.data def share( self, resource_id: str, *, role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Grants a role (one of 'admin', 'editor', 'commenter', or 'viewer') on a workspace resource to a user, group, or workspace (service account) API key. This overrides any existing role the target has on the resource. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be shared with the service account associated with that key. You must have admin access to the resource to share it. Parameters ---------- resource_id : str The ID of the target resource. role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole Role to grant to the target: one of 'admin', 'editor', 'commenter', or 'viewer'. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.resources.share( resource_id="resource_id", role="admin", resource_type="voice", ) """ _response = self._raw_client.share( resource_id, role=role, resource_type=resource_type, user_email=user_email, group_id=group_id, workspace_api_key_id=workspace_api_key_id, request_options=request_options, ) return _response.data def unshare( self, resource_id: str, *, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Removes any existing role on a workspace resource from a user, group, or workspace (service account) API key. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be unshared from the service account associated with that key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.resources.unshare( resource_id="resource_id", resource_type="voice", ) """ _response = self._raw_client.unshare( resource_id, resource_type=resource_type, user_email=user_email, group_id=group_id, workspace_api_key_id=workspace_api_key_id, request_options=request_options, ) return _response.data class AsyncResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawResourcesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawResourcesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawResourcesClient """ return self._raw_client async def get( self, resource_id: str, *, resource_type: WorkspaceResourceType, request_options: typing.Optional[RequestOptions] = None, ) -> ResourceMetadataResponseModel: """ Gets the metadata of a resource by ID. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- ResourceMetadataResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.resources.get( resource_id="resource_id", resource_type="voice", ) asyncio.run(main()) """ _response = await self._raw_client.get( resource_id, resource_type=resource_type, request_options=request_options ) return _response.data async def share( self, resource_id: str, *, role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Grants a role (one of 'admin', 'editor', 'commenter', or 'viewer') on a workspace resource to a user, group, or workspace (service account) API key. This overrides any existing role the target has on the resource. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be shared with the service account associated with that key. You must have admin access to the resource to share it. Parameters ---------- resource_id : str The ID of the target resource. role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole Role to grant to the target: one of 'admin', 'editor', 'commenter', or 'viewer'. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.resources.share( resource_id="resource_id", role="admin", resource_type="voice", ) asyncio.run(main()) """ _response = await self._raw_client.share( resource_id, role=role, resource_type=resource_type, user_email=user_email, group_id=group_id, workspace_api_key_id=workspace_api_key_id, request_options=request_options, ) return _response.data async def unshare( self, resource_id: str, *, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Removes any existing role on a workspace resource from a user, group, or workspace (service account) API key. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be unshared from the service account associated with that key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.resources.unshare( resource_id="resource_id", resource_type="voice", ) asyncio.run(main()) """ _response = await self._raw_client.unshare( resource_id, resource_type=resource_type, user_email=user_email, group_id=group_id, workspace_api_key_id=workspace_api_key_id, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/raw_client.py000066400000000000000000000550471523660243400312650ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.jsonable_encoder import jsonable_encoder from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.resource_metadata_response_model import ResourceMetadataResponseModel from ...types.workspace_resource_type import WorkspaceResourceType from .types.body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role import ( BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawResourcesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get( self, resource_id: str, *, resource_type: WorkspaceResourceType, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ResourceMetadataResponseModel]: """ Gets the metadata of a resource by ID. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[ResourceMetadataResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}", method="GET", params={ "resource_type": resource_type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ResourceMetadataResponseModel, construct_type( type_=ResourceMetadataResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def share( self, resource_id: str, *, role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Grants a role (one of 'admin', 'editor', 'commenter', or 'viewer') on a workspace resource to a user, group, or workspace (service account) API key. This overrides any existing role the target has on the resource. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be shared with the service account associated with that key. You must have admin access to the resource to share it. Parameters ---------- resource_id : str The ID of the target resource. role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole Role to grant to the target: one of 'admin', 'editor', 'commenter', or 'viewer'. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}/share", method="POST", json={ "role": role, "resource_type": resource_type, "user_email": user_email, "group_id": group_id, "workspace_api_key_id": workspace_api_key_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def unshare( self, resource_id: str, *, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ Removes any existing role on a workspace resource from a user, group, or workspace (service account) API key. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be unshared from the service account associated with that key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}/unshare", method="POST", json={ "resource_type": resource_type, "user_email": user_email, "group_id": group_id, "workspace_api_key_id": workspace_api_key_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get( self, resource_id: str, *, resource_type: WorkspaceResourceType, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ResourceMetadataResponseModel]: """ Gets the metadata of a resource by ID. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[ResourceMetadataResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}", method="GET", params={ "resource_type": resource_type, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( ResourceMetadataResponseModel, construct_type( type_=ResourceMetadataResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def share( self, resource_id: str, *, role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Grants a role (one of 'admin', 'editor', 'commenter', or 'viewer') on a workspace resource to a user, group, or workspace (service account) API key. This overrides any existing role the target has on the resource. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be shared with the service account associated with that key. You must have admin access to the resource to share it. Parameters ---------- resource_id : str The ID of the target resource. role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole Role to grant to the target: one of 'admin', 'editor', 'commenter', or 'viewer'. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}/share", method="POST", json={ "role": role, "resource_type": resource_type, "user_email": user_email, "group_id": group_id, "workspace_api_key_id": workspace_api_key_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def unshare( self, resource_id: str, *, resource_type: WorkspaceResourceType, user_email: typing.Optional[str] = OMIT, group_id: typing.Optional[str] = OMIT, workspace_api_key_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ Removes any existing role on a workspace resource from a user, group, or workspace (service account) API key. To target a user or service account, pass only the user email; the user must be in your workspace. To target a group, pass only the group id. To target a workspace (service account) API key, pass the api key id; the resource will be unshared from the service account associated with that key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. Parameters ---------- resource_id : str The ID of the target resource. resource_type : WorkspaceResourceType Resource type of the target resource. user_email : typing.Optional[str] The email of the user or service account. group_id : typing.Optional[str] The ID of the target group. Use 'default' to set the resource's baseline role — every workspace member receives this role unless they hold a higher one through a direct user grant, group membership, or workspace (service account) API key. workspace_api_key_id : typing.Optional[str] The ID of the target workspace (service account) API key. This is not the API key string itself that you pass in the header for authentication — it is the key's ID, which workspace admins can find under Developers → Service Accounts. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( f"v1/workspace/resources/{jsonable_encoder(resource_id)}/unshare", method="POST", json={ "resource_type": resource_type, "user_email": user_email, "group_id": group_id, "workspace_api_key_id": workspace_api_key_id, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/types/000077500000000000000000000000001523660243400277155ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/types/__init__.py000066400000000000000000000025721523660243400320340ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role import ( BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole, ) _dynamic_imports: typing.Dict[str, str] = { "BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole": ".body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole"] body_share_workspace_resource_v_1_workspace_resources_resource_id_share_post_role.py000066400000000000000000000003611523660243400510640ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/resources/types# This file was auto-generated by Fern from our API Definition. import typing BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole = typing.Union[ typing.Literal["admin", "editor", "commenter", "viewer"], typing.Any ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/000077500000000000000000000000001523660243400256435ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/__init__.py000066400000000000000000000023731523660243400277610ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .types import BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem _dynamic_imports: typing.Dict[str, str] = { "BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem": ".types" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/client.py000066400000000000000000000172361523660243400275040ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.column_filter import ColumnFilter from ...types.workspace_analytics_query_response_model import WorkspaceAnalyticsQueryResponseModel from .raw_client import AsyncRawUsageClient, RawUsageClient from .types.body_get_workspace_usage_v_1_workspace_analytics_query_usage_by_product_over_time_post_group_by_item import ( BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem, ) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class UsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawUsageClient """ return self._raw_client def get_usage_by_product_over_time( self, *, start_time: int, end_time: int, interval_seconds: typing.Optional[int] = OMIT, group_by: typing.Optional[ typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem] ] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, time_zone: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAnalyticsQueryResponseModel: """ Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : int Start of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. end_time : int End of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. interval_seconds : typing.Optional[int] Bucket size in seconds. Each row in the response covers this many seconds of the selected time range. For example, pass 3600 for hourly buckets or 86400 for daily buckets. Whether `time_zone` shifts bucket boundaries depends on this value: whole-day multiples (e.g. 86400) align to local midnight; whole-hour multiples up to 24 hours (e.g. 3600, 14400) align to local hour boundaries from midnight; sub-hour values and other sizes remain UTC-anchored regardless of `time_zone`. group_by : typing.Optional[typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem]] filters : typing.Optional[typing.Sequence[ColumnFilter]] time_zone : typing.Optional[str] IANA time zone identifier (e.g. 'America/New_York', 'Europe/London', 'UTC') used to align bucket boundaries for eligible `interval_seconds` values. Whole-day multiples start at local midnight; whole-hour multiples up to 24 hours align to local hour boundaries from midnight. Sub-hour intervals and other bucket sizes remain UTC-anchored regardless of this setting. Defaults to UTC. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAnalyticsQueryResponseModel Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspace.usage.get_usage_by_product_over_time( start_time=1, end_time=1, ) """ _response = self._raw_client.get_usage_by_product_over_time( start_time=start_time, end_time=end_time, interval_seconds=interval_seconds, group_by=group_by, filters=filters, time_zone=time_zone, request_options=request_options, ) return _response.data class AsyncUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawUsageClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawUsageClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawUsageClient """ return self._raw_client async def get_usage_by_product_over_time( self, *, start_time: int, end_time: int, interval_seconds: typing.Optional[int] = OMIT, group_by: typing.Optional[ typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem] ] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, time_zone: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> WorkspaceAnalyticsQueryResponseModel: """ Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : int Start of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. end_time : int End of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. interval_seconds : typing.Optional[int] Bucket size in seconds. Each row in the response covers this many seconds of the selected time range. For example, pass 3600 for hourly buckets or 86400 for daily buckets. Whether `time_zone` shifts bucket boundaries depends on this value: whole-day multiples (e.g. 86400) align to local midnight; whole-hour multiples up to 24 hours (e.g. 3600, 14400) align to local hour boundaries from midnight; sub-hour values and other sizes remain UTC-anchored regardless of `time_zone`. group_by : typing.Optional[typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem]] filters : typing.Optional[typing.Sequence[ColumnFilter]] time_zone : typing.Optional[str] IANA time zone identifier (e.g. 'America/New_York', 'Europe/London', 'UTC') used to align bucket boundaries for eligible `interval_seconds` values. Whole-day multiples start at local midnight; whole-hour multiples up to 24 hours align to local hour boundaries from midnight. Sub-hour intervals and other bucket sizes remain UTC-anchored regardless of this setting. Defaults to UTC. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- WorkspaceAnalyticsQueryResponseModel Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspace.usage.get_usage_by_product_over_time( start_time=1, end_time=1, ) asyncio.run(main()) """ _response = await self._raw_client.get_usage_by_product_over_time( start_time=start_time, end_time=end_time, interval_seconds=interval_seconds, group_by=group_by, filters=filters, time_zone=time_zone, request_options=request_options, ) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/raw_client.py000066400000000000000000000245401523660243400303510ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.column_filter import ColumnFilter from ...types.workspace_analytics_query_response_model import WorkspaceAnalyticsQueryResponseModel from .types.body_get_workspace_usage_v_1_workspace_analytics_query_usage_by_product_over_time_post_group_by_item import ( BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem, ) from pydantic import ValidationError # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class RawUsageClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_usage_by_product_over_time( self, *, start_time: int, end_time: int, interval_seconds: typing.Optional[int] = OMIT, group_by: typing.Optional[ typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem] ] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, time_zone: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[WorkspaceAnalyticsQueryResponseModel]: """ Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : int Start of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. end_time : int End of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. interval_seconds : typing.Optional[int] Bucket size in seconds. Each row in the response covers this many seconds of the selected time range. For example, pass 3600 for hourly buckets or 86400 for daily buckets. Whether `time_zone` shifts bucket boundaries depends on this value: whole-day multiples (e.g. 86400) align to local midnight; whole-hour multiples up to 24 hours (e.g. 3600, 14400) align to local hour boundaries from midnight; sub-hour values and other sizes remain UTC-anchored regardless of `time_zone`. group_by : typing.Optional[typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem]] filters : typing.Optional[typing.Sequence[ColumnFilter]] time_zone : typing.Optional[str] IANA time zone identifier (e.g. 'America/New_York', 'Europe/London', 'UTC') used to align bucket boundaries for eligible `interval_seconds` values. Whole-day multiples start at local midnight; whole-hour multiples up to 24 hours align to local hour boundaries from midnight. Sub-hour intervals and other bucket sizes remain UTC-anchored regardless of this setting. Defaults to UTC. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[WorkspaceAnalyticsQueryResponseModel] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspace/analytics/query/usage-by-product-over-time", method="POST", json={ "start_time": start_time, "end_time": end_time, "interval_seconds": interval_seconds, "group_by": group_by, "filters": convert_and_respect_annotation_metadata( object_=filters, annotation=typing.Sequence[ColumnFilter], direction="write" ), "time_zone": time_zone, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAnalyticsQueryResponseModel, construct_type( type_=WorkspaceAnalyticsQueryResponseModel, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawUsageClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_usage_by_product_over_time( self, *, start_time: int, end_time: int, interval_seconds: typing.Optional[int] = OMIT, group_by: typing.Optional[ typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem] ] = OMIT, filters: typing.Optional[typing.Sequence[ColumnFilter]] = OMIT, time_zone: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[WorkspaceAnalyticsQueryResponseModel]: """ Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows. Parameters ---------- start_time : int Start of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. end_time : int End of the time range as a Unix timestamp in milliseconds. Must be at least 2020-01-01. interval_seconds : typing.Optional[int] Bucket size in seconds. Each row in the response covers this many seconds of the selected time range. For example, pass 3600 for hourly buckets or 86400 for daily buckets. Whether `time_zone` shifts bucket boundaries depends on this value: whole-day multiples (e.g. 86400) align to local midnight; whole-hour multiples up to 24 hours (e.g. 3600, 14400) align to local hour boundaries from midnight; sub-hour values and other sizes remain UTC-anchored regardless of `time_zone`. group_by : typing.Optional[typing.Sequence[BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem]] filters : typing.Optional[typing.Sequence[ColumnFilter]] time_zone : typing.Optional[str] IANA time zone identifier (e.g. 'America/New_York', 'Europe/London', 'UTC') used to align bucket boundaries for eligible `interval_seconds` values. Whole-day multiples start at local midnight; whole-hour multiples up to 24 hours align to local hour boundaries from midnight. Sub-hour intervals and other bucket sizes remain UTC-anchored regardless of this setting. Defaults to UTC. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[WorkspaceAnalyticsQueryResponseModel] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspace/analytics/query/usage-by-product-over-time", method="POST", json={ "start_time": start_time, "end_time": end_time, "interval_seconds": interval_seconds, "group_by": group_by, "filters": convert_and_respect_annotation_metadata( object_=filters, annotation=typing.Sequence[ColumnFilter], direction="write" ), "time_zone": time_zone, }, headers={ "content-type": "application/json", }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( WorkspaceAnalyticsQueryResponseModel, construct_type( type_=WorkspaceAnalyticsQueryResponseModel, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/types/000077500000000000000000000000001523660243400270075ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/types/__init__.py000066400000000000000000000027121523660243400311220ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from .body_get_workspace_usage_v_1_workspace_analytics_query_usage_by_product_over_time_post_group_by_item import ( BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem, ) _dynamic_imports: typing.Dict[str, str] = { "BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem": ".body_get_workspace_usage_v_1_workspace_analytics_query_usage_by_product_over_time_post_group_by_item" } def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem"] 83f1d4657a87cc3ccae666aa633d4800c6496021.paxheader00006660000000000000000000000273152366024340020361xustar00rootroot00000000000000187 path=elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspace/usage/types/body_get_workspace_usage_v_1_workspace_analytics_query_usage_by_product_over_time_post_group_by_item.py 83f1d4657a87cc3ccae666aa633d4800c6496021.data000066400000000000000000000011741523660243400172200ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing BodyGetWorkspaceUsageV1WorkspaceAnalyticsQueryUsageByProductOverTimePostGroupByItem = typing.Union[ typing.Literal[ "product_type", "model", "voice_id", "user_id", "fiat_currency", "fiat_charge_type", "region", "reporting_workspace_id", "request_source", "resource_id", "subresource_id", "request_queue_type", "voice_multiplier", "hashed_xi_api_key", "billing_group_id", "surface", "actor", ], typing.Any, ] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/000077500000000000000000000000001523660243400247225ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/__init__.py000066400000000000000000000020221523660243400270270ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file import typing from importlib import import_module if typing.TYPE_CHECKING: from . import api_keys _dynamic_imports: typing.Dict[str, str] = {"api_keys": ".api_keys"} def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) if module_name is None: raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") try: module = import_module(module_name, __package__) if module_name == f".{attr_name}": return module else: return getattr(module, attr_name) except ImportError as e: raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e except AttributeError as e: raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e def __dir__(): lazy_attrs = list(_dynamic_imports.keys()) return sorted(lazy_attrs) __all__ = ["api_keys"] elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/api_keys/000077500000000000000000000000001523660243400265265ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/api_keys/__init__.py000066400000000000000000000001251523660243400306350ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. # isort: skip_file elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/api_keys/client.py000066400000000000000000000065751523660243400303730ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from .raw_client import AsyncRawApiKeysClient, RawApiKeysClient class ApiKeysClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawApiKeysClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawApiKeysClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawApiKeysClient """ return self._raw_client def disable(self, *, api_key_name: str, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Disable the API key used to authenticate this request. Requires the query parameter `api_key_name=self` as an explicit confirmation. Parameters ---------- api_key_name : str Must be set to `self` to disable the API key used to authenticate this request. Required as an explicit confirmation to avoid accidentally disabling the wrong key. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) client.workspaces.api_keys.disable( api_key_name="self", ) """ _response = self._raw_client.disable(api_key_name=api_key_name, request_options=request_options) return _response.data class AsyncApiKeysClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawApiKeysClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawApiKeysClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawApiKeysClient """ return self._raw_client async def disable( self, *, api_key_name: str, request_options: typing.Optional[RequestOptions] = None ) -> typing.Any: """ Disable the API key used to authenticate this request. Requires the query parameter `api_key_name=self` as an explicit confirmation. Parameters ---------- api_key_name : str Must be set to `self` to disable the API key used to authenticate this request. Required as an explicit confirmation to avoid accidentally disabling the wrong key. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- typing.Any Successful Response Examples -------- import asyncio from elevenlabs import AsyncElevenLabs client = AsyncElevenLabs( api_key="YOUR_API_KEY", ) async def main() -> None: await client.workspaces.api_keys.disable( api_key_name="self", ) asyncio.run(main()) """ _response = await self._raw_client.disable(api_key_name=api_key_name, request_options=request_options) return _response.data elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/api_keys/raw_client.py000066400000000000000000000133321523660243400312310ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type from ...errors.unprocessable_entity_error import UnprocessableEntityError from pydantic import ValidationError class RawApiKeysClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def disable( self, *, api_key_name: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.Any]: """ Disable the API key used to authenticate this request. Requires the query parameter `api_key_name=self` as an explicit confirmation. Parameters ---------- api_key_name : str Must be set to `self` to disable the API key used to authenticate this request. Required as an explicit confirmation to avoid accidentally disabling the wrong key. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[typing.Any] Successful Response """ _response = self._client_wrapper.httpx_client.request( "v1/workspaces/api-keys/disable", method="POST", params={ "api_key_name": api_key_name, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) class AsyncRawApiKeysClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def disable( self, *, api_key_name: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.Any]: """ Disable the API key used to authenticate this request. Requires the query parameter `api_key_name=self` as an explicit confirmation. Parameters ---------- api_key_name : str Must be set to `self` to disable the API key used to authenticate this request. Required as an explicit confirmation to avoid accidentally disabling the wrong key. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[typing.Any] Successful Response """ _response = await self._client_wrapper.httpx_client.request( "v1/workspaces/api-keys/disable", method="POST", params={ "api_key_name": api_key_name, }, request_options=request_options, ) try: if _response is None or not _response.text.strip(): return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), body=typing.cast( typing.Any, construct_type( type_=typing.Any, # type: ignore object_=_response.json(), ), ), ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) except ValidationError as e: raise ParsingError( status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/client.py000066400000000000000000000036771523660243400265670ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from __future__ import annotations import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .raw_client import AsyncRawWorkspacesClient, RawWorkspacesClient if typing.TYPE_CHECKING: from .api_keys.client import ApiKeysClient, AsyncApiKeysClient class WorkspacesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWorkspacesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._api_keys: typing.Optional[ApiKeysClient] = None @property def with_raw_response(self) -> RawWorkspacesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- RawWorkspacesClient """ return self._raw_client @property def api_keys(self): if self._api_keys is None: from .api_keys.client import ApiKeysClient # noqa: E402 self._api_keys = ApiKeysClient(client_wrapper=self._client_wrapper) return self._api_keys class AsyncWorkspacesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWorkspacesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._api_keys: typing.Optional[AsyncApiKeysClient] = None @property def with_raw_response(self) -> AsyncRawWorkspacesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- AsyncRawWorkspacesClient """ return self._raw_client @property def api_keys(self): if self._api_keys is None: from .api_keys.client import AsyncApiKeysClient # noqa: E402 self._api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper) return self._api_keys elevenlabs-elevenlabs-python-b6e5614/src/elevenlabs/workspaces/raw_client.py000066400000000000000000000006411523660243400274240ustar00rootroot00000000000000# This file was auto-generated by Fern from our API Definition. from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper class RawWorkspacesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper class AsyncRawWorkspacesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper elevenlabs-elevenlabs-python-b6e5614/tests/000077500000000000000000000000001523660243400207745ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/tests/__init__.py000066400000000000000000000000001523660243400230730ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/tests/e2e_test_convai.py000066400000000000000000000044361523660243400244260ustar00rootroot00000000000000import os import time import asyncio import pytest from elevenlabs import ElevenLabs from elevenlabs.conversational_ai.conversation import Conversation, ClientTools from elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterface @pytest.mark.skipif(os.getenv("CI") == "true", reason="Skip live conversation test in CI environment") def test_live_conversation(): """Test a live conversation with actual audio I/O""" api_key = os.getenv("ELEVENLABS_API_KEY") if not api_key: raise ValueError("ELEVENLABS_API_KEY environment variable missing.") agent_id = os.getenv("AGENT_ID") if not api_key or not agent_id: raise ValueError("AGENT_ID environment variable missing.") client = ElevenLabs(api_key=api_key) # Create conversation handlers def on_agent_response(text: str): print(f"Agent: {text}") def on_user_transcript(text: str): print(f"You: {text}") def on_latency(ms: int): print(f"Latency: {ms}ms") # Initialize client tools client_tools = ClientTools() def test(parameters): print("Sync tool called with parameters:", parameters) return "Tool called successfully" async def test_async(parameters): # Simulate some async work await asyncio.sleep(10) print("Async tool called with parameters:", parameters) return "Tool called successfully" client_tools.register("test", test) client_tools.register("test_async", test_async, is_async=True) # Initialize conversation conversation = Conversation( client=client, agent_id=agent_id, requires_auth=False, audio_interface=DefaultAudioInterface(), callback_agent_response=on_agent_response, callback_user_transcript=on_user_transcript, callback_latency_measurement=on_latency, client_tools=client_tools, ) # Start the conversation conversation.start_session() # Let it run for 100 seconds time.sleep(100) # End the conversation conversation.end_session() conversation.wait_for_session_end() # Get the conversation ID for reference conversation_id = conversation._conversation_id print(f"Conversation ID: {conversation_id}") if __name__ == "__main__": test_live_conversation() elevenlabs-elevenlabs-python-b6e5614/tests/fixtures/000077500000000000000000000000001523660243400226455ustar00rootroot00000000000000elevenlabs-elevenlabs-python-b6e5614/tests/fixtures/voice_sample.mp3000066400000000000000000000607201523660243400257410ustar00rootroot00000000000000ftypM4A M4A isommp42mdat\ZÐ"¯2(=úýÜH’Ls¥Þxjv›¶»WLDKþ’òd`T†­ÄN] 9É!_L‡ÿ1"ÓŒN”ÂJ1 x2ë¹ÖÉ=^Øžv ІÿA•oËãÉN ·ÈR5G' uý‚r¯#÷œeõB-bl¨NÜb ÄØe¤Ü¹=¾¨•YD6;òªäãfÉë´£¨…Ì! ç&ÉøZ“ ¡ñxD�Ëðˆb†�°s¸6ñ“Ç?‡ývÝ‚Ñ_ÊÞ²ˆÝ,û‘,ƒ­Û*“ãE§¦Kú»€=ZMWïëݤ§ºj!À6¢·-…‚uzÛÉY‘å^´¿„®.u¡�‹I_YsÈ „‰R�Y5m$^�Nl‹Ni© N dÊ<)ÏÔ CsªÝC5‹’ʧR8RgLÒÏì‹ÜN¸lÅeøŽàòm›4-‘´¦1sdÚ“õn£f˜«¡__õÖkµ��ØÕõïŸoUYt~êÚ{<Õˆ2°·Å3ù4ÜÉ¿?£/޹9" ΫY�:.í êÕ¾G�‰"Ýk�ɵƒÞx•óß? íÐ>°£hJw¢>›¼OMjƒÏþ„*á¿{mÍýU.›Ô³æ/åÅo¡-�éè¯øsFpÌ{ÿCÓ™ò)u†Ï7~Æ_áôæÕÉRvÚ˘¤R9°2Ý…7H"fß[¾!$c%ñ¦ñöyêã×AÇ÷à�qy#žñÖôøws*;6ý~-�ôÿëþµç»/Œ¶giÜÕ Ååï0UõØ}ËsÏ×­åmô6³*bÖ£-ã‰~Ÿø:¿KãÖZÖ6®× èoo‰ØëåÀä³Ê”ƒAÀåuŠï£kµ¼¡Î�Nã'‚¯ÉãÙíèÉÎV”ñÒ0üubû¨û‡º��µUy126[•_ËÞG«üÿ=ÊÑòU\~Õ]Mu]^²í“Ò'Iôº6©y¶ŸÓvÈy÷~Q‰ã^œÕ×.9ŧ1Œõ|éÙ´ì­æ>Oü{:Ê¿.ÿSe/* ¨­]¨‹F£N*™¨²P‰"@‰@N ÎQš¼——�ðoë®›‘1½„ï"y9�näjANŽí›‡Ãïúòž*(Þ³˜Î ÊÅh\y}_ÇAÛ‡ÌfZû‹¡ƒgXÆ  ÞN՜աfàÅ®ñq¹CÆ Î­hMk¢y9‘�šœ¢ŽÄ�“›,¯ÛJçA$æs"ídÛn—Ó¼ºÝÿE"½°‹›T¼hל){]PÀ, ¬r#œg!ˆÀEèÔsmµnF- h˜'úÉ�! &òJ“&¶&G“�ةӚ§G’ö"?¿ðs&.h2›â†}2œkvÖ’ô¶‘¡òxÍ ›pS´=‘³fèxdõÛ\NÐË+h¬ÉJCªpK.ÅÂsê Q¼ÔZ¤fxK™<³¼ª;¨–ï‘�;‹MPÒkÚ.ŽcJzS‰»æå®É(/̫ˆ*­Ð¤8¸.ô”JR$gÒ¹€íPÇNë&ÐI ÷c-�’ÜdåT'=ù8&àˆaiZ‚ʇ¢ ¿þßùòa94‹uzæhi‡Ñ”ïôþ/ ÞÜw—Ä›ó!O.ÞEF$I¥0 ºo�gP^õ¥DÉpV{R¾%‰ÐúžHç�E²–´v`î«·ðŸ#æ0SŽ÷ãI®u¤´ q�þP—d©$¼Õ�QAY*†Û°3i‹[«´—]…èC‰F´'�aËBD~ëÖî1¼/›IDRNU:®´D „À°ˆ"$ „“Üh¹­5ßÌ~]B©2(�m‹¤9¢²œBÕ,äKãôyæ5�çq°ÄéD±Åü˜VMNíº%�Š}.þ�bR5FE`©,¢æÊ9Q‰¬ro ¶þú„î¢Q”BÆ0†/ FpIÔ¹SF ×ãÓ“Ÿ›e“š©1zc-Á)âž�"Ñ?ïÍg€à™Ü8ômo1ŸØ¸Ì,�‚ÏêÂÌÏKÝ}A”eÒWžÜ�{Ž2®X‰‰öüUÔv¸dKÌC¡T—Ç–šá’—‡sSbiU*Õg+¢~ÏoV„gÅÝÕ‚"H"u4Ã’”RB‰ #¢©Ëdˆ§bºEŠ,#š‚ÐÅæY¹°Ö‚Td_°¹•³¼5- ÎC—gYñ>¿€)�éà5Óˆ¦~Ö�v|ÀB3ÌŸ=͔ǡ͓ÏPúyNw*X~±¾Èà>W­�Z-’b¢X`F…ƒA�(@LåÈ�[¿6d”ûÞ}w êë¬äÕHq ‰§e�˜"‰O7`¡î´èËoÀçòfI€‘g«ÜDP †W ,Cldp¿íÛ::ÈÌNλÏfá(îÌD\Ü_ïðµw• Ì~�¦Ýk`b(¡@åó ë.[ýþ_BBo©ÌXÔ Eø3wjéàî9�´ôÖŒ�±�ï÷yø ;0læŽÕ÷¿ªÿáâ 11£dÕ>§f(PÒ5zÁ”�*T»'|x0Òù¶�‚ÿ³\-Òxî÷ÍùE�‘¬�àþÉŸ}UÛ±°¸Ç‡SòU€ã1DÄ�†±Œ •s¯×:ÇðÝÐØQ©?R±jÄ¢ÙPÜŸ–¤@)«æ4d¤–[F™h*_˯ýŒ½�ÿ¢ë¾£zx´AèɆØ:–ænÉKLc!¤7›Vç©^®zy’³û¦Çüv$ç‘d ‡‹ˆvß0:ahª�\öoĵ�ˆÔKŒÌ�¯=—÷¿×áãÝþ?ýö|gíû7]:, ØJŸÚ4d�¡I:ˆ &ІŸo�½qÝÿr±Åtpÿ�¨S[ë<ÞÃÅä~šOÓ{Ž„Œø�'¯›P: 0H¯S ¤¸– à‹H‰ðéäüüüï0«6'wê{ø­`‡&"]/‚±Á€Ê`åGâÉt\%"e®‚%53}r¾V)oŸ|¿ìв«¹RÒ/¸.,¾Ëúz+y÷ßQ䄆\¾m¾4ìN>Ú ©‚�ða<;y:7óÃÒJ$Pá\ò±›­�Bw~SOŠž¥ÂdÎK¦L*ÿïNœTÊ¡¸ˆ`ð‚í:\þÊXJŸþ (œ±"vˆ–üûG4âþ+ñè![‚×{6 ºæYæuâP:Á1lY•Åǹ�lÛȾ2hU=´g¿C.êõ-RÏ#;ßÛ1µ-kßAŸäBlŸVCYJSúÓÑâQÛªâr�uæ¬:ë ëge4âÉÓÜxRélÚ u-ö'Fá�Òëþ }Oÿ¬Ÿ@êSŸ´Â.]nÓ€ö¥T$M‰ÅÓ�|µ.�Õ|'�(³{Õã¨ÑF@KͲ}«ÙæEM“á8꼨ËÊ3² ˜½&!@,f �ˆpJר�IB€PB [’À€�3á|9�V þ –3ßB‘H&ÓS2`…JH®.‹�!<1,–ÃÓ-…c|g¶™x¸Ü±0X�™ìïC…¾ŽEK!›ÙºÇüþ>b„š˜’;Í;W‰þ;§©8,ÝV”¸0z¶‘ Ìï¥g¦©�-Ñ Q€|©(ƒïÃÛ�z€g¸Ÿ&»ˆÍ|T­P4SÂ1“Ù…mÙ|Û�áÃ, Ó�n‹<ˆTw,�JA ÀNÝÒõµ” ½å X«t …q§ñºÜ¸¢ä(…!ãú:Á�ùå€Ë@œ¾îÝ@ö‡¤�ª¥ÔÊ fuùzŒŸþ_-Ö]ßê]o–2>ruqz•b\�k6rôM¢CÌŠJNºÕ?>öÀTë €é ÂY P/TC•p›E²²j�SHEeŽOYJdNÕ$€-ö¤xoïmiúM·(�ùýôóûö”Ó¥îZ6ˆ©D€À>§ "0¥!½A³ñÎzènhyp‘¦©©‹>w¦ ès äüWía7ï?kÌ7÷_7ž#[oK¯˜ÊöoÌUìÏ;Åœ"‡2�žšˆ’øäTž¤ïwJ¹½lH vËôZU�¸Ý9°I¾œ)Zxæ‚lQ®áÆÕFbšQhâ¯òÝùdÉ�ØTéÕ—Y¢˜8˜SÈ`, ìXâ´´^¢ç!<¦‹šäÔž”Y ±Q,]Ê7–Øâ8B¤Œ£3Fƒ2 ÈB ÞwÑÝqˆ,DiÐy ¾3¶}ŽH$g©8Ïøþ:ÀÏïÀñ@:;ªæŸ�ñRÒþuˆ6`8wTafÝÚî>¼x@ %ªI×`ñ›5ÿ*“7Þ¸I1Ö�-bqsfÁäß«ÝÛÍN$j5ñe€šõ§Þj.˜EpIt–“ÿÌ22K®–ûÃLaЊÛ#ÙÁíTzFM=Ä`¾’sH�tT�‰d‰HB Þ#§NÂjÃZu�)Tw+ßñ¡o e‚ñ†×ÿüÙ°=�…1eû‘iqõ)A´«è4œ_F#>b¼oœ”~å„[Ì=Š˜kÂ!é—È`6@N}³Añ³Îä«iêû烗himƒ”€ dn‚Ôg}Y£óÛP]uÙú; ÂiXÁÈöv-êV„ä$qðpB„TQ# EÄ`ˆ‚!6¨$б׉<$�(aÍDirš°luÍñ¿“®…%™|] ð¸;™+{OÍŽòÀ ÞæÇg¡Úòn‰Ià£<‘¨à º8…#³=¸^UŸ/¼¾þZV—µv­)&Umi+ki²œ4ÑD\NW¤æv"˜Šƒ„`&Õì>¬Òõvv,΢‹V ^yϧü£6o�þí¦|Q.iÑFè†W´LXñÄ#4Ù¸ÄCˆµüÜÂ|ÍrmÄË K³è¤5‡ÀÂj–²‡·Ô¤�ÀGä¥y ‚k,üûÿØ_ñ-ÉÞIr(´w’ C�ù�š÷˜_›{7ÄOl>Ulw¢6Iu$x¡LtPµKbUR°€4ŸF F£ÁN ÜS( J­±LÅÑ@/¥¸kÎý[^çG7•½jûôû÷ xk¯žþ7iÛ�äó�‡†ß²×Ðɦ6²™ÖžÐÈnår; +ÉBáG»í'þ»c�,‹ ·Åñ›¹Ù3lÒG÷µÒŽå<Þ$hÔïZt½þŸ,�˽Ê5úaÅ··j(-½é üô[¹þ§(²‡<ÎÎS˜ÇíÏÅè´£&�¥Ö %KlÄ^ m&ò�ñgô2Yï&T9›µÄÓí§ˆŒvtLóQˆ5(‹3ZîH­Ö±Ç¥œàd{5&”šÄ�ùmÎ}|Wçp‹|PÞ�äAt¬§ï(ÖÀ8×�vB@JÁD D>T¯%ÊZà›†òËš]­²Ê>³µI«þצb¹Áì=S¾1‡hà7ºÚG˜lÂë×wb»§šÉyb:_#Q°úVF¸‰5ï #lýÖó¸”iýáŸF™èfxüa| [Û‚Ì@áð{ ,@ Š� .±Hª€<„P”1!„C`�Œb�|ú„�áÕ©p 5s…¢ @¸:¶å©j"¯r,ðYëM8½‰Ü»Ô5†À'`G½�ÿà#.'ó‹�ÓÉ%rc`Ó¤s™‡mĽÌà…üpÂǦ%§æ\ÖE–›œ)_ÅÅ&艛” ”Eè–<]¼7aƒÄ±ŒáÕE²„!aYdZë”À³ |¬D½Üꦎê•B‘Ò-µyåâ/Y< 8>�¢¤pDAÏF²ppÖcÛ¢­Ê‰cë= õ5јoûhf»Ú5úü¬ÿO­É?¢ú%ßüûG–’:€-åšxƒ–0£Þ¬Å{yö³ÿžŸçH}&àS€›‡¯F 6A€óïAEy°ö‡ˆ‘VX°nM]c8fXNʰ(¶¤ÌtißÃNÛ>êF�Q¾cõú¢‘ÀBžF$ ÃAˆH"5�~�e‡˜ét¡Úê]“\C kþR¶ÁúH]ßwád|,OSuý�J¯Fˆ…DH‰œ"!�Q€-ap2¯$‡©ñð+ì‡ç�2‡Õ¶6¬!3�URž@F±øý„é¾Þ²q#è@·îµ…·sr4¤ Œ&­Û&vŒÉ“5‹ÄõÛ™m4�Š|\umÙ0 6:Ì�TÅ·ÔoT\PCö®|œeª1Õ’õRBíæ…¢µb�4!;Í`B”pF*š„€Ï‘�.:D°À³Z:U€ݹþѬ $ßhÈä¨mO›ë*u—;€Ùîæ{,—¶É{}ôX¼ÁÜ”?º 4–ÎËÃñWpªÖ’ÛT W7’$ªe3Uy•�ˆÃuIï›p­Ï/7¾‘YNo€H°šñ¢e2Às¦fíhYÎUíË o£t²ÂH—TLU%‡HW Œ‚[ )@‰MïxÔ-¿¢Æ€±z8Í@Î1Óá0¦cÓ”"E¼õ**|¸ƒñô‘t€t¯Bú†nâd[¥%ß�Êé$²ýG£qòˇ¤OÆX6&h(#[ðº£uÆÉØíYRñ¬Hw®Šw¿ë ¸¥£ý6Gñý÷kW¡T)Ž‚†…3ÊŸ2.³ÿG¦* ø€Zík†j7(fºìÌÛ2ÈÇ…ª @ŸV“Ch˜’I;E#‹ÑdY +ëA5¯¿wÿ‰û”­ükÿGï,sÇ×éñ{1Ûµô6z Ç¥y¢¦$g]õËNÅGiW@ª¦ig¼V?Å`zìxž#‡&ìÓ�€Ð �¶dÇ)q,è:ü%¤7âÅJ ­ÔïOx6ÙHKô|Èû�Μ‹šEëGKi€3›õ Ô¾Šh)Á�íÆÚ¯ ¸$€W°±ùÊ)Ówyéèþ¿…ÑO£å]T‚ᨊ­%„ßÖYžó¸‰±UæsfjŸ=¬Q°D¾ø@1þý[çÉ�­¡Z3LÌ`¡¾ç<× ¬”h� %Úö5§B/2r̶¦�F !6ÿ÷ž8ˆ‹:DA¨Ä w͘=-n¼ˆ¶Þ =8ŠƒínëkáÄZñ¦ã0’;+¨VªÅ*_{W|¿ ¬†�Rã¿´—%n‘3u-Ûfk'쉲—® gš+®PõáÏÇwUlŸ6£ÞŠk‚ÚÍV‹‚YAö×Ř�a‰á†´±ËT2%l~NØrÛwc�2†@QæÅ‹ ¯TðØÆ˜8DŒtYeÂŒî…!® N†ËL4Ŭ–?/ Lh ‚ •p/CxÁ>ãýÍŒDiz?éü9Urxhu>·µg4ÆJôeûK‚ºkã›ÃàAKjõm®Iýõ($C@¾ Æ ß¨Z•û:vxÕ=ÜóÄHÞIJPz³èZÃi?•+ìm†›|>Xiñ•#[Ób4Ÿòðtä£ÖÓí¼g åVêäZlb„°ßò¦O—lÝŸ½áÃ0ã”8 ò¸Ô%âÃÓuG<˜øÿâÚ1Ÿ.•ÒkàvºX��äë¤5à¢_D½~¯ªÎ®GÞè…í¶x½á<^áBà|å%þ¹¨B³’yi ¶¾Ù’³î�ËÄŒÌþgF€ 0ÈbΧ�d7¯Š9û¿z×H•š’î“h®"“èŽhoyý‘ßÄÄSül&E™<Ñ\Íet¦uÅž5íF®jjg"ñËj€€B�tUp™(AÀG¦ZŒàY2µw¦¥‹bËl{<-%¬¾¦Qç Am\W¿º¿WDŒóí`+áØïúEÔwÌç缤ñ xHdô$*�º®²R»]b ANî¬Pá�èbÄ®:5ÊÝV¨µã‹ 5¡“–:ॣ]V '|\âSÅK l'TÎ[XªjÁS q¨b±~Iy;b�—NÀ¸L«qv @W é’0œ †Œ”7} ¸ÃT¾ç4N bÔë$+VwE«Q©š’¨Z\ƒ:8W"“0Êì$$²:…¥|/Q¨YBʬ$®E ð¹ŒÈ–Žþ®åï+ç’ü;’mñúdÛÕ�õãDü¯<�aUØ)5¢î’ÓÓ%Ý5.ÐB�hì®(•ÖŠÎèIšý Õ Ç•++*˜­c’p•Rö €àŸ�{v.:Zñ %•�dY`¶ÿî»Ë·œãó¾¬ðÛ®ž_ëÏá~9j�uÇôp޽s‡sèíò[�gñ¯¥öätú!·é‚}ùÏó¶ [LåA³ ­ög4Ô ,ÔÙ�×­F»o¤5RÏ_ 8üë–¾þ­B™" ã#fD7ÁSwÏ›×»ïŽ5„½­(@R™L¡A_™¯¡P ïnÛ$¾��Øiµ± Ô¹gZÓ<ˆiQ…wY›™göpìÊoAóBYøI’HK«cü›VÔCäg¯†¾®È÷® ·Ü�º`õ¥Ï‰?£Š¶ø\µåÊ7Azjªp@Ÿ~ F(Æ�¢”Z€OÝm’i×ÿôs<µZt9ùš¿¶WÕÏš#MtûTAâÀH%OSøg¾»,-Ž; ¤G6g¯xk’£ŒÜÇÀ·1šClš¿â?j `õCŠÀ£IC+Á)ƒïñôФc'yK}õÿ-9sùb‹,ŽÁ#ÓÚn򯆼XÌF0,H¡@& …±j?{¿?�ðpHŸ®6(†¡ 9(‰¤àZ)ñbÜ\Ö¿í~zºtÙÇÓgN†ªixž8I~9È6ØÑÊ–ärÍ{î¥Fª•”©ƒŸÙX]Î^ Sbþ""ÀDaöÞÞ-s©žÑ‹Øƒ‘œÉ1œÛѰn<ÇM+'àÞÓY%¯¬ˆ<{€pZŸàO¯òX~p±n‹†ŒÒ«»[i~4BSë‰íø‹h4§„L/¸ª&&bry<6‘ø³Ómæ•fØ((ï;Å-DT¾6m†82ŸvÊv, äh)�&h—˜øjÄøó6޳Kþü:F%ý úéGÀ>ÕQÙÖÄ@Al»‹åOhPQu…w <9FaàêC‰)�Z'»Ïs„óUyt`«FPÌ�É )Ë]ºå �iœñÒ¬F´ÅCF¨á‹Ýbw®PL�’ÍP‚Á3†ã#ôý3£KµK+5s´6DØsËèòCäÀ½Œ!oåæ3„¾£� ¤¸L×–$v� ,ÉÕÆ� <:g9ÿ¯þð#z{^kJý_h�éøIôàó-Þð‘Õ^Õ—Ö™Õ¢á…<µ‹º˜‹õ3É`p,˜e‘ˆeÚí`€€™y @2µÚ«ÕGWW(uÕ[цyh�P3é[HJÂùÄ&¯0Û„òd�½ÇLèÏÍ$dÍd'·­m[¦­ef"®Èyâ*~w<øc~w‡×ízå½â ½Æ.W„tZm·)WŠôÚ½õBŒ£e(G•ªØ¤IÕ»£�!T’–‰ &8(’dÑhÈ]ÂÂÀ0€(pZ¨w?´jºÍL�[¥%•5\ ž„Ío£‘xkm�@‰¥7/H„U-ò�$LU]GÄêP¯àK?Ex+�¥õ‡ûÁ÷©rj$FëCß�F(ÈP�N -�kˆ-Ä]*Ó+ V…ÔôÆ÷>”U ¡VTSùÅ¢2ÇH#wXBËà&™%Qx©h €À¥Â¤ÂJÝ!Þ%¦¸im{kjÊ:¸×÷ÿ.ç?Ç¥0ý=±WŠ»üYMÕO¨f+@4*ÀÊ®ÃR��Œ*4ìNQ± 4…tqÂôº{bè«ýË(!щ‹V ˆŠú¸ñ—ÁiÓò„’^u'„¶£0 Qò"N®êܧè“ÅYBE¨¡¾*˜ää (NAÁ¡¡ „Bd¬²ÂBX3å““vW�D €3ÊÏUA$¼10š’Pe “R4!]‡vI±AßA˜ÌDkT ,M&Ø |ôÜF¥qF@'”übð­�jOÞ‹`²Å˜×�Ô»JË£öeÛ²ˆºJPJ¼‰_%V½îý�cbê�ñ#(+[°`Ÿ&™ÈÒ@�%ÃF‚ nà"%›Õ¶ÌŽ«Væ ÌDâaƒWá®!¯G*GʤH¢KÊÁe¯J%!``;³t™[ij¦z»˜ñ¨õ<˜†6e©Xâî£tÏŠn‘R€±ÓBÃë�›ÑHa)ž�´b \%°•°-ÏM"Ã+kïK ×¹8M³Â"Ð/½U—Ieþ˵E*…f.ô“À(™EAp /BÀ8 – næ…0R§B3{+¿j¹ .½ÊkÒ¹¤zº6•ÊDðÄÞ ³¶Á*QáÚEToø%d‰¼_(]²­d+¢öP‡«|˜Ò“Íc?A Ü’hÑ szºQí°‰ºëÕùÜÚÃ?¼—œGÈGÎ+9óLÉHedµÄ5«.(™¥1h± ,! ½¡igMây¤r�ÌNòHƒrišý63UzåÁ7ö¹Ñâê|âcéÝÕoÞ÷}üÒ!ã_òIàZ–bP‰º__ña;&�pºû•�JÝuV˜Bü“6&¢tÑ.«9DŠÈ]kZ¬“�Fãa(«[¦¼dšAugœ¢Ñˆš€8&•È¢X¨±¶�ÒÀ0Œ�ËÈBƒ~Ì¿½pÍ2ëãK»Û+É3Bó¢° Ê¥€ò'$òî4W%™Ä@Á ­×§pöLjM�ΈªZÀ °� ‘¾v(L|ª‘ÖЀƒn7 ¨ ["v߇.Ì’’te!¹ÍtljA9¡¹¨JíÑݹ¸¯c^~ù#wz!ÚÝa¦ò‹ ÉÕ@8&™â@¼XE¢ (ÀB¤È{JoÚ¡S‰ï¾¦9áDùƒA©É„‡K%ÜP:Éaí‚Iciè�tl¢öäu�œi´*,ò8æ5í’*Ñ© ”²ÌÕV93²²B*3˜Ë¿nxh^¼”/!5á-­U‘íW K×®�ÚˆâÆ�0D’]Ò?ü œ× F$,‘¥1h F‡*Áœ:ƒÓA§²‚öIg PESý߈Ëóþa|‹ûªÈþ`CÔê(›9�£X ä²µ¡cŽ›�Šóÿ¶‘¤I€Ó+Îî4…óWÔÿ ‘AeWA}Õ¥PŸAJF‘‘«“‘jºÞiÉ*f(H+ .°HLT‘T€p(™)!ˆ Z$F%€€béK Œq–öVYn \ nJT„îÁÙ’g˜µ±�†[e®µ˜6`Ùú‰©ƒûÃîš�[K¯8C­²Ò²’Ò\Á./¼32g†u+ž‰¡ø ¤8h‚ÔAH_ë-°Ñ›§X³’’`ب‘2­`A9ª–ª�€è³€ÿLŸc€2W˜…áXM˜Á‚ð,«ÎßýÔ¯uÿ?ÏÁ&ô WÛÓ’‘óß]Øm“yõ\{¤o=�…}xÔ$]†›~Èð5ÈðÚ#-ì2{wÌ À#C,ýC:Ñê‘:K„©+�˜»®D:Æ´©Y#tT’³÷³’µ®¡jÀ3·§:•p&°Tàž±šb hªJ8 ‰�ª˜d&Å€²CÛÀõùêv¾™ÇüeßY®íÔ_úð[àZõt<¢_Ü��ÉàëÝdP•Ø0bÔü²G⯠á/EuĈ îê½sàöbP̼±Þ²Í0ÿ?¤uœ¯ýt¾UVƒ¶—Fd´µ(wsþ6pôLÚ[¨G.¯RÞÌŒz‡kºæê=v#ì]?‚ÏDú}Õ×ßãÛÚŠ#Ur€„@ON»>ùE~/Õú‘¯nÄq‘Ø žÅü¾à;eYF%.j•%CšTZäÂÞ¿‘Ö-àVŸÕ’RC@ÁJ4��,’ÇVë¯n'üq×GƒUð×úþ>;kæØðÜ®ººçÝÆô$>úB>ßGV­^â¡âN¦ºR#)$D”áö¢–1 N]Àhª5„6,ƒd·{dy_ú´)Âþ2:]Ò¥_‡V)Ó7�Ž],ô·­×,D�§Úpæªt'ŠÍ’XB"Ë a¹ÚßÜ…Bz#¾„@Ýb©¸*Ÿn’t, $èX‰˜›òävõñÛËëí ÎÅÎõÇ—§{ÂøØ6$Ü’Õ§¾FbÚ¿3|<ß[Ž{Žç+vÄpåÄù�êF>¹ ‘0‡Ëuð ’,®¡�¦ºgfɬ½Iâ@:þñAf_¸+¸�å¡«Œ¦ì†;¨°]À8Ÿ¾ËÅÂÀÙRI‚À¾z–Þë[¿cúqí{g~Φƒ9MÉk—�Ç]Œöïfg-¢jI�ñlÆ#Ï«®þ—1So,l îÉYÎÞîÝ„ =ðDœ# Zó•L´�\Á åá\¸'U(“Áàð¯ 𣳈 �3Q¶)7•I?·Ú4½ÁZ^·9¸Ü£ÍH[¾#cŠš[1I“ªs6ÄsmÜÜCJTú¨P, ³h°à6ŸžÊ’èØià)J¡ýþè³\êiãO=‡' ü5Þç;äðÖ/$R“àà‡v':BN·Ý¦J†ÜÒ "ÑrµyÏàÿÂQ‚MLÏ›”>%ø} P¥R ¶FŹÅß¶xLaÚÒù• T-ôû.k]˜ =Eª¡ÌX7´Lãⷈؖ•w_Ý\¹¬w¯ŽÆ&�Žceçª4!IX˜°S׌¡€Äv—þ/ÜO‰Ô“îùj…ýp'¸8(��Ò„©ÀR×�°4H�ˆjB‰@B�M86FŽÚ6…Ä´-±íþ < åÈÜLa ]@æ GIÿ Ž��\²AÚ�äù˜=?îû ^Ÿ§¸ÀÑdÐX4%ÕÚÝd63Ñ�§-8_f•b95L´7+ñV˜ˆÿÌ_Æì¶~ÊkÓ."Õœ¶Ú,Õ¤Ap²Wxp®/©²D™³É…0©0„…‹‹±¼ÊΫŠ€Lˆ�@E@€0JÈ‚ `ùðýQxá;p“r1kyÖoEáLiÈìY\@žÏÃÇ—´!Q�ª†Ò´Ù¶tån*&tzµ}®ò¸à �ǺòÍ¢„$Ùÿ1È\àÿÀû‚§ãxƒ¸»iP/Œô>!¨ e›¨øP_¢f»°jýb6Ì‹ü82¦Æ„!”$óßΰÚÏ*²ö8GÃpEåQÉššcRÚ­Tåa`w}ŒÀ8ŸƒøÇÀ½N߃³fÄü7u tÝ€Fø}&-æ#LJ¼zgëJw½û.ä<>’µWÀZ ´‘i»/ÿU\·uëØÀXÅ¹ÙÆg ¸•µë²?Ž9ü˜BÌŒD��E5 ÀD!Fží�f/ÝÓ½G–Še¼«Û .£;)ZÿÓÆ€2¸^¬lÀèÔâÿ`áCS“Üäkð‹Ñs@:/'d3u¼ÂÝ�x÷r •¯ñ$-h) £TðL—êÁ�E, ¦¹r €Idv`Û™7Bï‰æññZÕVYKFä…"ë!e…fpHWˆ°1 Ti" bÏñÞ:bcIí­Û%œe¶IH˜´d ØÔäî^Â6-×áÝÚ¯«Ùó�—ÕòïÜ4êŲôoñb-ÊfÚãÒmæëtC[é¿ü½Stqüì÷+4gÝÚICa�Aüն߈Il÷´©5•¡$U‚™�K‘°˜2ÌL¸¢‰«$S™XÂÜž…>Èñ1`SÂ`S¦'[áEÓ"`Kî<žVðüü Û ~߆³½bÖ}µ¦ 5Í–w1ÕŸ§Mž³DCkÀ ÞÑxDËT¨û(òÿÐ°Ú /¤(±”êhäßR^I¶N*¯_ÿË®:æÕ¯»u‚A³¥%;µ»HýE/G4<«íúâ‘ n;HÃz‡D0WdlS Ö¥>¾ƒão¶{î" ’ä¶p‚ÏùoSCvt[¨¬! •\A²›7CUÏàt5–�ž7ÙÓT×%JÓîø0,ŽH“um|Ú²•“éE ´ãq�³éEj“²8ºI\J×�¶Dˆ…!@ÄŠ RøìjöÉž¬U%Ø´�'€ÿž�>–ê%ÊÉ&¦}Š5VÞȺAFgÉ‚ìÇZ ⻥gcíð,F:–£ F§<ÆRpØÆÿÛ·Qœaˆ.cÜp"-Lÿ—ÍÚ§×ôtg§DNªÕz{weÊÎ.vÝÍaþ—Èø2­“Á�è¸Ò™êhåÝjÀFtøÉæƒOõ¡ž}ªZû�n�þ‹Z¨­ÔýÍOªïü?ݺ¼§¬1÷º#g?JÝá t怾lM@i $¬K]K§–"ŒÁ€¢€BŸ5 BeˆB»x÷ì~®�Š[ÓCŽäã:G¶ì Õ•Òà=}I :ø!ñô±Œ¯ýýä€U )à¯�×1 Gn`>ŽÐW_�Gn$Ÿà�©Øá ¹Ð¹ wj%«Ïê´®*ßÄè= Wßër=Ñ *’V7Ç´Gá9ªæÛ¶9h5xäs›§Æ¦ñ88W�ô4%ˆ�PbP ”mïã’<·ø;p+ÈI§ŸÀ>þ<à�á¬40@`‘~/c�òΆ«§(ˆˆˆ@i¶•a€¯ÓúxO¨èÉrÇžöõëz|wèi€‚ðøÃÃÃÿÄ¿¸Té÷Fïé÷�ÈŸcè³8~ðj×>2@@³VG„ Ä82ŸþËÀ*Î�MÍ~+5n §Å”ÐlîÓxìgV—:¨iÔå΢ójsv=hò:ѳ£ž¶îT^Íû7ì»L·Æ1º7El®d H�´€R´)µºˆ’8ÂÛH¾—Kn¥ë¸¨ãà¬üWz+®ÈŠ.ëdQk-¤½™3%`"a.\± !1–­Ì©LP€,Tà8׉!1°D„6B€D€3 ߇'Ÿ8y:w3èÕå�Óf~ß|ô>¼áOâ©.T¹ðè„&ªŠØÔKñÄú.•ß´—䓩ÇÕåÿ�³’êª5S}ÝûÊp*¼j±O ÓäkWwü�¾õkÛ¶Öj�+ioÏÏ<ﮇámzKBhøIˆµ—À4�¶@ 'A„$1Fôz遼€ßCðt©ð¬›âÕï3ZéÒi ýdë”Û§Ã΋TRŽ»¹ò:Hm að#Ö`CMmé+×À‡/ð焦N×úZ«´jrƒº7ÁBÉ;æ¡Y ÂÖ–z$§vSdñšŒâLè´ñÈØ{Àôk¯·”|Ѝ3>|Ÿ û°åþ=¼„tR� Ö% úx1‹²ØjpþHé±hØp²)âýÏõí\;:¢Ñ𻺾Md¤êºåQ"}ÓpÈç6çÓÚ·��*Ç ²ÓQ£<Ø’ÑÆÚS¤Û†®ßCîÚü5H‘ó"H€IB[¾~MHî÷qøJ=xh­ç¿º¨â�ĘTAyŒ² 6ˆpt`™!„d!( Þxîí›3¥–LÓÉlHa±{?óÍ¢H‚äžK†ÆIzèLÇo×tœúÄN›úx@g )Åþ’…@ÅÒ¶zÊxQê€r†oLà��]ôG¦ðÈÊ×*â@¤Mké9Ô”†6”þ£†oWÚs¹-kBó™,b@I•9 *8H�Èq) ‚)@‰@CÐ㙣ðiÌ„y«NâÀ²÷~窰ãþ÷*Cáè^ˆÏ¨ë²Ë´3Nj¾gµ4J�æLŸd9¶ï1óeÝÚ´ `è+l?^RñK-qE‡Äò?¿=) §ÆÒÁúKWÂL€«ˆ€$IŽÝ.ÆI³sóO× XK Öè'L?k̸ã°Aud²I'<-…`�8@�ìA!J*žýÙðá`EŸ€Àh]bA%•ô²2®§®Æ%ž_šKç­p2¬IѤ׌Æ(€Ó¿¦-f ¼EgûœÙ›Ï0Å÷üþ¾×Â÷žH,£¼d›Àйd¼DP”X‘†ÑÞ¸Ø*Àü0µޤ^ˆ¯¯ÅºhºïBÂCˆ” È˜Ø *F´C€2˜t$a`H6Ètiˆ�b«’ju¸€O欒Kø*ÎV^åâ)|ŸÞ¹' ß)ÛkŽ.Ð4œØ²¬|Lðµ$Œ¬èbJ÷g£G@c+¬bÛè¼BI%ƒRÐxýIô‰ÀZœ“yĉ‘a]ÎÓ\ã]yà‡ B&R¥ilÓÅÜŸlC(1DœÒH˜•R‚,ŠÅ@Qà2˜‰B@œ‚%7ôì„:c,5€"aŽôî4Ö9Ñžz*€¾•–ÞšKúË=€ò €ˆEŠè'=¡p"ˆ‡/f�û(�²º{™ÕÁLcæEM�—²=ù¡Ömª\¨p.‘EÁ8 Þ‹µ�!@RŨFké„€|ú¨Ëõ²�’ˆõ'�™îßÒ�;§²¸ËÙ\·¦ë´íýö ¼0–´Ñw‡âA´x MZþaN°ÿˆ¤�“zOÁhB^V9tÚ$3#T;ÎÚÒY"óá µ–Wáj#Î>M7„~²¼ àªî:•Ím/�½å¥}Òœ ³+…D€8*™ aA H6–ŽPZð ŽžæžÅ¨§1º÷¶o$€æ¤yP#+»Q[ÔóÅïO]9[@+ÉRþQ_ùûÝuZuÐÕM"´T éŽ^<3ÚŒ­ Æ'0n¯-×F×B7Fñªµ²4‚t™ö#xUA%Ðâ·á † Y*Ötfl¢ƒZ(eLÛÒ…ÖMh°¨šRªÖNɲMAmD@à(˜eeB*0U––bË`@°A:òã_vê«Çõ}#ûûºVLγ©Š]"ÅßøvÝ� “Ë>ðT›;êã2@åäÊ4pùÃKØW ­žVØ™tM·P1”ÁBJJg�8´0N2žé^²ì�ôBìÈ÷ØÄŽDôSÓ‚î½è~êˆY8Z·„Qmwm,[M):`w�ÜJkÝJ ìP*“d¡@ ƒP "Z)!`›Pö�?gþpv [\n$ê_Ç+‡gÖRGf·#ã•5�z±O!LsKWÍØLæ+ÕÈ~0h«;-³ˆ¸pàmP¥A„Úðú¡ZXÉ+´U!Æ*±RÅÚË-ÖΦe©ÑžM‚ðDåc5 ½ˆràë²ñ+F1OP�4ì—�÷`� ÙX’,’tAT .,ÐÈDý=ê±y{â+an†I«Yc]«Ò1:i’éÎáR9”3\1?ĪKæ«Êu®n!“ G�´ÍnW…)�LAÄd„3‹fñ²&Þoœ'DU£‚&rÖx+T9U®·via�ú%^‡hX¥VÅ$^ðè¢;(¡8CzA‡Ly]v &E£%Ö€ p2™d´K@é†\h6 ¤ Yk\—bË’äC_w‘ªË{™ó_&ì�èÂH81‹+ê[)|à÷BÇZPo¼}ß(T@!¥yî,gì˜Ìv{‘Š4 ½ô~CŰ_ R•R½�<ÓÍå©‚òÂ�1‘‘dhR<*É9‘„–¶ê#²qô’\Ô�@ÞFèÙ°LˆÀ0W©)qhºL"á.ÀÍ–AsOÏNÚªlççñ}_Ñö¼]Ž}¹¿�Ÿ¨÷HQn¥qz)G¹ PFœ1‚þø}±‡®ºsà2]ë\yú–ëýÞù‹ú?W†0 CÞÖÐB?Ðú!òÓþ4ÿKˆ%]N¿Ót8.„’T5=7*Þ‹C²µ�~ÐÓøéNBönçTÇø?UäkÓ: W¼{Š€6ž¾ÍVƒmµFl ˜H˜£$J)ñj4Xþ�û`ÔiÕÿ®çG­_Ž/ªV¿ÅÓb ǨÊÞñ½EûŽRÛ¯‚~¿¹Øo{ÿ£Ðƒ0m =.{«¶}œ<„Fvv9?ßè¢~â›Ñ^ '[ [Cî çC˜ÌDÝTg*‡+ÃhÉ:Ê@¾˜ä/4âH~‹sI/kÏèåePâ;†üóεk²Œ­„íi6jÉ]Åú‹Õ·/‡½ˆذ`C�ÚÆðg¡µcÔâczöQðØ¹²p¬+;7qXZ3ùõ/5ÀDžvÛd h¶X2‹$ÂH‹L›4C® 4ûŸÝç¯�™‹|ÿ�?t!.qý�Û5Ð Ýs€UÌ.ß%K…¢¥«IøË�j‘ÕPªévM†TŠ<Æ+ùh*;¬—ÙÝyù0LáCù!|„É=É3je7ŸEò"‘—•Ü•Ø1¡’x°äÌ  t}u}h²+$ýR–uy“›ðÒÈ ·Õð(iOþtáÚ QjÅ^Bôú_%Gé\™Å[¥IGðu= 7»ÆuƒN6B˜¾�’±];H"OwRÿè¿ÝïAùp†}ù þ~í€D82žþrÌT#N B%»|Ú忯�tw†V¾áEyU¡7n³2^ë%B [:§Nü²LÖU7Ž?]@…E¼6JÖ»Òw¢³mT5ÝVz“Û8,C²“wöuÍ¿ �¶"r­·;¾ö÷“Ëþ\+*�û›oÛA-YGZ•}½}|º~ïMö[·SŸJ¡ÿ —gÙÃ�ølXľ9ŠjZgPÖa À~Z Ƈ՞f]«ÞÚÑKܯU-MO‚”\€@ŸþÊ¢ŒEùÿ6s¼ö@Q@gþ•*ˆª6™~ OÛ3­H¥P �(H6¹¹ò‹ÖøqwN*o�?ò N“×fÆú^©ÔÌ�x‘ÍiJùT–Kï&—h7ÞpžŠŸ3,Š·$öªy’F|Í^±¦,ºqf84DX¾ ¨í³ÏqºÓU™)+ iÈ Ž“7€€šèþT[Ußý•‚ð`�gÉ8gJŸîÉUÂP‰²™ŠA,@³ëÌoÃï³ã¯ïßùÆ'm÷¨1…èè1PÅ¡¢U­Jº;£€¦vT)`*¿÷‹ÄjûÜWS13ØœIbÇ1°†Q­VF.¥h0°˜”U*5LmªŠïÌ­Z“¦&ß"o=àa‰iží?¾¦Ž«qÚÈéõ;Šf\“í&€ê X¡Rå'´“¸7ö–xÔF±ŸöFÄVƒ`‚–lj•ÏCŸ‹Â–»x½LÈD‚ax1¿>ûh ˆ”��pŒx~bÚ^Áà6ד,"R ˆ!;Íä}àە`f0€_íÉ‚‚‚¨…°VX$])×¼ _ŒS+a,¡"ÀR]É’�¥Dƒ›k–ÆM–Å×§�÷p.e? Xp~*1å¤>–5¬ÜÈâW4% M¶w4꓈iIEt*dz3Tu�DüÈ⤬v5”7È¥Ì{µhøxŸû´|Ø•\z? •¡ÝpâÜïkTÖ\Æ2¦1¨dÎ&7Xm”ê@��¢.˜é20•E€”c@äY¼02±U E¿ÈÁ!%�’ëÓúA<ð̯p?:„—‡ŸŽ‘‡P÷{y¿?η¬Ô%Z³ï’© {s1Г›íãöÇ®”TßÏ&.Ô šœ¹,Ãj»�8KL#0«“ª�XhܶРJÌâÌ0P_Éê½ÖÕáŒí hE}ìÊ-ï\ºÛ¨Ëä-ïhÚPø2¤1“¸Äô0è ´«feA˜¬6¯" D“*ìÖ*ùéMŒ“¼Æ›((H*ætCÛŠ1)&t §6²¢B¤bde¸zݳò¿S÷éTüvಪIà3„óøBJ��$x>Ì›áÖÓ«…,„¸7aªÉ�ÈÍæ §#H¤ÀBgF?Y¹�4chwør]a—Áò�—\Àì¦2/çþÞLdç>Ô‚¿Î †ò9?ί‡oA—ÂâgÎõ¯í¶2Q�N¯ý��Ãv]ð M]¼…Ù�ýI…ãQòyÅ6ì0=×qˆY €˜i v©ëhOû:y¨>äûäË“®!ŽªF ä/…äKr~&P<…0øŠ¼‘ €à<�¶!%ÊÁQPLĦ‰#/+ÖvÃDÃI¹,GUp§N¼ ýÞA]Lù]ů[ë‘aÓ£V{ìÇ!zQ㬳¿ÝVÿÏúnëŽcƒ¶°îlOá·õº{:~Z>> ¶�ÅJêŠfA^—‚lQ<Œú;gRòx°Ó‡ UƺB±{&‹Z“˜r|NAj)9”þ¬@ ½ìwsÞcôa'h —¤V÷ï¥ês°�¥†;¤D’1¬#KÚŸ<“ãæ¯{ǵ@p.�´¡)"A„ #·èÙ§¥øy*‚t&® ¾3@éôWƒcò8ƒ=O/ÿýf�ð?sÿ?{¢çYT‚°ß©ái9äu| ÁZšÀ0Á é.©Ã�›mMá³/¾¤yË,R^}ºMËýŸE�QΠ�)\§RŒµ0{.L»«*ÅšÓº§î{aO¯°'4ÀØ�_»×zïä½—ê°v{£^9 ÀV.æ·õ±¶B¦�Löí{QªC—5+|F€p:ˆ– ÅA4°PÂB †#6ï~¸¢ dt²gX�‚�Ã,‘@aÎë>)* tòì&×7€ßoz-ïþ.Œ8y;U™Æ|lÓÇÄ~eÑ·5¶1…Q´mG_ükÂäü¿• ¢“±v~ûù“ÕU Îpp5ˆzñ×Ï4 seÜ� &'ÊÑ,ÝL&¶œë8Ä”ƒªDì»Ê³)@ä|µÓ\óÛ·×=z."€4ž„d)H‚�þDøÆ–êÛ 'Y×)¬‹]‘Í„�Ïþî»0a·Gv�]]’&99d‹SxÏÀ1F„îØMVÑD¿Záu­£¸áVm KpPb­…¥—Çi Úæ˜¶­êºõH¦©ï;sæJõ %O‡ô¥<‡y~y„À 3{ñ¦*CºNW¡OUÌÁ a9)k])Ô r…1€uÄkÆÙux½¯6¬²8ˆ”49A'‰@lÍúätgÀèцݯ:,б£Wþt¹J¦Š ¸ÝlÌô à LA.O‚Us·ìœ�åä4ýuε�òÿû ÁžIàX§ŒÐÿûümUe¢µ}ëXƸi/2KÅ|Z0ÆPL×FŸß]©*šê˜Œ¡æ�~ ºtâËÿÙõ&‘U—”¤³ó£-[„qt/RÓw²\@””P‡AÀH0d´Yëš\G�¹½ªµ¡¥ªXÇq¤]•­wª÷/0Y±´YžáûK�ü;Þĺ¹ë±fŠ‹�OwÇ{äŒ ÊgG±h9ÆPÀ2)Ò´³þÿÎø–>D{K¼6Y˜qÜ%™3â¤ì~Ÿ” Æþ'£:Bö«­¹¾°ß]:ei„ss5K´¿Æph¢rÉ‹‡èÍ«óžøP9F—"ÝKÂT­)à–�›=‚Q¤/ñIÆ¿†m0â;wÓ¨–u2 à2��QÂ!XFaBF[ÿ\�/_~ô`U£ ÐÍz~­KÞÖ]÷u~§áR‹¼©ãÕÚj¯ �ÀGŸ~ɧp Kk>sÒ¸D!¨å}Z5uÌ6¯‡¢‰ËOÚÿ¢‹$ø½ð¿µD bªZþ¸YàÙÛšhy" ² v‹ ÀrE™ƒÇ‰^©ãË„×þúpjÖ PG‰é!�Å:ôñ_e؈Ù¼I+&Â�`p@W˜”B#�L¨ Äùž˜yÀ7eÙ“«Æ˜•G=»sUaôƒgÐLµRàÓÏ33[Û|ÀáA¹=·ÁY ¬î†K�Crf  ®+ö¯�èjÎö¹ÛÊ,­4ÉAT­Cµj¯ü°®$DuMäŽ('Íñf†:©€»Œ„Ù­ 騣 yß_.—*ïa¯>:%Șg§| § Ò¨‚Íi\~o‰ð÷adÅ®‹²bHc ܈àBŸ^&HЉ:(bÀ_PˆáVÿ³éuÑÒòÿã·Ñ©ÄoÅÿ]ÏE­�äu¾NÎmZ D¹$T ùÆà–8TX\]çÊgb›jCf€–äæK¬?¯ç$� á:…Dq͇ #|lI¢§ÙÎÝÕ»ôž(Û2Üß„Q·Ò�Œu Ÿ9+2fÀ¶JL ”ŒRb�yGK×õ-àOþŸŽ.I:ëÿ¦Ÿw¥£î`û/]³‡ÜÙœœ}çŽå¥@ÏsÖ&d íý LÆãmµˆZÔÝ·w¡åž(° Ë(ŠZ�8ñ,Èo*òu7¦>Sšò§%Û6æ—PÄŒOs=´†Ãe´XU€ÇÓ{2�šzbÅMÏÑ“;»˜v1¸²2÷8lõ_Flû›—ˉv=—.‰Ž¢‹Ç£NÑ„ÛØÕ6ìb zWVë'?Ù[ëËó�»&Á�ÀLŸö p4ˆI„¢„H®¯ W·ýé^¤ü3AfRÑÃlŽbª]`?¶Üy»¾yl; Ád¢I¬1…ð¶�oÉiIâà„Õtí�Iz~®Nuç–@@Oµ6|·JhgëÍ_ =ÛÃ`g¸H™c‘²žÛ©— 2Ú1 °-½;0ŒùÉ'oð{iwœ¾ÒIr õmS)CI7 8ÍõfÅM° *‹$–Ý¥IG:�ú2<\¥f82ט´1–Â!€ŒÄ ï¿‘ËΩÓjÜ|/5{‹�Ü‘¦lY�I7Ö{>&fÇÍ¿Lö)€3ŒF€=ÀŸº¼gûî_ë»Ê|+¯Ðêã­ÇÒs"¤àw ÷#U„oeNûÇtÞ�Øßåk�BžÃ ·»IPF6ZX5ÀôŇ¡ËÚöøú¢½ÅÏø¢Vï[ÜA`ŒÈÚrʘP(/¬8W˜Ð1‹`¡d10 ìñê¤× Æ ¤ZKZÛÇ#xïœ]ØLSk'M|ÂhRuü+º7Uѵqä{ð¡u)*Ð0Ÿ�^´M'ª*e îh§-â?Íí±æ�êÇŽÁJ¦1d�¢ñ.øÖ²sC÷½‡5$—€2Í.ÙeŠÓ\¥ÜXˆ™–­ŸŸ‡W£^)î‚�¦²•µ“ä rSÎ^ qDp&žêT¡%&„XI¤’t0àr­òŹe3��èúòõ{5/Ûý^Zì¿+ÏÀ/q=&$#teãRä�ú‚¾ït‚ fjLàþŒy�qÀ¤ xÆsw×… ®âQCo>Æ~ñ‚Æø-~l箑 !½»mu·+ Îà“‡Ì«áÁ{ `C41˜5ëd \±f¾èÄW®›m€­•ñ|;†Áé~«ZSÜ».„l–ÙUKDC=@v¤ƒì$a�¡§ÈÛÓPpÉakDh·Š à@׈–†1% „€#±îÑN“M½ƒ¢äèÔž–üèæøWIÑMASÙ�h‹-,±ÎÕcv_G<ÌÏeh?Ù5¤Ýf…(/AШÅw¡Ûç›=â—^h­¡bʹŸÑîóÊ ÁŽ7 Jo Em NÔÃ8¥b­µFùçòù~xwæðÞVî™ñœ`,°HžîX¸zÁ®9ç®}=4å0o×Woñ×Óyñ¿\z€:W�”UIˆ„ÎþMÔWÒ.j×v lRÂ0òüTd.+ÔÌ„wÿ¦ +01€„ŠfvœØ÷è€7Y«49뿎9;ÉLÎî%,) ŽâãbÅšÁW9QíÖÛu)�‡a9=ØdÂ* +|0&X0t…@ pþ|±îí–C,¯t¨‚A<ÀÓ«`U¡oÔ8@Ÿ6'ÈDÚ”H›c@Ò&ÅÐ/ðüvwÖ‹¿ý?•º÷�<ËÿéÔøMÖïÏ•ÿèóçµ®ÿIõ%3èŽ<ÜÇMìG޲^8>ñM«ôn)C™!¿®�G>7êñó–ÇGgŠ.§›@{ʬú*’ªÞ(ÀD%7&q±�Çåt0Ç2¬éM¿O‡°ÂDú‹¹ÓZ"ó¬}çu{é{1(n¼"¬ ”ëº(Íx/ÊoÚ”ë_æI÷¥l`bñ&F×¼=‘µ[«e%ô&ìÑgÌÎ ë8ØîlWÕOÁÞk_Ñ,»&—ož~ Ôß[ˆÂàBׄP2ŠŒ! @b·¾:±z1«‹ѪZ  ‹*ªªkããáß{,Ï*bUÿ±??#v,ÿd16v—µ°Òà1� À›ÎÎÈü=œ“æ{€ù¨bt-‰ð²ÈþÄ;(-ýk¤CràZœ7ñq'"9¶ÂMª•œ£ø×²1ûêCjYֵѿÕÄÛ:ž¸&¢ËA—Ê™«BK'w:‘l$S Â10ˆL J Ò,ÖéݲÁÒ.k!;Q£…o ¦qVô\¢]5ÕIfUúØÞîäýˆLÝÛ ãt'¤l܉�[›ŒŽ'ç£(dD•HÏA‚®¸qßkE6C­°Ê€¸U�§¡çúµâ^ Ì®½Z[ lÕ“BËQ•³J‡TAÎ…˜ ð߉×QÁ¬ƒš«Ø-’²#=BhÁÙÇÌ7Þ,á*J`X�€"�éhå·÷ƒë+þäzÞó²\Wẹ¯5ÉÉÚI³—ÖTÝÖã³›.Û™ÀÀ8š(‘Y J-fk`ÈŠ.Ñj–´Ío–*ÛxLt¹‘‰6戙NPŒØH+ÃT1¸fÄÔ ¢ëlÌիꦋܭÃè(ëöcÿúíÓ‹*¼j› ëËiåQ’6§ò› ”®A]ÉC¶†i—êû—b[êäjge÷uêPÔÿïc? •·®H¨‹X¸.ÚX殈-¶à",ŠÐ,¨‰²@˜P«ck»mvH¥è�:Æ�d¹þïÓøod xˆÔB¥½ ‹oúúTÊÒ¶07 :2-]½pÑ^‚)ãR�Wè,³é��x.Â�.Œä&€2wÖ˜„#;¤X“ožÙ�3åݸe Ò‚-³ò‘€ÀÀ×qòígs4áxÂ1­±ë1â\`X€ ±& ‹`œD’¢ä5‘:ŒEÀ0™©#p �aƒ®ÖG&�4É ´'“ ºÚ‚yF“jkcK…Á±Em$tmKÉõ1�¥†7a€$çÂÉRÎòŠN¯Y1œw·' ÕK��­jÔU¿ÃZùîõg…A¬�÷½®YmKK[i+4àªâDš©n¶�¯¡Sô¾�ùÝ�%ʧJhª˜"#Ä¡£ªNãh2¦­”œå"êÆÔœ˜€2W ˆâ¨˜¤ËÓC3”t ™ËçùgÀNŽškT�ÛZ³�|o*÷ü ßy·d�ô>Üù“£>�ƒî÷Ñ™öÀäÌùBô6þ|}ýýßm"`àSG¸dÆ '‰©°¡.âÅ@¹ô¨ÇBÙO «Ò„ODÌ$~¶�³ Z,!]äTæ×,D5«3¼•`­ä §q€Ÿ¢’&hɉ“pŒM¶è�ÍQ�®™ =úò|õŠ˜Ÿ:ã�¸æ ßy©¼¾6Uþmìx®�^×þ«ëîä0°Û…�­Í2ä5g™ï�³ø³â™ÙBK4Χ\¶ÝQúa;Ž”GâCÉJ«Â'ãPÒ�ÄsßX‘Ôi6®º«ª‘ãþXE£Ç9¸Ôéªà·çÈåó:­ÉœºB» ü�5|B ëb¦¡RìµO<„o§>=pXºø‡ÏûHá½e…ø‘ŒÁ'N·’Ïd6ă¥]g§»ÿg,â®»+�¢ß÷? bI:îZFöæÜ>[Œ7e¨UhRTcíhYî§Ç¥J˜Jô>€û”-Îgä¸íØ "7 pæ…¶/}z|¨X"xBÑ–zañ=€8>ŸîËLÖ ²œ+ãÏ™ÎSŒê¸ëûzýoµEçÆ@§>…JÐ]T£\•7ÔY«á ¸hžµJŒ Öfù­‰ÈÓFªÓ4¦.£Þœ�†a–(jév‹"—¾8Ïm^Çx÷̽h¾Þ+ T%fç³@¹Ðç纊=µ¬ ± -�æÙ÷‚ô¾Ø’ÓO”¢Ÿº¹7õ•ê@eóÈkpÍ:kÑÙ+LTî™] _íCìúÇGIÑû›Ýτצ-ÂNñ6À¡§B ©Šb M.´¿û�Õ¸aák^ê¢?XHŸn’eDXŠe 4¬„¡dÉp‰‰ 'Z9¶³Í7ßÀ³>¿³OC;W�‡ãÅ„L£ªgâ“åÏïÖ¨{YÅì‚ nª„èJ¢Âiüs_Ò·`ù£œf@=˜7¯ÃÎnMÓ®=344•ºv¸©žJ.Ë© 1ÅYuZ/‹ã}î�ú™�MÌÈBÔ¨­úXÍTBx`íævÏÔ7u·‡óü V~èÈè tBMYù±ÎbüµÊ¨>—§V_/V›§åkðæ+!Œ¡Ø+Ì'˜dò‚!”ì$Ýmv'„Tžš b`îU(<˜¯€4×™Ä� –�a #eå—#±Íâ`Ûl¡À×üóM~Ü×.¡ÓlŒ2Úâ*£I°Ü¾õÚÌåÑ8AK&Ý�ÑÄ}½ÁÚ†užõÐ(F°P–1ê9�óâ]=ÔIÂ'ƒ¾WºÆª J‚¹ˆÓ!ÝiZ UYœ YKbGËTIï:p¬¥™»Ÿ7cœ&²j©r68SAw7 q‹’OÓ*?wš…kŸ ;@ÃÕ�°ó)7(CíY¢*Èe|fŸŸ‡1<+ÉH¨’Ô¥s‰0‡¯,éÈXàNW©*fÒ¦2ˆB0Î>w·Õù8-âÌÔoËL A³o‹6Ý›[´€$Eçøh+rÛáß–Q”ðüy™-f¹¬uzz¯¥¤:ýG>œÈ Ú� ­9¼þùßNä+zµ§`Ö€O¦ñ­EÜ_>Îß�îŒÐÛ[Bz¾s®¶LŸóŸ_·¿­ÿªú¼ ÏY\ô„›…Ø«“瀟§§üVé?íüþ™Ò€BUº‹­²ïÏ pDŸ~ât$ ˜,…‘FdŠ&™£VèõýssêËÖµÐQΦsJªÆèéÈ/}FéLç‡Ü:§9¿'áÊa÷O´8)‡ SÁS»^‰<&İãËsº–c0i‹?ÊåŸá³¨a&˜ÊäÔ^Ë'$ýGú×å ÐÉl£ø3€ %GKÂ1œÕ·>ŠÖɱ�LyÏäIÒØ¹¨>é|Zùå®àOêsŽ1Anóeb[*ŠÂü»"—Þ÷è¶å˜��Åü±à _çÙ?«Ñ]>·=Gí«ä¸�….Y3å‰cPþ(uü�S¾ç±SÁ\LŸÙËÊI"jÓ€k&î«­uй×_Øžo]õ—Zóûîc@+×zí^'EëÏÒ~Õ{NK¿NíµL[]»Yª�KBE"æ­¢ˆÖNæ^D÷íp ¡`š±Ì5îÓÑ0�¼FŽ«H9ÑA•#vÄæê _PrS?aÕîõêSáòóSÆsÚ“©<¦ˆ¸*Ù…0+åpÄ-¼„"?m›£Áoј�1>P\B[­Ì0Ê©Ó^¿·ŠK¬‚Øè5«�µè Ê�y²äºÓÔÞJûÆ8DŸ®Ò´ÌP±Q8bˆL&eR<ųû~÷œ‡-º¾ÿçæ>F÷ÝØA¯(U>LA´J|™û�àþÁ›ïž:í<üÉA,:÷@R½ì ÌE‡ 2 5Lã¨(Ô~›3�Eì ÔÉ nP‹]Óšk´ý'Ûº¨6H€’¹Û.¿îüõ"„CZÍy‹ê‘æUD;«a“ƒeQ¤wºä>ù¹€\Rì@àI°Í ƒÏ};n/T!¨ò£®~U¬©0d£8JwƒW�øøs¢qVê¢zLg‹ôøQBeiè·ËŽ~v<ƒFÌä…Wu–91APX2Ô�3:(êÒÄ–7e5š&š./pW2×™`9,C2 „€1`4&3VlVî^VÐ[k�̈Cü_m5ÉÝ"Ãà¸ÌѸ³³[©™°qG®A6b6¥=ô$³nƒ ¨Ü©ÛÝã\èé%Àú¹¹áR{ñ5y÷<ó­5$\ƒáŬÀÅ‹.Y°Öbú:°ó¬Ö…Ñ,V�™Î,ëR¥¢jàuÞP=Ûʰ†*da2 ƒ*`‹a„³€’€Ò†$:#Í™”NšÜ mp¸§xœÊ"C&Ñ-:P›¦Qy(MÓ:‘â¢åT´s‚U9–v¨‘,íPëGÑî\ËÝΠ{”_/翳g@jô\¯=ûÀlõü5…}ï.Í€àZmoovlmvhdã€Éµã€ÉµV"ù@ìtrak\tkhdã€Éµã€Éµù@ˆmdia mdhdã€Éµã€ÉµV"UÄ1hdlrsounCore Media Audio/minfsmhd$dinfdref url óstblgstsdWmp4aV"3esds€€€"€€€@}}€€€ˆ€€€stts�(stscstsz�è'¬¬×TœçâÄÀ½­¤¬˜¦ ‘ª¥É™©÷¸ËȨ­¥Æ³Š‹™��Ž�˜–�‹š�…‰Œã±Ô´Ã©“�Ž“õ±Ššž“Ÿ˜ª‰’ž“�¥œžš›�—¨æé¾£Ü½µ ÈDZ¯žÍ¯³Ò¯—£¡Ü´¡¨Ò¸ õ™Ü�££¡1ÙîÊ̼åÓ ¤o,stco,ç :-¶:«JBZYúudtaòmeta"hdlrmdirÄilst¼----meancom.apple.iTunesnameiTunSMPB„data 00000000 00000840 000000A0 000000000001FB20 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000elevenlabs-elevenlabs-python-b6e5614/tests/test_async_convai.py000066400000000000000000000421651523660243400250710ustar00rootroot00000000000000import asyncio import json import threading from unittest.mock import AsyncMock, MagicMock, patch import pytest from elevenlabs.conversational_ai.conversation import ( AsyncAudioInterface, AsyncConversation, ConversationInitiationData, ) class MockAsyncAudioInterface(AsyncAudioInterface): async def start(self, input_callback): print("Async audio interface started") self.input_callback = input_callback async def stop(self): print("Async audio interface stopped") async def output(self, audio): print(f"Would play audio of length: {len(audio)} bytes") async def interrupt(self): print("Async audio interrupted") # Add test constants and helpers at module level TEST_CONVERSATION_ID = "test123" TEST_AGENT_ID = "test_agent" def create_mock_async_websocket(messages=None): """Helper to create a mock async websocket with predefined responses""" mock_ws = AsyncMock() if messages is None: messages = [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, }, {"type": "agent_response", "agent_response_event": {"agent_response": "Hello there!"}}, ] # Convert messages to JSON strings json_messages = [json.dumps(msg) for msg in messages] # Create an iterator message_iter = iter(json_messages) async def mock_recv(): try: return next(message_iter) except StopIteration: # After all messages, simulate timeout by sleeping forever # This will be caught by asyncio.wait_for timeout in the conversation await asyncio.sleep(float("inf")) mock_ws.recv = mock_recv return mock_ws @pytest.mark.asyncio async def test_async_conversation_basic_flow(): # Mock setup mock_ws = create_mock_async_websocket() mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" agent_response_callback = AsyncMock() test_user_id = "test_user_123" # Setup the conversation with user_id passed directly to the constructor conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, user_id=test_user_id, requires_auth=False, audio_interface=MockAsyncAudioInterface(), callback_agent_response=agent_response_callback, ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() # Wait a bit for the callback to be called await asyncio.sleep(0.1) await conversation.end_session() await conversation.wait_for_session_end() # Assertions - check the call was made with the right structure send_calls = [call[0][0] for call in mock_ws.send.call_args_list] init_messages = [json.loads(call) for call in send_calls if "conversation_initiation_client_data" in call] assert len(init_messages) == 1 init_message = init_messages[0] assert init_message["type"] == "conversation_initiation_client_data" assert init_message["custom_llm_extra_body"] == {} assert init_message["conversation_config_override"] == {} assert init_message["dynamic_variables"] == {} assert init_message["source_info"]["source"] == "python_sdk" assert "version" in init_message["source_info"] assert init_message["user_id"] == test_user_id agent_response_callback.assert_called_once_with("Hello there!") assert conversation._conversation_id == TEST_CONVERSATION_ID assert conversation.user_id == test_user_id @pytest.mark.asyncio async def test_async_conversation_with_auth(): # Mock setup mock_client = MagicMock() mock_client.conversational_ai.conversations.get_signed_url.return_value.signed_url = "wss://signed.url" mock_ws = create_mock_async_websocket( [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, } ] ) conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=True, audio_interface=MockAsyncAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() await conversation.end_session() await conversation.wait_for_session_end() # Assertions mock_client.conversational_ai.conversations.get_signed_url.assert_called_once_with(agent_id=TEST_AGENT_ID, environment=None) @pytest.mark.asyncio async def test_async_conversation_gets_signed_url_off_event_loop(): conversation = AsyncConversation(client=MagicMock(), agent_id=TEST_AGENT_ID, requires_auth=True) event_loop_thread = threading.get_ident() def get_signed_url(): assert threading.get_ident() != event_loop_thread return "wss://signed.url" with patch.object(conversation, "_get_signed_url", side_effect=get_signed_url), patch.object( conversation, "_run", new=AsyncMock() ): await conversation.start_session() await conversation.wait_for_session_end() await conversation.end_session() @pytest.mark.asyncio async def test_async_conversation_with_dynamic_variables(): # Mock setup mock_ws = create_mock_async_websocket() mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" agent_response_callback = AsyncMock() dynamic_variables = {"name": "angelo"} config = ConversationInitiationData(dynamic_variables=dynamic_variables) # Setup the conversation conversation = AsyncConversation( client=mock_client, config=config, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface(), callback_agent_response=agent_response_callback, ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() # Wait a bit for the callback to be called await asyncio.sleep(0.1) await conversation.end_session() await conversation.wait_for_session_end() # Assertions - check the call was made with the right structure send_calls = [call[0][0] for call in mock_ws.send.call_args_list] init_messages = [json.loads(call) for call in send_calls if "conversation_initiation_client_data" in call] assert len(init_messages) == 1 init_message = init_messages[0] assert init_message["type"] == "conversation_initiation_client_data" assert init_message["custom_llm_extra_body"] == {} assert init_message["conversation_config_override"] == {} assert init_message["dynamic_variables"] == {"name": "angelo"} assert init_message["source_info"]["source"] == "python_sdk" assert "version" in init_message["source_info"] agent_response_callback.assert_called_once_with("Hello there!") assert conversation._conversation_id == TEST_CONVERSATION_ID @pytest.mark.asyncio async def test_async_conversation_with_contextual_update(): # Mock setup mock_ws = create_mock_async_websocket([]) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" # Setup the conversation conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() await asyncio.sleep(0.1) await conversation.send_contextual_update("User appears to be looking at pricing page") # Teardown await conversation.end_session() await conversation.wait_for_session_end() # Assertions expected = json.dumps({"type": "contextual_update", "text": "User appears to be looking at pricing page"}) mock_ws.send.assert_any_call(expected) @pytest.mark.asyncio async def test_async_conversation_send_user_message(): # Mock setup mock_ws = create_mock_async_websocket([]) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" # Setup the conversation conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() await asyncio.sleep(0.1) await conversation.send_user_message("Hello, how are you?") # Teardown await conversation.end_session() await conversation.wait_for_session_end() # Assertions expected = json.dumps({"type": "user_message", "text": "Hello, how are you?"}) mock_ws.send.assert_any_call(expected) @pytest.mark.asyncio async def test_async_conversation_register_user_activity(): # Mock setup mock_ws = create_mock_async_websocket([]) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" # Setup the conversation conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() await asyncio.sleep(0.1) await conversation.register_user_activity() # Teardown await conversation.end_session() await conversation.wait_for_session_end() # Assertions expected = json.dumps({"type": "user_activity"}) mock_ws.send.assert_any_call(expected) @pytest.mark.asyncio async def test_async_conversation_callback_flows(): # Mock setup for testing all callback types messages = [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, }, {"type": "agent_response", "agent_response_event": {"agent_response": "Hello there!"}}, { "type": "agent_response_correction", "agent_response_correction_event": { "original_agent_response": "Hello ther!", "corrected_agent_response": "Hello there!", }, }, {"type": "user_transcript", "user_transcription_event": {"user_transcript": "Hi, how are you?"}}, {"type": "ping", "ping_event": {"event_id": "123", "ping_ms": 50}}, {"type": "interruption", "interruption_event": {"event_id": "456"}}, { "type": "audio", "audio_event": {"event_id": "789", "audio_base_64": "dGVzdA=="}, # "test" in base64 }, ] mock_ws = create_mock_async_websocket(messages) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" # Setup callbacks agent_response_callback = AsyncMock() agent_response_correction_callback = AsyncMock() user_transcript_callback = AsyncMock() latency_measurement_callback = AsyncMock() end_session_callback = AsyncMock() # Setup the conversation conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface(), callback_agent_response=agent_response_callback, callback_agent_response_correction=agent_response_correction_callback, callback_user_transcript=user_transcript_callback, callback_latency_measurement=latency_measurement_callback, callback_end_session=end_session_callback, ) # Run the test with patch("elevenlabs.conversational_ai.conversation.websockets.connect") as mock_connect: mock_connect.return_value.__aenter__.return_value = mock_ws await conversation.start_session() # Wait for callbacks to be processed await asyncio.sleep(0.2) await conversation.end_session() await conversation.wait_for_session_end() # Assertions agent_response_callback.assert_called_with("Hello there!") agent_response_correction_callback.assert_called_with("Hello ther!", "Hello there!") user_transcript_callback.assert_called_with("Hi, how are you?") latency_measurement_callback.assert_called_with(50) end_session_callback.assert_called_once() assert conversation._conversation_id == TEST_CONVERSATION_ID assert conversation._last_interrupt_id == 456 @pytest.mark.asyncio async def test_async_conversation_wss_url_generation_without_get_environment(): from elevenlabs.core.client_wrapper import SyncClientWrapper # Test with various base URL formats to ensure robustness test_cases = [ ("https://api.elevenlabs.io", "wss://api.elevenlabs.io"), ("https://api.us.elevenlabs.io", "wss://api.us.elevenlabs.io"), ("https://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io"), ("http://localhost:8000", "ws://localhost:8000"), ] for base_url, expected_ws_base in test_cases: # Create a real SyncClientWrapper to ensure it doesn't have get_environment method mock_client = MagicMock() mock_client._client_wrapper = SyncClientWrapper( base_url=base_url, api_key="test_key", httpx_client=MagicMock(), timeout=30.0 ) conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface() ) try: wss_url = conversation._get_wss_url() # Verify the URL is correctly generated expected_url = ( f"{expected_ws_base}/v1/convai/conversation?agent_id={TEST_AGENT_ID}&source=python_sdk&version=" ) assert wss_url.startswith(expected_url), f"URL should start with {expected_url}, got {wss_url}" # Verify the URL contains version parameter assert "version=" in wss_url, f"URL should contain version parameter, got {wss_url}" except AttributeError as e: if "get_environment" in str(e): assert False else: raise # Re-raise if it's a different AttributeError except Exception as e: assert False, f"Unexpected error generating WebSocket URL: {e}" @pytest.mark.asyncio async def test_async_websocket_url_construction_edge_cases(): """Test WebSocket URL construction edge cases for async conversation, specifically for trailing slash handling.""" from elevenlabs.conversational_ai.conversation import AsyncConversation from elevenlabs.core.client_wrapper import SyncClientWrapper # Test cases with various base URL formats test_cases = [ # Base URLs without trailing slashes (the main edge case) ("https://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io"), ("https://api.elevenlabs.io", "wss://api.elevenlabs.io"), ("http://localhost:8000", "ws://localhost:8000"), # Base URLs with trailing slashes (should still work) ("https://api.eu.residency.elevenlabs.io/", "wss://api.eu.residency.elevenlabs.io"), ("https://api.elevenlabs.io/", "wss://api.elevenlabs.io"), ("http://localhost:8000/", "ws://localhost:8000"), ] for base_url, expected_ws_base in test_cases: # Test async conversation WebSocket URL construction mock_client = MagicMock() mock_client._client_wrapper = SyncClientWrapper( base_url=base_url, api_key="test_key", httpx_client=MagicMock(), timeout=30.0 ) conversation = AsyncConversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAsyncAudioInterface() ) # Test conversation URL generation conv_url = conversation._get_wss_url() expected_conv_url = f"{expected_ws_base}/v1/convai/conversation" assert ( expected_conv_url in conv_url ), f"Async conversation URL should contain {expected_conv_url}, got {conv_url}" # Ensure no double slashes in the path (except after the protocol) url_path = conv_url.split("://", 1)[1] # Remove protocol assert "//" not in url_path, f"Async conversation URL should not contain double slashes in path: {conv_url}" elevenlabs-elevenlabs-python-b6e5614/tests/test_audio_isolation.py000066400000000000000000000020201523660243400255610ustar00rootroot00000000000000from elevenlabs.play import play from elevenlabs.client import ElevenLabs from .utils import IN_GITHUB, DEFAULT_VOICE_FILE def test_audio_isolation() -> None: """Test basic audio isolation.""" client = ElevenLabs() audio_file = open(DEFAULT_VOICE_FILE, "rb") try: audio_stream = client.audio_isolation.convert(audio=audio_file) audio = b"".join(chunk for chunk in audio_stream) assert isinstance(audio, bytes), "Combined audio should be bytes" if not IN_GITHUB: play(audio) finally: audio_file.close() def test_audio_isolation_as_stream(): """Test audio isolation with streaming.""" client = ElevenLabs() audio_file = open(DEFAULT_VOICE_FILE, "rb") try: audio_stream = client.audio_isolation.stream(audio=audio_file) audio = b"".join(chunk for chunk in audio_stream) assert isinstance(audio, bytes), "Combined audio should be bytes" if not IN_GITHUB: play(audio) finally: audio_file.close() elevenlabs-elevenlabs-python-b6e5614/tests/test_client_headers.py000066400000000000000000000105611523660243400253610ustar00rootroot00000000000000"""Tests that the user-facing ElevenLabs / AsyncElevenLabs classes forward the ``headers`` and ``follow_redirects`` kwargs through to the underlying client wrapper / httpx client. Regression coverage for the case where ``ElevenLabs(headers={...})`` and ``ElevenLabs(follow_redirects=False)`` raised TypeError because the subclass's hand-rolled ``__init__`` did not accept or forward kwargs that ``BaseElevenLabs`` supports. """ import pytest from elevenlabs.client import AsyncElevenLabs, ElevenLabs def test_sync_client_accepts_headers_kwarg(): """ElevenLabs(headers=...) does not raise and stores the headers.""" custom = {"x-trace-id": "abc-123", "x-tenant": "acme"} client = ElevenLabs(api_key="sk-test", headers=custom) assert client._client_wrapper.get_custom_headers() == custom def test_sync_client_headers_default_is_none(): """Omitting headers leaves the wrapper's custom headers unset (backward-compatible).""" client = ElevenLabs(api_key="sk-test") assert client._client_wrapper.get_custom_headers() is None def test_sync_client_custom_headers_appear_in_merged_headers(): """Headers from the constructor are merged into get_headers() output.""" client = ElevenLabs(api_key="sk-test", headers={"x-trace-id": "abc-123"}) merged = client._client_wrapper.get_headers() assert merged.get("x-trace-id") == "abc-123" async def test_async_client_accepts_headers_kwarg(): """AsyncElevenLabs(headers=...) does not raise and stores the headers.""" custom = {"x-trace-id": "abc-123"} client = AsyncElevenLabs(api_key="sk-test", headers=custom) assert client._client_wrapper.get_custom_headers() == custom async def test_async_client_headers_default_is_none(): """Omitting headers on AsyncElevenLabs leaves custom headers unset.""" client = AsyncElevenLabs(api_key="sk-test") assert client._client_wrapper.get_custom_headers() is None def test_sync_constructor_signature_advertises_headers(): """`headers` is a documented keyword-only parameter on ElevenLabs.__init__.""" import inspect sig = inspect.signature(ElevenLabs.__init__) assert "headers" in sig.parameters assert sig.parameters["headers"].kind == inspect.Parameter.KEYWORD_ONLY def test_async_constructor_signature_advertises_headers(): """`headers` is a documented keyword-only parameter on AsyncElevenLabs.__init__.""" import inspect sig = inspect.signature(AsyncElevenLabs.__init__) assert "headers" in sig.parameters assert sig.parameters["headers"].kind == inspect.Parameter.KEYWORD_ONLY def test_sync_client_accepts_follow_redirects_false(): """ElevenLabs(follow_redirects=False) propagates to the default httpx client.""" client = ElevenLabs(api_key="sk-test", follow_redirects=False) assert client._client_wrapper.httpx_client.httpx_client.follow_redirects is False def test_sync_client_follow_redirects_default_is_true(): """Omitting follow_redirects keeps the parent's default of True.""" client = ElevenLabs(api_key="sk-test") assert client._client_wrapper.httpx_client.httpx_client.follow_redirects is True def test_async_client_accepts_follow_redirects_false(): """AsyncElevenLabs(follow_redirects=False) propagates to the default httpx client.""" client = AsyncElevenLabs(api_key="sk-test", follow_redirects=False) assert client._client_wrapper.httpx_client.httpx_client.follow_redirects is False def test_async_client_follow_redirects_default_is_true(): """Omitting follow_redirects on AsyncElevenLabs keeps the parent's default of True.""" client = AsyncElevenLabs(api_key="sk-test") assert client._client_wrapper.httpx_client.httpx_client.follow_redirects is True def test_sync_constructor_signature_advertises_follow_redirects(): """`follow_redirects` is a documented keyword-only parameter on ElevenLabs.__init__.""" import inspect sig = inspect.signature(ElevenLabs.__init__) assert "follow_redirects" in sig.parameters assert sig.parameters["follow_redirects"].kind == inspect.Parameter.KEYWORD_ONLY def test_async_constructor_signature_advertises_follow_redirects(): """`follow_redirects` is a documented keyword-only parameter on AsyncElevenLabs.__init__.""" import inspect sig = inspect.signature(AsyncElevenLabs.__init__) assert "follow_redirects" in sig.parameters assert sig.parameters["follow_redirects"].kind == inspect.Parameter.KEYWORD_ONLY elevenlabs-elevenlabs-python-b6e5614/tests/test_client_tools.py000066400000000000000000000262471523660243400251160ustar00rootroot00000000000000""" Tests for ClientTools custom event loop functionality. """ import asyncio import pytest import threading import time from elevenlabs.conversational_ai.conversation import ClientTools class TestClientTools: """Test suite for ClientTools functionality.""" def test_default_initialization(self): """Test that ClientTools can be initialized without parameters (backwards compatibility).""" client_tools = ClientTools() assert client_tools._custom_loop is None assert client_tools._loop is None assert not client_tools._running.is_set() def test_custom_loop_initialization(self): """Test that ClientTools can be initialized with a custom event loop.""" loop = asyncio.new_event_loop() try: client_tools = ClientTools(loop=loop) assert client_tools._custom_loop is loop assert client_tools._loop is None assert not client_tools._running.is_set() finally: loop.close() def test_start_with_default_loop(self): """Test starting ClientTools with default behavior (creates own loop).""" client_tools = ClientTools() try: client_tools.start() assert client_tools._running.is_set() assert client_tools._loop is not None assert client_tools._thread is not None assert client_tools._thread.is_alive() finally: client_tools.stop() @pytest.mark.asyncio async def test_start_with_custom_loop(self): """Test starting ClientTools with a custom event loop.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) try: client_tools.start() assert client_tools._running.is_set() assert client_tools._loop is custom_loop assert client_tools._thread is None # No thread created for custom loop finally: client_tools.stop() def test_tool_registration(self): """Test that tools can be registered correctly.""" client_tools = ClientTools() def sync_tool(params): return "sync result" async def async_tool(params): return "async result" client_tools.register("sync_tool", sync_tool, is_async=False) client_tools.register("async_tool", async_tool, is_async=True) assert "sync_tool" in client_tools.tools assert "async_tool" in client_tools.tools sync_handler, sync_is_async = client_tools.tools["sync_tool"] async_handler, async_is_async = client_tools.tools["async_tool"] assert sync_handler is sync_tool assert not sync_is_async assert async_handler is async_tool assert async_is_async def test_duplicate_tool_registration(self): """Test that registering a tool with the same name raises an error.""" client_tools = ClientTools() def tool(params): return "result" client_tools.register("test_tool", tool) with pytest.raises(ValueError, match="Tool 'test_tool' is already registered"): client_tools.register("test_tool", tool) def test_invalid_handler_registration(self): """Test that registering a non-callable handler raises an error.""" client_tools = ClientTools() with pytest.raises(ValueError, match="Handler must be callable"): client_tools.register("invalid_tool", "not_callable") @pytest.mark.asyncio async def test_sync_tool_execution_with_custom_loop(self): """Test executing a sync tool with a custom event loop.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) def sync_tool(params): return f"sync result: {params.get('input', 'default')}" client_tools.register("sync_tool", sync_tool, is_async=False) client_tools.start() try: result = await client_tools.handle("sync_tool", {"input": "test"}) assert result == "sync result: test" finally: client_tools.stop() @pytest.mark.asyncio async def test_async_tool_execution_with_custom_loop(self): """Test executing an async tool with a custom event loop.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) async def async_tool(params): await asyncio.sleep(0.01) # Simulate async work return f"async result: {params.get('input', 'default')}" client_tools.register("async_tool", async_tool, is_async=True) client_tools.start() try: result = await client_tools.handle("async_tool", {"input": "test"}) assert result == "async result: test" finally: client_tools.stop() @pytest.mark.asyncio async def test_tool_execution_with_callback_custom_loop(self): """Test executing a tool via callback mechanism with custom event loop.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) def sync_tool(params): return f"callback result: {params.get('data', 'none')}" client_tools.register("callback_tool", sync_tool, is_async=False) client_tools.start() callback_results = [] def test_callback(response): callback_results.append(response) try: client_tools.execute_tool( "callback_tool", {"tool_call_id": "test123", "data": "callback_test"}, test_callback ) # Wait for callback to be executed await asyncio.sleep(0.1) assert len(callback_results) == 1 response = callback_results[0] assert response["type"] == "client_tool_result" assert response["tool_call_id"] == "test123" assert "callback result: callback_test" in response["result"] assert response["is_error"] is False finally: client_tools.stop() def test_sync_tool_execution_with_default_loop(self): """Test executing a sync tool with default loop behavior.""" client_tools = ClientTools() def sync_tool(params): return f"default sync: {params.get('value', 'empty')}" client_tools.register("sync_tool", sync_tool, is_async=False) client_tools.start() # Use asyncio.run to test from a fresh event loop async def test(): result = await client_tools.handle("sync_tool", {"value": "default_test"}) return result try: result = asyncio.run(test()) assert result == "default sync: default_test" finally: client_tools.stop() @pytest.mark.asyncio async def test_unregistered_tool_error(self): """Test that calling an unregistered tool raises an error.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) client_tools.start() try: with pytest.raises(ValueError, match="Tool 'nonexistent' is not registered"): await client_tools.handle("nonexistent", {}) finally: client_tools.stop() def test_execute_tool_without_start(self): """Test that execute_tool raises error when not started.""" client_tools = ClientTools() def callback(response): pass with pytest.raises(RuntimeError, match="ClientTools event loop is not running"): client_tools.execute_tool("any_tool", {}, callback) @pytest.mark.asyncio async def test_tool_exception_handling(self): """Test that tool exceptions are handled correctly.""" custom_loop = asyncio.get_running_loop() client_tools = ClientTools(loop=custom_loop) def failing_tool(params): raise ValueError("Tool failed intentionally") client_tools.register("failing_tool", failing_tool, is_async=False) client_tools.start() callback_results = [] def error_callback(response): callback_results.append(response) try: client_tools.execute_tool( "failing_tool", {"tool_call_id": "error_test"}, error_callback ) # Wait for callback await asyncio.sleep(0.1) assert len(callback_results) == 1 response = callback_results[0] assert response["type"] == "client_tool_result" assert response["tool_call_id"] == "error_test" assert response["is_error"] is True assert "Tool failed intentionally" in response["result"] finally: client_tools.stop() @pytest.mark.asyncio async def test_event_loop_isolation(self): """Test that custom loop prevents 'different event loop' errors.""" # This test simulates the scenario mentioned in the GitHub issue main_loop = asyncio.get_running_loop() # Create ClientTools with the current loop client_tools = ClientTools(loop=main_loop) async def loop_aware_tool(params): # This tool checks which loop it's running on current_loop = asyncio.get_running_loop() return f"Running on loop: {id(current_loop)}" client_tools.register("loop_tool", loop_aware_tool, is_async=True) client_tools.start() try: result = await client_tools.handle("loop_tool", {}) # The result should indicate it's running on the same loop expected_loop_id = str(id(main_loop)) assert expected_loop_id in result finally: client_tools.stop() def test_stop_custom_loop_behavior(self): """Test that stop() doesn't close custom loops.""" custom_loop = asyncio.new_event_loop() client_tools = ClientTools(loop=custom_loop) try: client_tools.start() assert client_tools._running.is_set() client_tools.stop() assert not client_tools._running.is_set() # Custom loop should still be open and usable assert not custom_loop.is_closed() finally: custom_loop.close() def test_stop_default_loop_behavior(self): """Test that stop() properly cleans up default loops.""" client_tools = ClientTools() client_tools.start() assert client_tools._running.is_set() assert client_tools._thread is not None thread = client_tools._thread client_tools.stop() assert not client_tools._running.is_set() # Wait for thread to finish thread.join(timeout=1.0) assert not thread.is_alive()elevenlabs-elevenlabs-python-b6e5614/tests/test_convai.py000066400000000000000000000433411523660243400236710ustar00rootroot00000000000000from unittest.mock import MagicMock, patch from elevenlabs.conversational_ai.conversation import ( Conversation, AudioInterface, ConversationInitiationData, AgentChatResponsePartType, ) import json import time class MockAudioInterface(AudioInterface): def start(self, input_callback): print("Audio interface started") self.input_callback = input_callback def stop(self): print("Audio interface stopped") def output(self, audio): print(f"Would play audio of length: {len(audio)} bytes") def interrupt(self): print("Audio interrupted") # Add test constants and helpers at module level TEST_CONVERSATION_ID = "test123" TEST_AGENT_ID = "test_agent" def create_mock_websocket(messages=None): """Helper to create a mock websocket with predefined responses""" mock_ws = MagicMock() if messages is None: messages = [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, }, {"type": "agent_response", "agent_response_event": {"agent_response": "Hello there!"}}, ] def response_generator(): for msg in messages: yield json.dumps(msg) while True: yield '{"type": "keep_alive"}' mock_ws.recv = MagicMock(side_effect=response_generator()) return mock_ws def test_conversation_basic_flow(): # Mock setup mock_ws = create_mock_websocket() mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" agent_response_callback = MagicMock() test_user_id = "test_user_123" # Setup the conversation with user_id passed directly to the constructor conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, user_id=test_user_id, requires_auth=False, audio_interface=MockAudioInterface(), callback_agent_response=agent_response_callback, ) # Run the test with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() # Add a wait for the callback to be called timeout = 5 # 5 seconds timeout start_time = time.time() while not agent_response_callback.called and time.time() - start_time < timeout: time.sleep(0.1) conversation.end_session() conversation.wait_for_session_end() # Assertions - check the call was made with the right structure send_calls = [call[0][0] for call in mock_ws.send.call_args_list] init_messages = [json.loads(call) for call in send_calls if 'conversation_initiation_client_data' in call] assert len(init_messages) == 1 init_message = init_messages[0] assert init_message["type"] == "conversation_initiation_client_data" assert init_message["custom_llm_extra_body"] == {} assert init_message["conversation_config_override"] == {} assert init_message["dynamic_variables"] == {} assert init_message["source_info"]["source"] == "python_sdk" assert "version" in init_message["source_info"] assert init_message["user_id"] == test_user_id agent_response_callback.assert_called_once_with("Hello there!") assert conversation._conversation_id == TEST_CONVERSATION_ID assert conversation.user_id == test_user_id def test_conversation_with_auth(): # Mock setup mock_client = MagicMock() mock_client.conversational_ai.conversations.get_signed_url.return_value.signed_url = "wss://signed.url" mock_ws = create_mock_websocket( [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, } ] ) conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=True, audio_interface=MockAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() conversation.end_session() conversation.wait_for_session_end() # Assertions mock_client.conversational_ai.conversations.get_signed_url.assert_called_once_with(agent_id=TEST_AGENT_ID, environment=None) def test_conversation_with_dynamic_variables(): # Mock setup mock_ws = create_mock_websocket() mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" agent_response_callback = MagicMock() dynamic_variables = {"name": "angelo"} config = ConversationInitiationData(dynamic_variables=dynamic_variables) # Setup the conversation conversation = Conversation( client=mock_client, config=config, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAudioInterface(), callback_agent_response=agent_response_callback, ) # Run the test with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() # Add a wait for the callback to be called timeout = 5 # 5 seconds timeout start_time = time.time() while not agent_response_callback.called and time.time() - start_time < timeout: time.sleep(0.1) conversation.end_session() conversation.wait_for_session_end() # Assertions - check the call was made with the right structure send_calls = [call[0][0] for call in mock_ws.send.call_args_list] init_messages = [json.loads(call) for call in send_calls if 'conversation_initiation_client_data' in call] assert len(init_messages) == 1 init_message = init_messages[0] assert init_message["type"] == "conversation_initiation_client_data" assert init_message["custom_llm_extra_body"] == {} assert init_message["conversation_config_override"] == {} assert init_message["dynamic_variables"] == {"name": "angelo"} assert init_message["source_info"]["source"] == "python_sdk" assert "version" in init_message["source_info"] agent_response_callback.assert_called_once_with("Hello there!") assert conversation._conversation_id == TEST_CONVERSATION_ID def test_conversation_with_contextual_update(): # Mock setup mock_ws = create_mock_websocket([]) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" # Setup the conversation conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAudioInterface(), ) # Run the test with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() time.sleep(0.1) conversation.send_contextual_update("User appears to be looking at pricing page") # Teardown conversation.end_session() conversation.wait_for_session_end() # Assertions expected = json.dumps({"type": "contextual_update", "text": "User appears to be looking at pricing page"}) mock_ws.send.assert_any_call(expected) def test_conversation_wss_url_generation_without_get_environment(): from elevenlabs.core.client_wrapper import SyncClientWrapper # Test with various base URL formats to ensure robustness test_cases = [ ("https://api.elevenlabs.io", "wss://api.elevenlabs.io"), ("https://api.us.elevenlabs.io", "wss://api.us.elevenlabs.io"), ("https://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io"), ("http://localhost:8000", "ws://localhost:8000"), ] for base_url, expected_ws_base in test_cases: # Create a real SyncClientWrapper to ensure it doesn't have get_environment method mock_client = MagicMock() mock_client._client_wrapper = SyncClientWrapper( base_url=base_url, api_key="test_key", httpx_client=MagicMock(), timeout=30.0 ) # Create conversation with requires_auth=False conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAudioInterface() ) try: wss_url = conversation._get_wss_url() # Verify the URL is correctly generated expected_url = f"{expected_ws_base}/v1/convai/conversation?agent_id={TEST_AGENT_ID}&source=python_sdk&version=" assert wss_url.startswith(expected_url), f"URL should start with {expected_url}, got {wss_url}" # Verify the URL contains version parameter assert "version=" in wss_url, f"URL should contain version parameter, got {wss_url}" except AttributeError as e: if "get_environment" in str(e): assert False else: raise # Re-raise if it's a different AttributeError except Exception as e: assert False, f"Unexpected error generating WebSocket URL: {e}" def test_websocket_url_construction_edge_cases(): """Test WebSocket URL construction edge cases, specifically for trailing slash handling.""" from elevenlabs.core.client_wrapper import SyncClientWrapper from elevenlabs.conversational_ai.conversation import Conversation from elevenlabs.realtime_tts import RealtimeTextToSpeechClient # Test cases with various base URL formats test_cases = [ # Base URLs without trailing slashes (the main edge case) ("https://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io"), ("https://api.elevenlabs.io", "wss://api.elevenlabs.io", "wss://api.elevenlabs.io"), ("http://localhost:8000", "ws://localhost:8000", "wss://localhost:8000"), # Base URLs with trailing slashes (should still work) ("https://api.eu.residency.elevenlabs.io/", "wss://api.eu.residency.elevenlabs.io", "wss://api.eu.residency.elevenlabs.io/"), ("https://api.elevenlabs.io/", "wss://api.elevenlabs.io", "wss://api.elevenlabs.io/"), ("http://localhost:8000/", "ws://localhost:8000", "wss://localhost:8000/"), ] for base_url, expected_ws_base, expected_tts_ws_base in test_cases: # Test conversation WebSocket URL construction mock_client = MagicMock() mock_client._client_wrapper = SyncClientWrapper( base_url=base_url, api_key="test_key", httpx_client=MagicMock(), timeout=30.0 ) conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAudioInterface() ) # Test conversation URL generation conv_url = conversation._get_wss_url() expected_conv_url = f"{expected_ws_base}/v1/convai/conversation" assert expected_conv_url in conv_url, f"Conversation URL should contain {expected_conv_url}, got {conv_url}" # Ensure no double slashes in the path (except after the protocol) url_path = conv_url.split("://", 1)[1] # Remove protocol assert "//" not in url_path, f"URL should not contain double slashes in path: {conv_url}" # Test realtime TTS WebSocket URL construction realtime_client = RealtimeTextToSpeechClient(client_wrapper=mock_client._client_wrapper) # Test the WebSocket base URL construction # Note: realtime TTS always uses wss scheme, not ws assert realtime_client._ws_base_url == expected_tts_ws_base, f"TTS WebSocket base URL should be {expected_tts_ws_base}, got {realtime_client._ws_base_url}" # Test full URL construction using urljoin (simulating the actual method) import urllib.parse test_voice_id = "test_voice_123" test_model = "eleven_turbo_v2_5" test_format = "mp3_44100_128" relative_path = f"v1/text-to-speech/{test_voice_id}/stream-input?model_id={test_model}&output_format={test_format}" full_tts_url = urllib.parse.urljoin(realtime_client._ws_base_url, relative_path) # For URLs with trailing slash, expect it to be preserved in the joined URL expected_tts_url_base = expected_tts_ws_base.rstrip('/') + "/v1/text-to-speech/" + test_voice_id + "/stream-input" assert expected_tts_url_base in full_tts_url, f"TTS URL should contain {expected_tts_url_base}, got {full_tts_url}" # Ensure no double slashes in the path tts_url_path = full_tts_url.split("://", 1)[1] assert "//" not in tts_url_path, f"TTS URL should not contain double slashes in path: {full_tts_url}" def test_conversation_streaming_text_response(): mock_ws = create_mock_websocket( [ { "type": "conversation_initiation_metadata", "conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID}, }, { "type": "agent_chat_response_part", "text_response_part": {"text": "", "type": "start"}, }, { "type": "agent_chat_response_part", "text_response_part": {"text": "Hello", "type": "delta"}, }, { "type": "agent_chat_response_part", "text_response_part": {"text": " there", "type": "delta"}, }, { "type": "agent_chat_response_part", "text_response_part": {"text": "!", "type": "delta"}, }, { "type": "agent_chat_response_part", "text_response_part": {"text": "", "type": "stop"}, }, ] ) mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" streaming_calls = [] def streaming_callback(text, part_type): streaming_calls.append((text, part_type)) conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=MockAudioInterface(), callback_agent_chat_response_part=streaming_callback, ) with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() timeout = 5 start_time = time.time() while len(streaming_calls) < 5 and time.time() - start_time < timeout: time.sleep(0.1) conversation.end_session() conversation.wait_for_session_end() assert len(streaming_calls) == 5, f"Expected 5 streaming calls, got {len(streaming_calls)}" assert streaming_calls[0] == ("", AgentChatResponsePartType.START) assert streaming_calls[1] == ("Hello", AgentChatResponsePartType.DELTA) assert streaming_calls[2] == (" there", AgentChatResponsePartType.DELTA) assert streaming_calls[3] == ("!", AgentChatResponsePartType.DELTA) assert streaming_calls[4] == ("", AgentChatResponsePartType.STOP) def test_text_only_mode_auto_sets_config(): """When audio_interface is None, text_only should be auto-set in config.""" mock_ws = create_mock_websocket() mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" conversation = Conversation( client=mock_client, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=None, ) assert conversation.config.conversation_config_override.get("text_only") is True with patch("elevenlabs.conversational_ai.conversation.connect") as mock_connect: mock_connect.return_value.__enter__.return_value = mock_ws conversation.start_session() conversation.end_session() conversation.wait_for_session_end() send_calls = [call[0][0] for call in mock_ws.send.call_args_list] init_messages = [json.loads(call) for call in send_calls if 'conversation_initiation_client_data' in call] assert len(init_messages) == 1 assert init_messages[0]["conversation_config_override"]["text_only"] is True def test_text_only_mode_preserves_explicit_override(): """When user explicitly sets text_only=False, the override should be preserved.""" mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" config = ConversationInitiationData(conversation_config_override={"text_only": False}) conversation = Conversation( client=mock_client, config=config, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=None, ) assert conversation.config.conversation_config_override["text_only"] is False def test_text_only_mode_does_not_mutate_original_config(): """Setting text_only should not mutate the caller's original config dict.""" mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" original_override = {"some_setting": "value"} config = ConversationInitiationData(conversation_config_override=original_override) Conversation( client=mock_client, config=config, agent_id=TEST_AGENT_ID, requires_auth=False, audio_interface=None, ) assert "text_only" not in original_override # The ConversationInitiationData object itself should also be unmodified assert "text_only" not in config.conversation_config_override elevenlabs-elevenlabs-python-b6e5614/tests/test_convai_imports.py000066400000000000000000000002071523660243400254400ustar00rootroot00000000000000from elevenlabs import ElevenLabs def test_convai_imports(): client = ElevenLabs(api_key="") client.conversational_ai.agents elevenlabs-elevenlabs-python-b6e5614/tests/test_convai_on_prem.py000066400000000000000000000074501523660243400254110ustar00rootroot00000000000000import json from unittest.mock import MagicMock import pytest from elevenlabs.conversational_ai.conversation import ( AudioInterface, Conversation, OnPremInitiationData, PostCallWebhookConfig, ) class MockAudioInterface(AudioInterface): def start(self, input_callback): self.input_callback = input_callback def stop(self): pass def output(self, audio): pass def interrupt(self): pass def _make_conversation(on_prem_config: OnPremInitiationData) -> Conversation: mock_client = MagicMock() mock_client._client_wrapper.get_base_url.return_value = "https://api.elevenlabs.io" return Conversation( client=mock_client, agent_id="", requires_auth=False, audio_interface=MockAudioInterface(), # Mocked so the constructor's client_tools.start() does not spawn a real # event-loop thread; these tests only exercise message serialization. client_tools=MagicMock(), on_prem_config=on_prem_config, ) def test_post_call_webhook_config_to_dict(): assert PostCallWebhookConfig(url="https://example.com/hook").to_dict() == {"url": "https://example.com/hook"} assert PostCallWebhookConfig(url="https://example.com/hook", hmac_secret="0123456789abcdef").to_dict() == { "url": "https://example.com/hook", "hmac_secret": "0123456789abcdef", } def test_on_prem_initiation_message_includes_typed_webhooks(): conversation = _make_conversation( OnPremInitiationData( on_prem_conversation_url="ws://localhost:8000/sagemaker/convai/conversation", post_call_transcription_webhook=PostCallWebhookConfig( url="https://example.com/transcript", hmac_secret="0123456789abcdef" ), post_call_audio_webhook=PostCallWebhookConfig(url="https://example.com/audio"), ) ) message = json.loads(conversation._create_on_prem_initiation_message()) assert message["type"] == "enclave_setup_config" assert message["post_call_transcription_webhook"] == { "url": "https://example.com/transcript", "hmac_secret": "0123456789abcdef", } assert message["post_call_audio_webhook"] == {"url": "https://example.com/audio"} assert message["post_call_transcription_webhook_url"] is None assert message["post_call_audio_webhook_url"] is None def test_on_prem_initiation_message_omits_typed_webhooks_when_unset(): conversation = _make_conversation( OnPremInitiationData( on_prem_conversation_url="ws://localhost:8000/sagemaker/convai/conversation", post_call_transcription_webhook_url="https://example.com/transcript", ) ) message = json.loads(conversation._create_on_prem_initiation_message()) assert "post_call_transcription_webhook" not in message assert "post_call_audio_webhook" not in message assert message["post_call_transcription_webhook_url"] == "https://example.com/transcript" def test_on_prem_initiation_data_rejects_legacy_and_typed_transcription_webhook(): with pytest.raises(ValueError, match="not both"): OnPremInitiationData( on_prem_conversation_url="ws://localhost:8000/sagemaker/convai/conversation", post_call_transcription_webhook_url="https://example.com/hook", post_call_transcription_webhook=PostCallWebhookConfig(url="https://example.com/hook"), ) def test_on_prem_initiation_data_rejects_legacy_and_typed_audio_webhook(): with pytest.raises(ValueError, match="not both"): OnPremInitiationData( on_prem_conversation_url="ws://localhost:8000/sagemaker/convai/conversation", post_call_audio_webhook_url="https://example.com/hook", post_call_audio_webhook=PostCallWebhookConfig(url="https://example.com/hook"), ) elevenlabs-elevenlabs-python-b6e5614/tests/test_history.py000066400000000000000000000003561523660243400241120ustar00rootroot00000000000000from elevenlabs import GetSpeechHistoryResponse, ElevenLabs def test_history(): client = ElevenLabs() page_size = 5 history = client.history.list(page_size=page_size) assert isinstance(history, GetSpeechHistoryResponse) elevenlabs-elevenlabs-python-b6e5614/tests/test_models.py000066400000000000000000000003421523660243400236670ustar00rootroot00000000000000from elevenlabs import Model from elevenlabs.client import ElevenLabs def test_models_get_all(): client = ElevenLabs() models = client.models.list() assert len(models) > 0 assert isinstance(models[0], Model) elevenlabs-elevenlabs-python-b6e5614/tests/test_music_multipart.py000066400000000000000000000054111523660243400256270ustar00rootroot00000000000000import json import pytest from elevenlabs.music_custom import MusicClient, _find_audio_start SAMPLE_JSON = {"compositionPlan": {"sections": []}, "songMetadata": {"title": "Test"}} SAMPLE_AUDIO = bytes(range(256)) * 4 def _build_multipart(line_ending: bytes) -> bytes: """Build a realistic multipart response with the given line ending.""" boundary = b"--boundary123" nl = line_ending parts = [] parts.append(boundary + nl) parts.append(b"Content-Type: application/json" + nl) parts.append(nl) parts.append(json.dumps(SAMPLE_JSON).encode("utf-8") + nl) parts.append(boundary + nl) parts.append(b"Content-Type: audio/mpeg" + nl) parts.append(b'Content-Disposition: attachment; filename="test_song.mp3"' + nl) parts.append(nl) parts.append(SAMPLE_AUDIO) parts.append(nl + boundary + b"--" + nl) return b"".join(parts) class TestFindAudioStart: def test_crlf(self): data = b"Header: value\r\n\r\naudio data here" assert _find_audio_start(data, 0) == data.index(b"audio") def test_lf(self): data = b"Header: value\n\naudio data here" assert _find_audio_start(data, 0) == data.index(b"audio") def test_crlf_preferred_over_lf(self): data = b"Header: value\r\n\r\naudio data here" pos = _find_audio_start(data, 0) assert data[pos : pos + 5] == b"audio" def test_raises_when_no_separator(self): with pytest.raises(ValueError, match="header/body separator"): _find_audio_start(b"no blank line here", 0) def test_start_offset_respected(self): data = b"skip\n\nHeader: value\r\n\r\naudio" pos = _find_audio_start(data, 6) assert data[pos : pos + 5] == b"audio" class TestParseMultipart: @staticmethod def _parse(data: bytes): return MusicClient._parse_multipart(None, iter([data])) # type: ignore[arg-type] def test_crlf_line_endings(self): data = _build_multipart(b"\r\n") result = self._parse(data) assert result.audio.startswith(SAMPLE_AUDIO) assert result.json == SAMPLE_JSON assert result.filename == "test_song.mp3" def test_lf_line_endings(self): data = _build_multipart(b"\n") result = self._parse(data) assert result.audio.startswith(SAMPLE_AUDIO) assert result.json == SAMPLE_JSON assert result.filename == "test_song.mp3" def test_audio_bytes_not_corrupted(self): for nl in [b"\r\n", b"\n"]: data = _build_multipart(nl) result = self._parse(data) assert result.audio[:4] == SAMPLE_AUDIO[:4], ( f"First 4 bytes mismatch with {nl!r} line endings — possible byte offset error" ) assert result.audio[: len(SAMPLE_AUDIO)] == SAMPLE_AUDIO elevenlabs-elevenlabs-python-b6e5614/tests/test_recursive_models.py000066400000000000000000000006511523660243400257610ustar00rootroot00000000000000from elevenlabs import AgentWorkflowRequestModel, ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyOutput def test_recursive_models(): # Should be able to import and use the recursive types without PydanticUserError # ObjectJsonSchemaPropertyInput has no required fields, so it can be instantiated ObjectJsonSchemaPropertyInput() ObjectJsonSchemaPropertyOutput() AgentWorkflowRequestModel() elevenlabs-elevenlabs-python-b6e5614/tests/test_speech_engine_auth.py000066400000000000000000000275541523660243400262370ustar00rootroot00000000000000"""Tests for Speech Engine JWT verification.""" import asyncio import base64 import hashlib import hmac import json import time import typing import warnings import pytest from websockets.asyncio.client import connect as ws_connect from websockets.exceptions import InvalidStatus from elevenlabs.speech_engine import SpeechEngineServer from elevenlabs.speech_engine.resource import ( SpeechEngineResource, verify_speech_engine_jwt, ) TEST_API_KEY = "test-key" JWT_ISSUER = "https://api.elevenlabs.io/convai/speech-engine" JWT_SUBJECT = "convai_speech_engine_upstream" # --------------------------------------------------------------------------- # JWT test helpers # --------------------------------------------------------------------------- def _base64url_encode(data: bytes) -> str: return base64.urlsafe_b64encode(data).rstrip(b"=").decode("ascii") def _create_test_jwt( payload: typing.Dict[str, typing.Any], api_key: str = TEST_API_KEY, ) -> str: header = {"alg": "HS256", "typ": "JWT"} header_b64 = _base64url_encode(json.dumps(header).encode()) payload_b64 = _base64url_encode(json.dumps(payload).encode()) secret = hashlib.sha256(api_key.encode("utf-8")).digest() signature = hmac.new( secret, f"{header_b64}.{payload_b64}".encode(), hashlib.sha256 ).digest() return f"{header_b64}.{payload_b64}.{_base64url_encode(signature)}" def _valid_payload(**overrides: typing.Any) -> typing.Dict[str, typing.Any]: now = int(time.time()) return { "iss": JWT_ISSUER, "sub": JWT_SUBJECT, "iat": now, "exp": now + 300, **overrides, } # --------------------------------------------------------------------------- # verify_speech_engine_jwt # --------------------------------------------------------------------------- class TestVerifySpeechEngineJwt: def test_valid_token(self) -> None: token = _create_test_jwt(_valid_payload()) payload = verify_speech_engine_jwt(token, TEST_API_KEY) assert payload["iss"] == JWT_ISSUER assert payload["sub"] == JWT_SUBJECT def test_accepts_bearer_prefix(self) -> None: token = _create_test_jwt(_valid_payload()) payload = verify_speech_engine_jwt(f"Bearer {token}", TEST_API_KEY) assert payload["iss"] == JWT_ISSUER def test_rejects_wrong_key(self) -> None: token = _create_test_jwt(_valid_payload(), api_key="other-key") with pytest.raises(ValueError, match="signature mismatch"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_rejects_wrong_issuer(self) -> None: token = _create_test_jwt(_valid_payload(iss="https://evil.com")) with pytest.raises(ValueError, match="expected issuer"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_rejects_wrong_subject(self) -> None: token = _create_test_jwt(_valid_payload(sub="wrong_subject")) with pytest.raises(ValueError, match="expected subject"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_rejects_expired_token_beyond_leeway(self) -> None: now = int(time.time()) token = _create_test_jwt( _valid_payload(exp=now - 120, iat=now - 420) ) with pytest.raises(ValueError, match="expired"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_accepts_expired_within_leeway(self) -> None: now = int(time.time()) token = _create_test_jwt( _valid_payload(exp=now - 30, iat=now - 330) ) payload = verify_speech_engine_jwt(token, TEST_API_KEY) assert payload["iss"] == JWT_ISSUER def test_rejects_future_iat_beyond_leeway(self) -> None: now = int(time.time()) token = _create_test_jwt( _valid_payload(iat=now + 120, exp=now + 420) ) with pytest.raises(ValueError, match="iat is in the future"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_accepts_future_iat_within_leeway(self) -> None: now = int(time.time()) token = _create_test_jwt( _valid_payload(iat=now + 30, exp=now + 330) ) payload = verify_speech_engine_jwt(token, TEST_API_KEY) assert payload["iss"] == JWT_ISSUER def test_rejects_malformed_token(self) -> None: with pytest.raises(ValueError, match="expected 3 parts"): verify_speech_engine_jwt("not.a.valid.jwt.token", TEST_API_KEY) def test_rejects_missing_exp(self) -> None: payload = _valid_payload() del payload["exp"] token = _create_test_jwt(payload) with pytest.raises(ValueError, match="missing exp"): verify_speech_engine_jwt(token, TEST_API_KEY) def test_rejects_missing_iat(self) -> None: payload = _valid_payload() del payload["iat"] token = _create_test_jwt(payload) with pytest.raises(ValueError, match="missing iat"): verify_speech_engine_jwt(token, TEST_API_KEY) # --------------------------------------------------------------------------- # SpeechEngineResource.verify_request # --------------------------------------------------------------------------- class _FakeClientWrapper: def __init__(self, api_key: str) -> None: self._api_key = api_key def get_headers(self) -> dict: return {"xi-api-key": self._api_key} class TestVerifyRequest: def test_valid_header(self) -> None: resource = SpeechEngineResource( "seng_test", client_wrapper=_FakeClientWrapper(TEST_API_KEY) ) token = _create_test_jwt(_valid_payload()) assert resource.verify_request( {"x-elevenlabs-speech-engine-authorization": token} ) def test_missing_header(self) -> None: resource = SpeechEngineResource( "seng_test", client_wrapper=_FakeClientWrapper(TEST_API_KEY) ) assert not resource.verify_request({}) def test_no_api_key(self) -> None: resource = SpeechEngineResource("seng_test") token = _create_test_jwt(_valid_payload()) assert not resource.verify_request( {"x-elevenlabs-speech-engine-authorization": token} ) def test_invalid_token(self) -> None: resource = SpeechEngineResource( "seng_test", client_wrapper=_FakeClientWrapper(TEST_API_KEY) ) assert not resource.verify_request( {"x-elevenlabs-speech-engine-authorization": "bad-token"} ) # --------------------------------------------------------------------------- # SpeechEngineServer — api_key requirement # --------------------------------------------------------------------------- class TestServerApiKeyRequirement: @pytest.mark.asyncio async def test_raises_without_api_key(self, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.delenv("ELEVENLABS_API_KEY", raising=False) from elevenlabs.speech_engine import SpeechEngineServer server = SpeechEngineServer(port=0) with pytest.raises(RuntimeError, match="API key"): await server.serve() # --------------------------------------------------------------------------- # SpeechEngineServer — disable_auth # --------------------------------------------------------------------------- async def _run_server_briefly(server: SpeechEngineServer) -> asyncio.Task: """Start ``server`` in a background task and wait until it's listening.""" task = asyncio.create_task(server.serve()) # Give the server loop a moment to reach `await self._stop_event.wait()`. for _ in range(50): await asyncio.sleep(0.02) if server._server is not None: break return task def _server_port(server: SpeechEngineServer) -> int: import socket as _socket # websockets.serve(host="") binds both IPv4 and IPv6; on macOS the first # socket is often IPv6. Prefer an IPv4 socket so the client can connect # via 127.0.0.1 reliably. ipv4 = [ s for s in server._server.sockets if s.family == _socket.AF_INET ] chosen = ipv4[0] if ipv4 else next(iter(server._server.sockets), None) if chosen is None: raise RuntimeError("server has no sockets") return int(chosen.getsockname()[1]) class TestServerDisableAuth: @pytest.mark.asyncio async def test_serves_without_api_key_when_disable_auth( self, monkeypatch: pytest.MonkeyPatch ) -> None: monkeypatch.delenv("ELEVENLABS_API_KEY", raising=False) server = SpeechEngineServer(port=0, disable_auth=True) task = None try: with warnings.catch_warnings(): warnings.simplefilter("ignore") task = await _run_server_briefly(server) assert server._server is not None finally: await server.stop() if task is not None: await task @pytest.mark.asyncio async def test_emits_warning_when_disable_auth( self, monkeypatch: pytest.MonkeyPatch ) -> None: monkeypatch.delenv("ELEVENLABS_API_KEY", raising=False) server = SpeechEngineServer(port=0, disable_auth=True) task = None try: with warnings.catch_warnings(record=True) as caught: warnings.simplefilter("always") task = await _run_server_briefly(server) messages = [str(w.message) for w in caught] assert any("authentication is disabled" in m for m in messages) finally: await server.stop() if task is not None: await task @pytest.mark.asyncio async def test_accepts_unauthenticated_connection( self, monkeypatch: pytest.MonkeyPatch ) -> None: monkeypatch.delenv("ELEVENLABS_API_KEY", raising=False) init_ids: typing.List[str] = [] async def on_init(conversation_id: str, session: typing.Any) -> None: init_ids.append(conversation_id) server = SpeechEngineServer(port=0, disable_auth=True, on_init=on_init) task = None try: with warnings.catch_warnings(): warnings.simplefilter("ignore") task = await _run_server_briefly(server) port = _server_port(server) async with ws_connect(f"ws://127.0.0.1:{port}") as ws: await ws.send( json.dumps({"type": "init", "conversation_id": "conv_1"}) ) await asyncio.sleep(0.1) assert init_ids == ["conv_1"] finally: await server.stop() if task is not None: await task @pytest.mark.asyncio async def test_rejects_missing_header_when_auth_enabled(self) -> None: server = SpeechEngineServer(port=0, api_key=TEST_API_KEY) task = None try: task = await _run_server_briefly(server) port = _server_port(server) with pytest.raises(InvalidStatus) as exc: async with ws_connect(f"ws://127.0.0.1:{port}"): pass assert exc.value.response.status_code == 401 finally: await server.stop() if task is not None: await task @pytest.mark.asyncio async def test_rejects_invalid_jwt_when_auth_enabled(self) -> None: server = SpeechEngineServer(port=0, api_key=TEST_API_KEY) task = None try: task = await _run_server_briefly(server) port = _server_port(server) with pytest.raises(InvalidStatus) as exc: async with ws_connect( f"ws://127.0.0.1:{port}", additional_headers={ "X-Elevenlabs-Speech-Engine-Authorization": "not.a.jwt" }, ): pass assert exc.value.response.status_code == 401 finally: await server.stop() if task is not None: await task elevenlabs-elevenlabs-python-b6e5614/tests/test_speech_engine_custom.py000066400000000000000000000067051523660243400266030ustar00rootroot00000000000000"""Tests for SpeechEngineClient and AsyncSpeechEngineClient wrapper methods.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest from elevenlabs.speech_engine.client import AsyncSpeechEngineClient as AutogeneratedAsyncSpeechEngineClient from elevenlabs.speech_engine.client import SpeechEngineClient as AutogeneratedSpeechEngineClient from elevenlabs.speech_engine.resource import SpeechEngineResource from elevenlabs.speech_engine_custom import AsyncSpeechEngineClient, SpeechEngineClient from elevenlabs.types.speech_engine_config import SpeechEngineConfig from elevenlabs.types.speech_engine_response import SpeechEngineResponse def _make_sync_client() -> SpeechEngineClient: return SpeechEngineClient(client_wrapper=MagicMock()) def _make_async_client() -> AsyncSpeechEngineClient: return AsyncSpeechEngineClient(client_wrapper=MagicMock()) # --------------------------------------------------------------------------- # Sync # --------------------------------------------------------------------------- def test_create_returns_resource() -> None: client = _make_sync_client() mock_response = MagicMock(spec=SpeechEngineResponse, speech_engine_id="seng_abc") with patch.object(AutogeneratedSpeechEngineClient, "create", return_value=mock_response): result = client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test")) assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" def test_get_returns_resource() -> None: client = _make_sync_client() with patch.object(AutogeneratedSpeechEngineClient, "get", return_value=None): result = client.get("seng_abc") assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" def test_update_returns_resource() -> None: client = _make_sync_client() with patch.object(AutogeneratedSpeechEngineClient, "update", return_value=None): result = client.update("seng_abc", name="Renamed") assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" # --------------------------------------------------------------------------- # Async # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_async_create_returns_resource() -> None: client = _make_async_client() mock_response = MagicMock(spec=SpeechEngineResponse, speech_engine_id="seng_abc") with patch.object(AutogeneratedAsyncSpeechEngineClient, "create", new_callable=AsyncMock, return_value=mock_response): result = await client.create(speech_engine=SpeechEngineConfig(ws_url="wss://test")) assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" @pytest.mark.asyncio async def test_async_get_returns_resource() -> None: client = _make_async_client() with patch.object(AutogeneratedAsyncSpeechEngineClient, "get", new_callable=AsyncMock, return_value=None): result = await client.get("seng_abc") assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" @pytest.mark.asyncio async def test_async_update_returns_resource() -> None: client = _make_async_client() with patch.object(AutogeneratedAsyncSpeechEngineClient, "update", new_callable=AsyncMock, return_value=None): result = await client.update("seng_abc", name="Renamed") assert isinstance(result, SpeechEngineResource) assert result.engine_id == "seng_abc" elevenlabs-elevenlabs-python-b6e5614/tests/test_speech_engine_resource.py000066400000000000000000000065161523660243400271200ustar00rootroot00000000000000"""Tests for SpeechEngineResource — mirrors SpeechEngineResource.test.ts.""" import asyncio import json import typing import pytest from elevenlabs.speech_engine import SpeechEngineResource, SpeechEngineSession # --------------------------------------------------------------------------- # MockWebSocket (same as session tests) # --------------------------------------------------------------------------- _CLOSE_SENTINEL = object() class MockWebSocket: def __init__(self) -> None: self._inbox = asyncio.Queue() # type: asyncio.Queue[typing.Any] self.sent = [] # type: typing.List[str] self.closed = False async def recv(self) -> str: msg = await self._inbox.get() if msg is _CLOSE_SENTINEL: raise ConnectionError("connection closed") return msg async def send(self, data: str) -> None: self.sent.append(data) async def close(self) -> None: self.closed = True def receive_message(self, msg: typing.Dict[str, typing.Any]) -> None: self._inbox.put_nowait(json.dumps(msg)) def simulate_disconnect(self) -> None: self._inbox.put_nowait(_CLOSE_SENTINEL) # --------------------------------------------------------------------------- # create_session # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_create_session_returns_speech_engine_session() -> None: resource = SpeechEngineResource("seng_test") ws = MockWebSocket() session = resource.create_session(ws) assert isinstance(session, SpeechEngineSession) @pytest.mark.asyncio async def test_create_session_protocol_works() -> None: """Full send/receive cycle through a session created by the resource.""" resource = SpeechEngineResource("seng_test") ws = MockWebSocket() session = resource.create_session(ws, debug=False) async def handler(transcript: typing.Any) -> None: last = transcript[-1] await session.send_response("echo: {}".format(last.content)) session.on("user_transcript", handler) ws.receive_message( { "type": "user_transcript", "user_transcript": [{"role": "user", "content": "hello"}], "event_id": 1, } ) ws.simulate_disconnect() await session.run() sent = [json.loads(s) for s in ws.sent] assert sent[0] == { "type": "agent_response", "content": "echo: hello", "event_id": 1, "is_final": False, } # --------------------------------------------------------------------------- # client accessor stub # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_async_client_speech_engine_get() -> None: """The AsyncElevenLabs.speech_engine.get() returns a SpeechEngineResource.""" from unittest.mock import AsyncMock, patch from elevenlabs import AsyncElevenLabs from elevenlabs.speech_engine.client import AsyncSpeechEngineClient as AutogeneratedAsyncSpeechEngineClient client = AsyncElevenLabs(api_key="test-key") with patch.object(AutogeneratedAsyncSpeechEngineClient, "get", new_callable=AsyncMock, return_value=None): resource = await client.speech_engine.get("seng_123") assert isinstance(resource, SpeechEngineResource) assert resource.engine_id == "seng_123" elevenlabs-elevenlabs-python-b6e5614/tests/test_speech_engine_server.py000066400000000000000000000107551523660243400265770ustar00rootroot00000000000000"""Tests for SpeechEngineServer — mirrors SpeechEngineServer.test.ts.""" import asyncio import json import typing import pytest import websockets from elevenlabs.speech_engine import SpeechEngineServer # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- async def _connect_and_send( port: int, messages: typing.List[typing.Dict[str, typing.Any]], ) -> typing.List[typing.Dict[str, typing.Any]]: """Open a client WS, send *messages*, and collect the first response.""" uri = "ws://127.0.0.1:{}".format(port) received = [] # type: typing.List[typing.Dict[str, typing.Any]] async with websockets.connect(uri) as ws: # type: ignore[attr-defined] for msg in messages: await ws.send(json.dumps(msg)) # Give the server a moment to process and respond. try: while True: raw = await asyncio.wait_for(ws.recv(), timeout=0.2) received.append(json.loads(raw)) except (asyncio.TimeoutError, websockets.exceptions.ConnectionClosed): pass return received # --------------------------------------------------------------------------- # handleConnection # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_handle_connection_wraps_ws_and_calls_on_init() -> None: init_ids = [] # type: typing.List[str] async def on_init(conversation_id: str, session: typing.Any) -> None: init_ids.append(conversation_id) server = SpeechEngineServer(port=0, on_init=on_init) # Use port 0 to get an ephemeral port; start via websockets directly. started = asyncio.Event() actual_port = 0 async def _handler(ws: typing.Any, *_args: typing.Any) -> None: session = server.handle_connection(ws) await session.run() ws_server = await websockets.serve(_handler, "127.0.0.1", 0) # type: ignore[attr-defined] for sock in ws_server.sockets: actual_port = sock.getsockname()[1] break try: uri = "ws://127.0.0.1:{}".format(actual_port) async with websockets.connect(uri) as client: # type: ignore[attr-defined] await client.send( json.dumps({"type": "init", "conversation_id": "conv_1"}) ) await asyncio.sleep(0.1) finally: ws_server.close() await ws_server.wait_closed() assert init_ids == ["conv_1"] # --------------------------------------------------------------------------- # Session responses are received by the client # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_session_responses_received_by_client() -> None: async def on_transcript( transcript: typing.Any, session: typing.Any ) -> None: last = transcript[-1] await session.send_response("echo: {}".format(last.content)) server = SpeechEngineServer(port=0, on_transcript=on_transcript) async def _handler(ws: typing.Any, *_args: typing.Any) -> None: session = server.handle_connection(ws) await session.run() ws_server = await websockets.serve(_handler, "127.0.0.1", 0) # type: ignore[attr-defined] actual_port = 0 for sock in ws_server.sockets: actual_port = sock.getsockname()[1] break try: uri = "ws://127.0.0.1:{}".format(actual_port) async with websockets.connect(uri) as client: # type: ignore[attr-defined] await client.send( json.dumps( { "type": "user_transcript", "user_transcript": [{"role": "user", "content": "ping"}], "event_id": 1, } ) ) raw = await asyncio.wait_for(client.recv(), timeout=1.0) response = json.loads(raw) finally: ws_server.close() await ws_server.wait_closed() assert response == { "type": "agent_response", "content": "echo: ping", "event_id": 1, "is_final": False, } # --------------------------------------------------------------------------- # Lifecycle # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_stop_resolves_when_no_server_running() -> None: server = SpeechEngineServer() await server.stop() # Should not raise. elevenlabs-elevenlabs-python-b6e5614/tests/test_speech_engine_session.py000066400000000000000000000626711523660243400267600ustar00rootroot00000000000000"""Tests for SpeechEngineSession — mirrors SpeechEngineSession.test.ts.""" import asyncio import json import typing import pytest from elevenlabs.speech_engine import ( CLOSE, DISCONNECTED, ERROR, INIT, USER_TRANSCRIPT, ConversationMessage, SpeechEngineSession, ) # --------------------------------------------------------------------------- # MockWebSocket # --------------------------------------------------------------------------- class MockWebSocket: """In-memory WebSocket stand-in backed by an asyncio.Queue.""" def __init__(self) -> None: self._inbox = asyncio.Queue() # type: asyncio.Queue[typing.Any] self.sent = [] # type: typing.List[str] self.closed = False async def recv(self) -> str: msg = await self._inbox.get() if msg is _CLOSE_SENTINEL: raise ConnectionError("connection closed") return msg async def send(self, data: str) -> None: self.sent.append(data) async def close(self) -> None: self.closed = True # -- test helpers -- def receive_message(self, msg: typing.Dict[str, typing.Any]) -> None: """Inject an incoming message from the "ElevenLabs API".""" self._inbox.put_nowait(json.dumps(msg)) def receive_raw(self, data: str) -> None: """Inject raw (possibly invalid) data.""" self._inbox.put_nowait(data) def simulate_disconnect(self) -> None: """Simulate a WebSocket disconnection.""" self._inbox.put_nowait(_CLOSE_SENTINEL) _CLOSE_SENTINEL = object() # --------------------------------------------------------------------------- # Fixtures # --------------------------------------------------------------------------- TRANSCRIPT = [ {"role": "agent", "content": "how can I help you today?"}, {"role": "user", "content": "I need a pizza"}, ] TRANSCRIPT_2 = [ {"role": "agent", "content": "how can I help you today?"}, {"role": "user", "content": "I need a pizza"}, {"role": "agent", "content": "what size?"}, {"role": "user", "content": "large"}, ] @pytest.fixture def ws() -> MockWebSocket: return MockWebSocket() @pytest.fixture def session(ws: MockWebSocket) -> SpeechEngineSession: return SpeechEngineSession(ws) # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- def _parsed_sent(ws: MockWebSocket) -> typing.List[typing.Dict[str, typing.Any]]: return [json.loads(s) for s in ws.sent] async def _run_until_idle(session: SpeechEngineSession, ws: MockWebSocket) -> None: """Drive the session run loop, then disconnect so it returns.""" ws.simulate_disconnect() await session.run() # --------------------------------------------------------------------------- # init event # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_emits_init_with_conversation_id( ws: MockWebSocket, session: SpeechEngineSession ) -> None: captured = [] # type: typing.List[str] async def handler(conversation_id: str) -> None: captured.append(conversation_id) session.on(INIT, handler) ws.receive_message({"type": "init", "conversation_id": "conv_42"}) await _run_until_idle(session, ws) assert captured == ["conv_42"] assert session.conversation_id == "conv_42" # --------------------------------------------------------------------------- # user_transcript events # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_emits_user_transcript_with_conversation_history( ws: MockWebSocket, session: SpeechEngineSession ) -> None: captured = [] # type: typing.List[typing.List[ConversationMessage]] async def handler(transcript: typing.List[ConversationMessage]) -> None: captured.append(transcript) session.on(USER_TRANSCRIPT, handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) await _run_until_idle(session, ws) assert len(captured) == 1 assert len(captured[0]) == 2 assert captured[0][0].role == "agent" assert captured[0][0].content == "how can I help you today?" assert captured[0][1].role == "user" assert captured[0][1].content == "I need a pizza" @pytest.mark.asyncio async def test_cancels_previous_handler_on_new_transcript( ws: MockWebSocket, session: SpeechEngineSession ) -> None: """When a new transcript arrives the previous handler task is cancelled.""" cancelled = asyncio.Event() async def slow_handler(transcript: typing.List[ConversationMessage]) -> None: try: await asyncio.sleep(10) except asyncio.CancelledError: cancelled.set() raise session.on(USER_TRANSCRIPT, slow_handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT_2, "event_id": 2} ) await _run_until_idle(session, ws) assert cancelled.is_set() # --------------------------------------------------------------------------- # ping / pong # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_auto_responds_to_ping( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message({"type": "ping"}) await _run_until_idle(session, ws) assert len(ws.sent) == 1 assert json.loads(ws.sent[0]) == {"type": "pong"} # --------------------------------------------------------------------------- # close event (protocol-level) # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_emits_close_and_cancels_handler_on_close_message( ws: MockWebSocket, session: SpeechEngineSession ) -> None: close_called = asyncio.Event() cancelled = asyncio.Event() async def close_handler() -> None: close_called.set() async def slow_handler(transcript: typing.List[ConversationMessage]) -> None: try: await asyncio.sleep(10) except asyncio.CancelledError: cancelled.set() raise session.on(CLOSE, close_handler) session.on(USER_TRANSCRIPT, slow_handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) ws.receive_message({"type": "close"}) await _run_until_idle(session, ws) assert close_called.is_set() assert cancelled.is_set() # --------------------------------------------------------------------------- # error event (protocol-level) # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_emits_error_on_protocol_error_message( ws: MockWebSocket, session: SpeechEngineSession ) -> None: errors = [] # type: typing.List[Exception] async def handler(err: Exception) -> None: errors.append(err) session.on(ERROR, handler) ws.receive_message({"type": "error", "message": "something went wrong"}) await _run_until_idle(session, ws) assert len(errors) == 1 assert isinstance(errors[0], Exception) assert str(errors[0]) == "something went wrong" # --------------------------------------------------------------------------- # WebSocket-level events # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_emits_disconnected_when_websocket_closes( ws: MockWebSocket, session: SpeechEngineSession ) -> None: disconnected = asyncio.Event() async def handler() -> None: disconnected.set() session.on(DISCONNECTED, handler) ws.simulate_disconnect() await session.run() assert disconnected.is_set() assert not session.is_open @pytest.mark.asyncio async def test_cancels_handler_when_websocket_closes( ws: MockWebSocket, session: SpeechEngineSession ) -> None: cancelled = asyncio.Event() async def slow_handler(transcript: typing.List[ConversationMessage]) -> None: try: await asyncio.sleep(10) except asyncio.CancelledError: cancelled.set() raise session.on(USER_TRANSCRIPT, slow_handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) # Give the handler task a moment to start before disconnecting. await asyncio.sleep(0) ws.simulate_disconnect() await session.run() # The disconnect triggers _cancel_current in the finally block. assert cancelled.is_set() @pytest.mark.asyncio async def test_emits_error_on_malformed_json( ws: MockWebSocket, session: SpeechEngineSession ) -> None: errors = [] # type: typing.List[Exception] async def handler(err: Exception) -> None: errors.append(err) session.on(ERROR, handler) ws.receive_raw("not json") await _run_until_idle(session, ws) assert len(errors) == 1 @pytest.mark.asyncio async def test_ignores_unknown_message_types( ws: MockWebSocket, session: SpeechEngineSession ) -> None: errors = [] # type: typing.List[Exception] async def handler(err: Exception) -> None: errors.append(err) session.on(ERROR, handler) ws.receive_message({"type": "unknown_future_event", "data": 123}) await _run_until_idle(session, ws) assert len(errors) == 0 # --------------------------------------------------------------------------- # sendResponse (string) # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_sends_string_response_with_event_id_and_is_final( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 5} ) async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response("The answer is 42") session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 2 assert sent[0] == { "type": "agent_response", "content": "The answer is 42", "event_id": 5, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": "", "event_id": 5, "is_final": True, } @pytest.mark.asyncio async def test_raises_when_sending_after_close( ws: MockWebSocket, session: SpeechEngineSession ) -> None: session.close() with pytest.raises(RuntimeError, match="session is closed"): await session.send_response("too late") # --------------------------------------------------------------------------- # sendResponse (streaming) # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_streams_chunks_with_is_final_false_then_terminator( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 3} ) async def tokens(): # type: ignore[return] yield "Hello" yield " world" async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(tokens()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 3 assert sent[0] == { "type": "agent_response", "content": "Hello", "event_id": 3, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": " world", "event_id": 3, "is_final": False, } assert sent[2] == { "type": "agent_response", "content": "", "event_id": 3, "is_final": True, } @pytest.mark.asyncio async def test_stops_streaming_when_session_closed_mid_stream( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 7} ) async def slow_tokens(): # type: ignore[return] yield "first" yield "second" await asyncio.sleep(0.1) yield "third" async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(slow_tokens()) session.on(USER_TRANSCRIPT, handler) # Start the run loop in the background. task = asyncio.create_task(session.run()) # Let the handler task progress through the first two yields. await asyncio.sleep(0.05) session.close() await asyncio.sleep(0.15) task.cancel() try: await task except asyncio.CancelledError: pass sent = _parsed_sent(ws) chunks = [m for m in sent if m.get("type") == "agent_response"] # "first" and "second" are sent; session closes before "third". assert len(chunks) == 2 assert chunks[0] == { "type": "agent_response", "content": "first", "event_id": 7, "is_final": False, } assert chunks[1] == { "type": "agent_response", "content": "second", "event_id": 7, "is_final": False, } # --------------------------------------------------------------------------- # sendResponse (LLM stream formats) # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_extracts_text_from_openai_responses_api( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 10} ) async def openai_responses_stream(): # type: ignore[return] yield {"type": "response.created", "response": {}} yield {"type": "response.output_text.delta", "delta": "Hello"} yield {"type": "response.output_text.delta", "delta": " world"} yield {"type": "response.output_text.done", "text": "Hello world"} yield {"type": "response.completed", "response": {}} async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(openai_responses_stream()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 3 assert sent[0] == { "type": "agent_response", "content": "Hello", "event_id": 10, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": " world", "event_id": 10, "is_final": False, } assert sent[2] == { "type": "agent_response", "content": "", "event_id": 10, "is_final": True, } @pytest.mark.asyncio async def test_extracts_text_from_openai_chat_completions_api( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 11} ) async def openai_chat_stream(): # type: ignore[return] yield {"choices": [{"delta": {"role": "assistant"}}]} yield {"choices": [{"delta": {"content": "Hi"}}]} yield {"choices": [{"delta": {"content": " there"}}]} yield {"choices": [{"delta": {}}]} async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(openai_chat_stream()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 3 assert sent[0] == { "type": "agent_response", "content": "Hi", "event_id": 11, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": " there", "event_id": 11, "is_final": False, } assert sent[2] == { "type": "agent_response", "content": "", "event_id": 11, "is_final": True, } @pytest.mark.asyncio async def test_extracts_text_from_anthropic_messages_api( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 12} ) async def anthropic_stream(): # type: ignore[return] yield {"type": "message_start", "message": {}} yield {"type": "content_block_start", "content_block": {"type": "text", "text": ""}} yield {"type": "content_block_delta", "delta": {"type": "text_delta", "text": "Good"}} yield {"type": "content_block_delta", "delta": {"type": "text_delta", "text": " morning"}} yield {"type": "content_block_stop"} yield {"type": "message_stop"} async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(anthropic_stream()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 3 assert sent[0] == { "type": "agent_response", "content": "Good", "event_id": 12, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": " morning", "event_id": 12, "is_final": False, } assert sent[2] == { "type": "agent_response", "content": "", "event_id": 12, "is_final": True, } @pytest.mark.asyncio async def test_extracts_text_from_gemini_api( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 13} ) async def gemini_stream(): # type: ignore[return] yield {"candidates": [{"content": {"parts": [{"text": "Hey"}], "role": "model"}}]} yield {"candidates": [{"content": {"parts": [{"text": " buddy"}], "role": "model"}}]} async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(gemini_stream()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 3 assert sent[0] == { "type": "agent_response", "content": "Hey", "event_id": 13, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": " buddy", "event_id": 13, "is_final": False, } assert sent[2] == { "type": "agent_response", "content": "", "event_id": 13, "is_final": True, } @pytest.mark.asyncio async def test_skips_unrecognized_stream_events( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 14} ) async def mixed_stream(): # type: ignore[return] yield {"type": "unknown_event", "data": 123} yield {"type": "response.output_text.delta", "delta": "text"} yield 42 yield None async def handler(transcript: typing.List[ConversationMessage]) -> None: await session.send_response(mixed_stream()) session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) assert len(sent) == 2 assert sent[0] == { "type": "agent_response", "content": "text", "event_id": 14, "is_final": False, } assert sent[1] == { "type": "agent_response", "content": "", "event_id": 14, "is_final": True, } # --------------------------------------------------------------------------- # event_id tracking across interrupts # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_stamps_correct_event_id_after_interrupt( ws: MockWebSocket, session: SpeechEngineSession ) -> None: ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT_2, "event_id": 2} ) async def handler(transcript: typing.List[ConversationMessage]) -> None: # Non-blocking so both handlers complete within the run loop. await session.send_response("response") session.on(USER_TRANSCRIPT, handler) await _run_until_idle(session, ws) sent = _parsed_sent(ws) # Each sendResponse emits content + terminator = 2 messages. # The first handler's task may or may not complete before cancellation; # the second handler's response should use event_id 2. # Filter to the final handler's messages (event_id=2): id2 = [m for m in sent if m.get("event_id") == 2] assert len(id2) == 2 assert id2[0]["content"] == "response" assert id2[0]["is_final"] is False assert id2[1]["content"] == "" assert id2[1]["is_final"] is True # --------------------------------------------------------------------------- # close() # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_close_is_idempotent( ws: MockWebSocket, session: SpeechEngineSession ) -> None: session.close() session.close() assert not session.is_open # --------------------------------------------------------------------------- # Event constants # --------------------------------------------------------------------------- def test_event_constants() -> None: assert INIT == "init" assert USER_TRANSCRIPT == "user_transcript" assert CLOSE == "close" assert ERROR == "error" assert DISCONNECTED == "disconnected" # --------------------------------------------------------------------------- # on / off / once # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_off_removes_handler( ws: MockWebSocket, session: SpeechEngineSession ) -> None: calls = [] # type: typing.List[str] async def handler(conversation_id: str) -> None: calls.append(conversation_id) session.on(INIT, handler) session.off(INIT, handler) ws.receive_message({"type": "init", "conversation_id": "conv_1"}) await _run_until_idle(session, ws) assert calls == [] @pytest.mark.asyncio async def test_once_fires_only_once( ws: MockWebSocket, session: SpeechEngineSession ) -> None: calls = [] # type: typing.List[str] async def handler(conversation_id: str) -> None: calls.append(conversation_id) session.once(INIT, handler) ws.receive_message({"type": "init", "conversation_id": "conv_1"}) ws.receive_message({"type": "init", "conversation_id": "conv_2"}) await _run_until_idle(session, ws) assert calls == ["conv_1"] # --------------------------------------------------------------------------- # Transcript deduplication # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_skips_duplicate_event_id( ws: MockWebSocket, session: SpeechEngineSession ) -> None: """Duplicate transcripts with the same event_id are ignored.""" call_count = 0 async def handler(transcript: typing.List[ConversationMessage]) -> None: nonlocal call_count call_count += 1 await asyncio.sleep(0.5) session.on(USER_TRANSCRIPT, handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 30} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 30} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 30} ) await _run_until_idle(session, ws) assert call_count == 1 @pytest.mark.asyncio async def test_does_not_skip_different_event_id( ws: MockWebSocket, session: SpeechEngineSession ) -> None: """Different event_ids are processed normally.""" call_count = 0 async def handler(transcript: typing.List[ConversationMessage]) -> None: nonlocal call_count call_count += 1 session.on(USER_TRANSCRIPT, handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT, "event_id": 1} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT_2, "event_id": 2} ) await _run_until_idle(session, ws) assert call_count == 2 @pytest.mark.asyncio async def test_does_not_deduplicate_when_event_id_is_none( ws: MockWebSocket, session: SpeechEngineSession ) -> None: """Transcripts without event_id should never be deduplicated.""" call_count = 0 async def handler(transcript: typing.List[ConversationMessage]) -> None: nonlocal call_count call_count += 1 session.on(USER_TRANSCRIPT, handler) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT} ) ws.receive_message( {"type": "user_transcript", "user_transcript": TRANSCRIPT_2} ) await _run_until_idle(session, ws) assert call_count == 2 # --------------------------------------------------------------------------- # send_response outside on_transcript # --------------------------------------------------------------------------- @pytest.mark.asyncio async def test_send_response_warns_outside_transcript( ws: MockWebSocket, session: SpeechEngineSession ) -> None: """send_response before any transcript should warn and not send.""" await session.send_response("hello") assert len(ws.sent) == 0 elevenlabs-elevenlabs-python-b6e5614/tests/test_sts.py000066400000000000000000000020261523660243400232160ustar00rootroot00000000000000from elevenlabs.play import play from elevenlabs.client import ElevenLabs from .utils import IN_GITHUB, DEFAULT_VOICE, DEFAULT_VOICE_FILE def test_sts() -> None: """Test basic speech-to-speech generation.""" client = ElevenLabs() audio_file = open(DEFAULT_VOICE_FILE, "rb") try: audio_stream = client.speech_to_speech.convert(voice_id=DEFAULT_VOICE, audio=audio_file) audio = b"".join(chunk for chunk in audio_stream) assert isinstance(audio, bytes), "Combined audio should be bytes" if not IN_GITHUB: play(audio) finally: audio_file.close() def test_sts_as_stream(): client = ElevenLabs() audio_file = open(DEFAULT_VOICE_FILE, "rb") try: audio_stream = client.speech_to_speech.stream(voice_id=DEFAULT_VOICE, audio=audio_file) audio = b"".join(chunk for chunk in audio_stream) assert isinstance(audio, bytes), "Combined audio should be bytes" if not IN_GITHUB: play(audio) finally: audio_file.close() elevenlabs-elevenlabs-python-b6e5614/tests/test_stt.py000066400000000000000000000012431523660243400232170ustar00rootroot00000000000000import pytest from elevenlabs.client import AsyncElevenLabs, ElevenLabs from .utils import DEFAULT_VOICE_FILE DEFAULT_EXT_AUDIO = "https://storage.googleapis.com/eleven-public-cdn/audio/marketing/nicole.mp3" @pytest.mark.asyncio async def test_stt_convert(): """Test basic speech-to-text conversion.""" client = ElevenLabs() audio_file = open(DEFAULT_VOICE_FILE, "rb") transcription = client.speech_to_text.convert( file=audio_file, model_id="scribe_v2" ) assert isinstance(transcription.text, str) assert len(transcription.text) > 0 assert isinstance(transcription.words, list) assert len(transcription.words) > 0 elevenlabs-elevenlabs-python-b6e5614/tests/test_stt_realtime.py000066400000000000000000000600631523660243400251060ustar00rootroot00000000000000"""Tests for realtime speech-to-text (Scribe) functionality. These tests cover URL building, validation, and event handling behavior that don't require an actual WebSocket connection. """ import json from unittest.mock import AsyncMock, MagicMock, patch from urllib.parse import parse_qsl, urlparse import pytest from elevenlabs.realtime.connection import RealtimeConnection, RealtimeEvents from elevenlabs.realtime.scribe import ( AudioFormat, CommitStrategy, ScribeRealtime, ) def query_params(url): """Every query parameter on the URL, preserving repeats and their order.""" return parse_qsl(urlparse(url).query, keep_blank_values=True) class TestBuildWebsocketUrl: """Tests for _build_websocket_url helper method""" def setup_method(self): """Set up test fixtures""" self.scribe = ScribeRealtime(api_key="test-api-key") def test_builds_url_with_all_parameters(self): """Test URL construction with required and optional parameters""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="vad", vad_silence_threshold_secs=0.5, vad_threshold=0.3, min_speech_duration_ms=100, min_silence_duration_ms=200, language_code="es", include_timestamps=True ) # Base URL structure assert url.startswith("wss://api.elevenlabs.io/v1/speech-to-text/realtime?") # Required parameters assert "model_id=scribe_v2_realtime" in url assert "audio_format=pcm_16000" in url assert "commit_strategy=vad" in url # Optional parameters assert "vad_silence_threshold_secs=0.5" in url assert "vad_threshold=0.3" in url assert "min_speech_duration_ms=100" in url assert "min_silence_duration_ms=200" in url assert "language_code=es" in url assert "include_timestamps=true" in url def test_optional_parameters_omitted_when_none(self): """Test that None parameters are not included in URL""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", vad_silence_threshold_secs=None, language_code=None ) assert "vad_silence_threshold_secs" not in url assert "language_code" not in url def test_url_converts_https_to_wss(self): """Test that https base URLs are converted to wss""" scribe = ScribeRealtime( api_key="test-api-key", base_url="https://api.elevenlabs.io" ) url = scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual" ) assert url.startswith("wss://") assert not url.startswith("wss://wss://") def test_url_converts_http_to_ws(self): """Test that http base URLs are converted to ws""" scribe = ScribeRealtime( api_key="test-api-key", base_url="http://localhost:8080" ) url = scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual" ) assert url.startswith("ws://localhost:8080") def test_includes_keyterms_as_repeated_query_params(self): """Test that keyterms are included as repeated query params""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", keyterms=["ElevenLabs", "Scribe"], ) assert "keyterms=ElevenLabs" in url assert "keyterms=Scribe" in url def test_includes_no_verbatim_true(self): """Test that no_verbatim=true is included when set to True""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", no_verbatim=True, ) assert "no_verbatim=true" in url def test_includes_no_verbatim_false(self): """Test that no_verbatim=false is included when set to False""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", no_verbatim=False, ) assert "no_verbatim=false" in url def test_omits_keyterms_and_no_verbatim_when_not_specified(self): """Test that keyterms and no_verbatim are omitted when not specified""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", ) assert "keyterms" not in url assert "no_verbatim" not in url def test_serializes_every_supported_option_to_its_parameter_name(self): """Exhaustive check: a renamed, dropped or duplicated param fails here""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="vad", vad_silence_threshold_secs=1.5, vad_threshold=0.4, min_speech_duration_ms=100, min_silence_duration_ms=200, language_code="en", secondary_languages=["nl", "de"], include_timestamps=False, include_language_detection=True, keyterms=["ElevenLabs", "Scribe"], no_verbatim=True, entity_detection=["pii", "email_address"], filter_background_audio=True, enable_logging=False, token="sutkn_1234567890", ) assert sorted(query_params(url)) == sorted([ ("model_id", "scribe_v2_realtime"), ("audio_format", "pcm_16000"), ("commit_strategy", "vad"), ("vad_silence_threshold_secs", "1.5"), ("vad_threshold", "0.4"), ("min_speech_duration_ms", "100"), ("min_silence_duration_ms", "200"), ("language_code", "en"), ("secondary_languages", "nl"), ("secondary_languages", "de"), ("include_timestamps", "false"), ("include_language_detection", "true"), ("keyterms", "ElevenLabs"), ("keyterms", "Scribe"), ("no_verbatim", "true"), ("entity_detection", "pii"), ("entity_detection", "email_address"), ("filter_background_audio", "true"), ("enable_logging", "false"), ("token", "sutkn_1234567890"), ]) def test_sends_nothing_beyond_the_required_parameters(self): """Exhaustive check that unset options do not leak into the URL""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", ) assert sorted(query_params(url)) == sorted([ ("model_id", "scribe_v2_realtime"), ("audio_format", "pcm_16000"), ("commit_strategy", "manual"), ]) def test_transmits_booleans_that_are_explicitly_false(self): """False is meaningful: dropping it silently reverts to a server default""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", include_timestamps=False, include_language_detection=False, no_verbatim=False, filter_background_audio=False, enable_logging=False, ) params = dict(query_params(url)) assert params["include_timestamps"] == "false" assert params["include_language_detection"] == "false" assert params["no_verbatim"] == "false" assert params["filter_background_audio"] == "false" assert params["enable_logging"] == "false" def test_accepts_a_bare_string_for_entity_detection(self): """A single entity_detection string is sent as one value, not exploded""" url = self.scribe._build_websocket_url( model_id="scribe_v2_realtime", audio_format="pcm_16000", commit_strategy="manual", entity_detection="all", ) assert [v for k, v in query_params(url) if k == "entity_detection"] == ["all"] class TestConnectValidation: """Tests for connect method validation""" def setup_method(self): """Set up test fixtures""" self.scribe = ScribeRealtime(api_key="test-api-key") @pytest.mark.asyncio async def test_connect_requires_model_id(self): """Test that connect raises error without model_id""" with pytest.raises(ValueError, match="model_id is required"): await self.scribe.connect({}) # type: ignore @pytest.mark.asyncio async def test_connect_audio_mode_requires_format_and_sample_rate(self): """Test that audio mode requires both audio_format and sample_rate""" with pytest.raises(ValueError, match="audio_format and sample_rate are required"): await self.scribe.connect({ "model_id": "scribe_v2_realtime" }) # type: ignore with pytest.raises(ValueError, match="audio_format and sample_rate are required"): await self.scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000 # missing sample_rate }) # type: ignore with pytest.raises(ValueError, match="audio_format and sample_rate are required"): await self.scribe.connect({ "model_id": "scribe_v2_realtime", "sample_rate": 16000 # missing audio_format }) # type: ignore @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect") async def test_connect_url_mode_requires_url(self, mock_ws_connect): """Test that URL mode requires non-empty url parameter""" with pytest.raises(ValueError, match="url is required"): await self.scribe.connect({ "model_id": "scribe_v2_realtime", "url": "" }) # type: ignore class TestConnectEnumHandling: """Tests for correct enum value extraction when building WebSocket URLs. Regression tests to ensure AudioFormat and CommitStrategy enums are converted to their string values (e.g., 'pcm_16000') rather than being passed as enum objects (which would result in 'AudioFormat.PCM_16000'). """ def setup_method(self): """Set up test fixtures""" self.scribe = ScribeRealtime(api_key="test-api-key") @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_connect_audio_uses_enum_values_in_url(self, mock_ws_connect): """Test that AudioFormat and CommitStrategy enum values are correctly extracted. This is a regression test: previously, if .value was not called on enums, the URL would contain 'AudioFormat.PCM_16000' instead of 'pcm_16000'. """ mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket # Mock the async iterator for the websocket (needed for message handler) mock_websocket.__aiter__ = MagicMock(return_value=iter([])) await self.scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, "commit_strategy": CommitStrategy.VAD }) # Verify websocket_connect was called mock_ws_connect.assert_awaited_once() # Extract the URL that was passed to websocket_connect call_args = mock_ws_connect.call_args url = call_args[0][0] # First positional argument # Verify the URL contains the string values, not enum representations assert "audio_format=pcm_16000" in url, \ f"URL should contain 'audio_format=pcm_16000', not enum repr. Got: {url}" assert "AudioFormat" not in url, \ f"URL should not contain 'AudioFormat' enum name. Got: {url}" assert "commit_strategy=vad" in url, \ f"URL should contain 'commit_strategy=vad', not enum repr. Got: {url}" assert "CommitStrategy" not in url, \ f"URL should not contain 'CommitStrategy' enum name. Got: {url}" @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_connect_audio_default_commit_strategy_is_manual(self, mock_ws_connect): """Test that the default commit strategy is MANUAL when not specified.""" mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket mock_websocket.__aiter__ = MagicMock(return_value=iter([])) await self.scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000 # commit_strategy not specified }) url = mock_ws_connect.call_args[0][0] assert "commit_strategy=manual" in url @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_connect_threads_every_option_into_url(self, mock_ws_connect): """Exhaustive check of the option key to query parameter mapping. The URL builder is tested directly elsewhere, so this is the only cover for _shared_url_kwargs: a typo there would drop an option silently. """ mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket mock_websocket.__aiter__ = MagicMock(return_value=iter([])) await self.scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, "commit_strategy": CommitStrategy.VAD, "vad_silence_threshold_secs": 1.5, "vad_threshold": 0.4, "min_speech_duration_ms": 100, "min_silence_duration_ms": 200, "language_code": "en", "secondary_languages": ["en", "nl"], "include_timestamps": False, "include_language_detection": True, "keyterms": ["ElevenLabs"], "no_verbatim": True, "entity_detection": ["pii", "email_address"], "filter_background_audio": True, "enable_logging": False, "token": "sutkn_1234567890", }) url = mock_ws_connect.call_args[0][0] assert sorted(query_params(url)) == sorted([ ("model_id", "scribe_v2_realtime"), ("audio_format", "pcm_16000"), ("commit_strategy", "vad"), ("vad_silence_threshold_secs", "1.5"), ("vad_threshold", "0.4"), ("min_speech_duration_ms", "100"), ("min_silence_duration_ms", "200"), ("language_code", "en"), ("secondary_languages", "en"), ("secondary_languages", "nl"), ("include_timestamps", "false"), ("include_language_detection", "true"), ("keyterms", "ElevenLabs"), ("no_verbatim", "true"), ("entity_detection", "pii"), ("entity_detection", "email_address"), ("filter_background_audio", "true"), ("enable_logging", "false"), ("token", "sutkn_1234567890"), ]) class TestConnectAuthentication: """Tests for API key vs single-use token authentication""" @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_api_key_sent_as_header(self, mock_ws_connect): """Test that a configured api_key is sent in the xi-api-key header""" mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket mock_websocket.__aiter__ = MagicMock(return_value=iter([])) scribe = ScribeRealtime(api_key="test-api-key") await scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, }) headers = mock_ws_connect.call_args.kwargs["additional_headers"] assert headers == {"xi-api-key": "test-api-key"} @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_token_only_omits_api_key_header(self, mock_ws_connect): """Test that a token authenticates without sending an empty api key header""" mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket mock_websocket.__aiter__ = MagicMock(return_value=iter([])) scribe = ScribeRealtime(api_key="") await scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, "token": "sutkn_1234567890", }) headers = mock_ws_connect.call_args.kwargs["additional_headers"] assert headers == {} assert "token=sutkn_1234567890" in mock_ws_connect.call_args[0][0] @pytest.mark.asyncio @patch("elevenlabs.realtime.scribe.websocket_connect", new_callable=AsyncMock) async def test_token_takes_precedence_over_configured_api_key(self, mock_ws_connect): """The server authenticates the token and never falls back to the key, so sending it would transmit a long-lived credential that cannot be used.""" mock_websocket = MagicMock() mock_ws_connect.return_value = mock_websocket mock_websocket.__aiter__ = MagicMock(return_value=iter([])) scribe = ScribeRealtime(api_key="test-api-key") await scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, "token": "sutkn_1234567890", }) headers = mock_ws_connect.call_args.kwargs["additional_headers"] assert headers == {} assert "token=sutkn_1234567890" in mock_ws_connect.call_args[0][0] @pytest.mark.asyncio async def test_requires_api_key_or_token(self): """Test that connecting without either credential raises""" scribe = ScribeRealtime(api_key="") with pytest.raises(ValueError, match="api_key or a single-use token is required"): await scribe.connect({ "model_id": "scribe_v2_realtime", "audio_format": AudioFormat.PCM_16000, "sample_rate": 16000, }) class TestRealtimeConnectionEventHandling: """Tests for RealtimeConnection event handling behavior""" def setup_method(self): """Set up test fixtures""" self.mock_websocket = MagicMock() self.connection = RealtimeConnection( websocket=self.mock_websocket, current_sample_rate=16000, ffmpeg_process=None ) def test_emit_calls_all_registered_handlers(self): """Test that emitting an event calls all registered handlers in order""" call_order = [] def handler1(data): call_order.append(("handler1", data)) def handler2(data): call_order.append(("handler2", data)) self.connection.on("test_event", handler1) self.connection.on("test_event", handler2) self.connection._emit("test_event", {"value": 42}) assert call_order == [ ("handler1", {"value": 42}), ("handler2", {"value": 42}) ] def test_emit_isolates_handler_exceptions(self, capsys): """Test that an exception in one handler doesn't prevent others from running""" results = [] def bad_handler(data): raise ValueError("Handler error") def good_handler(data): results.append(data) self.connection.on("test_event", bad_handler) self.connection.on("test_event", good_handler) # Should not raise, and good_handler should still be called self.connection._emit("test_event", {"value": "test"}) assert results == [{"value": "test"}] captured = capsys.readouterr() assert "Error in event handler" in captured.out def test_emit_with_no_handlers_does_not_raise(self): """Test that emitting to an event with no handlers is a no-op""" # Should not raise self.connection._emit("nonexistent_event", {"data": "test"}) def test_handlers_receive_correct_arguments(self): """Test that handlers receive all emitted arguments""" received_args = [] def handler(*args): received_args.extend(args) self.connection.on(RealtimeEvents.PARTIAL_TRANSCRIPT, handler) self.connection._emit(RealtimeEvents.PARTIAL_TRANSCRIPT, "arg1", "arg2", {"key": "value"}) assert received_args == ["arg1", "arg2", {"key": "value"}] class _FakeWebsocket: """Minimal async-iterable stand-in for a websocket connection.""" def __init__(self, messages): self._messages = list(messages) def __aiter__(self): return self async def __anext__(self): if not self._messages: raise StopAsyncIteration return self._messages.pop(0) class TestMessageDispatch: """Tests that server message types are routed to the matching events""" async def _dispatch(self, *messages): """Feed raw JSON messages through the connection's message handler""" self.connection = RealtimeConnection( websocket=_FakeWebsocket([json.dumps(m) for m in messages]), current_sample_rate=16000, ffmpeg_process=None, ) for event, sink in self._subscriptions: self.connection.on(event, sink) await self.connection._start_message_handler() def setup_method(self): """Set up test fixtures""" self._subscriptions = [] def subscribe(self, event): """Register a sink for an event, returning the list it collects into""" received = [] self._subscriptions.append((event, received.append)) return received @pytest.mark.asyncio @pytest.mark.parametrize( "message_type", [ "final_transcript", "final_transcript_with_timestamps", "committed_transcript_entities", ], ) async def test_dispatches_transcript_events(self, message_type): """Test that transcript message types reach their handlers""" received = self.subscribe(message_type) await self._dispatch({"message_type": message_type, "text": "hello"}) assert received == [{"message_type": message_type, "text": "hello"}] @pytest.mark.asyncio async def test_invalid_request_emits_specific_and_generic_error(self): """Parameter rejections arrive as a message before the socket closes; dropping it leaves the caller with a closed connection and no reason why.""" specific = self.subscribe(RealtimeEvents.INVALID_REQUEST) generic = self.subscribe(RealtimeEvents.ERROR) payload = { "message_type": "invalid_request", "error": "Number of keyterms cannot exceed 50. You provided 51 keyterms.", } await self._dispatch(payload) assert specific == [payload] assert generic == [payload] @pytest.mark.asyncio async def test_unaccepted_terms_emits_both_event_names(self): """Test that the server's unaccepted_terms also fires the older event name""" new_name = self.subscribe(RealtimeEvents.UNACCEPTED_TERMS) old_name = self.subscribe(RealtimeEvents.UNACCEPTED_TERMS_ERROR) generic_error = self.subscribe(RealtimeEvents.ERROR) payload = {"message_type": "unaccepted_terms", "error": "terms not accepted"} await self._dispatch(payload) assert new_name == [payload] assert old_name == [payload] assert generic_error == [payload] elevenlabs-elevenlabs-python-b6e5614/tests/test_tts.py000066400000000000000000000056401523660243400232240ustar00rootroot00000000000000import asyncio from elevenlabs import VoiceSettings, Voice from elevenlabs.play import play from elevenlabs.client import AsyncElevenLabs, ElevenLabs from .utils import IN_GITHUB, DEFAULT_TEXT, DEFAULT_VOICE, DEFAULT_MODEL import base64 def test_tts_convert() -> None: """Test basic text-to-speech generation.""" client = ElevenLabs() audio_generator = client.text_to_speech.convert(text=DEFAULT_TEXT, voice_id=DEFAULT_VOICE, model_id=DEFAULT_MODEL) audio = b"".join(audio_generator) assert isinstance(audio, bytes), "TTS should return bytes" if not IN_GITHUB: play(audio) def test_tts_convert_with_voice_settings() -> None: """Test TTS with custom voice settings.""" client = ElevenLabs() audio_generator = client.text_to_speech.convert( text=DEFAULT_TEXT, voice_id=DEFAULT_VOICE, model_id=DEFAULT_MODEL, voice_settings=VoiceSettings(stability=0.71, similarity_boost=0.5, style=0.0, use_speaker_boost=True), ) audio = b"".join(audio_generator) assert isinstance(audio, bytes), "TTS with voice settings should return bytes" if not IN_GITHUB: play(audio) def test_tts_convert_as_stream(): async def main(): async_client = AsyncElevenLabs() results = async_client.text_to_speech.stream( text=DEFAULT_TEXT, voice_id=DEFAULT_VOICE, model_id=DEFAULT_MODEL ) out = b"" async for value in results: assert isinstance(value, bytes), "Stream chunks should be bytes" out += value if not IN_GITHUB: play(out) asyncio.run(main()) def test_tts_convert_with_timestamps() -> None: """Test TTS generation with timestamps.""" client = ElevenLabs() result = client.text_to_speech.convert_with_timestamps( text=DEFAULT_TEXT, voice_id=DEFAULT_VOICE, model_id=DEFAULT_MODEL ) # Check that the alignment data exists and has the expected structure assert hasattr(result, 'alignment') assert hasattr(result, 'audio_base_64') # Verify alignment contains timing data assert result.alignment is not None assert len(result.alignment.character_start_times_seconds) > 0 assert len(result.alignment.character_end_times_seconds) > 0 if not IN_GITHUB: audio_bytes = base64.b64decode(result.audio_base_64) play(audio_bytes) def test_tts_stream_with_timestamps(): async def main(): async_client = AsyncElevenLabs() audio_data = b"" async_stream = async_client.text_to_speech.stream_with_timestamps( voice_id=DEFAULT_VOICE, text=DEFAULT_TEXT, model_id=DEFAULT_MODEL, ) async for chunk in async_stream: if hasattr(chunk, "audio_base_64"): audio_bytes = base64.b64decode(chunk.audio_base_64) audio_data += audio_bytes if not IN_GITHUB: play(audio_data) asyncio.run(main()) elevenlabs-elevenlabs-python-b6e5614/tests/test_ttsfx.py000066400000000000000000000010321523660243400235510ustar00rootroot00000000000000from elevenlabs.play import play from elevenlabs.client import ElevenLabs from .utils import IN_GITHUB def test_text_to_sound_effects_convert() -> None: """Test basic sound-effect generation.""" client = ElevenLabs() audio_generator = client.text_to_sound_effects.convert( text="Hypnotic throbbing sound effect. Increases in imtensity.", duration_seconds=2, ) audio = b"".join(audio_generator) assert isinstance(audio, bytes), "TTS should return bytes" if not IN_GITHUB: play(audio) elevenlabs-elevenlabs-python-b6e5614/tests/test_ttv.py000066400000000000000000000016261523660243400232270ustar00rootroot00000000000000from elevenlabs.client import ElevenLabs def test_voice_preview_generation(): """Test generating voice previews from description.""" client = ElevenLabs() # Test parameters description = "A warm and friendly female voice with a slight British accent, speaking clearly and professionally" sample_text = "This is a test message that needs to be at least one hundred characters long to meet the API requirements. Here it is." previews = client.text_to_voice.create_previews(voice_description=description, text=sample_text) assert hasattr(previews, "previews"), "Response should have 'previews' attribute" assert len(previews.previews) > 0, "Should receive at least one preview" assert hasattr(previews.previews[0], "generated_voice_id"), "Preview should contain generated_voice_id" assert hasattr(previews.previews[0], "audio_base_64"), "Preview should contain audio_base_64" elevenlabs-elevenlabs-python-b6e5614/tests/test_url_utils.py000066400000000000000000000053761523660243400244420ustar00rootroot00000000000000"""Tests for the build_ws_url utility.""" import pytest from elevenlabs.url_utils import build_ws_url class TestSchemeConversion: def test_https_to_wss(self): url = build_ws_url("https://api.example.com", ["v1"], {}) assert url.startswith("wss://") def test_http_to_ws(self): url = build_ws_url("http://localhost:8080", ["v1"], {}) assert url.startswith("ws://") def test_wss_preserved(self): url = build_ws_url("wss://api.example.com", ["v1"], {}) assert url.startswith("wss://") def test_ws_preserved(self): url = build_ws_url("ws://localhost:8080", ["v1"], {}) assert url.startswith("ws://") class TestPathSegments: def test_segments_joined(self): url = build_ws_url("wss://api.example.com", ["v1", "speech", "realtime"], {}) assert url == "wss://api.example.com/v1/speech/realtime" def test_segments_percent_encoded(self): url = build_ws_url("wss://api.example.com", ["v1", "hello world"], {}) assert "/v1/hello%20world" in url def test_special_characters_encoded(self): url = build_ws_url("wss://api.example.com", ["v1", "a/b", "c?d", "e&f"], {}) assert "/v1/a%2Fb/c%3Fd/e%26f" in url def test_non_string_segments_converted(self): url = build_ws_url("wss://api.example.com", ["v1", 42, True], {}) assert "/v1/42/True" in url def test_appended_to_existing_base_path(self): url = build_ws_url("wss://api.example.com/base", ["v1", "endpoint"], {}) assert url == "wss://api.example.com/base/v1/endpoint" def test_base_path_trailing_slash_not_duplicated(self): url = build_ws_url("wss://api.example.com/base/", ["v1"], {}) assert "//v1" not in url assert "/base/v1" in url class TestQueryParams: def test_dict_params(self): url = build_ws_url("wss://api.example.com", ["v1"], {"key": "value"}) assert url.endswith("?key=value") def test_tuple_params(self): url = build_ws_url("wss://api.example.com", ["v1"], [("a", "1"), ("b", "2")]) assert "a=1" in url assert "b=2" in url def test_params_percent_encoded(self): url = build_ws_url("wss://api.example.com", ["v1"], {"term": "hello world"}) assert "term=hello%20world" in url def test_repeated_keys(self): url = build_ws_url("wss://api.example.com", ["v1"], [("k", "a"), ("k", "b")]) assert "k=a" in url assert "k=b" in url def test_empty_params(self): url = build_ws_url("wss://api.example.com", ["v1"], {}) assert url == "wss://api.example.com/v1" class TestPortPreserved: def test_custom_port(self): url = build_ws_url("http://localhost:9090", ["v1"], {}) assert url == "ws://localhost:9090/v1" elevenlabs-elevenlabs-python-b6e5614/tests/test_voices.py000066400000000000000000000011011523660243400236660ustar00rootroot00000000000000from elevenlabs import Voice, VoiceSettings, ElevenLabs from .utils import DEFAULT_VOICE def test_get_voice(): client = ElevenLabs() voice_id = DEFAULT_VOICE voice = client.voices.get(voice_id) assert isinstance(voice, Voice) assert voice.voice_id == voice_id if voice.settings is not None: assert isinstance(voice.settings, VoiceSettings) def test_get_voices(): client = ElevenLabs() response = client.voices.search() assert len(response.voices) > 0 for voice in response.voices: assert isinstance(voice, Voice) elevenlabs-elevenlabs-python-b6e5614/tests/test_webhooks.py000066400000000000000000000110171523660243400242260ustar00rootroot00000000000000import json import time import hmac import hashlib from unittest import mock from elevenlabs.client import ElevenLabs from elevenlabs.errors import BadRequestError import pytest def test_construct_event_valid_signature(): """Test webhook event construction with valid signature.""" # Setup client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} # Create a valid signature body = json.dumps(payload) timestamp = str(int(time.time())) message = f"{timestamp}.{body}" signature = "v0=" + hmac.new( webhook_secret.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).hexdigest() sig_header = f"t={timestamp},{signature}" # Verify event construction event = client.webhooks.construct_event(body, sig_header, webhook_secret) assert event == payload, "Event should match the original payload" def test_construct_event_missing_signature(): """Test webhook event construction with missing signature header.""" client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} with pytest.raises(BadRequestError) as excinfo: client.webhooks.construct_event(payload, "", webhook_secret) assert "Missing signature header" in str(excinfo.value) def test_construct_event_invalid_signature_format(): """Test webhook event construction with invalid signature format.""" client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} body = json.dumps(payload) sig_header = "invalid_format" with pytest.raises(BadRequestError) as excinfo: client.webhooks.construct_event(body, sig_header, webhook_secret) assert "No signature hash found with expected scheme v0" in str(excinfo.value) def test_construct_event_expired_timestamp(): """Test webhook event construction with expired timestamp.""" client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} # Create an expired timestamp (31 minutes old) expired_time = int(time.time()) - 31 * 60 timestamp = str(expired_time) body = json.dumps(payload) message = f"{timestamp}.{body}" signature = "v0=" + hmac.new( webhook_secret.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).hexdigest() sig_header = f"t={timestamp},{signature}" with pytest.raises(BadRequestError) as excinfo: client.webhooks.construct_event(body, sig_header, webhook_secret) assert "Timestamp outside the tolerance zone" in str(excinfo.value) def test_construct_event_invalid_signature(): """Test webhook event construction with invalid signature.""" client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} body = json.dumps(payload) timestamp = str(int(time.time())) sig_header = f"t={timestamp},v0=invalid_signature" with pytest.raises(BadRequestError) as excinfo: client.webhooks.construct_event(body, sig_header, webhook_secret) assert "Signature hash does not match" in str(excinfo.value) def test_construct_event_missing_secret(): """Test webhook event construction with missing secret.""" client = ElevenLabs() payload = {"event_type": "speech.completed", "id": "123456"} body = json.dumps(payload) timestamp = str(int(time.time())) sig_header = f"t={timestamp},v0=some_signature" with pytest.raises(BadRequestError) as excinfo: client.webhooks.construct_event(body, sig_header, "") assert "Webhook secret not configured" in str(excinfo.value) @mock.patch('time.time') def test_construct_event_mocked_time(mock_time): """Test webhook event construction with mocked time.""" mock_time.return_value = 1600000000 client = ElevenLabs() webhook_secret = "test_secret" payload = {"event_type": "speech.completed", "id": "123456"} # Create a valid signature with fixed timestamp body = json.dumps(payload) timestamp = "1600000000" message = f"{timestamp}.{body}" signature = "v0=" + hmac.new( webhook_secret.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).hexdigest() sig_header = f"t={timestamp},{signature}" # Verify event construction event = client.webhooks.construct_event(body, sig_header, webhook_secret) assert event == payload, "Event should match the original payload" elevenlabs-elevenlabs-python-b6e5614/tests/utils.py000066400000000000000000000013461523660243400225120ustar00rootroot00000000000000import os import tempfile import httpx from typing import Sequence, Generator IN_GITHUB = "GITHUB_ACTIONS" in os.environ DEFAULT_VOICE = "IRHApOXLvnW57QJPQH2P" DEFAULT_TEXT = "Hello" DEFAULT_MODEL = "eleven_multilingual_v2" DEFAULT_VOICE_FILE = "tests/fixtures/voice_sample.mp3" def as_local_files(urls: Sequence[str]) -> Generator[str, None, None]: """Util to download files from urls and return local file paths""" temp_files = [] for url in urls: response = httpx.get(url) temp_file = tempfile.NamedTemporaryFile() temp_file.write(response.content) temp_files.append(temp_file) yield temp_file.name # Remove the files for temp_file in temp_files: temp_file.close() elevenlabs-elevenlabs-python-b6e5614/tests/verify_types.py000066400000000000000000000112131523660243400240740ustar00rootroot00000000000000#!/usr/bin/env python3 """ Script to verify all types in src/elevenlabs/types/ can be imported and instantiated. Allows pydantic ValidationError but catches other errors (like circular imports). Each type is tested in a separate Python process to avoid import cache issues. """ import subprocess import sys from pathlib import Path from typing import Optional from concurrent.futures import ThreadPoolExecutor, as_completed def get_class_name_from_file(file_path: Path) -> Optional[str]: """Convert a file name to the expected class name using PascalCase.""" # Remove .py extension name = file_path.stem # Skip special files if name.startswith('__'): return None # Convert snake_case to PascalCase parts = name.split('_') class_name = ''.join(word.capitalize() for word in parts) return class_name def verify_type_import_in_subprocess(module_name: str, class_name: str) -> Optional[str]: """ Test importing and instantiating a type in a separate subprocess. Returns error_message if failed, None if successful. """ # Get project root (parent of tests directory) project_root = Path(__file__).parent.parent # Python code to test import in isolation test_code = f""" import sys from pydantic import ValidationError as PydanticValidationError try: # Try to import the type from elevenlabs.types.{module_name} import {class_name} # Try to instantiate with no args (expect ValidationError) try: {class_name}() except PydanticValidationError: pass # Expected - type requires arguments except TypeError: pass # Some types might not be Pydantic models (enums, etc.) sys.exit(0) # Success except ImportError as e: print(f"ImportError: {{e}}", file=sys.stderr) sys.exit(1) except Exception as e: print(f"{{type(e).__name__}}: {{e}}", file=sys.stderr) sys.exit(1) """ try: result = subprocess.run( ["poetry", "run", "python", "-c", test_code], capture_output=True, text=True, timeout=30, cwd=str(project_root) ) if result.returncode == 0: return None else: error_msg = result.stderr.strip() if result.stderr else "Unknown error" return error_msg except subprocess.TimeoutExpired: return "Timeout: Import took longer than 30 seconds" except Exception as e: return f"Subprocess error: {str(e)}" def main(): # Get project root (parent of tests directory) project_root = Path(__file__).parent.parent types_dir = project_root / "src/elevenlabs/types" if not types_dir.exists(): print(f"Error: {types_dir} does not exist", file=sys.stderr) sys.exit(1) # Get all Python files py_files = sorted([f for f in types_dir.glob("*.py") if not f.name.startswith("__")]) print(f"Testing {len(py_files)} type files in parallel...\n") failures = [] successes = [] # Test types in parallel for speed with ThreadPoolExecutor(max_workers=10) as executor: future_to_file = {} for py_file in py_files: module_name = py_file.stem class_name = get_class_name_from_file(py_file) if class_name is None: continue # Skip special files future = executor.submit(verify_type_import_in_subprocess, module_name, class_name) future_to_file[future] = (module_name, class_name) for future in as_completed(future_to_file): module_name, class_name = future_to_file[future] try: error = future.result() if error is None: successes.append((module_name, class_name)) print(f"✓ {module_name}.{class_name}") else: failures.append((module_name, class_name, error)) print(f"✗ {module_name}.{class_name}") except Exception as e: failures.append((module_name, class_name, f"Test execution failed: {str(e)}")) print(f"✗ {module_name}.{class_name}") # Print summary print(f"\n{'='*80}") print(f"Summary: {len(successes)} passed, {len(failures)} failed") print(f"{'='*80}") if failures: print("\nFailed imports:") for module_name, class_name, error in failures: print(f"\n{module_name}.{class_name}:") # Indent error messages for line in error.split('\n'): print(f" {line}") sys.exit(1) else: print("\nAll types can be imported successfully!") sys.exit(0) if __name__ == "__main__": main()