From 27bc327345be4e431600d306ddb24e6e8f2bc794 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 10:22:56 +0000 Subject: [PATCH] SDK regeneration --- pyproject.toml | 2 +- reference.md | 241 +++++++++++++++++- src/elevenlabs/__init__.py | 63 ++++- .../conversational_ai/agents/client.py | 24 ++ .../conversational_ai/agents/raw_client.py | 24 ++ .../conversational_ai/batch_calls/client.py | 9 + .../batch_calls/raw_client.py | 13 + .../conversational_ai/sip_trunk/client.py | 9 + .../conversational_ai/sip_trunk/raw_client.py | 13 + .../conversational_ai/tests/client.py | 15 +- .../conversational_ai/tests/raw_client.py | 15 +- .../conversational_ai/twilio/client.py | 9 + .../conversational_ai/twilio/raw_client.py | 13 + .../whatsapp_accounts/client.py | 16 +- .../whatsapp_accounts/raw_client.py | 8 + src/elevenlabs/core/client_wrapper.py | 4 +- src/elevenlabs/music/client.py | 101 +++++++- src/elevenlabs/music/raw_client.py | 143 ++++++++++- .../pronunciation_dictionaries/__init__.py | 9 + .../rules/__init__.py | 15 +- .../rules/client.py | 123 +++++++++ .../rules/raw_client.py | 151 +++++++++++ .../rules/types/__init__.py | 17 +- ...dictionary_id_set_rules_post_rules_item.py | 58 +++++ src/elevenlabs/speech_to_text/client.py | 4 +- ...speech_to_text_convert_request_model_id.py | 2 +- src/elevenlabs/types/__init__.py | 63 ++++- src/elevenlabs/types/agent_metadata.py | 1 + src/elevenlabs/types/asr_provider.py | 2 +- .../types/batch_call_detailed_response.py | 2 + src/elevenlabs/types/batch_call_response.py | 2 + src/elevenlabs/types/canvas_placement.py | 4 + .../types/chapter_statistics_response.py | 6 + .../check_service_availability_params.py | 20 ++ src/elevenlabs/types/client_event.py | 1 + .../types/content_guardrail_input.py | 2 + .../types/content_guardrail_output.py | 2 + .../types/conversation_user_response_model.py | 4 +- src/elevenlabs/types/create_asset_params.py | 20 ++ .../types/create_client_appointment_params.py | 20 ++ .../types/custom_guardrail_config.py | 7 +- .../types/custom_guardrail_config_model.py | 5 - .../types/custom_guardrail_input.py | 4 +- .../types/custom_guardrail_output.py | 4 +- ...g.py => custom_guardrails_config_input.py} | 2 +- .../types/custom_guardrails_config_output.py | 25 ++ src/elevenlabs/types/custom_llm.py | 2 +- src/elevenlabs/types/delete_asset_params.py | 20 ++ .../types/delete_calendar_event_params.py | 20 ++ .../types/get_client_appointments_params.py | 20 ++ .../types/get_whats_app_account_response.py | 1 + .../types/guardrail_execution_mode.py | 5 + src/elevenlabs/types/list_assets_params.py | 1 + .../types/list_calendar_events_params.py | 20 ++ src/elevenlabs/types/list_products_params.py | 1 + src/elevenlabs/types/list_services_params.py | 1 + src/elevenlabs/types/list_staff_params.py | 1 + src/elevenlabs/types/llm.py | 1 + .../types/moderation_guardrail_input.py | 2 + .../types/moderation_guardrail_output.py | 2 + src/elevenlabs/types/music_upload_response.py | 33 +++ .../object_json_schema_property_input.py | 2 + .../object_json_schema_property_output.py | 2 + .../types/project_extended_response.py | 6 + src/elevenlabs/types/project_response.py | 6 + src/elevenlabs/types/required_constraint.py | 24 ++ src/elevenlabs/types/required_constraints.py | 26 ++ src/elevenlabs/types/song_section.py | 2 +- .../types/studio_agent_settings_model.py | 21 ++ .../types/studio_agent_tool_settings_model.py | 20 ++ src/elevenlabs/types/telephony_call_config.py | 23 ++ src/elevenlabs/types/update_asset_params.py | 20 ++ .../types/update_calendar_event_params.py | 20 ++ .../types/voice_statistics_response_model.py | 33 +++ 74 files changed, 1569 insertions(+), 63 deletions(-) create mode 100644 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 create mode 100644 src/elevenlabs/types/check_service_availability_params.py create mode 100644 src/elevenlabs/types/create_asset_params.py create mode 100644 src/elevenlabs/types/create_client_appointment_params.py delete mode 100644 src/elevenlabs/types/custom_guardrail_config_model.py rename src/elevenlabs/types/{custom_guardrails_config.py => custom_guardrails_config_input.py} (92%) create mode 100644 src/elevenlabs/types/custom_guardrails_config_output.py create mode 100644 src/elevenlabs/types/delete_asset_params.py create mode 100644 src/elevenlabs/types/delete_calendar_event_params.py create mode 100644 src/elevenlabs/types/get_client_appointments_params.py create mode 100644 src/elevenlabs/types/guardrail_execution_mode.py create mode 100644 src/elevenlabs/types/list_calendar_events_params.py create mode 100644 src/elevenlabs/types/music_upload_response.py create mode 100644 src/elevenlabs/types/required_constraint.py create mode 100644 src/elevenlabs/types/required_constraints.py create mode 100644 src/elevenlabs/types/studio_agent_settings_model.py create mode 100644 src/elevenlabs/types/studio_agent_tool_settings_model.py create mode 100644 src/elevenlabs/types/telephony_call_config.py create mode 100644 src/elevenlabs/types/update_asset_params.py create mode 100644 src/elevenlabs/types/update_calendar_event_params.py create mode 100644 src/elevenlabs/types/voice_statistics_response_model.py diff --git a/pyproject.toml b/pyproject.toml index cf484dfc..45847787 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "elevenlabs" -version = "v2.37.0" +version = "v2.38.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 0d463d98..a9ee7e53 100644 --- a/reference.md +++ b/reference.md @@ -6285,7 +6285,7 @@ client = ElevenLabs( ) client.speech_to_text.convert( enable_logging=True, - model_id="scribe_v1", + model_id="scribe_v2", ) ``` @@ -6984,7 +6984,7 @@ client.music.compose()
-**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. +**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature.
@@ -7116,7 +7116,7 @@ client.music.compose_detailed()
-**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. +**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature.
@@ -7256,7 +7256,7 @@ client.music.stream()
-**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. +**store_for_inpainting:** `typing.Optional[bool]` — Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature.
@@ -7272,6 +7272,84 @@ client.music.stream() + + + + +
client.music.upload(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Upload a music file to be later used for inpainting. Only available to enterprise clients with access to the inpainting feature. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.music.upload() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**file:** `from __future__ import annotations + +core.File` — See core.File for more documentation + +
+
+ +
+
+ +**extract_composition_plan:** `typing.Optional[bool]` — Whether to generate and return the composition plan for the uploaded song. If True, the response will include the composition_plan but will increase the latency. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -7923,6 +8001,14 @@ client.conversational_ai.twilio.outbound_call(
+**telephony_call_config:** `typing.Optional[TelephonyCallConfig]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -8326,6 +8412,7 @@ client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.agents.create( + enable_versioning=True, conversation_config=ConversationalConfig(), ) @@ -8351,6 +8438,14 @@ client.conversational_ai.agents.create(
+**enable_versioning:** `typing.Optional[bool]` — Enable versioning for the agent + +
+
+ +
+
+ **platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
@@ -8595,6 +8690,7 @@ client = ElevenLabs( ) client.conversational_ai.agents.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", + enable_versioning_if_not_enabled=True, branch_id="branch_id", ) @@ -8620,6 +8716,14 @@ client.conversational_ai.agents.update(
+**enable_versioning_if_not_enabled:** `typing.Optional[bool]` — Enable versioning for the agent, if not already enabled + +
+
+ +
+
+ **branch_id:** `typing.Optional[str]` — The ID of the branch to use
@@ -9662,7 +9766,15 @@ client.conversational_ai.tests.list(
-**include_folders:** `typing.Optional[bool]` — Whether to include folders in the response. Defaults to false. +**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.
@@ -11684,6 +11796,14 @@ client.conversational_ai.batch_calls.create(
+**telephony_call_config:** `typing.Optional[TelephonyCallConfig]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -12140,6 +12260,14 @@ client.conversational_ai.sip_trunk.outbound_call(
+**telephony_call_config:** `typing.Optional[TelephonyCallConfig]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -12788,6 +12916,14 @@ client.conversational_ai.whatsapp_accounts.update(
+**enable_messaging:** `typing.Optional[bool]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18871,6 +19007,101 @@ client.music.composition_plan.create( ## PronunciationDictionaries Rules +
client.pronunciation_dictionaries.rules.set(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replaces all existing rules on the pronunciation dictionary with the provided ones. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +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", + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+
client.pronunciation_dictionaries.rules.add(...)
diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py index 572ffca7..a7e52b42 100644 --- a/src/elevenlabs/__init__.py +++ b/src/elevenlabs/__init__.py @@ -593,6 +593,7 @@ CharacterRefreshPeriod, CharacterUsageResponse, ChatSourceMedium, + CheckServiceAvailabilityParams, ClientEvent, ClientToolConfigInput, ClientToolConfigOutput, @@ -744,7 +745,9 @@ CreateAgentBranchResponseModel, CreateAgentResponseModel, CreateAgentTestResponseModel, + CreateAssetParams, CreateAudioNativeProjectRequest, + CreateClientAppointmentParams, CreateClientParams, CreatePhoneNumberResponseModel, CreatePreviouslyGeneratedVoiceRequest, @@ -762,10 +765,10 @@ CreateTranscriptRequest, CreateTwilioPhoneNumberRequest, CustomGuardrailConfig, - CustomGuardrailConfigModel, CustomGuardrailInput, CustomGuardrailOutput, - CustomGuardrailsConfig, + CustomGuardrailsConfigInput, + CustomGuardrailsConfigOutput, CustomLlm, CustomLlmRequestHeadersValue, CustomLlmapiType, @@ -777,6 +780,8 @@ DataCollectionResultCommonModel, DefaultSharingGroupResponseModel, DefaultSharingGroupResponseModelPermissionLevel, + DeleteAssetParams, + DeleteCalendarEventParams, DeleteChapterRequest, DeleteChapterResponseModel, DeleteClientParams, @@ -890,6 +895,7 @@ GetChapterSnapshotsRequest, GetChaptersRequest, GetChaptersResponse, + GetClientAppointmentsParams, GetClientByPhoneParams, GetConvAiDashboardSettingsResponseModel, GetConvAiDashboardSettingsResponseModelChartsItem, @@ -971,6 +977,7 @@ GetVoicesV2Response, GetWhatsAppAccountResponse, GetWorkspaceSecretsResponseModel, + GuardrailExecutionMode, GuardrailsV1Input, GuardrailsV1Output, HistoryAlignmentResponseModel, @@ -1014,6 +1021,7 @@ LibraryVoiceResponse, LibraryVoiceResponseModelCategory, ListAssetsParams, + ListCalendarEventsParams, ListClientsParams, ListMcpToolsResponseModel, ListProductsParams, @@ -1087,6 +1095,7 @@ MultipartMusicResponse, MusicExploreSongSourceContext, MusicPrompt, + MusicUploadResponse, NoCoachingSettings, NonStreamingOutputFormats, NormalizedAlignment, @@ -1270,6 +1279,8 @@ RenderStatus, RenderType, RequestPvcManualVerificationResponseModel, + RequiredConstraint, + RequiredConstraints, ResourceAccessInfo, ResourceAccessInfoRole, ResourceMetadataResponseModel, @@ -1376,6 +1387,8 @@ StartSpeakerSeparationResponseModel, StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel, StreamingAudioChunkWithTimestampsResponse, + StudioAgentSettingsModel, + StudioAgentToolSettingsModel, StudioClipReference, StudioClipReferenceClipType, Subscription, @@ -1404,6 +1417,7 @@ SystemToolConfigOutputParams_TransferToAgent, SystemToolConfigOutputParams_TransferToNumber, SystemToolConfigOutputParams_VoicemailDetection, + TelephonyCallConfig, TelephonyProvider, TestConditionRationaleCommonModel, TestConditionResultCommonModel, @@ -1504,7 +1518,9 @@ UnitTestToolCallParameterEval_Llm, UnitTestToolCallParameterEval_Regex, UnitTestWorkflowNodeTransitionEvaluationNodeId, + UpdateAssetParams, UpdateAudioNativeProjectRequest, + UpdateCalendarEventParams, UpdateChapterRequest, UpdateClientParams, UpdateProductParams, @@ -1551,6 +1567,7 @@ VoiceSharingResponse, VoiceSharingResponseModelCategory, VoiceSharingState, + VoiceStatisticsResponseModel, VoiceVerificationResponse, VoicemailDetectionToolConfig, WebhookAuthMethodType, @@ -2471,6 +2488,7 @@ "CharacterRefreshPeriod": ".types", "CharacterUsageResponse": ".types", "ChatSourceMedium": ".types", + "CheckServiceAvailabilityParams": ".types", "ClientEvent": ".types", "ClientToolConfigInput": ".types", "ClientToolConfigOutput": ".types", @@ -2624,7 +2642,9 @@ "CreateAgentBranchResponseModel": ".types", "CreateAgentResponseModel": ".types", "CreateAgentTestResponseModel": ".types", + "CreateAssetParams": ".types", "CreateAudioNativeProjectRequest": ".types", + "CreateClientAppointmentParams": ".types", "CreateClientParams": ".types", "CreatePhoneNumberResponseModel": ".types", "CreatePreviouslyGeneratedVoiceRequest": ".types", @@ -2642,10 +2662,10 @@ "CreateTranscriptRequest": ".types", "CreateTwilioPhoneNumberRequest": ".types", "CustomGuardrailConfig": ".types", - "CustomGuardrailConfigModel": ".types", "CustomGuardrailInput": ".types", "CustomGuardrailOutput": ".types", - "CustomGuardrailsConfig": ".types", + "CustomGuardrailsConfigInput": ".types", + "CustomGuardrailsConfigOutput": ".types", "CustomLlm": ".types", "CustomLlmRequestHeadersValue": ".types", "CustomLlmapiType": ".types", @@ -2657,6 +2677,8 @@ "DataCollectionResultCommonModel": ".types", "DefaultSharingGroupResponseModel": ".types", "DefaultSharingGroupResponseModelPermissionLevel": ".types", + "DeleteAssetParams": ".types", + "DeleteCalendarEventParams": ".types", "DeleteChapterRequest": ".types", "DeleteChapterResponseModel": ".types", "DeleteClientParams": ".types", @@ -2777,6 +2799,7 @@ "GetChapterSnapshotsRequest": ".types", "GetChaptersRequest": ".types", "GetChaptersResponse": ".types", + "GetClientAppointmentsParams": ".types", "GetClientByPhoneParams": ".types", "GetConvAiDashboardSettingsResponseModel": ".types", "GetConvAiDashboardSettingsResponseModelChartsItem": ".types", @@ -2858,6 +2881,7 @@ "GetVoicesV2Response": ".types", "GetWhatsAppAccountResponse": ".types", "GetWorkspaceSecretsResponseModel": ".types", + "GuardrailExecutionMode": ".types", "GuardrailsV1Input": ".types", "GuardrailsV1Output": ".types", "HistoryAlignmentResponseModel": ".types", @@ -2903,6 +2927,7 @@ "LibraryVoiceResponse": ".types", "LibraryVoiceResponseModelCategory": ".types", "ListAssetsParams": ".types", + "ListCalendarEventsParams": ".types", "ListClientsParams": ".types", "ListMcpToolsResponseModel": ".types", "ListProductsParams": ".types", @@ -2977,6 +3002,7 @@ "MusicExploreSongSourceContext": ".types", "MusicPrompt": ".types", "MusicSeparateStemsRequestStemVariationId": ".music", + "MusicUploadResponse": ".types", "NoCoachingSettings": ".types", "NonStreamingOutputFormats": ".types", "NormalizedAlignment": ".types", @@ -3170,6 +3196,8 @@ "RenderStatus": ".types", "RenderType": ".types", "RequestPvcManualVerificationResponseModel": ".types", + "RequiredConstraint": ".types", + "RequiredConstraints": ".types", "ResourceAccessInfo": ".types", "ResourceAccessInfoRole": ".types", "ResourceMetadataResponseModel": ".types", @@ -3288,6 +3316,8 @@ "StartSpeakerSeparationResponseModel": ".types", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel": ".types", "StreamingAudioChunkWithTimestampsResponse": ".types", + "StudioAgentSettingsModel": ".types", + "StudioAgentToolSettingsModel": ".types", "StudioClipReference": ".types", "StudioClipReferenceClipType": ".types", "Subscription": ".types", @@ -3316,6 +3346,7 @@ "SystemToolConfigOutputParams_TransferToAgent": ".types", "SystemToolConfigOutputParams_TransferToNumber": ".types", "SystemToolConfigOutputParams_VoicemailDetection": ".types", + "TelephonyCallConfig": ".types", "TelephonyProvider": ".types", "TestConditionRationaleCommonModel": ".types", "TestConditionResultCommonModel": ".types", @@ -3426,7 +3457,9 @@ "UnitTestToolCallParameterEval_Regex": ".types", "UnitTestWorkflowNodeTransitionEvaluationNodeId": ".types", "UnprocessableEntityError": ".errors", + "UpdateAssetParams": ".types", "UpdateAudioNativeProjectRequest": ".types", + "UpdateCalendarEventParams": ".types", "UpdateChapterRequest": ".types", "UpdateClientParams": ".types", "UpdateProductParams": ".types", @@ -3474,6 +3507,7 @@ "VoiceSharingResponse": ".types", "VoiceSharingResponseModelCategory": ".types", "VoiceSharingState": ".types", + "VoiceStatisticsResponseModel": ".types", "VoiceVerificationResponse": ".types", "VoicemailDetectionToolConfig": ".types", "VoicesGetSharedRequestCategory": ".voices", @@ -4333,6 +4367,7 @@ def __dir__(): "CharacterRefreshPeriod", "CharacterUsageResponse", "ChatSourceMedium", + "CheckServiceAvailabilityParams", "ClientEvent", "ClientToolConfigInput", "ClientToolConfigOutput", @@ -4486,7 +4521,9 @@ def __dir__(): "CreateAgentBranchResponseModel", "CreateAgentResponseModel", "CreateAgentTestResponseModel", + "CreateAssetParams", "CreateAudioNativeProjectRequest", + "CreateClientAppointmentParams", "CreateClientParams", "CreatePhoneNumberResponseModel", "CreatePreviouslyGeneratedVoiceRequest", @@ -4504,10 +4541,10 @@ def __dir__(): "CreateTranscriptRequest", "CreateTwilioPhoneNumberRequest", "CustomGuardrailConfig", - "CustomGuardrailConfigModel", "CustomGuardrailInput", "CustomGuardrailOutput", - "CustomGuardrailsConfig", + "CustomGuardrailsConfigInput", + "CustomGuardrailsConfigOutput", "CustomLlm", "CustomLlmRequestHeadersValue", "CustomLlmapiType", @@ -4519,6 +4556,8 @@ def __dir__(): "DataCollectionResultCommonModel", "DefaultSharingGroupResponseModel", "DefaultSharingGroupResponseModelPermissionLevel", + "DeleteAssetParams", + "DeleteCalendarEventParams", "DeleteChapterRequest", "DeleteChapterResponseModel", "DeleteClientParams", @@ -4639,6 +4678,7 @@ def __dir__(): "GetChapterSnapshotsRequest", "GetChaptersRequest", "GetChaptersResponse", + "GetClientAppointmentsParams", "GetClientByPhoneParams", "GetConvAiDashboardSettingsResponseModel", "GetConvAiDashboardSettingsResponseModelChartsItem", @@ -4720,6 +4760,7 @@ def __dir__(): "GetVoicesV2Response", "GetWhatsAppAccountResponse", "GetWorkspaceSecretsResponseModel", + "GuardrailExecutionMode", "GuardrailsV1Input", "GuardrailsV1Output", "HistoryAlignmentResponseModel", @@ -4765,6 +4806,7 @@ def __dir__(): "LibraryVoiceResponse", "LibraryVoiceResponseModelCategory", "ListAssetsParams", + "ListCalendarEventsParams", "ListClientsParams", "ListMcpToolsResponseModel", "ListProductsParams", @@ -4839,6 +4881,7 @@ def __dir__(): "MusicExploreSongSourceContext", "MusicPrompt", "MusicSeparateStemsRequestStemVariationId", + "MusicUploadResponse", "NoCoachingSettings", "NonStreamingOutputFormats", "NormalizedAlignment", @@ -5032,6 +5075,8 @@ def __dir__(): "RenderStatus", "RenderType", "RequestPvcManualVerificationResponseModel", + "RequiredConstraint", + "RequiredConstraints", "ResourceAccessInfo", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", @@ -5150,6 +5195,8 @@ def __dir__(): "StartSpeakerSeparationResponseModel", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel", "StreamingAudioChunkWithTimestampsResponse", + "StudioAgentSettingsModel", + "StudioAgentToolSettingsModel", "StudioClipReference", "StudioClipReferenceClipType", "Subscription", @@ -5178,6 +5225,7 @@ def __dir__(): "SystemToolConfigOutputParams_TransferToAgent", "SystemToolConfigOutputParams_TransferToNumber", "SystemToolConfigOutputParams_VoicemailDetection", + "TelephonyCallConfig", "TelephonyProvider", "TestConditionRationaleCommonModel", "TestConditionResultCommonModel", @@ -5288,7 +5336,9 @@ def __dir__(): "UnitTestToolCallParameterEval_Regex", "UnitTestWorkflowNodeTransitionEvaluationNodeId", "UnprocessableEntityError", + "UpdateAssetParams", "UpdateAudioNativeProjectRequest", + "UpdateCalendarEventParams", "UpdateChapterRequest", "UpdateClientParams", "UpdateProductParams", @@ -5336,6 +5386,7 @@ def __dir__(): "VoiceSharingResponse", "VoiceSharingResponseModelCategory", "VoiceSharingState", + "VoiceStatisticsResponseModel", "VoiceVerificationResponse", "VoicemailDetectionToolConfig", "VoicesGetSharedRequestCategory", diff --git a/src/elevenlabs/conversational_ai/agents/client.py b/src/elevenlabs/conversational_ai/agents/client.py index 2ebccf64..f2e60170 100644 --- a/src/elevenlabs/conversational_ai/agents/client.py +++ b/src/elevenlabs/conversational_ai/agents/client.py @@ -69,6 +69,7 @@ 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, @@ -84,6 +85,9 @@ def create( conversation_config : ConversationalConfig Conversation configuration for an agent + enable_versioning : typing.Optional[bool] + Enable versioning for the agent + platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -114,11 +118,13 @@ def create( 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, @@ -210,6 +216,7 @@ 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, @@ -228,6 +235,9 @@ def update( agent_id : str The id of an agent. This is returned on agent creation. + enable_versioning_if_not_enabled : typing.Optional[bool] + Enable versioning for the agent, if not already enabled + branch_id : typing.Optional[str] The ID of the branch to use @@ -268,11 +278,13 @@ def update( ) 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, @@ -681,6 +693,7 @@ 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, @@ -696,6 +709,9 @@ async def create( conversation_config : ConversationalConfig Conversation configuration for an agent + enable_versioning : typing.Optional[bool] + Enable versioning for the agent + platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -731,6 +747,7 @@ async def create( async def main() -> None: await client.conversational_ai.agents.create( + enable_versioning=True, conversation_config=ConversationalConfig(), ) @@ -739,6 +756,7 @@ async def main() -> None: """ _response = await self._raw_client.create( conversation_config=conversation_config, + enable_versioning=enable_versioning, platform_settings=platform_settings, workflow=workflow, name=name, @@ -846,6 +864,7 @@ 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, @@ -864,6 +883,9 @@ async def update( agent_id : str The id of an agent. This is returned on agent creation. + enable_versioning_if_not_enabled : typing.Optional[bool] + Enable versioning for the agent, if not already enabled + branch_id : typing.Optional[str] The ID of the branch to use @@ -909,6 +931,7 @@ async def update( async def main() -> None: await client.conversational_ai.agents.update( agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz", + enable_versioning_if_not_enabled=True, branch_id="branch_id", ) @@ -917,6 +940,7 @@ async def main() -> None: """ _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, diff --git a/src/elevenlabs/conversational_ai/agents/raw_client.py b/src/elevenlabs/conversational_ai/agents/raw_client.py index cfe9813c..3b8d61c7 100644 --- a/src/elevenlabs/conversational_ai/agents/raw_client.py +++ b/src/elevenlabs/conversational_ai/agents/raw_client.py @@ -45,6 +45,7 @@ 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, @@ -60,6 +61,9 @@ def create( conversation_config : ConversationalConfig Conversation configuration for an agent + enable_versioning : typing.Optional[bool] + Enable versioning for the agent + platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -85,6 +89,9 @@ def create( _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" @@ -244,6 +251,7 @@ 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, @@ -262,6 +270,9 @@ def update( agent_id : str The id of an agent. This is returned on agent creation. + enable_versioning_if_not_enabled : typing.Optional[bool] + Enable versioning for the agent, if not already enabled + branch_id : typing.Optional[str] The ID of the branch to use @@ -297,6 +308,7 @@ def update( 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={ @@ -741,6 +753,7 @@ 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, @@ -756,6 +769,9 @@ async def create( conversation_config : ConversationalConfig Conversation configuration for an agent + enable_versioning : typing.Optional[bool] + Enable versioning for the agent + platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. @@ -781,6 +797,9 @@ async def create( _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" @@ -942,6 +961,7 @@ 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, @@ -960,6 +980,9 @@ async def update( agent_id : str The id of an agent. This is returned on agent creation. + enable_versioning_if_not_enabled : typing.Optional[bool] + Enable versioning for the agent, if not already enabled + branch_id : typing.Optional[str] The ID of the branch to use @@ -995,6 +1018,7 @@ async def update( 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={ diff --git a/src/elevenlabs/conversational_ai/batch_calls/client.py b/src/elevenlabs/conversational_ai/batch_calls/client.py index 000bf8f1..a4c756d2 100644 --- a/src/elevenlabs/conversational_ai/batch_calls/client.py +++ b/src/elevenlabs/conversational_ai/batch_calls/client.py @@ -8,6 +8,7 @@ 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 @@ -40,6 +41,7 @@ def create( agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, + telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BatchCallResponse: """ @@ -61,6 +63,8 @@ def create( timezone : typing.Optional[str] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -90,6 +94,7 @@ def create( agent_phone_number_id=agent_phone_number_id, whatsapp_params=whatsapp_params, timezone=timezone, + telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data @@ -280,6 +285,7 @@ async def create( agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, + telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BatchCallResponse: """ @@ -301,6 +307,8 @@ async def create( timezone : typing.Optional[str] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -338,6 +346,7 @@ async def main() -> None: agent_phone_number_id=agent_phone_number_id, whatsapp_params=whatsapp_params, timezone=timezone, + telephony_call_config=telephony_call_config, request_options=request_options, ) return _response.data diff --git a/src/elevenlabs/conversational_ai/batch_calls/raw_client.py b/src/elevenlabs/conversational_ai/batch_calls/raw_client.py index 754d0912..0a0dd702 100644 --- a/src/elevenlabs/conversational_ai/batch_calls/raw_client.py +++ b/src/elevenlabs/conversational_ai/batch_calls/raw_client.py @@ -16,6 +16,7 @@ from ...types.batch_call_whats_app_params import BatchCallWhatsAppParams from ...types.http_validation_error import HttpValidationError from ...types.outbound_call_recipient import OutboundCallRecipient +from ...types.telephony_call_config import TelephonyCallConfig from ...types.workspace_batch_calls_response import WorkspaceBatchCallsResponse # this is used as the default value for optional parameters @@ -36,6 +37,7 @@ def create( agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, + telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[BatchCallResponse]: """ @@ -57,6 +59,8 @@ def create( timezone : typing.Optional[str] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -80,6 +84,9 @@ def create( object_=whatsapp_params, annotation=BatchCallWhatsAppParams, direction="write" ), "timezone": timezone, + "telephony_call_config": convert_and_respect_annotation_metadata( + object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" + ), }, headers={ "content-type": "application/json", @@ -373,6 +380,7 @@ async def create( agent_phone_number_id: typing.Optional[str] = OMIT, whatsapp_params: typing.Optional[BatchCallWhatsAppParams] = OMIT, timezone: typing.Optional[str] = OMIT, + telephony_call_config: typing.Optional[TelephonyCallConfig] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[BatchCallResponse]: """ @@ -394,6 +402,8 @@ async def create( timezone : typing.Optional[str] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -417,6 +427,9 @@ async def create( object_=whatsapp_params, annotation=BatchCallWhatsAppParams, direction="write" ), "timezone": timezone, + "telephony_call_config": convert_and_respect_annotation_metadata( + object_=telephony_call_config, annotation=TelephonyCallConfig, direction="write" + ), }, headers={ "content-type": "application/json", diff --git a/src/elevenlabs/conversational_ai/sip_trunk/client.py b/src/elevenlabs/conversational_ai/sip_trunk/client.py index 210a00d1..482e13dc 100644 --- a/src/elevenlabs/conversational_ai/sip_trunk/client.py +++ b/src/elevenlabs/conversational_ai/sip_trunk/client.py @@ -6,6 +6,7 @@ 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 @@ -34,6 +35,7 @@ def outbound_call( 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: """ @@ -49,6 +51,8 @@ def outbound_call( conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -75,6 +79,7 @@ def outbound_call( 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 @@ -102,6 +107,7 @@ async def outbound_call( 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: """ @@ -117,6 +123,8 @@ async def outbound_call( conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -151,6 +159,7 @@ async def main() -> None: 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 diff --git a/src/elevenlabs/conversational_ai/sip_trunk/raw_client.py b/src/elevenlabs/conversational_ai/sip_trunk/raw_client.py index 512b9762..4ff64b23 100644 --- a/src/elevenlabs/conversational_ai/sip_trunk/raw_client.py +++ b/src/elevenlabs/conversational_ai/sip_trunk/raw_client.py @@ -13,6 +13,7 @@ from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.http_validation_error import HttpValidationError from ...types.sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse +from ...types.telephony_call_config import TelephonyCallConfig # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -29,6 +30,7 @@ def outbound_call( 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]: """ @@ -44,6 +46,8 @@ def outbound_call( conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -64,6 +68,9 @@ def outbound_call( 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", @@ -109,6 +116,7 @@ async def outbound_call( 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]: """ @@ -124,6 +132,8 @@ async def outbound_call( conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + telephony_call_config : typing.Optional[TelephonyCallConfig] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -144,6 +154,9 @@ async def outbound_call( 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", diff --git a/src/elevenlabs/conversational_ai/tests/client.py b/src/elevenlabs/conversational_ai/tests/client.py index 61c15fa7..73818356 100644 --- a/src/elevenlabs/conversational_ai/tests/client.py +++ b/src/elevenlabs/conversational_ai/tests/client.py @@ -9,6 +9,7 @@ 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_type import TestType from .raw_client import AsyncRawTestsClient, RawTestsClient from .types.tests_create_request_body import TestsCreateRequestBody from .types.tests_get_response import TestsGetResponse @@ -215,6 +216,7 @@ def list( 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, request_options: typing.Optional[RequestOptions] = None, @@ -236,8 +238,11 @@ def list( 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] - Whether to include folders in the response. Defaults to false. + 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. @@ -271,6 +276,7 @@ def list( page_size=page_size, search=search, parent_folder_id=parent_folder_id, + types=types, include_folders=include_folders, sort_mode=sort_mode, request_options=request_options, @@ -519,6 +525,7 @@ async def list( 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, request_options: typing.Optional[RequestOptions] = None, @@ -540,8 +547,11 @@ async def list( 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] - Whether to include folders in the response. Defaults to false. + 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. @@ -583,6 +593,7 @@ async def main() -> None: page_size=page_size, search=search, parent_folder_id=parent_folder_id, + types=types, include_folders=include_folders, sort_mode=sort_mode, request_options=request_options, diff --git a/src/elevenlabs/conversational_ai/tests/raw_client.py b/src/elevenlabs/conversational_ai/tests/raw_client.py index 13d2da8a..9b903a5c 100644 --- a/src/elevenlabs/conversational_ai/tests/raw_client.py +++ b/src/elevenlabs/conversational_ai/tests/raw_client.py @@ -15,6 +15,7 @@ from ...types.get_tests_page_response_model import GetTestsPageResponseModel from ...types.get_tests_summaries_by_ids_response_model import GetTestsSummariesByIdsResponseModel from ...types.http_validation_error import HttpValidationError +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 @@ -310,6 +311,7 @@ def list( 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, request_options: typing.Optional[RequestOptions] = None, @@ -331,8 +333,11 @@ def list( 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] - Whether to include folders in the response. Defaults to false. + 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. @@ -353,6 +358,7 @@ def list( "page_size": page_size, "search": search, "parent_folder_id": parent_folder_id, + "types": types, "include_folders": include_folders, "sort_mode": sort_mode, }, @@ -670,6 +676,7 @@ async def list( 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, request_options: typing.Optional[RequestOptions] = None, @@ -691,8 +698,11 @@ async def list( 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] - Whether to include folders in the response. Defaults to false. + 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. @@ -713,6 +723,7 @@ async def list( "page_size": page_size, "search": search, "parent_folder_id": parent_folder_id, + "types": types, "include_folders": include_folders, "sort_mode": sort_mode, }, diff --git a/src/elevenlabs/conversational_ai/twilio/client.py b/src/elevenlabs/conversational_ai/twilio/client.py index 0b688811..020be3ac 100644 --- a/src/elevenlabs/conversational_ai/twilio/client.py +++ b/src/elevenlabs/conversational_ai/twilio/client.py @@ -5,6 +5,7 @@ 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.twilio_outbound_call_response import TwilioOutboundCallResponse from .raw_client import AsyncRawTwilioClient, RawTwilioClient from .types.body_register_a_twilio_call_and_return_twi_ml_v_1_convai_twilio_register_call_post_direction import ( @@ -38,6 +39,7 @@ def outbound_call( 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: """ @@ -56,6 +58,8 @@ def outbound_call( 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. @@ -83,6 +87,7 @@ def outbound_call( 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 @@ -166,6 +171,7 @@ async def outbound_call( 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: """ @@ -184,6 +190,8 @@ async def outbound_call( 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. @@ -219,6 +227,7 @@ async def main() -> None: 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 diff --git a/src/elevenlabs/conversational_ai/twilio/raw_client.py b/src/elevenlabs/conversational_ai/twilio/raw_client.py index 6206b5bc..02123890 100644 --- a/src/elevenlabs/conversational_ai/twilio/raw_client.py +++ b/src/elevenlabs/conversational_ai/twilio/raw_client.py @@ -12,6 +12,7 @@ from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from ...types.http_validation_error import HttpValidationError +from ...types.telephony_call_config import TelephonyCallConfig from ...types.twilio_outbound_call_response import TwilioOutboundCallResponse from .types.body_register_a_twilio_call_and_return_twi_ml_v_1_convai_twilio_register_call_post_direction import ( BodyRegisterATwilioCallAndReturnTwiMlV1ConvaiTwilioRegisterCallPostDirection, @@ -33,6 +34,7 @@ def outbound_call( 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]: """ @@ -51,6 +53,8 @@ def outbound_call( 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. @@ -72,6 +76,9 @@ def outbound_call( 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", @@ -189,6 +196,7 @@ async def outbound_call( 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]: """ @@ -207,6 +215,8 @@ async def outbound_call( 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. @@ -228,6 +238,9 @@ async def outbound_call( 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", diff --git a/src/elevenlabs/conversational_ai/whatsapp_accounts/client.py b/src/elevenlabs/conversational_ai/whatsapp_accounts/client.py index b2b41a8d..a155582d 100644 --- a/src/elevenlabs/conversational_ai/whatsapp_accounts/client.py +++ b/src/elevenlabs/conversational_ai/whatsapp_accounts/client.py @@ -94,6 +94,7 @@ def update( phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, + enable_messaging: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -105,6 +106,8 @@ def update( assigned_agent_id : typing.Optional[str] + enable_messaging : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -125,7 +128,10 @@ def update( ) """ _response = self._raw_client.update( - phone_number_id, assigned_agent_id=assigned_agent_id, request_options=request_options + phone_number_id, + assigned_agent_id=assigned_agent_id, + enable_messaging=enable_messaging, + request_options=request_options, ) return _response.data @@ -256,6 +262,7 @@ async def update( phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, + enable_messaging: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -267,6 +274,8 @@ async def update( assigned_agent_id : typing.Optional[str] + enable_messaging : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -295,7 +304,10 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.update( - phone_number_id, assigned_agent_id=assigned_agent_id, request_options=request_options + phone_number_id, + assigned_agent_id=assigned_agent_id, + enable_messaging=enable_messaging, + request_options=request_options, ) return _response.data diff --git a/src/elevenlabs/conversational_ai/whatsapp_accounts/raw_client.py b/src/elevenlabs/conversational_ai/whatsapp_accounts/raw_client.py index 6997c7c0..45865771 100644 --- a/src/elevenlabs/conversational_ai/whatsapp_accounts/raw_client.py +++ b/src/elevenlabs/conversational_ai/whatsapp_accounts/raw_client.py @@ -127,6 +127,7 @@ def update( phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, + enable_messaging: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ @@ -138,6 +139,8 @@ def update( assigned_agent_id : typing.Optional[str] + enable_messaging : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -151,6 +154,7 @@ def update( method="PATCH", json={ "assigned_agent_id": assigned_agent_id, + "enable_messaging": enable_messaging, }, headers={ "content-type": "application/json", @@ -343,6 +347,7 @@ async def update( phone_number_id: str, *, assigned_agent_id: typing.Optional[str] = OMIT, + enable_messaging: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ @@ -354,6 +359,8 @@ async def update( assigned_agent_id : typing.Optional[str] + enable_messaging : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -367,6 +374,7 @@ async def update( method="PATCH", json={ "assigned_agent_id": assigned_agent_id, + "enable_messaging": enable_messaging, }, headers={ "content-type": "application/json", diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index ffd22ef7..371fe14a 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "elevenlabs/v2.37.0", + "User-Agent": "elevenlabs/v2.38.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "v2.37.0", + "X-Fern-SDK-Version": "v2.38.0", **(self.get_custom_headers() or {}), } if self._api_key is not None: diff --git a/src/elevenlabs/music/client.py b/src/elevenlabs/music/client.py index 9f80da9f..9117c7d2 100644 --- a/src/elevenlabs/music/client.py +++ b/src/elevenlabs/music/client.py @@ -9,6 +9,7 @@ from ..core.request_options import RequestOptions from ..types.allowed_output_formats import AllowedOutputFormats from ..types.music_prompt import MusicPrompt +from ..types.music_upload_response import MusicUploadResponse from .raw_client import AsyncRawMusicClient, RawMusicClient from .types.music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId @@ -80,7 +81,7 @@ def compose( Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan`. When set to true, the model will precisely respect each section's `duration_ms` from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. @@ -159,7 +160,7 @@ def compose_detailed( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. @@ -239,7 +240,7 @@ def stream( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. 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. @@ -271,6 +272,46 @@ def stream( ) as r: yield from r.data + def upload( + self, + *, + file: core.File, + extract_composition_plan: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> MusicUploadResponse: + """ + Upload a music file to be later used for inpainting. Only available to enterprise clients with access to the inpainting feature. + + Parameters + ---------- + file : core.File + See core.File for more documentation + + extract_composition_plan : typing.Optional[bool] + Whether to generate and return the composition plan for the uploaded song. If True, the response will include the composition_plan 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, request_options=request_options + ) + return _response.data + def separate_stems( self, *, @@ -385,7 +426,7 @@ async def compose( Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan`. When set to true, the model will precisely respect each section's `duration_ms` from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. @@ -473,7 +514,7 @@ async def compose_detailed( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. @@ -562,7 +603,7 @@ async def stream( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. 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. @@ -603,6 +644,54 @@ async def main() -> None: async for _chunk in r.data: yield _chunk + async def upload( + self, + *, + file: core.File, + extract_composition_plan: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> MusicUploadResponse: + """ + Upload a music file to be later used for inpainting. Only available to enterprise clients with access to the inpainting feature. + + Parameters + ---------- + file : core.File + See core.File for more documentation + + extract_composition_plan : typing.Optional[bool] + Whether to generate and return the composition plan for the uploaded song. If True, the response will include the composition_plan 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, request_options=request_options + ) + return _response.data + async def separate_stems( self, *, diff --git a/src/elevenlabs/music/raw_client.py b/src/elevenlabs/music/raw_client.py index cfa1d5d8..482213c4 100644 --- a/src/elevenlabs/music/raw_client.py +++ b/src/elevenlabs/music/raw_client.py @@ -15,6 +15,7 @@ from ..types.allowed_output_formats import AllowedOutputFormats from ..types.http_validation_error import HttpValidationError from ..types.music_prompt import MusicPrompt +from ..types.music_upload_response import MusicUploadResponse from .types.music_separate_stems_request_stem_variation_id import MusicSeparateStemsRequestStemVariationId # this is used as the default value for optional parameters @@ -71,7 +72,7 @@ def compose( Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan`. When set to true, the model will precisely respect each section's `duration_ms` from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. @@ -181,7 +182,7 @@ def compose_detailed( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. @@ -292,7 +293,7 @@ def stream( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. 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. @@ -354,6 +355,71 @@ def _stream() -> HttpResponse[typing.Iterator[bytes]]: yield _stream() + def upload( + self, + *, + file: core.File, + extract_composition_plan: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[MusicUploadResponse]: + """ + Upload a music file to be later used for inpainting. Only available to enterprise clients with access to the inpainting feature. + + Parameters + ---------- + file : core.File + See core.File for more documentation + + extract_composition_plan : typing.Optional[bool] + Whether to generate and return the composition plan for the uploaded song. If True, the response will include the composition_plan 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, + }, + 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( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: 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) + @contextlib.contextmanager def separate_stems( self, @@ -486,7 +552,7 @@ async def compose( Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan`. When set to true, the model will precisely respect each section's `duration_ms` from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. sign_with_c_2_pa : typing.Optional[bool] Whether to sign the generated song with C2PA. Applicable only for mp3 files. @@ -597,7 +663,7 @@ async def compose_detailed( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. with_timestamps : typing.Optional[bool] Whether to return the timestamps of the words in the generated song. @@ -709,7 +775,7 @@ async def stream( 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`. store_for_inpainting : typing.Optional[bool] - Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. + Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting feature. 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. @@ -772,6 +838,71 @@ async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: yield await _stream() + async def upload( + self, + *, + file: core.File, + extract_composition_plan: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[MusicUploadResponse]: + """ + Upload a music file to be later used for inpainting. Only available to enterprise clients with access to the inpainting feature. + + Parameters + ---------- + file : core.File + See core.File for more documentation + + extract_composition_plan : typing.Optional[bool] + Whether to generate and return the composition plan for the uploaded song. If True, the response will include the composition_plan 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, + }, + 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( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: 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) + @contextlib.asynccontextmanager async def separate_stems( self, diff --git a/src/elevenlabs/pronunciation_dictionaries/__init__.py b/src/elevenlabs/pronunciation_dictionaries/__init__.py index 5b463606..b3018c5c 100644 --- a/src/elevenlabs/pronunciation_dictionaries/__init__.py +++ b/src/elevenlabs/pronunciation_dictionaries/__init__.py @@ -16,6 +16,9 @@ ) from . import rules from .rules import ( + BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem, + BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias, + BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme, PronunciationDictionaryRule, PronunciationDictionaryRule_Alias, PronunciationDictionaryRule_Phoneme, @@ -25,6 +28,9 @@ "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme": ".types", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess": ".types", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem": ".rules", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias": ".rules", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme": ".rules", "PronunciationDictionariesCreateFromFileRequestWorkspaceAccess": ".types", "PronunciationDictionariesListRequestSort": ".types", "PronunciationDictionaryRule": ".rules", @@ -60,6 +66,9 @@ def __dir__(): "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", "PronunciationDictionariesCreateFromFileRequestWorkspaceAccess", "PronunciationDictionariesListRequestSort", "PronunciationDictionaryRule", diff --git a/src/elevenlabs/pronunciation_dictionaries/rules/__init__.py b/src/elevenlabs/pronunciation_dictionaries/rules/__init__.py index 70dec2c2..94c9bc12 100644 --- a/src/elevenlabs/pronunciation_dictionaries/rules/__init__.py +++ b/src/elevenlabs/pronunciation_dictionaries/rules/__init__.py @@ -7,11 +7,17 @@ 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", @@ -39,4 +45,11 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme"] +__all__ = [ + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", + "PronunciationDictionaryRule", + "PronunciationDictionaryRule_Alias", + "PronunciationDictionaryRule_Phoneme", +] diff --git a/src/elevenlabs/pronunciation_dictionaries/rules/client.py b/src/elevenlabs/pronunciation_dictionaries/rules/client.py index 9494f3b6..850f479d 100644 --- a/src/elevenlabs/pronunciation_dictionaries/rules/client.py +++ b/src/elevenlabs/pronunciation_dictionaries/rules/client.py @@ -6,6 +6,9 @@ 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 @@ -27,6 +30,61 @@ def with_raw_response(self) -> 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, @@ -139,6 +197,71 @@ def with_raw_response(self) -> 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, diff --git a/src/elevenlabs/pronunciation_dictionaries/rules/raw_client.py b/src/elevenlabs/pronunciation_dictionaries/rules/raw_client.py index b9598046..b953fef8 100644 --- a/src/elevenlabs/pronunciation_dictionaries/rules/raw_client.py +++ b/src/elevenlabs/pronunciation_dictionaries/rules/raw_client.py @@ -13,6 +13,9 @@ from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.http_validation_error import HttpValidationError 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 # this is used as the default value for optional parameters @@ -23,6 +26,80 @@ 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( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: 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 add( self, pronunciation_dictionary_id: str, @@ -160,6 +237,80 @@ 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( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: 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 add( self, pronunciation_dictionary_id: str, diff --git a/src/elevenlabs/pronunciation_dictionaries/rules/types/__init__.py b/src/elevenlabs/pronunciation_dictionaries/rules/types/__init__.py index dc7fdf84..bac57ff4 100644 --- a/src/elevenlabs/pronunciation_dictionaries/rules/types/__init__.py +++ b/src/elevenlabs/pronunciation_dictionaries/rules/types/__init__.py @@ -6,12 +6,20 @@ 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", @@ -39,4 +47,11 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["PronunciationDictionaryRule", "PronunciationDictionaryRule_Alias", "PronunciationDictionaryRule_Phoneme"] +__all__ = [ + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Alias", + "BodySetRulesOnThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdSetRulesPostRulesItem_Phoneme", + "PronunciationDictionaryRule", + "PronunciationDictionaryRule_Alias", + "PronunciationDictionaryRule_Phoneme", +] diff --git a/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 b/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 new file mode 100644 index 00000000..97a701c9 --- /dev/null +++ b/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 @@ -0,0 +1,58 @@ +# 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"), +] diff --git a/src/elevenlabs/speech_to_text/client.py b/src/elevenlabs/speech_to_text/client.py index f0c5d289..0b15c4e7 100644 --- a/src/elevenlabs/speech_to_text/client.py +++ b/src/elevenlabs/speech_to_text/client.py @@ -146,7 +146,7 @@ def convert( ) client.speech_to_text.convert( enable_logging=True, - model_id="scribe_v1", + model_id="scribe_v2", ) """ _response = self._raw_client.convert( @@ -312,7 +312,7 @@ async def convert( async def main() -> None: await client.speech_to_text.convert( enable_logging=True, - model_id="scribe_v1", + model_id="scribe_v2", ) diff --git a/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_model_id.py b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_model_id.py index ddcae377..97ec0ad6 100644 --- a/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_model_id.py +++ b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_model_id.py @@ -2,4 +2,4 @@ import typing -SpeechToTextConvertRequestModelId = typing.Union[typing.Literal["scribe_v1", "scribe_v2"], typing.Any] +SpeechToTextConvertRequestModelId = typing.Union[typing.Literal["scribe_v2", "scribe_v1"], typing.Any] diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py index e93e322f..6cb089aa 100644 --- a/src/elevenlabs/types/__init__.py +++ b/src/elevenlabs/types/__init__.py @@ -663,6 +663,7 @@ from .character_refresh_period import CharacterRefreshPeriod 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 @@ -882,7 +883,9 @@ from .create_agent_branch_response_model import CreateAgentBranchResponseModel from .create_agent_response_model import CreateAgentResponseModel from .create_agent_test_response_model import CreateAgentTestResponseModel + from .create_asset_params import CreateAssetParams from .create_audio_native_project_request import CreateAudioNativeProjectRequest + from .create_client_appointment_params import CreateClientAppointmentParams from .create_client_params import CreateClientParams from .create_phone_number_response_model import CreatePhoneNumberResponseModel from .create_previously_generated_voice_request import CreatePreviouslyGeneratedVoiceRequest @@ -904,10 +907,10 @@ from .create_transcript_request import CreateTranscriptRequest from .create_twilio_phone_number_request import CreateTwilioPhoneNumberRequest from .custom_guardrail_config import CustomGuardrailConfig - from .custom_guardrail_config_model import CustomGuardrailConfigModel from .custom_guardrail_input import CustomGuardrailInput from .custom_guardrail_output import CustomGuardrailOutput - from .custom_guardrails_config import CustomGuardrailsConfig + from .custom_guardrails_config_input import CustomGuardrailsConfigInput + from .custom_guardrails_config_output import CustomGuardrailsConfigOutput from .custom_llm import CustomLlm from .custom_llm_request_headers_value import CustomLlmRequestHeadersValue from .custom_llmapi_type import CustomLlmapiType @@ -919,6 +922,8 @@ from .data_collection_result_common_model import DataCollectionResultCommonModel from .default_sharing_group_response_model import DefaultSharingGroupResponseModel from .default_sharing_group_response_model_permission_level import DefaultSharingGroupResponseModelPermissionLevel + 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_params import DeleteClientParams @@ -1042,6 +1047,7 @@ 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 ( @@ -1157,6 +1163,7 @@ 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 .guardrail_execution_mode import GuardrailExecutionMode from .guardrails_v_1_input import GuardrailsV1Input from .guardrails_v_1_output import GuardrailsV1Output from .history_alignment_response_model import HistoryAlignmentResponseModel @@ -1204,6 +1211,7 @@ from .library_voice_response import LibraryVoiceResponse from .library_voice_response_model_category import LibraryVoiceResponseModelCategory from .list_assets_params import ListAssetsParams + from .list_calendar_events_params import ListCalendarEventsParams from .list_clients_params import ListClientsParams from .list_mcp_tools_response_model import ListMcpToolsResponseModel from .list_products_params import ListProductsParams @@ -1281,6 +1289,7 @@ from .multipart_music_response import MultipartMusicResponse from .music_explore_song_source_context import MusicExploreSongSourceContext from .music_prompt import MusicPrompt + from .music_upload_response import MusicUploadResponse from .no_coaching_settings import NoCoachingSettings from .non_streaming_output_formats import NonStreamingOutputFormats from .normalized_alignment import NormalizedAlignment @@ -1494,6 +1503,8 @@ from .render_status import RenderStatus from .render_type import RenderType 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_role import ResourceAccessInfoRole from .resource_metadata_response_model import ResourceMetadataResponseModel @@ -1604,6 +1615,8 @@ 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 .subscription import Subscription @@ -1636,6 +1649,7 @@ SystemToolConfigOutputParams_TransferToNumber, SystemToolConfigOutputParams_VoicemailDetection, ) + from .telephony_call_config import TelephonyCallConfig from .telephony_provider import TelephonyProvider from .test_condition_rationale_common_model import TestConditionRationaleCommonModel from .test_condition_result_common_model import TestConditionResultCommonModel @@ -1746,7 +1760,9 @@ UnitTestToolCallParameterEval_Regex, ) from .unit_test_workflow_node_transition_evaluation_node_id import UnitTestWorkflowNodeTransitionEvaluationNodeId + from .update_asset_params import UpdateAssetParams from .update_audio_native_project_request import UpdateAudioNativeProjectRequest + from .update_calendar_event_params import UpdateCalendarEventParams from .update_chapter_request import UpdateChapterRequest from .update_client_params import UpdateClientParams from .update_product_params import UpdateProductParams @@ -1797,6 +1813,7 @@ from .voice_sharing_response import VoiceSharingResponse from .voice_sharing_response_model_category import VoiceSharingResponseModelCategory 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 .webhook_auth_method_type import WebhookAuthMethodType @@ -2615,6 +2632,7 @@ "CharacterRefreshPeriod": ".character_refresh_period", "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", @@ -2766,7 +2784,9 @@ "CreateAgentBranchResponseModel": ".create_agent_branch_response_model", "CreateAgentResponseModel": ".create_agent_response_model", "CreateAgentTestResponseModel": ".create_agent_test_response_model", + "CreateAssetParams": ".create_asset_params", "CreateAudioNativeProjectRequest": ".create_audio_native_project_request", + "CreateClientAppointmentParams": ".create_client_appointment_params", "CreateClientParams": ".create_client_params", "CreatePhoneNumberResponseModel": ".create_phone_number_response_model", "CreatePreviouslyGeneratedVoiceRequest": ".create_previously_generated_voice_request", @@ -2784,10 +2804,10 @@ "CreateTranscriptRequest": ".create_transcript_request", "CreateTwilioPhoneNumberRequest": ".create_twilio_phone_number_request", "CustomGuardrailConfig": ".custom_guardrail_config", - "CustomGuardrailConfigModel": ".custom_guardrail_config_model", "CustomGuardrailInput": ".custom_guardrail_input", "CustomGuardrailOutput": ".custom_guardrail_output", - "CustomGuardrailsConfig": ".custom_guardrails_config", + "CustomGuardrailsConfigInput": ".custom_guardrails_config_input", + "CustomGuardrailsConfigOutput": ".custom_guardrails_config_output", "CustomLlm": ".custom_llm", "CustomLlmRequestHeadersValue": ".custom_llm_request_headers_value", "CustomLlmapiType": ".custom_llmapi_type", @@ -2799,6 +2819,8 @@ "DataCollectionResultCommonModel": ".data_collection_result_common_model", "DefaultSharingGroupResponseModel": ".default_sharing_group_response_model", "DefaultSharingGroupResponseModelPermissionLevel": ".default_sharing_group_response_model_permission_level", + "DeleteAssetParams": ".delete_asset_params", + "DeleteCalendarEventParams": ".delete_calendar_event_params", "DeleteChapterRequest": ".delete_chapter_request", "DeleteChapterResponseModel": ".delete_chapter_response_model", "DeleteClientParams": ".delete_client_params", @@ -2912,6 +2934,7 @@ "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", @@ -2993,6 +3016,7 @@ "GetVoicesV2Response": ".get_voices_v_2_response", "GetWhatsAppAccountResponse": ".get_whats_app_account_response", "GetWorkspaceSecretsResponseModel": ".get_workspace_secrets_response_model", + "GuardrailExecutionMode": ".guardrail_execution_mode", "GuardrailsV1Input": ".guardrails_v_1_input", "GuardrailsV1Output": ".guardrails_v_1_output", "HistoryAlignmentResponseModel": ".history_alignment_response_model", @@ -3036,6 +3060,7 @@ "LibraryVoiceResponse": ".library_voice_response", "LibraryVoiceResponseModelCategory": ".library_voice_response_model_category", "ListAssetsParams": ".list_assets_params", + "ListCalendarEventsParams": ".list_calendar_events_params", "ListClientsParams": ".list_clients_params", "ListMcpToolsResponseModel": ".list_mcp_tools_response_model", "ListProductsParams": ".list_products_params", @@ -3109,6 +3134,7 @@ "MultipartMusicResponse": ".multipart_music_response", "MusicExploreSongSourceContext": ".music_explore_song_source_context", "MusicPrompt": ".music_prompt", + "MusicUploadResponse": ".music_upload_response", "NoCoachingSettings": ".no_coaching_settings", "NonStreamingOutputFormats": ".non_streaming_output_formats", "NormalizedAlignment": ".normalized_alignment", @@ -3292,6 +3318,8 @@ "RenderStatus": ".render_status", "RenderType": ".render_type", "RequestPvcManualVerificationResponseModel": ".request_pvc_manual_verification_response_model", + "RequiredConstraint": ".required_constraint", + "RequiredConstraints": ".required_constraints", "ResourceAccessInfo": ".resource_access_info", "ResourceAccessInfoRole": ".resource_access_info_role", "ResourceMetadataResponseModel": ".resource_metadata_response_model", @@ -3398,6 +3426,8 @@ "StartSpeakerSeparationResponseModel": ".start_speaker_separation_response_model", "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", "Subscription": ".subscription", @@ -3426,6 +3456,7 @@ "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", "TelephonyProvider": ".telephony_provider", "TestConditionRationaleCommonModel": ".test_condition_rationale_common_model", "TestConditionResultCommonModel": ".test_condition_result_common_model", @@ -3526,7 +3557,9 @@ "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", + "UpdateAssetParams": ".update_asset_params", "UpdateAudioNativeProjectRequest": ".update_audio_native_project_request", + "UpdateCalendarEventParams": ".update_calendar_event_params", "UpdateChapterRequest": ".update_chapter_request", "UpdateClientParams": ".update_client_params", "UpdateProductParams": ".update_product_params", @@ -3573,6 +3606,7 @@ "VoiceSharingResponse": ".voice_sharing_response", "VoiceSharingResponseModelCategory": ".voice_sharing_response_model_category", "VoiceSharingState": ".voice_sharing_state", + "VoiceStatisticsResponseModel": ".voice_statistics_response_model", "VoiceVerificationResponse": ".voice_verification_response", "VoicemailDetectionToolConfig": ".voicemail_detection_tool_config", "WebhookAuthMethodType": ".webhook_auth_method_type", @@ -4371,6 +4405,7 @@ def __dir__(): "CharacterRefreshPeriod", "CharacterUsageResponse", "ChatSourceMedium", + "CheckServiceAvailabilityParams", "ClientEvent", "ClientToolConfigInput", "ClientToolConfigOutput", @@ -4522,7 +4557,9 @@ def __dir__(): "CreateAgentBranchResponseModel", "CreateAgentResponseModel", "CreateAgentTestResponseModel", + "CreateAssetParams", "CreateAudioNativeProjectRequest", + "CreateClientAppointmentParams", "CreateClientParams", "CreatePhoneNumberResponseModel", "CreatePreviouslyGeneratedVoiceRequest", @@ -4540,10 +4577,10 @@ def __dir__(): "CreateTranscriptRequest", "CreateTwilioPhoneNumberRequest", "CustomGuardrailConfig", - "CustomGuardrailConfigModel", "CustomGuardrailInput", "CustomGuardrailOutput", - "CustomGuardrailsConfig", + "CustomGuardrailsConfigInput", + "CustomGuardrailsConfigOutput", "CustomLlm", "CustomLlmRequestHeadersValue", "CustomLlmapiType", @@ -4555,6 +4592,8 @@ def __dir__(): "DataCollectionResultCommonModel", "DefaultSharingGroupResponseModel", "DefaultSharingGroupResponseModelPermissionLevel", + "DeleteAssetParams", + "DeleteCalendarEventParams", "DeleteChapterRequest", "DeleteChapterResponseModel", "DeleteClientParams", @@ -4668,6 +4707,7 @@ def __dir__(): "GetChapterSnapshotsRequest", "GetChaptersRequest", "GetChaptersResponse", + "GetClientAppointmentsParams", "GetClientByPhoneParams", "GetConvAiDashboardSettingsResponseModel", "GetConvAiDashboardSettingsResponseModelChartsItem", @@ -4749,6 +4789,7 @@ def __dir__(): "GetVoicesV2Response", "GetWhatsAppAccountResponse", "GetWorkspaceSecretsResponseModel", + "GuardrailExecutionMode", "GuardrailsV1Input", "GuardrailsV1Output", "HistoryAlignmentResponseModel", @@ -4792,6 +4833,7 @@ def __dir__(): "LibraryVoiceResponse", "LibraryVoiceResponseModelCategory", "ListAssetsParams", + "ListCalendarEventsParams", "ListClientsParams", "ListMcpToolsResponseModel", "ListProductsParams", @@ -4865,6 +4907,7 @@ def __dir__(): "MultipartMusicResponse", "MusicExploreSongSourceContext", "MusicPrompt", + "MusicUploadResponse", "NoCoachingSettings", "NonStreamingOutputFormats", "NormalizedAlignment", @@ -5048,6 +5091,8 @@ def __dir__(): "RenderStatus", "RenderType", "RequestPvcManualVerificationResponseModel", + "RequiredConstraint", + "RequiredConstraints", "ResourceAccessInfo", "ResourceAccessInfoRole", "ResourceMetadataResponseModel", @@ -5154,6 +5199,8 @@ def __dir__(): "StartSpeakerSeparationResponseModel", "StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel", "StreamingAudioChunkWithTimestampsResponse", + "StudioAgentSettingsModel", + "StudioAgentToolSettingsModel", "StudioClipReference", "StudioClipReferenceClipType", "Subscription", @@ -5182,6 +5229,7 @@ def __dir__(): "SystemToolConfigOutputParams_TransferToAgent", "SystemToolConfigOutputParams_TransferToNumber", "SystemToolConfigOutputParams_VoicemailDetection", + "TelephonyCallConfig", "TelephonyProvider", "TestConditionRationaleCommonModel", "TestConditionResultCommonModel", @@ -5282,7 +5330,9 @@ def __dir__(): "UnitTestToolCallParameterEval_Llm", "UnitTestToolCallParameterEval_Regex", "UnitTestWorkflowNodeTransitionEvaluationNodeId", + "UpdateAssetParams", "UpdateAudioNativeProjectRequest", + "UpdateCalendarEventParams", "UpdateChapterRequest", "UpdateClientParams", "UpdateProductParams", @@ -5329,6 +5379,7 @@ def __dir__(): "VoiceSharingResponse", "VoiceSharingResponseModelCategory", "VoiceSharingState", + "VoiceStatisticsResponseModel", "VoiceVerificationResponse", "VoicemailDetectionToolConfig", "WebhookAuthMethodType", diff --git a/src/elevenlabs/types/agent_metadata.py b/src/elevenlabs/types/agent_metadata.py index a789a217..61853c54 100644 --- a/src/elevenlabs/types/agent_metadata.py +++ b/src/elevenlabs/types/agent_metadata.py @@ -11,6 +11,7 @@ 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 diff --git a/src/elevenlabs/types/asr_provider.py b/src/elevenlabs/types/asr_provider.py index 9c6df052..f9dc1d95 100644 --- a/src/elevenlabs/types/asr_provider.py +++ b/src/elevenlabs/types/asr_provider.py @@ -2,4 +2,4 @@ import typing -AsrProvider = typing.Union[typing.Literal["elevenlabs", "scribe_realtime"], typing.Any] +AsrProvider = typing.Union[typing.Literal["elevenlabs", "scribe_realtime", "scribe_v2_turbo"], typing.Any] diff --git a/src/elevenlabs/types/batch_call_detailed_response.py b/src/elevenlabs/types/batch_call_detailed_response.py index 33a156e6..4ee736f6 100644 --- a/src/elevenlabs/types/batch_call_detailed_response.py +++ b/src/elevenlabs/types/batch_call_detailed_response.py @@ -8,6 +8,7 @@ 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 @@ -31,6 +32,7 @@ class BatchCallDetailedResponse(UncheckedBaseModel): last_updated_at_unix: int status: BatchCallStatus retry_count: int + telephony_call_config: TelephonyCallConfig agent_name: str recipients: typing.List[OutboundCallRecipientResponseModel] diff --git a/src/elevenlabs/types/batch_call_response.py b/src/elevenlabs/types/batch_call_response.py index bc09e292..44231f9d 100644 --- a/src/elevenlabs/types/batch_call_response.py +++ b/src/elevenlabs/types/batch_call_response.py @@ -7,6 +7,7 @@ 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 @@ -26,6 +27,7 @@ class BatchCallResponse(UncheckedBaseModel): last_updated_at_unix: int status: BatchCallStatus retry_count: int + telephony_call_config: TelephonyCallConfig agent_name: str if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/canvas_placement.py b/src/elevenlabs/types/canvas_placement.py index 9c21c978..4051e388 100644 --- a/src/elevenlabs/types/canvas_placement.py +++ b/src/elevenlabs/types/canvas_placement.py @@ -20,6 +20,10 @@ class CanvasPlacement(UncheckedBaseModel): 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 if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/chapter_statistics_response.py b/src/elevenlabs/types/chapter_statistics_response.py index 68906fd9..e0c43024 100644 --- a/src/elevenlabs/types/chapter_statistics_response.py +++ b/src/elevenlabs/types/chapter_statistics_response.py @@ -5,6 +5,7 @@ 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): @@ -28,6 +29,11 @@ class ChapterStatisticsResponse(UncheckedBaseModel): The number of unconverted 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: diff --git a/src/elevenlabs/types/check_service_availability_params.py b/src/elevenlabs/types/check_service_availability_params.py new file mode 100644 index 00000000..b8264af2 --- /dev/null +++ b/src/elevenlabs/types/check_service_availability_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/client_event.py b/src/elevenlabs/types/client_event.py index 37325445..ddc5f02b 100644 --- a/src/elevenlabs/types/client_event.py +++ b/src/elevenlabs/types/client_event.py @@ -22,6 +22,7 @@ "vad_score", "agent_chat_response_part", "client_error", + "guardrail_triggered", "internal_turn_probability", "internal_tentative_agent_response", ], diff --git a/src/elevenlabs/types/content_guardrail_input.py b/src/elevenlabs/types/content_guardrail_input.py index 1da9e8ff..59cfac45 100644 --- a/src/elevenlabs/types/content_guardrail_input.py +++ b/src/elevenlabs/types/content_guardrail_input.py @@ -6,9 +6,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_config import ContentConfig +from .guardrail_execution_mode import GuardrailExecutionMode class ContentGuardrailInput(UncheckedBaseModel): + execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ContentConfig] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/content_guardrail_output.py b/src/elevenlabs/types/content_guardrail_output.py index 46a98256..33cbaec9 100644 --- a/src/elevenlabs/types/content_guardrail_output.py +++ b/src/elevenlabs/types/content_guardrail_output.py @@ -6,9 +6,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .content_config import ContentConfig +from .guardrail_execution_mode import GuardrailExecutionMode class ContentGuardrailOutput(UncheckedBaseModel): + execution_mode: typing.Optional[GuardrailExecutionMode] = None config: typing.Optional[ContentConfig] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/conversation_user_response_model.py b/src/elevenlabs/types/conversation_user_response_model.py index 06d22294..933d983a 100644 --- a/src/elevenlabs/types/conversation_user_response_model.py +++ b/src/elevenlabs/types/conversation_user_response_model.py @@ -12,8 +12,8 @@ class ConversationUserResponseModel(UncheckedBaseModel): 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: typing.Optional[str] = None + last_contact_agent_id: str + last_contact_conversation_id: str last_contact_agent_name: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/create_asset_params.py b/src/elevenlabs/types/create_asset_params.py new file mode 100644 index 00000000..676f18cd --- /dev/null +++ b/src/elevenlabs/types/create_asset_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/create_client_appointment_params.py b/src/elevenlabs/types/create_client_appointment_params.py new file mode 100644 index 00000000..3855b3db --- /dev/null +++ b/src/elevenlabs/types/create_client_appointment_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/custom_guardrail_config.py b/src/elevenlabs/types/custom_guardrail_config.py index 09411911..b1159f64 100644 --- a/src/elevenlabs/types/custom_guardrail_config.py +++ b/src/elevenlabs/types/custom_guardrail_config.py @@ -5,7 +5,7 @@ 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 .guardrail_execution_mode import GuardrailExecutionMode class CustomGuardrailConfig(UncheckedBaseModel): @@ -24,10 +24,7 @@ class CustomGuardrailConfig(UncheckedBaseModel): Instruction describing what to block, e.g. 'don't talk about politics' """ - model: CustomGuardrailConfigModel = pydantic.Field() - """ - LLM model to use for custom guardrail evaluation - """ + execution_mode: typing.Optional[GuardrailExecutionMode] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/custom_guardrail_config_model.py b/src/elevenlabs/types/custom_guardrail_config_model.py deleted file mode 100644 index 7a87a4b4..00000000 --- a/src/elevenlabs/types/custom_guardrail_config_model.py +++ /dev/null @@ -1,5 +0,0 @@ -# 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.0-flash"], typing.Any] diff --git a/src/elevenlabs/types/custom_guardrail_input.py b/src/elevenlabs/types/custom_guardrail_input.py index ec3cc2d5..d11053a1 100644 --- a/src/elevenlabs/types/custom_guardrail_input.py +++ b/src/elevenlabs/types/custom_guardrail_input.py @@ -5,7 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .custom_guardrails_config import CustomGuardrailsConfig +from .custom_guardrails_config_input import CustomGuardrailsConfigInput class CustomGuardrailInput(UncheckedBaseModel): @@ -13,7 +13,7 @@ class CustomGuardrailInput(UncheckedBaseModel): Container for custom guardrails, matching ModerationGuardrail pattern """ - config: typing.Optional[CustomGuardrailsConfig] = None + 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 diff --git a/src/elevenlabs/types/custom_guardrail_output.py b/src/elevenlabs/types/custom_guardrail_output.py index 8bd44a12..679d3976 100644 --- a/src/elevenlabs/types/custom_guardrail_output.py +++ b/src/elevenlabs/types/custom_guardrail_output.py @@ -5,7 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .custom_guardrails_config import CustomGuardrailsConfig +from .custom_guardrails_config_output import CustomGuardrailsConfigOutput class CustomGuardrailOutput(UncheckedBaseModel): @@ -13,7 +13,7 @@ class CustomGuardrailOutput(UncheckedBaseModel): Container for custom guardrails, matching ModerationGuardrail pattern """ - config: typing.Optional[CustomGuardrailsConfig] = None + 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 diff --git a/src/elevenlabs/types/custom_guardrails_config.py b/src/elevenlabs/types/custom_guardrails_config_input.py similarity index 92% rename from src/elevenlabs/types/custom_guardrails_config.py rename to src/elevenlabs/types/custom_guardrails_config_input.py index d44293c0..6b20e370 100644 --- a/src/elevenlabs/types/custom_guardrails_config.py +++ b/src/elevenlabs/types/custom_guardrails_config_input.py @@ -8,7 +8,7 @@ from .custom_guardrail_config import CustomGuardrailConfig -class CustomGuardrailsConfig(UncheckedBaseModel): +class CustomGuardrailsConfigInput(UncheckedBaseModel): """ Config container for custom guardrails list """ diff --git a/src/elevenlabs/types/custom_guardrails_config_output.py b/src/elevenlabs/types/custom_guardrails_config_output.py new file mode 100644 index 00000000..beb7a6dc --- /dev/null +++ b/src/elevenlabs/types/custom_guardrails_config_output.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/custom_llm.py b/src/elevenlabs/types/custom_llm.py index 001a86a8..a170186e 100644 --- a/src/elevenlabs/types/custom_llm.py +++ b/src/elevenlabs/types/custom_llm.py @@ -23,7 +23,7 @@ class CustomLlm(UncheckedBaseModel): api_key: typing.Optional[ConvAiSecretLocator] = pydantic.Field(default=None) """ - The API key for authentication + The API key for authentication. Either a workspace secret reference {'secret_id': '...'} or an environment variable reference {'env_var_label': '...'}. """ request_headers: typing.Optional[typing.Dict[str, CustomLlmRequestHeadersValue]] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/delete_asset_params.py b/src/elevenlabs/types/delete_asset_params.py new file mode 100644 index 00000000..c99f872d --- /dev/null +++ b/src/elevenlabs/types/delete_asset_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/delete_calendar_event_params.py b/src/elevenlabs/types/delete_calendar_event_params.py new file mode 100644 index 00000000..60fedda7 --- /dev/null +++ b/src/elevenlabs/types/delete_calendar_event_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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): + 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 diff --git a/src/elevenlabs/types/get_client_appointments_params.py b/src/elevenlabs/types/get_client_appointments_params.py new file mode 100644 index 00000000..889278bd --- /dev/null +++ b/src/elevenlabs/types/get_client_appointments_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/get_whats_app_account_response.py b/src/elevenlabs/types/get_whats_app_account_response.py index 792314f4..6dbbc0de 100644 --- a/src/elevenlabs/types/get_whats_app_account_response.py +++ b/src/elevenlabs/types/get_whats_app_account_response.py @@ -14,6 +14,7 @@ class GetWhatsAppAccountResponse(UncheckedBaseModel): phone_number_name: str phone_number: str assigned_agent_id: typing.Optional[str] = None + enable_messaging: typing.Optional[bool] = None assigned_agent_name: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/guardrail_execution_mode.py b/src/elevenlabs/types/guardrail_execution_mode.py new file mode 100644 index 00000000..b1b0ecdb --- /dev/null +++ b/src/elevenlabs/types/guardrail_execution_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GuardrailExecutionMode = typing.Union[typing.Literal["streaming", "blocking"], typing.Any] diff --git a/src/elevenlabs/types/list_assets_params.py b/src/elevenlabs/types/list_assets_params.py index 03e3d407..846ac7a3 100644 --- a/src/elevenlabs/types/list_assets_params.py +++ b/src/elevenlabs/types/list_assets_params.py @@ -8,6 +8,7 @@ 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: diff --git a/src/elevenlabs/types/list_calendar_events_params.py b/src/elevenlabs/types/list_calendar_events_params.py new file mode 100644 index 00000000..a577f88c --- /dev/null +++ b/src/elevenlabs/types/list_calendar_events_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/list_products_params.py b/src/elevenlabs/types/list_products_params.py index 07c9b44d..ad42e260 100644 --- a/src/elevenlabs/types/list_products_params.py +++ b/src/elevenlabs/types/list_products_params.py @@ -8,6 +8,7 @@ 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: diff --git a/src/elevenlabs/types/list_services_params.py b/src/elevenlabs/types/list_services_params.py index bae28ebb..338395b9 100644 --- a/src/elevenlabs/types/list_services_params.py +++ b/src/elevenlabs/types/list_services_params.py @@ -8,6 +8,7 @@ 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: diff --git a/src/elevenlabs/types/list_staff_params.py b/src/elevenlabs/types/list_staff_params.py index 2cc231d5..0a9bad1c 100644 --- a/src/elevenlabs/types/list_staff_params.py +++ b/src/elevenlabs/types/list_staff_params.py @@ -8,6 +8,7 @@ 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: diff --git a/src/elevenlabs/types/llm.py b/src/elevenlabs/types/llm.py index 3db61624..06d877e4 100644 --- a/src/elevenlabs/types/llm.py +++ b/src/elevenlabs/types/llm.py @@ -27,6 +27,7 @@ "gemini-3-pro-preview", "gemini-3-flash-preview", "claude-sonnet-4-5", + "claude-sonnet-4-6", "claude-sonnet-4", "claude-haiku-4-5", "claude-3-7-sonnet", diff --git a/src/elevenlabs/types/moderation_guardrail_input.py b/src/elevenlabs/types/moderation_guardrail_input.py index 8a35b24e..b4bf0960 100644 --- a/src/elevenlabs/types/moderation_guardrail_input.py +++ b/src/elevenlabs/types/moderation_guardrail_input.py @@ -5,10 +5,12 @@ 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: diff --git a/src/elevenlabs/types/moderation_guardrail_output.py b/src/elevenlabs/types/moderation_guardrail_output.py index a2f108a9..604bf636 100644 --- a/src/elevenlabs/types/moderation_guardrail_output.py +++ b/src/elevenlabs/types/moderation_guardrail_output.py @@ -5,10 +5,12 @@ 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: diff --git a/src/elevenlabs/types/music_upload_response.py b/src/elevenlabs/types/music_upload_response.py new file mode 100644 index 00000000..3eb55a5f --- /dev/null +++ b/src/elevenlabs/types/music_upload_response.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern 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_prompt import MusicPrompt + + +class MusicUploadResponse(UncheckedBaseModel): + """ + Response model for music upload endpoint. + """ + + song_id: str = pydantic.Field() + """ + Unique identifier for the uploaded song + """ + + composition_plan: typing.Optional[MusicPrompt] = pydantic.Field(default=None) + """ + The composition plan extracted from the uploaded song. Only present if `extract_composition_plan` 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 diff --git a/src/elevenlabs/types/object_json_schema_property_input.py b/src/elevenlabs/types/object_json_schema_property_input.py index c9785454..9998c050 100644 --- a/src/elevenlabs/types/object_json_schema_property_input.py +++ b/src/elevenlabs/types/object_json_schema_property_input.py @@ -7,6 +7,7 @@ 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 ObjectJsonSchemaPropertyInput(UncheckedBaseModel): @@ -14,6 +15,7 @@ class ObjectJsonSchemaPropertyInput(UncheckedBaseModel): required: typing.Optional[typing.List[str]] = None description: typing.Optional[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 diff --git a/src/elevenlabs/types/object_json_schema_property_output.py b/src/elevenlabs/types/object_json_schema_property_output.py index 4c5fb590..e2e208e8 100644 --- a/src/elevenlabs/types/object_json_schema_property_output.py +++ b/src/elevenlabs/types/object_json_schema_property_output.py @@ -7,6 +7,7 @@ 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): @@ -14,6 +15,7 @@ class ObjectJsonSchemaPropertyOutput(UncheckedBaseModel): required: typing.Optional[typing.List[str]] = None description: typing.Optional[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 diff --git a/src/elevenlabs/types/project_extended_response.py b/src/elevenlabs/types/project_extended_response.py index ee7078d6..59d88ee6 100644 --- a/src/elevenlabs/types/project_extended_response.py +++ b/src/elevenlabs/types/project_extended_response.py @@ -21,6 +21,7 @@ from .project_voice_response_model import ProjectVoiceResponseModel from .pronunciation_dictionary_locator_response_model import PronunciationDictionaryLocatorResponseModel from .pronunciation_dictionary_version_response_model import PronunciationDictionaryVersionResponseModel +from .studio_agent_settings_model import StudioAgentSettingsModel from .voice import Voice @@ -197,6 +198,11 @@ class ProjectExtendedResponse(UncheckedBaseModel): The aspect ratio of the project. """ + agent_settings: typing.Optional[StudioAgentSettingsModel] = pydantic.Field(default=None) + """ + Agent-related settings for the project + """ + quality_preset: ProjectExtendedResponseModelQualityPreset = pydantic.Field() """ The quality preset level of the project. diff --git a/src/elevenlabs/types/project_response.py b/src/elevenlabs/types/project_response.py index 970c88d1..4be744a9 100644 --- a/src/elevenlabs/types/project_response.py +++ b/src/elevenlabs/types/project_response.py @@ -13,6 +13,7 @@ from .project_response_model_source_type import ProjectResponseModelSourceType from .project_response_model_target_audience import ProjectResponseModelTargetAudience from .project_state import ProjectState +from .studio_agent_settings_model import StudioAgentSettingsModel class ProjectResponse(UncheckedBaseModel): @@ -188,6 +189,11 @@ class ProjectResponse(UncheckedBaseModel): The aspect ratio of the project. """ + agent_settings: typing.Optional[StudioAgentSettingsModel] = pydantic.Field(default=None) + """ + Agent-related settings for the project + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/required_constraint.py b/src/elevenlabs/types/required_constraint.py new file mode 100644 index 00000000..55239d6c --- /dev/null +++ b/src/elevenlabs/types/required_constraint.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/required_constraints.py b/src/elevenlabs/types/required_constraints.py new file mode 100644 index 00000000..dd064801 --- /dev/null +++ b/src/elevenlabs/types/required_constraints.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/song_section.py b/src/elevenlabs/types/song_section.py index 4d9ce592..0249a17f 100644 --- a/src/elevenlabs/types/song_section.py +++ b/src/elevenlabs/types/song_section.py @@ -36,7 +36,7 @@ class SongSection(UncheckedBaseModel): source_from: typing.Optional[SectionSource] = pydantic.Field(default=None) """ - Optional source to extract the section from. Used for inpainting. Only available to enterprise clients with access to the inpainting API. + Optional source to extract the section from. Used for inpainting. Only available to enterprise clients with access to the inpainting feature. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/studio_agent_settings_model.py b/src/elevenlabs/types/studio_agent_settings_model.py new file mode 100644 index 00000000..67a3bb88 --- /dev/null +++ b/src/elevenlabs/types/studio_agent_settings_model.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/studio_agent_tool_settings_model.py b/src/elevenlabs/types/studio_agent_tool_settings_model.py new file mode 100644 index 00000000..e8de56fa --- /dev/null +++ b/src/elevenlabs/types/studio_agent_tool_settings_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/telephony_call_config.py b/src/elevenlabs/types/telephony_call_config.py new file mode 100644 index 00000000..3525fef0 --- /dev/null +++ b/src/elevenlabs/types/telephony_call_config.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern 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. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/update_asset_params.py b/src/elevenlabs/types/update_asset_params.py new file mode 100644 index 00000000..5b37cc1d --- /dev/null +++ b/src/elevenlabs/types/update_asset_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/update_calendar_event_params.py b/src/elevenlabs/types/update_calendar_event_params.py new file mode 100644 index 00000000..29edc702 --- /dev/null +++ b/src/elevenlabs/types/update_calendar_event_params.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern 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 diff --git a/src/elevenlabs/types/voice_statistics_response_model.py b/src/elevenlabs/types/voice_statistics_response_model.py new file mode 100644 index 00000000..a47b1ec9 --- /dev/null +++ b/src/elevenlabs/types/voice_statistics_response_model.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern 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): + voice_id: str = pydantic.Field() + """ + The voice 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. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow